pktdescr.h

Reference Documentation

Platform
IntelĀ® PAC
Napatech SmartNIC
Content Type
Reference Information
Napatech Software Suite: include/ntapi/pktdescr.h File Reference
pktdescr.h File Reference

Detailed Description

This source file contains the packet macros available.
See the Packet macros for details.

Definition in file pktdescr.h.

Go to the source code of this file.

Macros

#define NT_DESCR_STD_LENGTH
 Constant integer with length of the NT standard descriptor. More...
 
#define NT_DESCR_EXT7_LENGTH
 Length of the NT Extended 7 descriptor. More...
 
#define NT_DESCR_EXT8_LENGTH
 Constant integer with length of the NT Extended 8 descriptor. More...
 
#define NT_DESCR_EXT9_LENGTH
 Constant integer with length of the NT Extended 9 descriptor. More...
 
#define NT_DESCR_DYN1_LENGTH
 Constant integer with length of the NT Dynamic 1 descriptor. More...
 
#define NT_DESCR_DYN2_LENGTH
 Constant integer with length of the NT Dynamic 2 descriptor. More...
 
#define NT_DESCR_DYN3_LENGTH
 Constant integer with length of the NT Dynamic 3 descriptor. More...
 
#define NT_DESCR_DYN4_LENGTH
 Constant integer with length of the NT Dynamic 4 descriptor. More...
 
#define NT_NET_SET_PKT_CLEAR_DESCR_STD(_hNetBuf_)
 Clears the STD descriptor. More...
 
#define NT_NET_SET_PKT_CLEAR_DESCR_EXT7(_hNetBuf_)
 Clears the EXT7 descriptor. More...
 
#define NT_NET_SET_PKT_CLEAR_DESCR_EXT8(_hNetBuf_)
 Clears the EXT8 descriptor. More...
 
#define NT_NET_SET_PKT_CLEAR_DESCR_EXT9(_hNetBuf_)
 Clears the EXT9 descriptor. More...
 
#define NT_NET_SET_PKT_CLEAR_DESCR_DYN1(_hNetBuf_)
 Clears the DYN1 descriptor. More...
 
#define NT_NET_SET_PKT_CLEAR_DESCR_DYN2(_hNetBuf_)
 Clears the DYN2 descriptor. More...
 
#define NT_NET_SET_PKT_CLEAR_DESCR_DYN3(_hNetBuf_)
 Clears the DYN3 descriptor. More...
 
#define NT_NET_SET_PKT_CLEAR_DESCR_DYN4(_hNetBuf_)
 Clears the DYN4 descriptor. More...
 
#define NT_NET_GET_PKT_DESCR_TYPE(_hNetBuf_)
 Get the packet descriptor type. More...
 
#define NT_NET_SET_PKT_DESCR_TYPE_STD(_hNetBuf_)
 Sets the packet descriptor type to NT. More...
 
#define NT_NET_SET_PKT_DESCR_TYPE_EXT7(_hNetBuf_)
 Sets the packet descriptor type to EXT7. More...
 
#define NT_NET_SET_PKT_DESCR_TYPE_EXT8(_hNetBuf_)
 Sets the packet descriptor type to EXT8. More...
 
#define NT_NET_SET_PKT_DESCR_TYPE_EXT9(_hNetBuf_)
 Sets the packet descriptor type to EXT9. More...
 
#define NT_NET_SET_PKT_DESCR_TYPE_DYN1(_hNetBuf_)
 Sets the packet descriptor type to DYN1. More...
 
#define NT_NET_SET_PKT_DESCR_TYPE_DYN2(_hNetBuf_)
 Sets the packet descriptor type to DYN2. More...
 
#define NT_NET_SET_PKT_DESCR_TYPE_DYN3(_hNetBuf_)
 Sets the packet descriptor type to DYN3. More...
 
#define NT_NET_SET_PKT_DESCR_TYPE_DYN4(_hNetBuf_)
 Sets the packet descriptor type to DYN4. More...
 
#define NT_NET_GET_PKT_DESCR_PTR_STD(_hNetBuf_)
 Get standard packet descriptor pointer. More...
 
#define NT_NET_GET_PKT_DESCR_PTR_EXT7(_hNetBuf_)
 Get extended packet descriptor 7 pointer. More...
 
#define NT_NET_GET_PKT_DESCR_PTR_EXT8(_hNetBuf_)
 Get extended packet descriptor 8 pointer. More...
 
