-
Notifications
You must be signed in to change notification settings - Fork 26
/
pcap.h
executable file
·49 lines (40 loc) · 1.01 KB
/
pcap.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef _COMMON_H
#define _COMMON_H
#define FORMAT_CAP 1
#define FORMAT_IVS 2
#define TCPDUMP_MAGIC 0xA1B2C3D4
#define TCPDUMP_CIGAM 0xD4C3B2A1
#define IVSONLY_MAGIC "\xBF\xCA\x84\xD4"
#define PCAP_VERSION_MAJOR 2
#define PCAP_VERSION_MINOR 4
#define LINKTYPE_ETHERNET 1
#define LINKTYPE_IEEE802_11 105
#define LINKTYPE_PRISM_HEADER 119
#define LINKTYPE_RADIOTAP_HDR 127
#define uchar unsigned char
#define ushort unsigned short
#define uint unsigned int
#define ulong unsigned long
#define SWAP32(x) \
x = ( ( ( x >> 24 ) & 0x000000FF ) | \
( ( x >> 8 ) & 0x0000FF00 ) | \
( ( x << 8 ) & 0x00FF0000 ) | \
( ( x << 24 ) & 0xFF000000 ) );
struct pcap_file_header
{
uint magic;
ushort version_major;
ushort version_minor;
int thiszone;
uint sigfigs;
uint snaplen;
uint linktype;
};
struct pcap_pkthdr
{
int tv_sec;
int tv_usec;
uint caplen;
uint len;
};
#endif /* common.h */