pktdescr.h
Go to the documentation of this file.
166 #define NT_NET_SET_PKT_CLEAR_DESCR_STD(_hNetBuf_) do{ memset((_hNetBuf_)->hHdr, 0, sizeof(NtStd0Descr_t)); } while(0)
173 #define NT_NET_SET_PKT_CLEAR_DESCR_EXT7(_hNetBuf_) do{ memset((_hNetBuf_)->hHdr, 0, sizeof(NtExt7Descr_t)); } while(0)
180 #define NT_NET_SET_PKT_CLEAR_DESCR_EXT8(_hNetBuf_) do{ memset((_hNetBuf_)->hHdr, 0, sizeof(NtExt8Descr_t)); } while(0)
187 #define NT_NET_SET_PKT_CLEAR_DESCR_EXT9(_hNetBuf_) do{ memset((_hNetBuf_)->hHdr, 0, sizeof(NtExt9Descr_t)); } while(0)
194 #define NT_NET_SET_PKT_CLEAR_DESCR_DYN1(_hNetBuf_) do{ memset((_hNetBuf_)->hHdr, 0, sizeof(NtDyn1Descr_t)); } while(0)
201 #define NT_NET_SET_PKT_CLEAR_DESCR_DYN2(_hNetBuf_) do{ memset((_hNetBuf_)->hHdr, 0, sizeof(NtDyn2Descr_t)); } while(0)
208 #define NT_NET_SET_PKT_CLEAR_DESCR_DYN3(_hNetBuf_) do{ memset((_hNetBuf_)->hHdr, 0, sizeof(NtDyn3Descr_t)); } while(0)
215 #define NT_NET_SET_PKT_CLEAR_DESCR_DYN4(_hNetBuf_) do{ memset((_hNetBuf_)->hHdr, 0, sizeof(NtDyn4Descr_t)); } while(0)
230 #define NT_NET_SET_PKT_DESCR_TYPE_STD(_hNetBuf_) do{ _NT_NET_GET_PKT_DESCR_PTR_STD0(_hNetBuf_)->descriptorType = 1; } while(0)
244 _NT_NET_GET_PKT_DESCR_PTR_STD0(_hNetBuf_)->extensionLength = NT_EXTENDED_DESCRIPTOR_07_LENGTH; } while(0)
258 _NT_NET_GET_PKT_DESCR_PTR_STD0(_hNetBuf_)->extensionLength = NT_EXTENDED_DESCRIPTOR_08_LENGTH; } while(0)
272 _NT_NET_GET_PKT_DESCR_PTR_STD0(_hNetBuf_)->extensionLength = NT_EXTENDED_DESCRIPTOR_09_LENGTH; } while(0)
286 _NT_NET_GET_PKT_DESCR_PTR_DYN(_hNetBuf_)->descrLength = NT_DYNAMIC_DESCRIPTOR_01_LENGTH; } while(0)
300 _NT_NET_GET_PKT_DESCR_PTR_DYN(_hNetBuf_)->descrLength = NT_DYNAMIC_DESCRIPTOR_02_LENGTH; } while(0)
314 _NT_NET_GET_PKT_DESCR_PTR_DYN(_hNetBuf_)->descrLength = NT_DYNAMIC_DESCRIPTOR_03_LENGTH; } while(0)
328 _NT_NET_GET_PKT_DESCR_PTR_DYN(_hNetBuf_)->descrLength = NT_DYNAMIC_DESCRIPTOR_04_LENGTH; } while(0)
395 * @brief A pointer to the L2 packet data. If an ISL header is present it will point to the ISL header.
403 * @brief When creating packets within a segment it is required to update the L2 pointer using this macro after applying the descriptor info
463 #define NT_NET_GET_PKT_CAP_LENGTH(_hNetBuf_) ((uint16_t)(_NT_NET_GET_PKT_CAP_LENGTH(_hNetBuf_)))
466 * @brief Calculates and sets the packet capture length. Input is wire length. Capture length is calculated from the value - no alignment is applied
471 #define NT_NET_SET_PKT_CAP_LENGTH_NOALIGN(_hNetBuf_, _Length_) _NT_NET_SET_PKT_CAP_LENGTH_NOALIGN(_hNetBuf_, _Length_)
478 * The following is only available if "PacketDescriptor = NT or Ext7 or Ext8 or Ext9" has been selected in the ntservice.ini file
479 * and if @ref NT_NET_GET_PKT_DESCRIPTOR_TYPE returns @ref NT_PACKET_DESCRIPTOR_TYPE_NT || @ref NT_PACKET_DESCRIPTOR_TYPE_NT_EXTENDED.
484 * @brief Calculates and sets the packet capture length. Input is wire length. Capture length is calculated from the value.
489 #define NT_NET_SET_PKT_CAP_LENGTH_ALIGN_NT(_hNetBuf_, _Length_) _NT_NET_SET_PKT_CAP_LENGTH_ALIGN_NT(_hNetBuf_, _Length_)
499 #define NT_NET_GET_PKT_WIRE_LENGTH_NT(_hNetBuf_) ((uint16_t)_NT_NET_GET_PKT_WIRE_LENGTH_NT(_hNetBuf_))
507 #define NT_NET_SET_PKT_WIRE_LENGTH_NT(_hNetBuf_, _Length_) _NT_NET_SET_PKT_WIRE_LENGTH_NT(_hNetBuf_, _Length_)
523 #define NT_NET_SET_PKT_CRC_ERROR_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_CRC_ERROR_NT(_hNetBuf_, _bval_)
539 #define NT_NET_SET_PKT_TCP_CSUM_OK_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_TCP_CSUM_OK_NT(_hNetBuf_, _bval_)
555 #define NT_NET_SET_PKT_UDP_CSUM_OK_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_UDP_CSUM_OK_NT(_hNetBuf_, _bval_)
571 #define NT_NET_SET_PKT_IP_CSUM_OK_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_IP_CSUM_OK_NT(_hNetBuf_, _bval_)
587 #define NT_NET_SET_PKT_CV_ERROR_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_CV_ERROR_NT(_hNetBuf_, _bval_)
603 #define NT_NET_SET_PKT_SLICED_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_SLICED_NT(_hNetBuf_, _bval_)
608 * @return Returns 1 if the packet has been hard sliced - If no hard slicing has occured this is 0
619 #define NT_NET_SET_PKT_HARD_SLICED_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_HARD_SLICED_NT(_hNetBuf_, _bval_)
633 * @return Returns 1 if the packet has a TCP header - returns 0 if the packet does not have a TCP header
644 #define NT_NET_SET_PKT_IS_TCP_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_IS_TCP_NT(_hNetBuf_, _bval_)
649 * @return Returns 1 if the packet has an UDP header - returns 0 if the packet does not have an UDP header
660 #define NT_NET_SET_PKT_IS_UDP_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_IS_UDP_NT(_hNetBuf_, _bval_)
665 * @return Returns 1 if the packet has an IP header - returns 0 if the packet does not have an IP header
687 * @brief 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
692 #define NT_NET_SET_PKT_TXPORT_NT(_hNetBuf_, _Port_) _NT_NET_SET_PKT_TXPORT_NT(_hNetBuf_, _Port_)
695 * @brief Indicates if the original CRC in the received frame will be recalculated and overwritten in the transmitted frame.
697 * @return Returns 1 if the packet has L2 CRC recalc/override set - Returns 0 if L2 CRC recalc/override is not set
708 #define NT_NET_SET_PKT_RECALC_L2_CRC_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_RECALC_L2_CRC_NT(_hNetBuf_, _bval_)
711 * @brief Indicates if the frame is to be transmitted according to time stamp or as fast as possible.
735 * @brief Marks the packet not to be sent - useful in in-line scenarios where some packets should not be retransmitted
740 #define NT_NET_SET_PKT_TXIGNORE_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_TXIGNORE_NT(_hNetBuf_, _bval_)
743 * @brief Cause the adapter transmission delta to by incremented by the configured delta adjustment before transmitting the packet
748 #define NT_NET_SET_PKT_TXSETCLOCK_NT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_TXSETCLOCK_NT(_hNetBuf_, _bval_)
754 * The following is only available if "PacketDescriptor = Ext7, Ext8 or Ext9" has been set in the ntservice.ini
755 * file and if @ref NT_NET_GET_PKT_DESCRIPTOR_TYPE returns @ref NT_PACKET_DESCRIPTOR_TYPE_NT_EXTENDED
777 * @return Returns 1 if the hash value/type is valid - Returns 0 if the hash value/type is invalid
785 * @return Returns 1 if the packet has a jumbo frame - Returns 0 if the packet does not have a jumbo frame
793 * @return Returns 1 if the destination MAC is a broadcast address - Returns 0 if the destination MAC is not a broadcast address
800 * When using extended descriptor 9 it is advised to use @ref NT_NET_GET_PKT_TUNNEL_TYPE instead.
813 #define NT_NET_GET_PKT_L4_FRAME_TYPE_EXT(_hNetBuf_) _NT_NET_GET_PKT_L4_FRAME_TYPE_EXT(_hNetBuf_)
821 #define NT_NET_GET_PKT_L3_FRAME_TYPE_EXT(_hNetBuf_) _NT_NET_GET_PKT_L3_FRAME_TYPE_EXT(_hNetBuf_)
829 #define NT_NET_GET_PKT_L2_FRAME_TYPE_EXT(_hNetBuf_) _NT_NET_GET_PKT_L2_FRAME_TYPE_EXT(_hNetBuf_)
866 * @return Returns 1 if ISL encapsulation is present - Returns 0 if ISL encapsulation is not present
882 * @return - Returns 1 when FrameSize > MaxFrameSize. MaxFrameSize is set in ntservice.ini. Returns 0 when FrameSize <= MaxFrameSize
898 * @return Returns 1 if IPv6 fragment header is present - Returns 0 if no IPv6 fragment header is present
901 #define NT_NET_GET_PKT_IPV6_FR_HEADER_EXT(_hNetBuf_) _NT_NET_GET_PKT_IPV6_FR_HEADER_EXT(_hNetBuf_)
906 * @return Returns 1 if IPv6 routing header is present - Returns 0 if no IPv6 routing header is present
909 #define NT_NET_GET_PKT_IPV6_RT_HEADER_EXT(_hNetBuf_) _NT_NET_GET_PKT_IPV6_RT_HEADER_EXT(_hNetBuf_)
917 #define NT_NET_GET_PKT_L4_PROTOCOL_NUM_EXT(_hNetBuf_) _NT_NET_GET_PKT_L4_PROTOCOL_NUM_EXT(_hNetBuf_)
920 * @brief 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
925 #define NT_NET_GET_PKT_L3_FRAGMENTED_EXT(_hNetBuf_) _NT_NET_GET_PKT_L3_FRAGMENTED_EXT(_hNetBuf_)
928 * @brief Layer 3 First fragment (offset = 0) Note: Only valid for IPv4 - always set on IPv6 so use IPV6_FR_HEADER instead
933 #define NT_NET_GET_PKT_L3_FIRST_FRAG_EXT(_hNetBuf_) _NT_NET_GET_PKT_L3_FIRST_FRAG_EXT(_hNetBuf_)
992 #define NT_NET_GET_PKT_IPF_UNMATCHED_STREAMID_EXT(_hNetBuf_) _NT_NET_GET_PKT_IPF_UNMATCHED_STREAMID_EXT(_hNetBuf_)
1001 #define NT_NET_GET_PKT_IPF_UNMATCHED_FLAG_EXT(_hNetBuf_) _NT_NET_GET_PKT_IPF_UNMATCHED_FLAG_EXT(_hNetBuf_)
1010 #define NT_NET_GET_PKT_IPF_LAST_FRAGMENT_EXT(_hNetBuf_) _NT_NET_GET_PKT_IPF_LAST_FRAGMENT_EXT(_hNetBuf_)
1035 #define NT_NET_GET_PKT_INNER_L3_OFFSET_EXT9(_hNetBuf_) _NT_NET_GET_PKT_INNER_L3_OFFSET_EXT(_hNetBuf_)
1045 #define NT_NET_GET_PKT_INNER_L4_OFFSET_EXT9(_hNetBuf_) _NT_NET_GET_PKT_INNER_L4_OFFSET_EXT(_hNetBuf_)
1055 #define NT_NET_GET_PKT_INNER_L5_OFFSET_EXT9(_hNetBuf_) _NT_NET_GET_PKT_INNER_L5_OFFSET_EXT(_hNetBuf_)
1063 #define NT_NET_GET_PKT_INNER_L3_FRAME_TYPE_EXT9(_hNetBuf_) _NT_NET_GET_PKT_INNER_L3_FRAME_TYPE_EXT(_hNetBuf_)
1071 #define NT_NET_GET_PKT_INNER_L4_FRAME_TYPE_EXT9(_hNetBuf_) _NT_NET_GET_PKT_INNER_L4_FRAME_TYPE_EXT(_hNetBuf_)
1079 #define NT_NET_GET_PKT_INNER_L3_FRAGMENT_TYPE_EXT9(_hNetBuf_) _NT_NET_GET_PKT_INNER_L3_FRAGMENT_TYPE_EXT(_hNetBuf_)
1095 #define NT_NET_GET_PKT_TUNNEL_HDR_LENGTH_EXT9(_hNetBuf_) _NT_NET_GET_PKT_TUNNEL_HDR_LENGTH_EXT(_hNetBuf_)
1100 * @return Returns 1 if the inner tunnel frame could not be decoded correctly - Returns 0 otherwise
1103 #define NT_NET_GET_PKT_INNER_DECODE_ERROR_EXT9(_hNetBuf_) _NT_NET_GET_PKT_INNER_DECODE_ERROR_EXT(_hNetBuf_)
1111 #define NT_NET_GET_PKT_DEDUPLICATION_CRC_EXT9(_hNetBuf_) _NT_NET_GET_PKT_DEDUPLICATION_CRC_EXT(_hNetBuf_)
1136 #define NT_NET_SET_PKT_INJECT_TIMESTAMP_EXT(_hNetBuf_, _offset_) _NT_NET_SET_PKT_INJECT_TIMESTAMP_EXT(_hNetBuf_, _offset_)
1152 #define NT_NET_SET_PKT_VLAN_COUNT_EXT(_hNetBuf_, _count_) _NT_NET_SET_PKT_VLAN_COUNT_EXT(_hNetBuf_, _count_)
1160 #define NT_NET_SET_PKT_MPLS_COUNT_EXT(_hNetBuf_, _count_) _NT_NET_SET_PKT_MPLS_COUNT_EXT(_hNetBuf_, _count_)
1168 #define NT_NET_SET_PKT_L2_FRAME_TYPE_EXT(_hNetBuf_, _type_) _NT_NET_SET_PKT_L2_FRAME_TYPE_EXT(_hNetBuf_, _type_)
1176 #define NT_NET_SET_PKT_L3_FRAME_TYPE_EXT(_hNetBuf_, _type_) _NT_NET_SET_PKT_L3_FRAME_TYPE_EXT(_hNetBuf_, _type_)
1184 #define NT_NET_SET_PKT_L4_FRAME_TYPE_EXT(_hNetBuf_, _type_) _NT_NET_SET_PKT_L4_FRAME_TYPE_EXT(_hNetBuf_, _type_)
1192 #define NT_NET_SET_PKT_L3_LENGTH_EXT(_hNetBuf_, _u32len_) _NT_NET_SET_PKT_L3_LENGTH_EXT(_hNetBuf_, _u32len_)
1200 #define NT_NET_SET_PKT_L4_LENGTH_EXT(_hNetBuf_, _u32len_) _NT_NET_SET_PKT_L4_LENGTH_EXT(_hNetBuf_, _u32len_)
1208 #define NT_NET_SET_PKT_CALC_L3_CHECKSUM_EXT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_CALC_L3_CHECKSUM_EXT(_hNetBuf_, _bval_)
1216 #define NT_NET_SET_PKT_CALC_L4_CHECKSUM_EXT(_hNetBuf_, _bval_) _NT_NET_SET_PKT_CALC_L4_CHECKSUM_EXT(_hNetBuf_, _bval_)