2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 22:35:15 +00:00

pcap-file: Add nanosecond resolution pcap support.

PCAP header magic numbers are different for microsecond and nanosecond
resolution timestamps. This patch adds support for understanding the
difference and reporting the time correctly with ovs_pcap_read().

When writing pcap files, OVS will always use microsecond resolution, so
no new calculations were added to those functions.

Signed-off-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Mark Michelson
2018-10-05 12:52:40 -04:00
committed by Ben Pfaff
parent 2b2532dd4c
commit b6e840aed0
6 changed files with 102 additions and 61 deletions

View File

@@ -21,13 +21,17 @@
struct flow;
struct dp_packet;
struct pcap_file;
/* PCAP file reading and writing. */
FILE *ovs_pcap_open(const char *file_name, const char *mode);
int ovs_pcap_read_header(FILE *);
void ovs_pcap_write_header(FILE *);
int ovs_pcap_read(FILE *, struct dp_packet **, long long int *when);
void ovs_pcap_write(FILE *, struct dp_packet *);
struct pcap_file *ovs_pcap_open(const char *file_name, const char *mode);
struct pcap_file *ovs_pcap_stdout(void);
int ovs_pcap_read_header(struct pcap_file *);
void ovs_pcap_write_header(struct pcap_file *);
int ovs_pcap_read(struct pcap_file *, struct dp_packet **,
long long int *when);
void ovs_pcap_write(struct pcap_file *, struct dp_packet *);
void ovs_pcap_close(struct pcap_file *);
/* Extracting TCP stream data from an Ethernet packet capture. */