25 "packet-generator new {\n" 29 " node ethernet-input\n";
55 ethertype = clib_net_to_host_u16 (h->
type);
63 if (ethertype == 0x8100 )
65 u16 * vlan_ethertype = (
u16 *)(h+1);
66 ethertype = clib_net_to_host_u16(vlan_ethertype[0]);
73 " 0x%04x: %02x%02x.%02x%02x.%02x%02x" 74 " -> %02x%02x.%02x%02x.%02x%02x\n",
91 for (j = offset; j <
vec_len (pkt); j++)
100 int main (
int argc,
char **argv)
104 u8 * input_file = 0, * output_file = 0;
112 if (
unformat(&input,
"-i %s", &input_file)
113 ||
unformat (&input,
"input %s", &input_file))
115 else if (
unformat (&input,
"-o %s", &output_file)
116 ||
unformat (&input,
"output %s", &output_file))
122 "usage: pcap2pg -i <input-file> [-o <output-file>]\n");
141 ofp = fopen ((
char *)output_file,
"rw");
sll srl srl sll sra u16x4 i
#define clib_error_report(e)
int main(int argc, char **argv)
void stream_boilerplate(FILE *ofp, int i, u8 *pkt)
clib_error_t * pcap_read(pcap_main_t *pm)
#define clib_unix_warning(format, args...)
int pcap2pg(pcap_main_t *pm, FILE *ofp)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)