summaryrefslogtreecommitdiff
path: root/wiretap/libpcap.h
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-08-30 09:43:47 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-08-30 09:43:47 +0000
commit4cd4f9a669bf38b22c377e2647054d2143e05409 (patch)
tree30ddaf8cbf77036b274b0302a942bbead4220c4a /wiretap/libpcap.h
parent57ad54abdc18bd1856a150bdc79ea281a6193a1b (diff)
downloadwireshark-4cd4f9a669bf38b22c377e2647054d2143e05409.tar.gz
Add support for slightly modified libpcap file format with nanosecond resolution (currently supported by Ethereal only). Support for both read and write was added.
The file format stays the same as the common libpcap format, only the lower part of the timestamp field uses nanoseconds instead of microseconds. This file format uses the libpcap magic number 0xa1b23c4d. svn path=/trunk/; revision=15623
Diffstat (limited to 'wiretap/libpcap.h')
-rw-r--r--wiretap/libpcap.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/wiretap/libpcap.h b/wiretap/libpcap.h
index f76b09bb98..401cf343a7 100644
--- a/wiretap/libpcap.h
+++ b/wiretap/libpcap.h
@@ -37,11 +37,18 @@
http://ftp.sunet.se/pub/os/Linux/ip-routing/lbl-tools/
- applied; PCAP_SWAPPED_MODIFIED_MAGIC is the byte-swapped version. */
+ applied; PCAP_SWAPPED_MODIFIED_MAGIC is the byte-swapped version.
+
+ PCAP_NSEC_MAGIC is for Ulf Lamping's modified "libpcap" format,
+ which uses the same common file format as PCAP_MAGIC, but the
+ timestamps are saved in nanosecond resolution instead of microseconds.
+ PCAP_SWAPPED_NSEC_MAGIC is a byte-swapped version of that. */
#define PCAP_MAGIC 0xa1b2c3d4
#define PCAP_SWAPPED_MAGIC 0xd4c3b2a1
#define PCAP_MODIFIED_MAGIC 0xa1b2cd34
#define PCAP_SWAPPED_MODIFIED_MAGIC 0x34cdb2a1
+#define PCAP_NSEC_MAGIC 0xa1b23c4d
+#define PCAP_SWAPPED_NSEC_MAGIC 0x4d3cb2a1
/* "libpcap" file header (minus magic number). */
struct pcap_hdr {
@@ -56,7 +63,7 @@ struct pcap_hdr {
/* "libpcap" record header. */
struct pcaprec_hdr {
guint32 ts_sec; /* timestamp seconds */
- guint32 ts_usec; /* timestamp microseconds */
+ guint32 ts_usec; /* timestamp microseconds (nsecs for PCAP_NSEC_MAGIC) */
guint32 incl_len; /* number of octets of packet saved in file */
guint32 orig_len; /* actual length of packet */
};