timestamp_inject_example.cpp

Reference Documentation

product_line_custom
IntelĀ® PAC
Napatech SmartNIC
category
Reference Information
Napatech Software Suite: examples/net/timestamp_inject/timestamp_inject_example.cpp File Reference
timestamp_inject_example.cpp File Reference
#include "nt.h"
#include <atomic>
#include <iostream>
#include <thread>
#include <unistd.h>
#include <signal.h>

Go to the source code of this file.

Functions

void printDescriptor (NtPacketDescriptorType_e descrType)
 
static void sighandler (int)
 
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)
 

Data Structures

struct  Dyn3_tx_descriptor
 
class  PacketReaderThread
 
class  PacketTransmitterThread
 

Variables

std::atomic< bool > running {true}
 
const unsigned char examplePacket []
 

Function Documentation

void printDescriptor ( NtPacketDescriptorType_e  descrType)
Examples:
net/timestamp_inject/timestamp_inject_example.cpp.

Definition at line 163 of file timestamp_inject_example.cpp.

Referenced by PacketReaderThread::processPackets().

static void sighandler ( int  )
static
Examples:
net/timestamp_inject/timestamp_inject_example.cpp.

Definition at line 496 of file timestamp_inject_example.cpp.

Referenced by main().

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

Definition at line 514 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 539 of file timestamp_inject_example.cpp.

Referenced by main().

static void usage ( const char *  argv0)
static
Examples:
net/timestamp_inject/timestamp_inject_example.cpp.

Definition at line 579 of file timestamp_inject_example.cpp.

Referenced by argparse_init(), and main().

int main ( int  argc,
char **  argv 
)

Definition at line 595 of file timestamp_inject_example.cpp.

Variable Documentation

std::atomic<bool> running {true}
Examples:
net/timestamp_inject/timestamp_inject_example.cpp, and net/vlandemo/vlandemo_example.c.

Definition at line 122 of file timestamp_inject_example.cpp.

Referenced by main(), PacketReaderThread::processPackets(), sighandler(), PacketTransmitterThread::transmitPackets(), and PacketTransmitterThread::txPacket().

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 299 of file timestamp_inject_example.cpp.

Referenced by PacketTransmitterThread::txPacket().