#define NT_NET_GET_PKT_DESCR_PTR_EXT9(_hNetBuf_)
 Get extended packet descriptor 9 pointer. More...
 
#define NT_NET_GET_PKT_DESCR_PTR_DYN1(_hNetBuf_)
 Get dynamic packet descriptor 1 pointer. More...
 
#define NT_NET_GET_PKT_DESCR_PTR_DYN2(_hNetBuf_)
 Get dynamic packet descriptor 2 pointer. More...
 
#define NT_NET_GET_PKT_DESCR_PTR_DYN3(_hNetBuf_)
 Get dynamic packet descriptor 3 pointer. More...
 
#define NT_NET_GET_PKT_DESCR_PTR_DYN4(_hNetBuf_)
 Get dynamic packet descriptor 4 pointer. More...
 
#define NT_NET_GET_PKT_L2_PTR(_hNetBuf_)
 A pointer to the L2 packet data. If an ISL header is present it will point to the ISL header. More...
 
#define NT_NET_UPDATE_PKT_L2_PTR(_hNetBuf_)
 When creating packets within a segment it is required to update the L2 pointer using this macro after applying the descriptor info. More...
 
#define NT_NET_GET_PKT_DESCR_LENGTH(_hNetBuf_)
 Get the length of the packet descriptor. More...
 
#define NT_NET_GET_PKT_DESCR_FORMAT(_hNetBuf_)
 Indicates if extended packet descriptor 7, 8, or 9 is used, if the standard packet descriptor is used, or what dynamic packet descriptor type is used. More...
 
#define NT_NET_GET_PKT_TIMESTAMP(_hNetBuf_)
 Get the packet timestamp. More...
 
#define NT_NET_SET_PKT_TIMESTAMP(_hNetBuf_, _ts_)
 Sets the packet time stamp - useful when controlling the traffic rate. More...
 
#define NT_NET_GET_PKT_TIMESTAMP_TYPE(_hNetBuf_)
 Get the packet time stamp type. See NtTimestampType_e. More...
 
#define NT_NET_GET_PKT_CAP_LENGTH(_hNetBuf_)
 Returns the total stored length of the received frame including packet descriptors, in bytes, after any slicing. The value is a multiple of 8 if received on 3GA adapters, or if capture length was set with ALIGN macro. Also rounded up for unsliced frames with wire lengths. that are not multiples of 8 bytes. More...
 
#define NT_NET_SET_PKT_CAP_LENGTH_NOALIGN(_hNetBuf_, _Length_)
 Calculates and sets the packet capture length. Input is wire length. Capture length is calculated from the value - no alignment is applied. More...
 
#define NT_NET_SET_PKT_CAP_LENGTH_ALIGN_NT(_hNetBuf_, _Length_)
 Calculates and sets the packet capture length. Input is wire length. Capture length is calculated from the value. More...
 
#define NT_NET_GET_PKT_WIRE_LENGTH_NT(_hNetBuf_)
 Returns the wire length of the received frame, in bytes, with the value saturated at 16,383 for longer frames. More...
 
#define NT_NET_SET_PKT_WIRE_LENGTH_NT(_hNetBuf_, _Length_)
 Sets the packet wire length. More...
 
#define NT_NET_GET_PKT_CRC_ERROR_NT(_hNetBuf_)
 Indicates if the received frame has a layer 2 CRC error. More...
 
#define NT_NET_SET_PKT_CRC_ERROR_NT(_hNetBuf_, _bval_)
 Sets if the packet has a CRC error. More...
 
#define NT_NET_GET_PKT_TCP_CSUM_OK_NT(_hNetBuf_)
 Indicates if the received TCP checksum is correct. More...
 
#define NT_NET_SET_PKT_TCP_CSUM_OK_NT(_hNetBuf_, _bval_)
 Sets if the packet has an OK TCP checksum. More...
 
#define NT_NET_GET_PKT_UDP_CSUM_OK_NT(_hNetBuf_)
 Indicates if the received UDP checksum is correct. More...
 
#define NT_NET_SET_PKT_UDP_CSUM_OK_NT(_hNetBuf_, _bval_)
 Sets if the packet has an OK UDP checksum. More...
 
#define NT_NET_GET_PKT_IP_CSUM_OK_NT(_hNetBuf_)
 Indicates if the received IP checksum is correct. More...
 
#define NT_NET_SET_PKT_IP_CSUM_OK_NT(_hNetBuf_, _bval_)
 Sets if the packet has an OK IP checksum. More...
 
