FD.io VPP
v20.05.1-6-gf53edbc3b
Vector Packet Processing
|
mapped pcap file support More...
Go to the source code of this file.
Functions | |
clib_error_t * | mpcap_close (mpcap_main_t *pm) |
Close a mapped pcap file. More... | |
clib_error_t * | mpcap_init (mpcap_main_t *pm) |
Initialize a mapped pcap file. More... | |
clib_error_t * | mpcap_map (mpcap_main_t *pm) |
mmap a mapped pcap file, e.g. More... | |
mapped pcap file support
Usage:
#include <vnet/unix/mpcap.h>
static mpcap_main_t mpcap = { .file_name = "/tmp/ip4", .n_packets_to_capture = 2, .packet_type = MPCAP_PACKET_TYPE_ip, };
To add a buffer:
mpcap_add_buffer (&mpcap, vm, pi0, 128);
File will be written after n_packets_to_capture
or call to mpcap_close
Definition in file mpcap.c.
clib_error_t* mpcap_close | ( | mpcap_main_t * | pm | ) |
Close a mapped pcap file.
Flush / unmap a mpcap file.
mpcap_main_t | * pm |
Definition at line 56 of file mpcap.c.
clib_error_t* mpcap_init | ( | mpcap_main_t * | pm | ) |
Initialize a mapped pcap file.
initialize a mpcap file (for writing)
mpcap_main_t | * pm |
Definition at line 85 of file mpcap.c.
clib_error_t* mpcap_map | ( | mpcap_main_t * | pm | ) |
mmap a mapped pcap file, e.g.
mmap a mpcap data file.
to read from another process
pcap_main_t | *pm |