-
Notifications
You must be signed in to change notification settings - Fork 3
/
vectors.h
168 lines (140 loc) · 4.36 KB
/
vectors.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/* this is the template radiotap header we send packets out with */
static const u8 u8aRadiotapHeader[] = {
0x00, 0x00, // <-- radiotap version
0x19, 0x00, // <- radiotap header length
0x6f, 0x08, 0x00, 0x00, // <-- bitmap
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // <-- timestamp
0x00, // <-- flags (Offset +0x10)
0x02, // <-- rate (0ffset +0x11)
0x85, 0x09, 0xc0, 0x00, // <-- channel 6
0xde, // <-- antsignal
0x00, // <-- antnoise
0x01, // <-- antenna
};
#define OFFSET_FLAGS 0x10
#define OFFSET_RATE 0x11
/* Penumbra IEEE80211 header */
static const u8 u8aIeeeHeader[] = {
0x08, 0x01, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x13, 0x22, 0x33, 0x44, 0x55, 0x66,
0x13, 0x22, 0x33, 0x44, 0x55, 0x66,
0x10, 0x86,
};
typedef struct _VECTOR {
int size;
u8 * data;
} tvector;
static const u8 Vec_Data[] = {
// Radiotap first 25 bytes
0x00, 0x00, // <-- radiotap version
0x19, 0x00, // <- radiotap header length
0x6f, 0x08, 0x00, 0x00, // <-- bitmap
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // <-- timestamp
0x00, // <-- flags (Offset +0x10)
0x6c, // <-- rate (0ffset +0x11)
0x85, 0x09, 0xc0, 0x00, // <-- channel 6
0xde, // <-- antsignal
0x00, // <-- antnoise
0x01, // <-- antenna
// IEEE80211 header 24 bytes
0x08, 0x01, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x13, 0x22, 0x33, 0x44, 0x55, 0x66,
0x13, 0x22, 0x33, 0x44, 0x55, 0x66,
0x10, 0x86,
// Data
'V', 'e', 't', 'o', 'r', 's','p','a','m','m','e','r',
}; // 61 bytes
static const u8 Vec_Null[] = {
// Radiotap first 25 bytes
0x00, 0x00, // <-- radiotap version
0x19, 0x00, // <- radiotap header length
0x6f, 0x08, 0x00, 0x00, // <-- bitmap
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // <-- timestamp
0x00, // <-- flags (Offset +0x10)
0x6c, // <-- rate (0ffset +0x11)
0x85, 0x09, 0xc0, 0x00, // <-- channel 6
0xde, // <-- antsignal
0x00, // <-- antnoise
0x01, // <-- antenna
// IEEE80211 header 24 bytes
0x48, 0x0b, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x13, 0x22, 0x33, 0x44, 0x55, 0x66,
0x13, 0x22, 0x33, 0x44, 0x55, 0x66,
0x10, 0x86,
// Data
0x13, 0x22, 0x33, 0x44, 0x55, 0x66,
}; // 55 bytes
static const u8 Vec_Beacon[] = {
// Radiotap first 25 bytes
0x00, 0x00, // <-- radiotap version
0x19, 0x00, // <- radiotap header length
0x6f, 0x08, 0x00, 0x00, // <-- bitmap
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // <-- timestamp
0x00, // <-- flags (Offset +0x10)
0x6c, // <-- rate (0ffset +0x11)
0x85, 0x09, 0xc0, 0x00, // <-- channel 6
0xde, // <-- antsignal
0x00, // <-- antnoise
0x01, // <-- antenna
// IEEE80211 header 24 bytes
0x80, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x13, 0x22, 0x33, 0x44, 0x55, 0x66,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x86,
// Data
'V', 'e', 't', 'o', 'r', 's','p','a','m','m','e','r',
};
static const u8 Vec_ProbeResp[] = {
// Radiotap first 25 bytes
0x00, 0x00, // <-- radiotap version
0x19, 0x00, // <- radiotap header length
0x6f, 0x08, 0x00, 0x00, // <-- bitmap
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // <-- timestamp
0x00, // <-- flags (Offset +0x10)
0x6c, // <-- rate (0ffset +0x11)
0x85, 0x09, 0xc0, 0x00, // <-- channel 6
0xde, // <-- antsignal
0x00, // <-- antnoise
0x01, // <-- antenna
// IEEE80211 header 24 bytes
0x50, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x13, 0x22, 0x33, 0x44, 0x55, 0x66,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x86,
// Data
'V', 'e', 't', 'o', 'r', 's','p','a','m','m','e','r',
};
static const u8 Vec_ProbeReq[] = {
// Radiotap first 25 bytes
0x00, 0x00, // <-- radiotap version
0x19, 0x00, // <- radiotap header length
0x6f, 0x08, 0x00, 0x00, // <-- bitmap
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // <-- timestamp
0x00, // <-- flags (Offset +0x10)
0x6c, // <-- rate (0ffset +0x11)
0x85, 0x09, 0xc0, 0x00, // <-- channel 6
0xde, // <-- antsignal
0x00, // <-- antnoise
0x01, // <-- antenna
// IEEE80211 header 24 bytes
0x40, 0x08, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x13, 0x22, 0x33, 0x44, 0x55, 0x66,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x86,
// Data
'V', 'e', 't', 'o', 'r', 's','p','a','m','m','e','r',
};
static const tvector Vectors[] = {
{sizeof(Vec_Data), (u8 *)Vec_Data},
{sizeof(Vec_Null), (u8 *)Vec_Null},
{sizeof(Vec_Beacon), (u8 *)Vec_Beacon},
{sizeof(Vec_ProbeResp), (u8 *)Vec_ProbeResp},
{sizeof(Vec_ProbeReq), (u8 *)Vec_ProbeReq},
};
#define NUM_VECTORS 5