FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
pcap2pg.c File Reference

Functions to convert PCAP file format to VPP PG (Packet Generator) More...

+ Include dependency graph for pcap2pg.c:

Go to the source code of this file.

Functions

void stream_boilerplate (FILE *ofp, int i, u8 *pkt)
 Packet Generator Stream boilerplate. More...
 
int pcap2pg (pcap_main_t *pm, FILE *ofp)
 Conversion of PCAP file to PG file format. More...
 
int main (int argc, char **argv)
 pcap2pg. More...
 

Variables

pcap_main_t pcap_main
 
static char * pg_fmt
 char * to seed a PG file More...
 

Detailed Description

Functions to convert PCAP file format to VPP PG (Packet Generator)

Definition in file pcap2pg.c.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

pcap2pg.

usage: pcap2pg -i <input-file> [-o <output-file>]

Definition at line 126 of file pcap2pg.c.

+ Here is the call graph for this function:

◆ pcap2pg()

int pcap2pg ( pcap_main_t pm,
FILE *  ofp 
)

Conversion of PCAP file to PG file format.

Parameters
*pm- pcap_main_t
*ofp- FILE
Returns
rc - int

In vnet terms, packet generator interfaces are not ethernets. They don't have vlan tables. This transforms captured 802.1q VLAN packets into regular Ethernet packets.

Definition at line 60 of file pcap2pg.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stream_boilerplate()

void stream_boilerplate ( FILE *  ofp,
int  i,
u8 pkt 
)

Packet Generator Stream boilerplate.

Parameters
*ofp- FILE
i- int
*pkt- u8

Definition at line 45 of file pcap2pg.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ pcap_main

pcap_main_t pcap_main

Definition at line 26 of file pcap2pg.c.

◆ pg_fmt

char* pg_fmt
static
Initial value:
=
"packet-generator new {\n"
" name s%d\n"
" limit 1\n" " size %d-%d\n" " node ethernet-input\n"

char * to seed a PG file

Definition at line 31 of file pcap2pg.c.