NT_NetRxOpen_v2

Reference Documentation

product_line_custom
Napatech SmartNIC
category
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.
Note:

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:

Flag

Description

NT_NETRX_NONE

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

NT_NETRX_READONLY_STREAM

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

Parameters

[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

NT_SUCCESS

Success

!=NT_SUCCESS

Error - use NT_ExplainError for an error description

Definition at line 475 of file stream_net.h.