|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
32 "packet-generator new {\n"
34 " limit 1\n" " size %d-%d\n" " node ethernet-input\n";
78 ethertype = clib_net_to_host_u16 (
h->type);
86 if (ethertype == 0x8100 )
88 u16 *vlan_ethertype = (
u16 *) (
h + 1);
89 ethertype = clib_net_to_host_u16 (vlan_ethertype[0]);
96 " 0x%04x: %02x%02x.%02x%02x.%02x%02x"
97 " -> %02x%02x.%02x%02x.%02x%02x\n",
108 h->dst_address[3],
h->dst_address[4],
h->dst_address[5]);
130 u8 *input_file = 0, *output_file = 0;
138 if (
unformat (&input,
"-i %s", &input_file)
139 ||
unformat (&input,
"input %s", &input_file))
141 else if (
unformat (&input,
"-o %s", &output_file)
142 ||
unformat (&input,
"output %s", &output_file))
148 "usage: pcap2pg -i <input-file> [-o <output-file>]\n");
167 ofp = fopen ((
char *) output_file,
"w+");
__clib_export clib_error_t * pcap_read(pcap_main_t *pm)
Read PCAP file.
int main(int argc, char **argv)
pcap2pg.
void stream_boilerplate(FILE *ofp, int i, u8 *pkt)
Packet Generator Stream boilerplate.
#define clib_error_report(e)
PCAP main state data structure.
#define clib_unix_warning(format, args...)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
struct clib_bihash_value offset
template key/value backing page structure
PCAP utility definitions.
sll srl srl sll sra u16x4 i
u8 ** packets_read
Packets read from file.
template key/value backing page structure
int pcap2pg(pcap_main_t *pm, FILE *ofp)
Conversion of PCAP file to PG file format.
char * file_name
File name of pcap output.
static char * pg_fmt
char * to seed a PG file