capture_example.c
Go to the documentation of this file.
110 * will return NT_SUCCESS when a segment is returned. Segments with NT_NET_GET_SEGMENTLENGTH()==0
112 * the segment. The NT_NET_GET_SEGMENT_TIMESTAMP() macro can still be used on the empty segments.
200 NtNetBuf_t hNetBuf = NULL; // Net buffer container. Segment data is returned in this when calling NT_NetRxGet().
218 // Initialize the NTAPI library and thereby check if NTAPI_VERSION can be used together with this library
235 if ((status = NT_NTPL(hCfgStream, "Assign[streamid=1;color=7] = port == 0", &ntplInfo, NT_NTPL_PARSER_VALIDATE_NORMAL)) != NT_SUCCESS) {
274 // Get a stream handle with stream ID 1. NT_NET_INTERFACE_SEGMENT specify that we will receive data in a segment based matter.
275 if ((status = NT_NetRxOpen(&hNetRx, "TestStream", NT_NET_INTERFACE_SEGMENT, 1, -1)) != NT_SUCCESS) {
317 // We got a segment. Check if the timestamp is newer than when the NTPL assign command was applied
320 if ((((struct ntpcap_ts_s *)NT_NET_GET_SEGMENT_PTR(hNetBuf))->sec * 1000000 + ((struct ntpcap_ts_s *)NT_NET_GET_SEGMENT_PTR(hNetBuf))->usec) >
322 break; // Break out, we have received a segment that is received after the NTPL assign command was applied
326 if ((((struct ntpcap_ts_s *)NT_NET_GET_SEGMENT_PTR(hNetBuf))->sec * 1000000000 + ((struct ntpcap_ts_s *)NT_NET_GET_SEGMENT_PTR(hNetBuf))->usec) >
328 break; // Break out, we have received a segment that is received after the NTPL assign command was applied
332 break; // Break out, we have received a segment that is received after the NTPL assign command was applied
417 // Close the stream and release the hostbuffer. This will also remove the NTPL assignments performed.
450 if ((status = NT_NTPL(hCfgStream, tmpBuffer, &ntplInfo, NT_NTPL_PARSER_VALIDATE_NORMAL)) != NT_SUCCESS) {