Detailed Description
This is header file of the network stream interface
Definition in file stream_net.h.
Go to the source code of this file.
Functions | |
int | NT_NetRxOpen (NtNetStreamRx_t *hStream, const char *name, enum NtNetInterface_e netIntf, uint32_t streamId, int hostBufferAllowance) |
Opens in-line or capture host buffer(s) and returns a NtNetStreamRx_t handle. More... | |
int | NT_NetRxOpen_v2 (NtNetStreamRx_t *hStream, const char *name, enum NtNetInterface_e netIntf, uint32_t streamId, int hostBufferAllowance, int flags) |
Opens in-line or capture host buffer(s) and returns a NtNetStreamRx_t handle. More... | |
void | NT_NetRxOpenAttrInit (NtNetRxAttr_t *attr) |
Initialize RX stream attributes. More... | |
void | NT_NetRxOpenAttrSetName (NtNetRxAttr_t *attr, const char *name) |
Sets the stream name attribute. More... | |
const char * | NT_NetRxOpenAttrGetName (const NtNetRxAttr_t *attr) |
Returns the name attribute. More... | |
void | NT_NetRxOpenAttrSetNetIntf (NtNetRxAttr_t *attr, enum NtNetInterface_e netIntf) |
Sets the interface type attribute. More... | |
enum NtNetInterface_e | NT_NetRxOpenAttrGetNetIntf (const NtNetRxAttr_t *attr) |
Returns the interface type attribute. More... | |
void | NT_NetRxOpenAttrSetHostBufferAllowance (NtNetRxAttr_t *attr, int hostBufferAllowance) |
Sets the host buffer allowance attribute. More... | |
int | NT_NetRxOpenAttrGetHostBufferAllowance (const NtNetRxAttr_t *attr) |
Returns the buffer allowance attribute. More... | |
void | NT_NetRxOpenAttrSetFlags (NtNetRxAttr_t *attr, int flags) |
Sets the flags attribute. More... | |
int | NT_NetRxOpenAttrGetFlags (const NtNetRxAttr_t *attr) |
Returns the flags attribute. More... | |
int | NT_NetRxOpen_Attr (NtNetStreamRx_t *hStream, uint32_t streamId, const NtNetRxAttr_t *attr) |
Opens in-line or capture host buffer(s) and returns a NtNetStreamRx_t handle. More... | |
int | NT_NetRxOpenMulti (NtNetStreamRx_t *hStream, const char *name, enum NtNetInterface_e netIntf, uint32_t *paStreamId, unsigned int numStreamIds, int hostBufferAllowance) |
Opens in-line or capture host buffer(s) and returns a NtNetStreamRx_t handle. More... | |
int | NT_NetRxOpenMulti_v2 (NtNetStreamRx_t *hStream, const char *name, enum NtNetInterface_e netIntf, uint32_t *paStreamId, unsigned int numStreamIds, int hostBufferAllowance, int flags) |
Opens in-line or capture host buffer(s) and returns a NtNetStreamRx_t handle. More... | |
int | NT_NetRxOpenMulti_Attr (NtNetStreamRx_t *hStream, uint32_t *paStreamId, unsigned int numStreamIds, const NtNetRxAttr_t *attr) |
Opens in-line or capture host buffer(s) and returns a NtNetStreamRx_t handle. More... | |
int | NT_NetRxGet (NtNetStreamRx_t hStream, NtNetBuf_t *netBuf, int timeout) |
Gets data from an in-line or capture stream. More... | |
int | NT_NetRxGetNextPacket (NtNetStreamRx_t hStream, NtNetBuf_t *netBuf, int timeout) |
Gets data from an in-line or capture stream. More... | |
int | NT_NetRxRead (NtNetStreamRx_t hStream, NtNetRx_t *cmd) |
Reads data from the stream. More... | |
int | NT_NetRxRelease (NtNetStreamRx_t hStream, NtNetBuf_t netBuf) |
Releases network buffer. More... | |
int | NT_NetRxClose (NtNetStreamRx_t hStream) |
Closes an in-line or capture stream. More... | |
int | NT_NetTxOpen (NtNetStreamTx_t *hStream, const char *name, uint64_t portMask, uint32_t NUMA, uint32_t minHostBufferSize) |
Opens a TX host buffer and returns a NtNetStreamTx_t handle. More... | |
int | NT_NetTxOpen_v2 (NtNetStreamTx_t *hStream, const char *name, uint64_t portMask, uint32_t NUMA, uint32_t minHostBufferSize, enum NtPacketDescriptorType_e descriptor, enum NtTimestampType_e ts) |
Opens a TX host buffer and returns a NtNetStreamTx_t handle (extended version) More... | |
int | NT_NetTxOpen_v3 (NtNetStreamTx_t *hStream, const char *name, uint64_t portMask, uint32_t NUMA, uint64_t minHostBufferSize, enum NtPacketDescriptorType_e descriptor, enum NtTimestampType_e ts) |
Opens a TX host buffer and returns a NtNetStreamTx_t handle (extended version) More... | |
void | NT_NetTxOpenAttrInit (NtNetTxAttr_t *attr) |
Initialize TX stream attributes. More... | |
void | NT_NetTxOpenAttrSetName (NtNetTxAttr_t *attr, const char *name) |
Sets the stream name attribute. More... | |
const char * | NT_NetTxOpenAttrGetName (const NtNetTxAttr_t *attr) |
Returns the name attribute. More... | |
int | NT_NetTxOpenAttrSetDescriptorMode (NtNetTxAttr_t *attr, enum NtNetTxDescriptorMode_e descriptorMode) |
Sets the descriptor mode attribute. More... | |
enum NtNetTxDescriptorMode_e | NT_NetTxOpenAttrGetDescriptorMode (const NtNetTxAttr_t *attr) |
Returns the descriptor mode attribute. More... | |
void | NT_NetTxOpenAttrSetPortMask (NtNetTxAttr_t *attr, uint64_t portMask) |
Sets the port mask attribute. More... | |
uint64_t | NT_NetTxOpenAttrGetPortMask (NtNetTxAttr_t *attr) |
Returns the port mask attribute. More... | |
void | NT_NetTxOpenAttrSetNUMA (NtNetTxAttr_t *attr, uint32_t NUMA) |
Sets the numa attribute. More... | |
uint32_t | NT_NetTxOpenAttrGetNUMA (NtNetTxAttr_t *attr) |
Returns the numa attribute. More... | |
void | NT_NetTxOpenAttrSetFlags (NtNetTxAttr_t *attr, uint32_t flags) |
Sets the flags attribute. More... | |
uint32_t | NT_NetTxOpenAttrGetFlags (NtNetTxAttr_t *attr) |
Returns the flags attribute. More... | |
void | NT_NetTxOpenAttrSetMinHostbufferSize (NtNetTxAttr_t *attr, uint64_t minHostBufferSize) |
Sets the minimum host buffer size attribute. More... | |
uint64_t | NT_NetTxOpenAttrGetMinHostbufferSize (NtNetTxAttr_t *attr) |
Returns the minimum host buffer size attribute. More... | |
void | NT_NetTxOpenAttrSetDescriptor (NtNetTxAttr_t *attr, enum NtPacketDescriptorType_e descriptor) |
Sets the descriptor type attribute. More... | |
enum NtPacketDescriptorType_e | NT_NetTxOpenAttrGetDescriptor (NtNetTxAttr_t *attr) |
Returns the descriptor type attribute. More... | |
int | NT_NetTxOpenAttrSetTxtDescriptorPosTimestampInject (NtNetTxAttr_t *attr, bool enable, uint32_t pos) |
Sets bit position in packet descriptor for the Timestamp Inject command bit. More... | |
void | NT_NetTxOpenAttrGetTxtDescriptorPosTimestampInject (NtNetTxAttr_t *attr, bool *enable, uint32_t *pos) |
Gets bit position in packet descriptor for the Timestamp Inject command bit. More... | |
int | NT_NetTxOpenAttrSetTxtDescriptorPosFcs (NtNetTxAttr_t *attr, bool enable, uint32_t pos) |
Sets bit position in packet descriptor for the FCS control command bit. More... | |
void | NT_NetTxOpenAttrGetTxtDescriptorPosFcs (NtNetTxAttr_t *attr, bool *enable, uint32_t *pos) |
Gets bit position in packet descriptor for the FCS control command bit. More... | |
void | NT_NetTxOpenAttrSetTimestampType (NtNetTxAttr_t *attr, enum NtTimestampType_e timestampType) |
Sets the timestamp type attribute. More... | |
enum NtTimestampType_e | NT_NetTxOpenAttrGetTimestampType (NtNetTxAttr_t *attr) |
Returns the timestamp type attribute. More... | |
int | NT_NetTxOpenAttrSetDescriptorPosLayer3Offset (NtNetTxAttr_t *attr, bool enable, uint32_t pos) |
Set bit position in packet descriptor for layer 3 offset bits. More... | |
void | NT_NetTxOpenAttrGetDescriptorPosLayer3Offset (const NtNetTxAttr_t *attr, bool *enable, uint32_t *pos) |
Get bit position in packet descriptor for layer 3 offset bits. More... | |
int | NT_NetTxOpenAttrSetDescriptorPosLayer4Offset (NtNetTxAttr_t *attr, bool enable, uint32_t pos) |
Set bit position in packet descriptor for layer 4 offset bits. More... | |
void | NT_NetTxOpenAttrGetDescriptorPosLayer4Offset (const NtNetTxAttr_t *attr, bool *enable, uint32_t *pos) |
Get bit position in packet descriptor for layer 4 offset bits. More... | |
int | NT_NetTxOpenAttrSetDescriptorPosFrameType (NtNetTxAttr_t *attr, bool enable, uint32_t pos) |
Set bit position in packet descriptor for frame type bits. More... | |
void | NT_NetTxOpenAttrGetDescriptorPosFrameType (const NtNetTxAttr_t *attr, bool *enable, uint32_t *pos) |
Get bit position in packet descriptor for frame type bits. More... | |
int | NT_NetTxOpenAttrSetDescriptorPosChecksumCmd (NtNetTxAttr_t *attr, bool enable, uint32_t pos) |
Set bit position in packet descriptor for checksum command bits. More... | |
void | NT_NetTxOpenAttrGetDescriptorPosChecksumCmd (const NtNetTxAttr_t *attr, bool *enable, uint32_t *pos) |
Get bit position in packet descriptor for checksum command bits. More... | |
int | NT_NetTxOpenAttrSetDescriptorPosIgnoreBit (NtNetTxAttr_t *attr, bool enable, uint32_t pos) |
Set bit position in packet descriptor for TX ignore bit. More... | |
void | NT_NetTxOpenAttrGetDescriptorPosIgnoreBit (const NtNetTxAttr_t *attr, bool *enable, uint32_t *pos) |
Get bit position in packet descriptor for TX ignore bit. More... | |
int | NT_NetTxOpenAttrSetDescriptorPosTxNowBit (NtNetTxAttr_t *attr, bool enable, uint32_t pos) |
Set bit position in packet descriptor for TX now bit. More... | |
void | NT_NetTxOpenAttrGetDescriptorPosTxNowBit (const NtNetTxAttr_t *attr, bool *enable, uint32_t *pos) |
Get bit position in packet descriptor for TX now bit. More... | |
int | NT_NetTxOpenAttrSetDescriptorPosClockBit (NtNetTxAttr_t *attr, bool enable, uint32_t pos) |
Set bit position in packet descriptor for TX set clock bit. More... | |
void | NT_NetTxOpenAttrGetDescriptorPosClockBit (const NtNetTxAttr_t *attr, bool *enable, uint32_t *pos) |
Get bit position in packet descriptor for TX set clock bit. More... | |
int | NT_NetTxOpen_Attr (NtNetStreamTx_t *hStream, const NtNetTxAttr_t *attr) |
Opens a TX host buffer and returns a NtNetStreamTx_t handle (extended version) More... | |
int | NT_NetTxGet (NtNetStreamTx_t hStream, NtNetBuf_t *netBuf, uint32_t port, size_t packetSize, enum NtNetTxPacketOption_e packetOption, int timeout) |
Gets a TX port buffer. More... | |
int | NT_NetTxRelease (NtNetStreamTx_t hStream, NtNetBuf_t netBuf) |
Releases the network buffer. More... | |
int | NT_NetTxRead (NtNetStreamTx_t hStream, NtNetTx_t *cmd) |
Reads data from the stream. More... | |
int | NT_NetTxClose (NtNetStreamTx_t hStream) |
Closes a TX stream. More... | |
int | NT_NetTxAddPacket (NtNetStreamTx_t hStream, uint32_t port, NtNetTxFragment_t *fragments, uint32_t fragmentCount, int timeout) |
AddPacket to a TX stream. More... | |
int | NT_NetFileOpen (NtNetStreamFile_t *hStream, const char *name, enum NtNetInterface_e netIntf, const char *file) |
Opens a capture file. More... | |
int | NT_NetFileOpen_v2 (NtNetStreamFile_t *hStream, const char *name, enum NtNetInterface_e netIntf, const char *file, bool noConvert) |
Opens a capture file (extended version) More... | |
int | NT_NetFileGet (NtNetStreamFile_t hStream, NtNetBuf_t *netBuf) |
Gets packets/segments from a file stream. More... | |
int | NT_NetFileRelease (NtNetStreamFile_t hStream, NtNetBuf_t netBuf) |
Releases the network buffer. More... | |
int | NT_NetFileClose (NtNetStreamFile_t hStream) |
Closes a file stream. More... | |
int | NT_NetFileRead (NtNetStreamFile_t hStream, NtNetFileRead_t *data) |
Read information about a file stream. More... | |
int | NT_NetFileOpen_Attr (NtNetStreamFile_t *hStream, const char *file, const NtNetFileAttr_t *attr) |
Opens a capture file. More... | |
void | NT_NetFileOpenAttrInit (NtNetFileAttr_t *attr) |
Initialize NetFile stream attributes. More... | |
void | NT_NetFileOpenAttrSetName (NtNetFileAttr_t *attr, const char *name) |
Sets the stream name attribute. More... | |
const char * | NT_NetFileOpenAttrGetName (const NtNetFileAttr_t *attr) |
Returns the name attribute. More... | |
void | NT_NetFileOpenAttrSetInterface (NtNetFileAttr_t *attr, enum NtNetInterface_e netIntf) |
Sets the interface type attribute. More... | |
enum NtNetInterface_e | NT_NetTxOpenAttrGetInterface (NtNetTxAttr_t *attr) |
Returns the interface type attribute. More... | |
void | NT_NetFileOpenAttrSetEnablePcapToNtConversion (NtNetFileAttr_t *attr, bool enableFlag) |
Enable or disable automatic conversion from PCAP to NT format. More... | |
bool | NT_NetFileOpenAttrGetEnablePcapToNtConversion (const NtNetTxAttr_t *attr) |
Returns whether automatic conversion from PCAP to NT format is enabled. More... | |
int | NT_NetFileOpenAttrSetConvertedTsType (NtNetFileAttr_t *attr, enum NtTimestampType_e convertedTsType) |
Sets the converted timstamp type attribute. More... | |
enum NtTimestampType_e | NT_NetFileOpenAttrGetConvertedTsType (NtNetTxAttr_t *attr) |
Gets the converted timstamp type attribute. More... | |
uint64_t | NT_NetGetSegmentTimestamp (void *pDescr) |
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... | |
Data Structures | |
struct | NtNetBuf_s |
struct | NtNetRxFileHeader_s |
struct | NtNetRxStreamDrop_s |
struct | NtNetRxStreamTime_s |
struct | NtNetRxPcapInfo_s |
struct | NtNetRxHbRing_s |
struct | NtNetRxHbInfo_s |
struct | NtNetRxHbInfo_s::NtNetRxHb_s |
struct | NtNetRx_s |
union | NtNetRx_s::NtNetRx_u |
struct | NtNetTxHbInfo_s |
struct | NtNetTxHbInfo_s::NtNetTxHb_s |
struct | NtNetTxHbRing_s |
struct | NtNetTx_s |
union | NtNetTx_s::NtNetTx_u |
struct | NtNetTxFragment_s |
struct | NtNetFileReadInfo_v1_s |
struct | NtNetFileReadDesc_s |
struct | NtNetFileRead_s |
union | NtNetFileRead_s::NtNetFileRead_u |
union | __nt_netrx_attr |
union | __nt_nettx_attr |
union | __nt_netfile_attr |
Macros | |
#define | __SIZEOF_NT_NETRX_ATTR (128) |
#define | __SIZEOF_NT_NETTX_ATTR (128) |
#define | __SIZEOF_NT_NETFILE_ATTR (128) |
#define | NT_NETRX_NONE (0) |
#define | NT_NETRX_READONLY_STREAM (1LL<<0) |
#define | NT_NET_GET_USER_META_ARG0(_hNetBuf_) |
Returns the meta data arg0 uintptr_t value. More... | |
#define | NT_NET_GET_USER_META_ARG1(_hNetBuf_) |
Returns the meta data arg1 uintptr_t value. More... | |
#define | NT_NET_GET_USER_META_ARG2(_hNetBuf_) |
Returns the meta data arg2 uintptr_t value. More... | |
#define | NT_NET_SET_USER_META_ARG0(_hNetBuf_, value) |
Set the meta data arg0 uintptr_t value. More... | |
#define | NT_NET_SET_USER_META_ARG1(_hNetBuf_, value) |
Set the meta data arg1 uintptr_t value. More... | |
#define | NT_NET_SET_USER_META_ARG2(_hNetBuf_, value) |
Set the meta data arg2 uintptr_t value. More... | |
#define | NT_NET_GET_SEGMENT_PTR(_hNetBuf_) |
Returns the segment pointer. More... | |
#define | NT_NET_GET_SEGMENT_LENGTH(_hNetBuf_) |
Returns the segment length. More... | |
#define | NT_NET_GET_SEGMENT_PKTS(_hNetBuf_) |
Returns the number of packets in a segment. More... | |
#define | NT_NET_GET_SEGMENT_TIMESTAMP(_hNetBuf_) |
The time stamp of the first packet in the segment. More... | |
#define | NT_NET_GET_SEGMENT_TIMESTAMP_TYPE(_hNetBuf_) |
The time stamp type. More... | |
#define | NT_NET_SET_SEGMENT_LENGTH(_hNetBuf_, _length_) |
Sets the segment length. More... | |
Typedefs | |
typedef struct NtNetBuf_s * | NtNetBuf_t |
typedef struct NtNetRx_s | NtNetRx_t |
typedef struct NtNetTx_s | NtNetTx_t |
typedef struct NtNetTxFragment_s | NtNetTxFragment_t |
typedef struct NtNetFileReadInfo_v1_s | NtNetFileInfo_v1_t |
typedef struct NtNetFileReadDesc_s | NtNetFileReadDesc_t |
typedef struct NtNetFileRead_s | NtNetFileRead_t |
typedef struct NtNetStreamRx_s * | NtNetStreamRx_t |
typedef union __nt_netrx_attr | NtNetRxAttr_t |
typedef union __nt_nettx_attr | NtNetTxAttr_t |
typedef union __nt_netfile_attr | NtNetFileAttr_t |
typedef struct NtNetStreamTx_s * | NtNetStreamTx_t |
typedef struct NtNetStreamFile_s * | NtNetStreamFile_t |
Typedef Documentation
typedef struct NtNetBuf_s * NtNetBuf_t |
This structure is used by the Network Stream Get/Release functions and provides a handle to the returned data. The layout of the structure is confidential and must only be accessed via Network macros. The layout of the structure might change between major releases of NTAPI.
Enumeration Type Documentation
enum NtNetInterface_e |
The network interface types. Used to select PACKET or NETWORK interface.
Enumerator | |
---|---|
NT_NET_INTERFACE_UNKNOWN |
Unknown interface. |
NT_NET_INTERFACE_PACKET |
Packet interface. |
NT_NET_INTERFACE_SEGMENT |
Segment interface. |
Definition at line 201 of file stream_net.h.
enum NtL2FrameType_e |
MACROs to access network data Layer 2 types
Enumerator | |
---|---|
NT_L2_FRAME_TYPE_ETHER_II |
Ether type II frame. |
NT_L2_FRAME_TYPE_LLC |
LLC frame. |
NT_L2_FRAME_TYPE_SNAP |
SNAP frame. |
NT_L2_FRAME_TYPE_NOVELL_RAW |
Novell Raw frame. |
Definition at line 1697 of file stream_net.h.
enum NtL3FrameType_e |
Layer 3 types
Enumerator | |
---|---|
NT_L3_FRAME_TYPE_IPv4 |
IPv4 frame. |
NT_L3_FRAME_TYPE_IPv6 |
IPV6 frame. |
NT_L3_FRAME_TYPE_IPX |
IPX frame. |
NT_L3_FRAME_TYPE_OTHER |
Other frame. |
Definition at line 1707 of file stream_net.h.
enum NtL4FrameType_e |
Layer 4 frame types
Definition at line 1717 of file stream_net.h.
enum NtL4PortType_e |
Layer 4 port types
Enumerator | |
---|---|
NT_L4_PORT_OTHER |
Other port. |
NT_L4_PORT_GTPV0_U |
GTPV0_U port. |
NT_L4_PORT_GTPV1V2_C |
GTPV1V2_C port. |
NT_L4_PORT_GTPV1_U |
GTPV1_U port. |
Definition at line 1731 of file stream_net.h.
enum NtTunnelType_e |
Frame tunnel types
Definition at line 1741 of file stream_net.h.
enum NtL3FragmentType_e |
L3 fragmentation
Enumerator | |
---|---|
NT_L3_FRAGMENT_TYPE_NONE |
L3 not fragmented. |
NT_L3_FRAGMENT_TYPE_FIRST |
L3 first fragment. |
NT_L3_FRAGMENT_TYPE_MIDDLE |
L3 middle fragment. |
NT_L3_FRAGMENT_TYPE_LAST |
L3 last fragment. |
Definition at line 1753 of file stream_net.h.