NT descriptor macros

Reference Documentation

product_line_custom
Intel® PAC
Napatech SmartNIC
category
Reference Information
Napatech Software Suite: NT descriptor macros

Detailed Description

The following is only available if "PacketDescriptor = NT or Ext7 or Ext8 or Ext9" has been selected in the ntservice.ini file and if NT_NET_GET_PKT_DESCRIPTOR_TYPE returns NT_PACKET_DESCRIPTOR_TYPE_NT || NT_PACKET_DESCRIPTOR_TYPE_NT_EXTENDED. The following macros constitute the collection extracting data from the "NT" descriptor.

Macros

#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...
 

Macro Definition Documentation

#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.

Parameters
[in]_hNetBuf_Packet container reference
[in]_Length_The length value

Definition at line 487 of file pktdescr.h.

#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.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns the packet wire length

Definition at line 496 of file pktdescr.h.

#define NT_NET_SET_PKT_WIRE_LENGTH_NT (   _hNetBuf_,
  _Length_ 
)

Sets the packet wire length.

Parameters
[in]_hNetBuf_Packet container reference
[in]_Length_The length value

Definition at line 504 of file pktdescr.h.

#define NT_NET_GET_PKT_CRC_ERROR_NT (   _hNetBuf_)

Indicates if the received frame has a layer 2 CRC error.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns 1 if the packet has a L2 CRC error - If no L2 CRC error this is 0.

Definition at line 512 of file pktdescr.h.

#define NT_NET_SET_PKT_CRC_ERROR_NT (   _hNetBuf_,
  _bval_ 
)

Sets if the packet has a CRC error.

Parameters
[in]_hNetBuf_Packet container reference
[in]_bval_Set to 1 if packet has a CRC error, 0 otherwise

Definition at line 520 of file pktdescr.h.

#define NT_NET_GET_PKT_TCP_CSUM_OK_NT (   _hNetBuf_)

Indicates if the received TCP checksum is correct.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns 1 if the packet has a valid TCP checksum - if not a TCP packet this is 0

Definition at line 528 of file pktdescr.h.

#define NT_NET_SET_PKT_TCP_CSUM_OK_NT (   _hNetBuf_,
  _bval_ 
)

Sets if the packet has an OK TCP checksum.

Parameters
[in]_hNetBuf_Packet container reference
[in]_bval_Set to 1 if packet packet has an OK TCP checksum, 0 otherwise

Definition at line 536 of file pktdescr.h.

#define NT_NET_GET_PKT_UDP_CSUM_OK_NT (   _hNetBuf_)

Indicates if the received UDP checksum is correct.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns 1 if the packet has a valid UDP checksum - if not a UDP packet this is 0

Definition at line 544 of file pktdescr.h.

#define NT_NET_SET_PKT_UDP_CSUM_OK_NT (   _hNetBuf_,
  _bval_ 
)

Sets if the packet has an OK UDP checksum.

Parameters
[in]_hNetBuf_Packet container reference
[in]_bval_Set to 1 if packet packet has an OK UDP checksum, 0 otherwise

Definition at line 552 of file pktdescr.h.

#define NT_NET_GET_PKT_IP_CSUM_OK_NT (   _hNetBuf_)

Indicates if the received IP checksum is correct.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns 1 if the packet has a valid IP checksum - if not an IP packet this is 0

Definition at line 560 of file pktdescr.h.

#define NT_NET_SET_PKT_IP_CSUM_OK_NT (   _hNetBuf_,
  _bval_ 
)

Sets if the packet has an OK IP checksum.

Parameters
[in]_hNetBuf_Packet container reference
[in]_bval_Set to 1 if packet packet has an OK IP checksum, 0 otherwise

Definition at line 568 of file pktdescr.h.

#define NT_NET_GET_PKT_CV_ERROR_NT (   _hNetBuf_)

Indicates if the frame has any coding violations errors.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns 1 if the packet has coding violations - If no coding violations this is 0.

Definition at line 576 of file pktdescr.h.

#define NT_NET_SET_PKT_CV_ERROR_NT (   _hNetBuf_,
  _bval_ 
)

Sets if the frame has any coding violations errors.

Parameters
[in]_hNetBuf_Packet container reference
[in]_bval_Set to 1 if packet packet has coding violations errors, 0 otherwise

Definition at line 584 of file pktdescr.h.

#define NT_NET_GET_PKT_SLICED_NT (   _hNetBuf_)

Indicates if the frame has been sliced.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns 1 if the packet has been sliced - If no slicing has occured this is 0

Definition at line 592 of file pktdescr.h.

#define NT_NET_SET_PKT_SLICED_NT (   _hNetBuf_,
  _bval_ 
)

Sets if the frame has been sliced.

Parameters
[in]_hNetBuf_Packet container reference
[in]_bval_Set to 1 if packet packet has been sliced, 0 otherwise

