master
h 30 lines 1006 Bytes
Raw
1 /*
2 * SPDX-License-Identifier: GPL-2.0-or-later
3 */
4 #ifndef QEMU_PCAP_H
5 #define QEMU_PCAP_H
6
7 #define PCAP_MAGIC 0xa1b2c3d4
8 #define PCAP_MAJOR 2
9 #define PCAP_MINOR 4
10
11 /* https://wiki.wireshark.org/Development/LibpcapFileFormat */
12
13 struct pcap_hdr {
14 uint32_t magic_number; /* magic number */
15 uint16_t version_major; /* major version number */
16 uint16_t version_minor; /* minor version number */
17 int32_t thiszone; /* GMT to local correction */
18 uint32_t sigfigs; /* accuracy of timestamps */
19 uint32_t snaplen; /* max length of captured packets, in octets */
20 uint32_t network; /* data link type */
21 };
22
23 struct pcaprec_hdr {
24 uint32_t ts_sec; /* timestamp seconds */
25 uint32_t ts_usec; /* timestamp microseconds */
26 uint32_t incl_len; /* number of octets of packet saved in file */
27 uint32_t orig_len; /* actual length of packet */
28 };
29
30 #endif /* QEMU_PCAP_H */