#define NT_NET_GET_PKT_CV_ERROR_NT(_hNetBuf_)
 Indicates if the frame has any coding violations errors. More...
 
#define NT_NET_SET_PKT_CV_ERROR_NT(_hNetBuf_, _bval_)
 Sets if the frame has any coding violations errors. More...
 
#define NT_NET_GET_PKT_SLICED_NT(_hNetBuf_)
 Indicates if the frame has been sliced. More...
 
#define NT_NET_SET_PKT_SLICED_NT(_hNetBuf_, _bval_)
 Sets if the frame has been sliced. More...
 
#define NT_NET_GET_PKT_HARD_SLICED_NT(_hNetBuf_)
 Indicates if the frame has been hard sliced. More...
 
#define NT_NET_SET_PKT_HARD_SLICED_NT(_hNetBuf_, _bval_)
 Sets if the frame has been hard sliced. More...
 
#define NT_NET_GET_PKT_RXPORT_NT(_hNetBuf_)
 Specifies the port number where the frame was received. More...
 
#define NT_NET_GET_PKT_IS_TCP_NT(_hNetBuf_)
 Indicates if the received frame is a TCP frame. More...
 
#define NT_NET_SET_PKT_IS_TCP_NT(_hNetBuf_, _bval_)
 Sets if the packet is TCP. More...
 
#define NT_NET_GET_PKT_IS_UDP_NT(_hNetBuf_)
 Indicates if the received frame is a UDP frame. More...
 
#define NT_NET_SET_PKT_IS_UDP_NT(_hNetBuf_, _bval_)
 Sets if the packet is UDP. More...
 
#define NT_NET_GET_PKT_IS_IP_NT(_hNetBuf_)
 Indicates if the received frame is an IP frame. More...
 
#define NT_NET_SET_PKT_IS_IP_NT(_hNetBuf_, _bval_)
 Sets if the packet is IP. More...
 
#define NT_NET_GET_PKT_TXPORT_NT(_hNetBuf_)
 Get TX port. More...
 
#define NT_NET_SET_PKT_TXPORT_NT(_hNetBuf_, _Port_)
 Sets the packet port where the packets should be transmitted. More...
 
#define NT_NET_GET_PKT_RECALC_L2_CRC_NT(_hNetBuf_)
 Indicates if the original CRC in the received frame will be recalculated and overwritten in the transmitted frame. More...
 
#define NT_NET_SET_PKT_RECALC_L2_CRC_NT(_hNetBuf_, _bval_)
 Asks the adapter to re-generate the CRC. More...
 
#define NT_NET_GET_PKT_TXNOW_NT(_hNetBuf_)
 Indicates if the frame is to be transmitted according to time stamp or as fast as possible. More...
 
#define NT_NET_SET_PKT_TXNOW_NT(_hNetBuf_, _bval_)
 If set the IPG is ignored - this will result in line rate TX. More...
 
#define NT_NET_GET_PKT_TXIGNORE_NT(_hNetBuf_)
 Indicates if the frame is to be transmitted or not. More...
 
#define NT_NET_SET_PKT_TXIGNORE_NT(_hNetBuf_, _bval_)
 Marks the packet not to be sent - useful in in-line scenarios where some packets should not be retransmitted. More...
 
#define NT_NET_SET_PKT_TXSETCLOCK_NT(_hNetBuf_, _bval_)
 Cause the adapter transmission delta to by incremented by the configured delta adjustment before transmitting the packet. More...
 
#define NT_NET_GET_PKT_HASH_EXT(_hNetBuf_)
 Get the packet hash value. More...
 
#define NT_NET_GET_PKT_HASH_TYPE_EXT(_hNetBuf_)
 Get the number of the used hash key type. More...
 
#define NT_NET_GET_PKT_HASH_VALID_EXT(_hNetBuf_)
 Indicates if the hash calculation is valid. More...
 
#define NT_NET_GET_PKT_JUMBO_EXT(_hNetBuf_)
 Indicates if the frame is a jumbo frame. More...
 
#define NT_NET_GET_PKT_BROADCAST_EXT(_hNetBuf_)
 Indicates if the destination MAC address is broadcast. More...
 
#define NT_NET_GET_PKT_L4_PORT_TYPE_EXT(_hNetBuf_)
 Get the layer 4 port type When using extended descriptor 9 it is advised to use NT_NET_GET_PKT_TUNNEL_TYPE instead. More...
 
