flowmatch_example_helper.cpp

Reference Documentation

product_line_custom
IntelĀ® PAC
Napatech SmartNIC
category
Reference Information
Napatech Software Suite: examples/flowmatch/flowmatch_example_helper.cpp File Reference
flowmatch_example_helper.cpp File Reference
#include <atomic>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <nt.h>
#include "flowmatch_example_helper.h"

Go to the source code of this file.

Functions

bool applicationRunning (void)
 
void applicationStop (void)
 
void handleErrorStatus (int status, const char *message)
 
void setHostLoopback (uint8_t port, bool enable)
 

Namespaces

 anonymous_namespace{flowmatch_example_helper.cpp}
 

Variables

std::atomic< bool > anonymous_namespace{flowmatch_example_helper.cpp}::ApplicationRunning { true }
 

Function Documentation

bool applicationRunning ( void  )

Check if application is still running.

Returns
true until applicationStop() has been called.

Definition at line 59 of file flowmatch_example_helper.cpp.

Referenced by taskReceiverCounter(), and taskReceiverMiss().

void applicationStop ( void  )

Sets flag that causes applicationRunning() to return false.

Examples:
flowmatch/flowmatch_example_main.cpp.

Definition at line 64 of file flowmatch_example_helper.cpp.

Referenced by main().

void handleErrorStatus ( int  status,
const char *  message 
)

Check if status is an error code, and if it is print the error description and then quit the application.

Examples:
flowmatch/flowmatch_example_main.cpp.

Definition at line 69 of file flowmatch_example_helper.cpp.

Referenced by assignNtplFilters(), main(), anonymous_namespace{flowmatch_example_ntpl.cpp}::ntplCall(), openAndClearFlowStats(), printAndCloseFlowStats(), setHostLoopback(), taskReceiverCounter(), taskReceiverMiss(), and taskTransmitter().

void setHostLoopback ( uint8_t  port,
bool  enable 
)

Configure a port to enable or disable host-loopback. This function is used to allow the example code to be independent of a specific test setup.

Examples:
flowmatch/flowmatch_example_main.cpp.

Definition at line 79 of file flowmatch_example_helper.cpp.

Referenced by main().