1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#if !defined(_ISL_OID_H)
21#define _ISL_OID_H
22
23
24
25
26
27
28struct obj_ssid {
29 u8 length;
30 char octets[33];
31} __packed;
32
33struct obj_key {
34 u8 type;
35 u8 length;
36 char key[32];
37} __packed;
38
39struct obj_mlme {
40 u8 address[6];
41 u16 id;
42 u16 state;
43 u16 code;
44} __packed;
45
46struct obj_mlmeex {
47 u8 address[6];
48 u16 id;
49 u16 state;
50 u16 code;
51 u16 size;
52 u8 data[0];
53} __packed;
54
55struct obj_buffer {
56 u32 size;
57 u32 addr;
58} __packed;
59
60struct obj_bss {
61 u8 address[6];
62 int:16;
63
64 char state;
65 char reserved;
66 short age;
67
68 char quality;
69 char rssi;
70
71 struct obj_ssid ssid;
72 short channel;
73 char beacon_period;
74 char dtim_period;
75 short capinfo;
76 short rates;
77 short basic_rates;
78 int:16;
79} __packed;
80
81struct obj_bsslist {
82 u32 nr;
83 struct obj_bss bsslist[0];
84} __packed;
85
86struct obj_frequencies {
87 u16 nr;
88 u16 mhz[0];
89} __packed;
90
91struct obj_attachment {
92 char type;
93 char reserved;
94 short id;
95 short size;
96 char data[0];
97} __packed;
98
99
100
101
102
103static inline void
104__bug_on_wrong_struct_sizes(void)
105{
106 BUILD_BUG_ON(sizeof (struct obj_ssid) != 34);
107 BUILD_BUG_ON(sizeof (struct obj_key) != 34);
108 BUILD_BUG_ON(sizeof (struct obj_mlme) != 12);
109 BUILD_BUG_ON(sizeof (struct obj_mlmeex) != 14);
110 BUILD_BUG_ON(sizeof (struct obj_buffer) != 8);
111 BUILD_BUG_ON(sizeof (struct obj_bss) != 60);
112 BUILD_BUG_ON(sizeof (struct obj_bsslist) != 4);
113 BUILD_BUG_ON(sizeof (struct obj_frequencies) != 2);
114}
115
116enum dot11_state_t {
117 DOT11_STATE_NONE = 0,
118 DOT11_STATE_AUTHING = 1,
119 DOT11_STATE_AUTH = 2,
120 DOT11_STATE_ASSOCING = 3,
121
122 DOT11_STATE_ASSOC = 5,
123 DOT11_STATE_IBSS = 6,
124 DOT11_STATE_WDS = 7
125};
126
127enum dot11_bsstype_t {
128 DOT11_BSSTYPE_NONE = 0,
129 DOT11_BSSTYPE_INFRA = 1,
130 DOT11_BSSTYPE_IBSS = 2,
131 DOT11_BSSTYPE_ANY = 3
132};
133
134enum dot11_auth_t {
135 DOT11_AUTH_NONE = 0,
136 DOT11_AUTH_OS = 1,
137 DOT11_AUTH_SK = 2,
138 DOT11_AUTH_BOTH = 3
139};
140
141enum dot11_mlme_t {
142 DOT11_MLME_AUTO = 0,
143 DOT11_MLME_INTERMEDIATE = 1,
144 DOT11_MLME_EXTENDED = 2
145};
146
147enum dot11_priv_t {
148 DOT11_PRIV_WEP = 0,
149 DOT11_PRIV_TKIP = 1
150};
151
152
153
154
155
156
157
158
159
160enum dot11_maxframeburst_t {
161
162 DOT11_MAXFRAMEBURST_OFF = 0,
163 DOT11_MAXFRAMEBURST_MIXED_SAFE = 650,
164 DOT11_MAXFRAMEBURST_IDEAL = 1300,
165 DOT11_MAXFRAMEBURST_MAX = 5000,
166
167
168
169
170
171};
172
173
174
175
176
177
178
179
180enum dot11_preamblesettings_t {
181 DOT11_PREAMBLESETTING_LONG = 0,
182
183 DOT11_PREAMBLESETTING_SHORT = 1,
184
185 DOT11_PREAMBLESETTING_DYNAMIC = 2
186
187};
188
189
190
191
192
193enum dot11_slotsettings_t {
194 DOT11_SLOTSETTINGS_LONG = 0,
195
196 DOT11_SLOTSETTINGS_SHORT = 1,
197
198 DOT11_SLOTSETTINGS_DYNAMIC = 2
199
200};
201
202
203
204
205
206
207
208
209
210
211
212
213enum do11_nonerpstatus_t {
214 DOT11_ERPSTAT_NONEPRESENT = 0,
215 DOT11_ERPSTAT_USEPROTECTION = 1
216};
217
218
219
220
221
222
223enum dot11_nonerpprotection_t {
224 DOT11_NONERP_NEVER = 0,
225 DOT11_NONERP_ALWAYS = 1,
226 DOT11_NONERP_DYNAMIC = 2
227};
228
229
230
231
232enum dot11_profile_t {
233
234 DOT11_PROFILE_B_ONLY = 0,
235
236
237
238
239
240
241 DOT11_PROFILE_MIXED_G_WIFI = 1,
242
243
244
245
246
247
248 DOT11_PROFILE_MIXED_LONG = 2,
249
250 DOT11_PROFILE_G_ONLY = 3,
251
252 DOT11_PROFILE_TEST = 4,
253
254
255
256
257
258 DOT11_PROFILE_B_WIFI = 5,
259
260 DOT11_PROFILE_A_ONLY = 6,
261
262
263
264 DOT11_PROFILE_MIXED_SHORT = 7
265
266};
267
268
269
270
271enum oid_inl_conformance_t {
272 OID_INL_CONFORMANCE_NONE = 0,
273 OID_INL_CONFORMANCE_STRICT = 1,
274 OID_INL_CONFORMANCE_FLEXIBLE = 2,
275
276
277};
278
279enum oid_inl_mode_t {
280 INL_MODE_NONE = -1,
281 INL_MODE_PROMISCUOUS = 0,
282 INL_MODE_CLIENT = 1,
283 INL_MODE_AP = 2,
284 INL_MODE_SNIFFER = 3
285};
286
287enum oid_inl_config_t {
288 INL_CONFIG_NOTHING = 0x00,
289 INL_CONFIG_MANUALRUN = 0x01,
290 INL_CONFIG_FRAMETRAP = 0x02,
291 INL_CONFIG_RXANNEX = 0x04,
292 INL_CONFIG_TXANNEX = 0x08,
293 INL_CONFIG_WDS = 0x10
294};
295
296enum oid_inl_phycap_t {
297 INL_PHYCAP_2400MHZ = 1,
298 INL_PHYCAP_5000MHZ = 2,
299 INL_PHYCAP_FAA = 0x80000000,
300};
301
302
303enum oid_num_t {
304 GEN_OID_MACADDRESS = 0,
305 GEN_OID_LINKSTATE,
306 GEN_OID_WATCHDOG,
307 GEN_OID_MIBOP,
308 GEN_OID_OPTIONS,
309 GEN_OID_LEDCONFIG,
310
311
312 DOT11_OID_BSSTYPE,
313 DOT11_OID_BSSID,
314 DOT11_OID_SSID,
315 DOT11_OID_STATE,
316 DOT11_OID_AID,
317 DOT11_OID_COUNTRYSTRING,
318 DOT11_OID_SSIDOVERRIDE,
319
320 DOT11_OID_MEDIUMLIMIT,
321 DOT11_OID_BEACONPERIOD,
322 DOT11_OID_DTIMPERIOD,
323 DOT11_OID_ATIMWINDOW,
324 DOT11_OID_LISTENINTERVAL,
325 DOT11_OID_CFPPERIOD,
326 DOT11_OID_CFPDURATION,
327
328 DOT11_OID_AUTHENABLE,
329 DOT11_OID_PRIVACYINVOKED,
330 DOT11_OID_EXUNENCRYPTED,
331 DOT11_OID_DEFKEYID,
332 DOT11_OID_DEFKEYX,
333 DOT11_OID_STAKEY,
334 DOT11_OID_REKEYTHRESHOLD,
335 DOT11_OID_STASC,
336
337 DOT11_OID_PRIVTXREJECTED,
338 DOT11_OID_PRIVRXPLAIN,
339 DOT11_OID_PRIVRXFAILED,
340 DOT11_OID_PRIVRXNOKEY,
341
342 DOT11_OID_RTSTHRESH,
343 DOT11_OID_FRAGTHRESH,
344 DOT11_OID_SHORTRETRIES,
345 DOT11_OID_LONGRETRIES,
346 DOT11_OID_MAXTXLIFETIME,
347 DOT11_OID_MAXRXLIFETIME,
348 DOT11_OID_AUTHRESPTIMEOUT,
349 DOT11_OID_ASSOCRESPTIMEOUT,
350
351 DOT11_OID_ALOFT_TABLE,
352 DOT11_OID_ALOFT_CTRL_TABLE,
353 DOT11_OID_ALOFT_RETREAT,
354 DOT11_OID_ALOFT_PROGRESS,
355 DOT11_OID_ALOFT_FIXEDRATE,
356 DOT11_OID_ALOFT_RSSIGRAPH,
357 DOT11_OID_ALOFT_CONFIG,
358
359 DOT11_OID_VDCFX,
360 DOT11_OID_MAXFRAMEBURST,
361
362 DOT11_OID_PSM,
363 DOT11_OID_CAMTIMEOUT,
364 DOT11_OID_RECEIVEDTIMS,
365 DOT11_OID_ROAMPREFERENCE,
366
367 DOT11_OID_BRIDGELOCAL,
368 DOT11_OID_CLIENTS,
369 DOT11_OID_CLIENTSASSOCIATED,
370 DOT11_OID_CLIENTX,
371
372 DOT11_OID_CLIENTFIND,
373 DOT11_OID_WDSLINKADD,
374 DOT11_OID_WDSLINKREMOVE,
375 DOT11_OID_EAPAUTHSTA,
376 DOT11_OID_EAPUNAUTHSTA,
377 DOT11_OID_DOT1XENABLE,
378 DOT11_OID_MICFAILURE,
379 DOT11_OID_REKEYINDICATE,
380
381 DOT11_OID_MPDUTXSUCCESSFUL,
382 DOT11_OID_MPDUTXONERETRY,
383 DOT11_OID_MPDUTXMULTIPLERETRIES,
384 DOT11_OID_MPDUTXFAILED,
385 DOT11_OID_MPDURXSUCCESSFUL,
386 DOT11_OID_MPDURXDUPS,
387 DOT11_OID_RTSSUCCESSFUL,
388 DOT11_OID_RTSFAILED,
389 DOT11_OID_ACKFAILED,
390 DOT11_OID_FRAMERECEIVES,
391 DOT11_OID_FRAMEERRORS,
392 DOT11_OID_FRAMEABORTS,
393 DOT11_OID_FRAMEABORTSPHY,
394
395 DOT11_OID_SLOTTIME,
396 DOT11_OID_CWMIN,
397 DOT11_OID_CWMAX,
398 DOT11_OID_ACKWINDOW,
399 DOT11_OID_ANTENNARX,
400 DOT11_OID_ANTENNATX,
401 DOT11_OID_ANTENNADIVERSITY,
402 DOT11_OID_CHANNEL,
403 DOT11_OID_EDTHRESHOLD,
404 DOT11_OID_PREAMBLESETTINGS,
405 DOT11_OID_RATES,
406 DOT11_OID_CCAMODESUPPORTED,
407 DOT11_OID_CCAMODE,
408 DOT11_OID_RSSIVECTOR,
409 DOT11_OID_OUTPUTPOWERTABLE,
410 DOT11_OID_OUTPUTPOWER,
411 DOT11_OID_SUPPORTEDRATES,
412 DOT11_OID_FREQUENCY,
413 DOT11_OID_SUPPORTEDFREQUENCIES,
414 DOT11_OID_NOISEFLOOR,
415 DOT11_OID_FREQUENCYACTIVITY,
416 DOT11_OID_IQCALIBRATIONTABLE,
417 DOT11_OID_NONERPPROTECTION,
418 DOT11_OID_SLOTSETTINGS,
419 DOT11_OID_NONERPTIMEOUT,
420 DOT11_OID_PROFILES,
421 DOT11_OID_EXTENDEDRATES,
422
423 DOT11_OID_DEAUTHENTICATE,
424 DOT11_OID_AUTHENTICATE,
425 DOT11_OID_DISASSOCIATE,
426 DOT11_OID_ASSOCIATE,
427 DOT11_OID_SCAN,
428 DOT11_OID_BEACON,
429 DOT11_OID_PROBE,
430 DOT11_OID_DEAUTHENTICATEEX,
431 DOT11_OID_AUTHENTICATEEX,
432 DOT11_OID_DISASSOCIATEEX,
433 DOT11_OID_ASSOCIATEEX,
434 DOT11_OID_REASSOCIATE,
435 DOT11_OID_REASSOCIATEEX,
436
437 DOT11_OID_NONERPSTATUS,
438
439 DOT11_OID_STATIMEOUT,
440 DOT11_OID_MLMEAUTOLEVEL,
441 DOT11_OID_BSSTIMEOUT,
442 DOT11_OID_ATTACHMENT,
443 DOT11_OID_PSMBUFFER,
444
445 DOT11_OID_BSSS,
446 DOT11_OID_BSSX,
447 DOT11_OID_BSSFIND,
448 DOT11_OID_BSSLIST,
449
450 OID_INL_TUNNEL,
451 OID_INL_MEMADDR,
452 OID_INL_MEMORY,
453 OID_INL_MODE,
454 OID_INL_COMPONENT_NR,
455 OID_INL_VERSION,
456 OID_INL_INTERFACE_ID,
457 OID_INL_COMPONENT_ID,
458 OID_INL_CONFIG,
459 OID_INL_DOT11D_CONFORMANCE,
460 OID_INL_PHYCAPABILITIES,
461 OID_INL_OUTPUTPOWER,
462
463 OID_NUM_LAST
464};
465
466#define OID_FLAG_CACHED 0x80
467#define OID_FLAG_TYPE 0x7f
468
469#define OID_TYPE_U32 0x01
470#define OID_TYPE_SSID 0x02
471#define OID_TYPE_KEY 0x03
472#define OID_TYPE_BUFFER 0x04
473#define OID_TYPE_BSS 0x05
474#define OID_TYPE_BSSLIST 0x06
475#define OID_TYPE_FREQUENCIES 0x07
476#define OID_TYPE_MLME 0x08
477#define OID_TYPE_MLMEEX 0x09
478#define OID_TYPE_ADDR 0x0A
479#define OID_TYPE_RAW 0x0B
480#define OID_TYPE_ATTACH 0x0C
481
482
483
484
485
486struct oid_t {
487 enum oid_num_t oid;
488 short range;
489 short size;
490 char flags;
491};
492
493union oid_res_t {
494 void *ptr;
495 u32 u;
496};
497
498#define IWMAX_BITRATES 20
499#define IWMAX_BSS 24
500#define IWMAX_FREQ 30
501#define PRIV_STR_SIZE 1024
502
503#endif
504
505