Definition at line 600 of file pktdescr.h.

#define NT_NET_GET_PKT_HARD_SLICED_NT (   _hNetBuf_)

Indicates if the frame has been hard sliced.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns 1 if the packet has been hard sliced - If no hard slicing has occured this is 0

Definition at line 608 of file pktdescr.h.

#define NT_NET_SET_PKT_HARD_SLICED_NT (   _hNetBuf_,
  _bval_ 
)

Sets if the frame has been hard sliced.

Parameters
[in]_hNetBuf_Packet container reference
[in]_bval_Set to 1 if packet packet has been hard sliced, 0 otherwise

Definition at line 616 of file pktdescr.h.

#define NT_NET_GET_PKT_RXPORT_NT (   _hNetBuf_)

Specifies the port number where the frame was received.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns the port that received this packet

Definition at line 624 of file pktdescr.h.

#define NT_NET_GET_PKT_IS_TCP_NT (   _hNetBuf_)

Indicates if the received frame is a TCP frame.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns 1 if the packet has a TCP header - returns 0 if the packet does not have a TCP header

Definition at line 632 of file pktdescr.h.

#define NT_NET_SET_PKT_IS_TCP_NT (   _hNetBuf_,
  _bval_ 
)

Sets if the packet is TCP.

Parameters
[in]_hNetBuf_Packet container reference
[in]_bval_Set to 1 if TCP packet, 0 otherwise

Definition at line 640 of file pktdescr.h.

#define NT_NET_GET_PKT_IS_UDP_NT (   _hNetBuf_)

Indicates if the received frame is a UDP frame.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns 1 if the packet has an UDP header - returns 0 if the packet does not have an UDP header

Definition at line 648 of file pktdescr.h.

#define NT_NET_SET_PKT_IS_UDP_NT (   _hNetBuf_,
  _bval_ 
)

Sets if the packet is UDP.

Parameters
[in]_hNetBuf_Packet container reference
[in]_bval_Set to 1 if UDP packet, 0 otherwise

Definition at line 656 of file pktdescr.h.

#define NT_NET_GET_PKT_IS_IP_NT (   _hNetBuf_)

Indicates if the received frame is an IP frame.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns 1 if the packet has an IP header - returns 0 if the packet does not have an IP header

Definition at line 664 of file pktdescr.h.

#define NT_NET_SET_PKT_IS_IP_NT (   _hNetBuf_,
  _bval_ 
)

Sets if the packet is IP.

Parameters
[in]_hNetBuf_Packet container reference
[in]_bval_Set to 1 if IP packet, 0 otherwise

Definition at line 672 of file pktdescr.h.

#define NT_NET_GET_PKT_TXPORT_NT (   _hNetBuf_)

Get TX port.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns the port number where the frame is to be transmitted.

Definition at line 680 of file pktdescr.h.

#define NT_NET_SET_PKT_TXPORT_NT (   _hNetBuf_,
  _Port_ 
)

Sets the packet port where the packets should be transmitted.

Note
This feature only works on the CaptureReplay profile and the TX port can only be within the range of one adapter
Parameters
[in]_hNetBuf_Packet container reference
[in]_Port_Port number

Definition at line 688 of file pktdescr.h.

#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.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns 1 if the packet has L2 CRC recalc/override set - Returns 0 if L2 CRC recalc/override is not set

Definition at line 696 of file pktdescr.h.

#define NT_NET_SET_PKT_RECALC_L2_CRC_NT (   _hNetBuf_,
  _bval_ 
)

Asks the adapter to re-generate the CRC.

Parameters
[in]_hNetBuf_Packet container reference
[in]_bval_Set to 1 if CRC should be re-generated, 0 otherwise

Definition at line 704 of file pktdescr.h.

#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.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns 1 if the packet has TxNow set - Returns 0 if TxNow is not set

Definition at line 712 of file pktdescr.h.

#define NT_NET_SET_PKT_TXNOW_NT (   _hNetBuf_,
  _bval_ 
)

If set the IPG is ignored - this will result in line rate TX.

Parameters
[in]_hNetBuf_Packet container reference
[in]_bval_Set to 1 if line rate, 0 otherwise

Definition at line 720 of file pktdescr.h.

#define NT_NET_GET_PKT_TXIGNORE_NT (   _hNetBuf_)

Indicates if the frame is to be transmitted or not.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns 1 if the packet has TxIgnore set - Returns 0 if TxIgnore is not set

Definition at line 728 of file pktdescr.h.

#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.

Parameters
[in]_hNetBuf_Packet container reference
[in]_bval_Set to 1 to not transmit the packet, 0 otherwise

Definition at line 736 of file pktdescr.h.

#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.

Parameters
[in]_hNetBuf_Packet container reference
[in]_bval_Set to 1 to increment delta before transmitting this packet, 0 otherwise

Definition at line 744 of file pktdescr.h.