#define NT_NET_GET_PKT_L4_FRAME_TYPE_EXT(_hNetBuf_)
 Get layer 4 frame type. More...
 
#define NT_NET_GET_PKT_L3_FRAME_TYPE_EXT(_hNetBuf_)
 Get layer 3 frame type. More...
 
#define NT_NET_GET_PKT_L2_FRAME_TYPE_EXT(_hNetBuf_)
 Get layer 2 frame type. More...
 
#define NT_NET_GET_PKT_L4_LENGTH_EXT(_hNetBuf_)
 Get layer 4 header length (valid for L4 = UDP/TCP only) More...
 
#define NT_NET_GET_PKT_L3_LENGTH_EXT(_hNetBuf_)
 Get layer 3 header length (valid for L3 = IPv4/IPv6 only) More...
 
#define NT_NET_GET_PKT_MPLS_COUNT_EXT(_hNetBuf_)
 Get the number of MPLS shim labels present. More...
 
#define NT_NET_GET_PKT_VLAN_COUNT_EXT(_hNetBuf_)
 Get the number of VLANs present. More...
 
#define NT_NET_GET_PKT_ISL_EXT(_hNetBuf_)
 Indicates if ISL encapsulation is present. More...
 
#define NT_NET_GET_PKT_DECODE_ERROR_EXT(_hNetBuf_)
 Indicates if a frame decoding error is present. More...
 
#define NT_NET_GET_PKT_FRAME_LARGE_EXT(_hNetBuf_)
 Indicates if the frame is a large frame. More...
 
#define NT_NET_GET_PKT_FRAME_SMALL_EXT(_hNetBuf_)
 Indicates if the frame is a small frame. More...
 
#define NT_NET_GET_PKT_IPV6_FR_HEADER_EXT(_hNetBuf_)
 Indicates if an IPv6 fragment header is present. More...
 
#define NT_NET_GET_PKT_IPV6_RT_HEADER_EXT(_hNetBuf_)
 Indicates if an IPv6 routing header is present. More...
 
#define NT_NET_GET_PKT_L4_PROTOCOL_NUM_EXT(_hNetBuf_)
 Get layer 4 protocol number (TCP, UDP, SCTP etc.) - if not an IP packet this is 0. More...
 
#define NT_NET_GET_PKT_L3_FRAGMENTED_EXT(_hNetBuf_)
 Indicates if the packet is part of a layer 3 fragmented datagram. Only valid for IPv4 if more fragments bit = 1 or fragment offset not equal to 0. More...
 
#define NT_NET_GET_PKT_L3_FIRST_FRAG_EXT(_hNetBuf_)
 Layer 3 First fragment (offset = 0) Note: Only valid for IPv4 - always set on IPv6 so use IPV6_FR_HEADER instead. More...
 
#define NT_NET_GET_PKT_COLOR_EXT(_hNetBuf_)
 Returns the packet color of the frame, if the frame matches a filter. The color is automatically assigned as a 6bit color ID when the filter is defined. If the frame matches more than one filter, the packet color of the frame is the one from the filter with the highest priority. More...
 
#define NT_NET_GET_PKT_L5_OFFSET_EXT(_hNetBuf_)
 Returns the offset in bytes (0x00 - 0x1FF) from the start of the frame to the start of layer 5. The value 0x00 indicates an invalid offset. More...
 
#define NT_NET_GET_PKT_L4_OFFSET_EXT(_hNetBuf_)
 Returns the offset in bytes (0x00 - 0x1FF) from the start of the frame to the start of layer 4. The value 0x00 indicates an invalid offset. More...
 
#define NT_NET_GET_PKT_L3_OFFSET_EXT(_hNetBuf_)
 Returns the offset in bytes (0x00 - 0x1FF) from the start of the frame to the start of layer 3. The value 0x00 indicates an invalid offset. More...
 
#define NT_NET_GET_PKT_IPF_UNMATCHED_STREAMID_EXT(_hNetBuf_)
 Stream ID where unmatched fragments are stored. More...
 
#define NT_NET_GET_PKT_IPF_UNMATCHED_FLAG_EXT(_hNetBuf_)
 Indicates if no entry corresponding to the packet was allocated or found in the datagram lookup table. More...
 
#define NT_NET_GET_PKT_IPF_LAST_FRAGMENT_EXT(_hNetBuf_)
 Indicates if the packet is the last fragment of a layer 3 fragmented datagram. (More fragment bit = 0 && offset != 0) More...
 
