flowmatch_example_receiver.cpp

Reference Documentation

Platform
Napatech SmartNIC
Content Type
Reference Information
Capture Software Version
Link™ Capture Software 12.6
Napatech Software Suite: examples/flowmatch/flowmatch_example_receiver.cpp File Reference
flowmatch_example_receiver.cpp File Reference
#include <atomic>
#include <chrono>
#include <cstring>
#include <iostream>
#include <memory>
#include <thread>
#include <vector>
#include <nt.h>
#include "flowmatch_example_helper.h"
#include "flowmatch_example_receiver.h"

Go to the source code of this file.

Functions

void anonymous_namespace{flowmatch_example_receiver.cpp}::printFlowStreamInfo (NtFlowStream_t &flowStream, std::vector< std::unique_ptr< NtFlow_t >> &learnedFlowList, std::atomic< uint64_t > *ipv4counter, std::atomic< uint64_t > *ipv6counter)
 
void taskReceiverMiss (const char *streamName, uint32_t streamId, std::atomic< uint64_t > *ipv4counter, std::atomic< uint64_t > *ipv6counter)
 
void taskReceiverCounter (const char *streamName, uint32_t streamId, std::atomic< uint64_t > *counter)
 

Namespaces

 anonymous_namespace{flowmatch_example_receiver.cpp}
 

Function Documentation

void taskReceiverMiss ( const char *  streamName,
uint32_t  streamId,
std::atomic< uint64_t > *  ipv4counter,
std::atomic< uint64_t > *  ipv6counter 
)

Handle MISSED packages, and learn new flows based on received packages. This function is the main function of a separate thread.

Examples:
flowmatch/flowmatch_example_main.cpp.

Definition at line 126 of file flowmatch_example_receiver.cpp.

Referenced by main().

void taskReceiverCounter ( const char *  streamName,
uint32_t  streamId,
std::atomic< uint64_t > *  counter 
)

Count packages received in specified stream. This function is the main function of a separate thread. Note: The transmit function in this example does not cause enough traffic for any packages to be received as unhandled. However, if the tool pktgen is running while this example is run, it can generate unhandled packages.

Examples:
flowmatch/flowmatch_example_main.cpp.

Definition at line 236 of file flowmatch_example_receiver.cpp.

Referenced by main().