SolarCapture C Bindings
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
sc_pcap.h
1 
2 #ifndef __SC_PCAP_H__
3 #define __SC_PCAP_H__
4 
5 
6 #define PCAP_MAGIC 0xa1b2c3d4
7 #define PCAP_MAGIC_BSWAP 0xd4c3b2a1
8 /* For details of libpcap support for nanosecond format, visit:
9  * http://anonsvn.wireshark.org/viewvc/trunk/wiretap/libpcap.h?revision=37543
10  */
11 #define PCAP_NSEC_MAGIC 0xa1b23c4d
12 #define PCAP_NSEC_MAGIC_BSWAP 0x4d3cb2a1
13 
14 
15 struct pcap_file_hdr {
16  uint32_t magic_number; /* magic number */
17  uint16_t version_major; /* major version number */
18  uint16_t version_minor; /* minor version number */
19  int32_t thiszone; /* GMT to local correction */
20  uint32_t sigfigs; /* accuracy of timestamps */
21  uint32_t snap; /* max length of captured packets, in octets */
22  uint32_t network; /* data link type */
23 };
24 
25 
26 struct pcap_rec_hdr {
27  uint32_t ts_sec; /* timestamp seconds */
28  uint32_t ts_subsec; /* timestamp in ms or ns */
29  uint32_t incl_len; /* number of octets of packet saved in file */
30  uint32_t orig_len; /* actual length of packet */
31 };
32 
33 
34 enum ts_type {
35  ts_micro = 1,
36  ts_nano = 2,
37 };
38 
39 #endif /* __SC_PCAP_H__ */
40