replay4ga_loop_example.c

Reference Documentation

Platform
Intel® PAC
Napatech SmartNIC
Content Type
Reference Information
Capture Software Version
Link™ Capture Software 12.10
Napatech Software Suite: examples/net/replay4GA_loop/replay4ga_loop_example.c File Reference
replay4ga_loop_example.c File Reference
#include <nt.h>
#include <argparse.h>
#include <signal.h>

Go to the source code of this file.

Data Structures

struct  pcap_timespec_s
 

Macros

#define ONEMBIT   (1000000ULL)
 

Functions

static void StopApplication (int sig)
 
static uint64_t convertToUnixNsTs (const struct NtConfigTimestampReadData_s *data)
 
int main (int argc, const char **argv)
 

Variables

static const char * usageText []
 
static int opt_port = 0
 
static char * opt_filename
 
static int opt_num_repetitions = 1
 
static int opt_scale = 100
 
static int appRunning = 1
 
struct argparse_option arg_options []
 

Macro Definition Documentation

#define ONEMBIT   (1000000ULL)

Definition at line 58 of file replay4ga_loop_example.c.

Referenced by main().

Function Documentation

static void StopApplication ( int  sig)
static

The function called when user is pressing CTRL-C

Definition at line 98 of file replay4ga_loop_example.c.

Referenced by main().

static uint64_t convertToUnixNsTs ( const struct NtConfigTimestampReadData_s *  data)
static
int main ( int  argc,
const char **  argv 
)

Definition at line 136 of file replay4ga_loop_example.c.

Variable Documentation

const char* usageText[]
static
Initial value:
= {
"Syntax:\n"
"replay4ga_loop_example [-h][-p <port no.>][-f <file name>][-n <number of iterations> [-s <replay speed in % of capture>]\n"
"Example: replay4ga_loop_example -p 1 -f mycapture.cap -n 10 -s 200\n",
NULL
}

Print command line info

Definition at line 63 of file replay4ga_loop_example.c.

Referenced by main().

int opt_port = 0
static

Definition at line 70 of file replay4ga_loop_example.c.

Referenced by main().

char* opt_filename
static

Definition at line 71 of file replay4ga_loop_example.c.

Referenced by main().

int opt_num_repetitions = 1
static

Definition at line 72 of file replay4ga_loop_example.c.

Referenced by main().

int opt_scale = 100
static

Definition at line 73 of file replay4ga_loop_example.c.

Referenced by main().

int appRunning = 1
static

Definition at line 75 of file replay4ga_loop_example.c.

Referenced by main(), and StopApplication().

struct argparse_option arg_options[]
Initial value:
= {
OPT_INTEGER('p', "port", &opt_port, "Tx port", NULL, 0, 0, "port number"),
OPT_STRING('f', "filename", &opt_filename, "File name\n", NULL, 0, 0, "value"),
OPT_INTEGER('n', "repetitions", &opt_num_repetitions, "Number of repetitions\n", NULL, 0, 0, "value"),
OPT_INTEGER('s', "scale", &opt_scale, "Replay speed in % of captured speed\n", NULL, 0, 0, "value"),
}

Table of valid options.

Definition at line 80 of file replay4ga_loop_example.c.