replay4ga_loop_example.c

Reference Documentation

product_line_custom
IntelĀ® PAC
Napatech SmartNIC
category
Reference Information
Napatech Software Suite: examples/net/replay4GA_loop/replay4ga_loop_example.c File Reference
replay4ga_loop_example.c File Reference
#include <nt.h>
#include <unistd.h>
#include <signal.h>
#include <argparse.h>

Go to the source code of this file.

Functions

static void StopApplication (int sig)
 
int main (int argc, const char **argv)
 

Macros

#define ONEMBIT   (1000000ULL)
 

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 []
 

Function Documentation

static void StopApplication ( int  sig)
static

The function called when user is pressing CTRL-C

Definition at line 93 of file replay4ga_loop_example.c.

Referenced by main().

int main ( int  argc,
const char **  argv 
)

Definition at line 109 of file replay4ga_loop_example.c.

Macro Definition Documentation

#define ONEMBIT   (1000000ULL)

Definition at line 49 of file replay4ga_loop_example.c.

Referenced by main().

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",
}

Print command line info

Definition at line 54 of file replay4ga_loop_example.c.

Referenced by main().

int opt_port = 0
static

Definition at line 61 of file replay4ga_loop_example.c.

Referenced by main().

char* opt_filename
static

Definition at line 62 of file replay4ga_loop_example.c.

Referenced by main().

int opt_num_repetitions = 1
static

Definition at line 63 of file replay4ga_loop_example.c.

Referenced by main().

int opt_scale = 100
static

Definition at line 64 of file replay4ga_loop_example.c.

Referenced by main().

int appRunning = 1
static

Definition at line 66 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 71 of file replay4ga_loop_example.c.