NT descriptor macros

Reference Documentation

Platform
Napatech SmartNIC
Content Type
Reference Information
Capture Software Version
Link™ Capture Software 12.6
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. NT_NET_GET_PKT_WIRE_LENGTH_NT returns a value of type uint16_t. 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. NT_NET_GET_PKT_RXPORT_NT returns a value of type uint8_t. 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 489 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. NT_NET_GET_PKT_WIRE_LENGTH_NT returns a value of type uint16_t.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns an uint16_t value that is the packet wire length

Definition at line 499 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 507 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 515 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 523 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 531 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 539 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 547 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 555 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 563 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 571 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 579 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 587 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 595 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 603 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 611 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 619 of file pktdescr.h.

#define NT_NET_GET_PKT_RXPORT_NT (   _hNetBuf_)

Specifies the port number where the frame was received. NT_NET_GET_PKT_RXPORT_NT returns a value of type uint8_t.

Parameters
[in]_hNetBuf_Packet container reference
Returns
Returns an uint8_t value that is the port that received this packet

Definition at line 628 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 636 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 644 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 652 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 660 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 668 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 676 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 684 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 692 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 700 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 708 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 716 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 724 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 732 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 740 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 748 of file pktdescr.h.