timestamp_inject_example.cpp

Reference Documentation

Platform
Napatech SmartNIC
Content Type
Reference Information
Capture Software Version
Link™ Capture Software 12.14
Napatech Software Suite: examples/net/timestamp_inject/timestamp_inject_example.cpp File Reference
timestamp_inject_example.cpp File Reference
#include <nt.h>
#include <iostream>
#include <thread>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <atomic>

Go to the source code of this file.

Data Structures

struct  Dyn3_tx_descriptor
 
class  PacketReaderThread
 
class  PacketTransmitterThread
 

Functions

void printDescriptor (NtPacketDescriptorType_e descrType)
 
static void StopApplication (int sig)
 
void printError (int status, const char *formatstr)
 
void applyNtpl (uint64_t rxPort)
 
bool featuresAvailable (uint64_t txPort)
 
static void usage (const char *argv0)
 
int main (int argc, char **argv)
 

Variables

static std::atomic_int appRunning {1}
 
const unsigned char examplePacket []
 

Function Documentation

void printDescriptor ( NtPacketDescriptorType_e  descrType)
static void StopApplication ( int  sig)
static

The function called when user is pressing CTRL-C

Definition at line 511 of file timestamp_inject_example.cpp.

Referenced by main(), and PacketTransmitterThread::transmitPackets().

void applyNtpl ( uint64_t  rxPort)
Examples:
net/timestamp_inject/timestamp_inject_example.cpp.

Definition at line 531 of file timestamp_inject_example.cpp.

Referenced by main().

bool featuresAvailable ( uint64_t  txPort)
Examples:
net/timestamp_inject/timestamp_inject_example.cpp.

Definition at line 556 of file timestamp_inject_example.cpp.

Referenced by main().

static void usage ( const char *  argv0)
static
int main ( int  argc,
char **  argv 
)

Definition at line 612 of file timestamp_inject_example.cpp.

Variable Documentation

const unsigned char examplePacket[]
Initial value:
=
{
0x94, 0xC6, 0x91, 0x1C, 0x68, 0x1D, 0x94, 0xC6, 0x91, 0x1C, 0x68, 0xC3, 0x08, 0x00, 0x45, 0x00,
0x00, 0x78, 0x00, 0x01, 0x00, 0x00, 0x40, 0x06, 0xB5, 0xCF, 0xC0, 0xA8, 0x00, 0x02, 0x01, 0x02,
0x03, 0x04, 0x00, 0x14, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02,
0x20, 0x00, 0x42, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}
Examples:
net/timestamp_inject/timestamp_inject_example.cpp.

Definition at line 305 of file timestamp_inject_example.cpp.

Referenced by PacketTransmitterThread::txPacket().