Reference Documentation

Napatech SmartNIC
Reference Information
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.

This function is called to retrieve a handle to an in-line or capture network stream with flags.

It is important to start calling NT_NetRxGet() and NT_NetRxRelease() soon after this call to avoid packet drop. Host buffers are assigned/released to the streamid within NT_NetRxGet() and NT_NetRxRelease().

The flags shall be either NT_NETRX_NONE or the bitwise-inclusive OR of one or more of the other flags in the following table:




No flags set, equivalent to passing '0' as flag.


Using this option will cause a write to data returned by NT_NetRxGet to fail with a segmentation fault.


[out] hStream

Reference to a NtNetStreamRx_t stream pointer

[in] name

Stream friendly name - used in, for example, logging statements

[in] netIntf

Interface type - segment or packet

[in] streamId

The network stream ID to open - can be opened a number of times which will cause sharing of the host buffers in the streamId

[in] hostBufferAllowance

Drop level for the host buffer allowance (hysteresis), -1 means disabled

[in] flags

Flags for the stream OR'd together, or zero for no flags.

Return values




Error - use NT_ExplainError for an error description

Definition at line 475 of file stream_net.h.