-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpktf.h
112 lines (98 loc) · 2.36 KB
/
pktf.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#ifndef PKTF_H
#define PKTF_H
#include <QObject>
typedef struct {
quint8 dst[6];
quint8 src[6];
quint16 type;
} *etherhdr;
typedef struct {
quint32 family;
} *nullhdr;
typedef struct {
quint8 version_hdrlen;
quint8 sertype;
quint16 pktlen;
quint16 iden;
quint16 offset;
quint8 ttl;
quint8 protocol;
quint16 checksum;
quint8 src[4];
quint8 dst[4];
quint32 *opts;
} *ipv4hdr;
typedef struct {
quint32 ver_ds_fl;
quint16 payloadlen;
quint8 nexthdr;
quint8 hoplimit;
quint8 src[16];
quint8 dst[16];
} *ipv6hdr;
typedef struct {
quint16 type;
quint16 protocol;
quint8 haddrlen;
quint8 paddrlen;
quint16 opcode;
quint8 srchaddr[6];
quint8 srcpaddr[4];
quint8 dsthaddr[6];
quint8 dstpaddr[4];
} *arp;
typedef struct {
quint8 type;
quint8 code;
quint16 checksum;
quint16 iden;
quint16 seq;
} *icmp;
typedef struct {
quint8 type;
quint8 maxresptime;
quint16 checksum;
quint8 groupaddr[4];
} *igmp; // igmpv2
typedef struct {
quint8 type;
quint8 maxresptime;
quint16 checksum;
quint8 groupaddr[4];
quint8 rsq; // reserved + s + qrv
quint8 qqic;
quint16 nos;
quint32 *srcaddr;
} *igmpv3; // igmpv3
typedef struct {
quint16 src;
quint16 dst;
quint32 seqN;
quint32 ackN;
quint8 hdrlen; // hdrlen + flags
quint8 flags; // continued flags
quint16 winsize;
quint16 checksum;
quint16 urgptr;
quint32 *options;
} *tcphdr;
typedef struct {
quint16 src;
quint16 dst;
quint16 payloadlen;
quint16 checksum;
} *udphdr;
typedef struct {
quint16 iden;
quint16 flags;
quint16 question;
quint16 anwser;
quint16 authority;
quint16 additional;
quint16 type;
quint16 clas;
} *dns;
typedef struct {
quint32 family;
} *nullpkthdr;
#endif // PKTF_H