Functions to handle segment data

Reference Documentation

product_line_custom
Intel® PAC
Napatech SmartNIC
category
Reference Information
Napatech Software Suite: Functions to handle segment data

Detailed Description

These inline C functions are only valid when "PacketDescriptor" in ntservice.ini file has been set to any value than PCAP and NT_NET_GET_PKT_DESCRIPTOR_TYPE returns NT_PACKET_DESCRIPTOR_TYPE_NT_EXTENDED or NT_PACKET_DESCRIPTOR_TYPE_NT

Functions

static NT_INLINE void _nt_net_create_segment_netbuf (uint64_t size, void *mem, uint8_t portOffset, struct NtNetBuf_s *segNetBuf)
 Inline C function to create a segment NtNetBuf_t. More...
 
static NT_INLINE uint64_t _nt_net_get_next_packet (struct NtNetBuf_s *segNetBuf, uint64_t segLength, struct NtNetBuf_s *pktNetBuf)
 Inline C function to use when traversing segments. The function will update the NetBuf to the next packet in the segment. More...
 
static NT_INLINE void _nt_net_build_pkt_netbuf (struct NtNetBuf_s *segNetBuf, struct NtNetBuf_s *pktNetBuf)
 Inline C function to build a packet based NtNetBuf_t from a segment based NtNetBuf_t. More...
 
static NT_INLINE void _nt_net_initialize_segment_netbuf (uint64_t size, void *segment, uint8_t portOffset, struct NtNetBuf_s *segNetBuf)
 Inline C function to initialize a segment NtNetBuf_t structure using any received segment buffer. More...
 

Function Documentation

static NT_INLINE void _nt_net_create_segment_netbuf ( uint64_t  size,
void *  mem,
uint8_t  portOffset,
struct NtNetBuf_s segNetBuf 
)
static

Inline C function to create a segment NtNetBuf_t.

This function is used when creating segments in application memory, e.g. when constructing a transmit segment

Parameters
[in]sizeSize of the memory provided by the "mem" pointer
[in]memPointer to the segment memory allocated
[in]portOffsetSegments are per adapter and ports are relative to the port offset. The port offset can be found in NtInfoAdapter_v6_s::portOffset. If 0 is provided then the possible values in NT_NET_SET_PKT_TXPORT can only be from 0 to 3.
[out]segNetBufDestination segment NtNetBuf_t structure

Definition at line 1781 of file stream_net.h.

static NT_INLINE uint64_t _nt_net_get_next_packet ( struct NtNetBuf_s segNetBuf,
uint64_t  segLength,
struct NtNetBuf_s pktNetBuf 
)
static

Inline C function to use when traversing segments. The function will update the NetBuf to the next packet in the segment.

Parameters
[in]segNetBufSegment NtNetBuf_s * structure
[in]segLengthLength of the segment - used to know when there is no more data
[out]pktNetBufPacket NtNetBuf_s * structure
Return values
Returnsthe amount of data left in the segment
Examples:
net/capture/capture_example.c, net/replay/replay_example.c, net/replay4GA/replay4ga_example.c, net/replayGS/replayGS_example.c, net/transmit_multifunction/transmit_multifunction_example.c, net/transmit_segment/transmit_segment_example.c, and net/transmit_segment_dyn_descr/transmit_segment_dyn_descr_example.cpp.

Definition at line 1805 of file stream_net.h.

Referenced by main().

static NT_INLINE void _nt_net_build_pkt_netbuf ( struct NtNetBuf_s segNetBuf,
struct NtNetBuf_s pktNetBuf 
)
static

Inline C function to build a packet based NtNetBuf_t from a segment based NtNetBuf_t.

Parameters
[in]segNetBufSegment NtNetBuf_t structure
[out]pktNetBufDestination packet NtNetBuf_t structure
Examples:
net/capture/capture_example.c, net/replay/replay_example.c, net/replay4GA/replay4ga_example.c, net/replayGS/replayGS_example.c, net/transmit_multifunction/transmit_multifunction_example.c, net/transmit_segment/transmit_segment_example.c, and net/transmit_segment_dyn_descr/transmit_segment_dyn_descr_example.cpp.

Definition at line 1830 of file stream_net.h.

Referenced by GetTimeStamp(), and main().

static NT_INLINE void _nt_net_initialize_segment_netbuf ( uint64_t  size,
void *  segment,
uint8_t  portOffset,
struct NtNetBuf_s segNetBuf 
)
static

Inline C function to initialize a segment NtNetBuf_t structure using any received segment buffer.

This function is used when a new NtNetBuf_t handle is needed for a provided segment buffer, e.g. when copying segments

Parameters
[in]sizeSize of the segment pointed to by the "segment" pointer
[in]segmentPointer to the segment
[in]portOffsetSegments are per adapter and ports are relative to the port offset. The port offset of the adapter of which the segment originates from most be copied/stored in parallel, or known by some other means, and specified here. If 0 is used here local ports will be seen as virtual ports.
[out]segNetBufSegment NtNetBuf_t structure to initialize

Definition at line 1850 of file stream_net.h.