#define NT_NET_GET_PKT_INNER_L3_OFFSET_EXT9(_hNetBuf_)
 Returns the offset in bytes (0x00 - 0x1FF) from the start of the frame to the start of inner layer 3. The value 0x00 indicates an invalid offset. More...
 
#define NT_NET_GET_PKT_INNER_L4_OFFSET_EXT9(_hNetBuf_)
 Returns the offset in bytes (0x00 - 0x1FF) from the start of the frame to the start of inner layer 4. The value 0x00 indicates an invalid offset. More...
 
#define NT_NET_GET_PKT_INNER_L5_OFFSET_EXT9(_hNetBuf_)
 Returns the offset in bytes (0x00 - 0x1FF) from the start of the frame to the start of inner layer 5. The value 0x00 indicates an invalid offset. More...
 
#define NT_NET_GET_PKT_INNER_L3_FRAME_TYPE_EXT9(_hNetBuf_)
 Get the inner tunnel layer 3 frame type. More...
 
#define NT_NET_GET_PKT_INNER_L4_FRAME_TYPE_EXT9(_hNetBuf_)
 Get the inner tunnel layer 4 frame type. More...
 
#define NT_NET_GET_PKT_INNER_L3_FRAGMENT_TYPE_EXT9(_hNetBuf_)
 Get inner layer 3 fragment type. More...
 
#define NT_NET_GET_PKT_TUNNEL_TYPE_EXT9(_hNetBuf_)
 Get the tunnel type. More...
 
#define NT_NET_GET_PKT_TUNNEL_HDR_LENGTH_EXT9(_hNetBuf_)
 Get the tunnel header length. More...
 
#define NT_NET_GET_PKT_INNER_DECODE_ERROR_EXT9(_hNetBuf_)
 Indicates if a inner tunnel frame decoding error is present. More...
 
#define NT_NET_GET_PKT_DEDUPLICATION_CRC_EXT9(_hNetBuf_)
 The packet deduplication CRC value. Only available on extended descriptor 9. More...
 
#define NT_NET_SET_PKT_INJECT_TIMESTAMP_EXT(_hNetBuf_, _offset_)   _NT_NET_SET_PKT_INJECT_TIMESTAMP_EXT(_hNetBuf_, _offset_)
 
#define NT_NET_SET_PKT_ISL_EXT(_hNetBuf_, _bval_)    _NT_NET_SET_PKT_ISL_EXT(_hNetBuf_, _bval_)
 
#define NT_NET_SET_PKT_VLAN_COUNT_EXT(_hNetBuf_, _count_)    _NT_NET_SET_PKT_VLAN_COUNT_EXT(_hNetBuf_, _count_)
 
#define NT_NET_SET_PKT_MPLS_COUNT_EXT(_hNetBuf_, _count_)    _NT_NET_SET_PKT_MPLS_COUNT_EXT(_hNetBuf_, _count_)
 
#define NT_NET_SET_PKT_L2_FRAME_TYPE_EXT(_hNetBuf_, _type_)    _NT_NET_SET_PKT_L2_FRAME_TYPE_EXT(_hNetBuf_, _type_)
 
#define NT_NET_SET_PKT_L3_FRAME_TYPE_EXT(_hNetBuf_, _type_)    _NT_NET_SET_PKT_L3_FRAME_TYPE_EXT(_hNetBuf_, _type_)
 
#define NT_NET_SET_PKT_L4_FRAME_TYPE_EXT(_hNetBuf_, _type_)    _NT_NET_SET_PKT_L4_FRAME_TYPE_EXT(_hNetBuf_, _type_)
 
#define NT_NET_SET_PKT_L3_LENGTH_EXT(_hNetBuf_, _u32len_)    _NT_NET_SET_PKT_L3_LENGTH_EXT(_hNetBuf_, _u32len_)
 
#define NT_NET_SET_PKT_L4_LENGTH_EXT(_hNetBuf_, _u32len_)    _NT_NET_SET_PKT_L4_LENGTH_EXT(_hNetBuf_, _u32len_)
 
#define NT_NET_SET_PKT_CALC_L3_CHECKSUM_EXT(_hNetBuf_, _bval_)    _NT_NET_SET_PKT_CALC_L3_CHECKSUM_EXT(_hNetBuf_, _bval_)
 
#define NT_NET_SET_PKT_CALC_L4_CHECKSUM_EXT(_hNetBuf_, _bval_)    _NT_NET_SET_PKT_CALC_L4_CHECKSUM_EXT(_hNetBuf_, _bval_)