API: Open a Flow Stream

Stateful Flow Management

Napatech SmartNIC
Content Type
User Guide
Capture Software Version
Link™ Capture Software 12.10

Use this example to open a flow stream. You need to open a flow stream before flow learning.

A flow stream to the SmartNIC must be established using NT_FlowOpen_Attr. Each flow stream is SmartNIC-specific, so if multiple SmartNICs are used, then multiple flow streams are required.

The following code snippet shows how a flow stream is configured and then opened.
  uint8_t         adapterNo = 0;
  NtFlowAttr_t    flowAttr;
  NtFlowStream_t  flowStream;

  // Initialize flow stream attributes and set adapter number attribute.
  NT_FlowOpenAttrSetAdapterNo(&flowAttr, adapterNo);

  // Opens a flow programming stream and returns a stream handle (flowStream).
  status = NT_FlowOpen_Attr(&flowStream, "open_flow_stream_example", &flowAttr);
  if(status != NT_SUCCESS) { /* Handle error */ }