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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
|
/*
* Header file defines the interface with AUTH daemon (802.1x authenticator)
*
* $Id: 8192cd_security.h,v 1.3.2.1 2010/12/01 13:38:00 button Exp $
*
* Copyright (c) 2009 Realtek Semiconductor Corp.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef _8192CD_SECURITY_H_
#define _8192CD_SECURITY_H_
#include "./8192cd_cfg.h"
#ifdef INCLUDE_WPS
#include "./wps/wsc.h"
#endif
typedef struct _DOT11_QUEUE_NODE
{
unsigned short ItemSize;
unsigned char Item[MAXDATALEN];
}DOT11_QUEUE_NODE;
typedef struct _DOT11_QUEUE
{
int Head;
int Tail;
int NumItem;
int MaxItem;
DOT11_QUEUE_NODE ItemArray[MAXQUEUESIZE];
}DOT11_QUEUE;
typedef unsigned char DOT11_KEY_RSC[8];
typedef enum{
DOT11_KeyType_Group = 0,
DOT11_KeyType_Pairwise = 1
} DOT11_KEY_TYPE;
typedef enum{
DOT11_EAPOL_GROUP_INDEX = 0,
DOT11_EAPOL_PAIRWISE_INDEX = 3
} DOT11_EAPOL_KEY_INDEX;
typedef enum{
DOT11_KeyUsage_ENC,
DOT11_KeyUsage_MIC
} DOT11_KEY_USAGE;
typedef enum{
DOT11_Role_Auth,
DOT11_Role_Supp
} DOT11_ROLE;
typedef enum{
DOT11_VARIABLE_MACEnable,
DOT11_VARIABLE_SystemAuthControl,
DOT11_VARIABLE_AuthControlledPortStatus,
DOT11_VARIABLE_AuthControlledPortControl,
DOT11_VARIABLE_AuthenticationType,
DOT11_VARIABLE_KeyManagement,
DOT11_VARIABLE_MulticastCipher,
DOT11_VARIABLE_UnicastCipher
} DOT11_VARIABLE_TYPE;
typedef enum{
DOT11_SysAuthControl_Disabled,
DOT11_SysAuthControl_Enabled
} DOT11_SYSTEM_AUTHENTICATION_CONTROL;
typedef enum{
DOT11_PortControl_ForceUnauthorized,
DOT11_PortControl_ForceAuthorized,
DOT11_PortControl_Auto
} DOT11_PORT_CONTROL;
typedef enum{
DOT11_PortStatus_Unauthorized,
DOT11_PortStatus_Authorized,
DOT11_PortStatus_Guest
}DOT11_PORT_STATUS;
typedef enum{
DOT11_Association_Fail,
DOT11_Association_Success
}DOT11_ASSOCIATION_RESULT;
typedef enum{
DOT11_AuthKeyType_RSN = 1,
DOT11_AuthKeyType_PSK = 2,
DOT11_AuthKeyType_NonRSN802dot1x = 3
} DOT11_AUTHKEY_TYPE;
typedef enum{
DOT11_AuthKeyType_RSN_MAP = 1,
DOT11_AuthKeyType_PSK_MAP = 2,
DOT11_AuthKeyType_NonRSN802dot1x_MAP = 4
} DOT11_AUTHKEY_TYPE_MAP;
typedef enum{
DOT11_Ioctl_Query = 0,
DOT11_Ioctl_Set = 1
} DOT11_Ioctl_Flag;
typedef enum{
DOT11_ENC_NONE = 0,
DOT11_ENC_WEP40 = 1,
DOT11_ENC_TKIP = 2,
DOT11_ENC_WRAP = 3,
DOT11_ENC_CCMP = 4,
DOT11_ENC_WEP104= 5,
DOT11_ENC_WAPI= 6
} DOT11_ENC_ALGO;
typedef enum{
DOT11_ENC_NONE_MAP = 1,
DOT11_ENC_WEP40_MAP = 2,
DOT11_ENC_TKIP_MAP = 4,
DOT11_ENC_WRAP_MAP = 8,
DOT11_ENC_CCMP_MAP = 16,
DOT11_ENC_WEP104_MAP= 32
} DOT11_ENC_ALGO_MAP;
typedef enum{
DOT11_EVENT_NO_EVENT = 1,
DOT11_EVENT_REQUEST = 2,
DOT11_EVENT_ASSOCIATION_IND = 3,
DOT11_EVENT_ASSOCIATION_RSP = 4,
DOT11_EVENT_AUTHENTICATION_IND = 5,
DOT11_EVENT_REAUTHENTICATION_IND = 6,
DOT11_EVENT_DEAUTHENTICATION_IND = 7,
DOT11_EVENT_DISASSOCIATION_IND = 8,
DOT11_EVENT_DISCONNECT_REQ = 9,
DOT11_EVENT_SET_802DOT11 = 10,
DOT11_EVENT_SET_KEY = 11,
DOT11_EVENT_SET_PORT = 12,
DOT11_EVENT_DELETE_KEY = 13,
DOT11_EVENT_SET_RSNIE = 14,
DOT11_EVENT_GKEY_TSC = 15,
DOT11_EVENT_MIC_FAILURE = 16,
DOT11_EVENT_ASSOCIATION_INFO = 17,
DOT11_EVENT_INIT_QUEUE = 18,
DOT11_EVENT_EAPOLSTART = 19,
DOT11_EVENT_ACC_SET_EXPIREDTIME = 31,
DOT11_EVENT_ACC_QUERY_STATS = 32,
DOT11_EVENT_ACC_QUERY_STATS_ALL = 33,
DOT11_EVENT_REASSOCIATION_IND = 34,
DOT11_EVENT_REASSOCIATION_RSP = 35,
DOT11_EVENT_STA_QUERY_BSSID = 36,
DOT11_EVENT_STA_QUERY_SSID = 37,
DOT11_EVENT_EAP_PACKET = 41,
#ifdef RTL_WPA2_PREAUTH
DOT11_EVENT_EAPOLSTART_PREAUTH = 45,
DOT11_EVENT_EAP_PACKET_PREAUTH = 46,
#endif
DOT11_EVENT_WPA2_MULTICAST_CIPHER = 47,
DOT11_EVENT_WPA_MULTICAST_CIPHER = 48,
#ifdef WIFI_SIMPLE_CONFIG
DOT11_EVENT_WSC_SET_IE = 55,
DOT11_EVENT_WSC_PROBE_REQ_IND = 56,
DOT11_EVENT_WSC_PIN_IND = 57,
DOT11_EVENT_WSC_ASSOC_REQ_IE_IND = 58,
#ifdef INCLUDE_WPS
DOT11_EVENT_WSC_SET_MIB=42,
DOT11_EVENT_WSC_GET_MIB=43,
DOT11_EVENT_REQUEST_F_INCLUDE_WPS=44,
DOT11_EVENT_WSC_INIT_IND = 70,
DOT11_EVENT_WSC_EXIT_IND = 71,
DOT11_EVENT_WSC_TERM_IND = 72,
DOT11_EVENT_WSC_GETCONF_IND = 73,
DOT11_EVENT_WSC_PUTCONF_IND = 74,
DOT11_EVENT_WSC_LEDCONTROL_IND = 75,
DOT11_EVENT_WSC_SENDMSG_IND = 76,
DOT11_EVENT_WSC_PUTCONF = 77,
DOT11_EVENT_WSC_SOAP = 78,
DOT11_EVENT_WSC_PIN = 79,
DOT11_EVENT_WSC_PBC = 80,
DOT11_EVENT_WSC_SYS = 81,
DOT11_EVENT_WSC_PUTWLANREQUEST_IND = 82,
DOT11_EVENT_WSC_PUTPKT = 83,
DOT11_EVENT_WSC_GETDEVINFO = 84,
DOT11_EVENT_WSC_M2M4M6M8 = 85,
DOT11_EVENT_WSC_PUTWLANRESPONSE = 86,
DOT11_EVENT_WSC_PUTMESSAGE = 87,
DOT11_EVENT_WSC_PUTWLREQ_PROBEIND = 88,
DOT11_EVENT_WSC_PUTWLREQ_STATUSIND = 89,
#endif
#ifdef CONFIG_RTL_COMAPI_CFGFILE
DOT11_EVENT_WSC_START_IND = 90,
//EV_MODE, EV_STATUS, EV_MEHOD, EV_STEP, EV_OOB
DOT11_EVENT_WSC_MODE_IND = 91,
DOT11_EVENT_WSC_STATUS_IND = 92,
DOT11_EVENT_WSC_METHOD_IND = 93,
DOT11_EVENT_WSC_STEP_IND = 94,
DOT11_EVENT_WSC_OOB_IND = 95,
#endif
#ifdef P2P_SUPPORT
DOT11_EVENT_WSC_SWITCH_MODE = 100,
DOT11_EVENT_WSC_STOP = 101,
#endif
/* support Assigned MAC Addr,Assigned SSID,dymanic change STA's PIN code, 2011-0505 */
DOT11_EVENT_WSC_SET_MY_PIN = 102,
DOT11_EVENT_WSC_SPEC_SSID = 103,
DOT11_EVENT_WSC_SPEC_MAC_IND = 104,
/* support Assigned MAC Addr,Assigned SSID,dymanic change STA's PIN code, 2011-0505 */
#endif
#ifdef CONFIG_RTK_MESH
DOT11_EVENT_PATHSEL_GEN_RREQ = 59,
DOT11_EVENT_PATHSEL_GEN_RERR = 60,
DOT11_EVENT_PATHSEL_RECV_RREQ = 61,
DOT11_EVENT_PATHSEL_RECV_RREP = 62,
DOT11_EVENT_PATHSEL_RECV_RERR = 63,
DOT11_EVENT_PATHSEL_RECV_RREP_ACK = 64,
DOT11_EVENT_PATHSEL_RECV_PANN = 65,
DOT11_EVENT_PATHSEL_RECV_RANN = 66,
#endif // CONFIG_RTK_MESH
#ifdef CONFIG_RTL_WAPI_SUPPORT
DOT11_EVENT_WAPI_INIT_QUEUE =67,
DOT11_EVENT_WAPI_READ_QUEUE = 68,
DOT11_EVENT_WAPI_WRITE_QUEUE =69,
#endif
#if defined(CONFIG_RTL_COMAPI_CFGFILE) && defined(WIFI_SIMPLE_CONFIG)
#ifdef INCLUDE_WPS
DOT11_EVENT_WSC_START_IND = 90,
//EV_MODE, EV_STATUS, EV_MEHOD, EV_STEP, EV_OOB
DOT11_EVENT_WSC_MODE_IND = 91,
DOT11_EVENT_WSC_STATUS_IND = 92,
DOT11_EVENT_WSC_METHOD_IND = 93,
DOT11_EVENT_WSC_STEP_IND = 94,
DOT11_EVENT_WSC_OOB_IND = 95,
#else
DOT11_EVENT_WSC_START_IND = 70,
//EV_MODE, EV_STATUS, EV_MEHOD, EV_STEP, EV_OOB
DOT11_EVENT_WSC_MODE_IND = 71,
DOT11_EVENT_WSC_STATUS_IND = 72,
DOT11_EVENT_WSC_METHOD_IND = 73,
DOT11_EVENT_WSC_STEP_IND = 74,
DOT11_EVENT_WSC_OOB_IND = 75,
#endif
#endif
DOT11_EVENT_WSC_RM_PBC_STA=106
} DOT11_EVENT;
#ifdef WIFI_SIMPLE_CONFIG
enum {SET_IE_FLAG_BEACON=1, SET_IE_FLAG_PROBE_RSP=2, SET_IE_FLAG_PROBE_REQ=3,
SET_IE_FLAG_ASSOC_RSP=4, SET_IE_FLAG_ASSOC_REQ=5};
#endif
typedef struct _DOT11_GENERAL{
unsigned char EventId;
unsigned char IsMoreEvent;
unsigned char *Data;
}DOT11_GENERAL;
typedef struct _DOT11_NOEVENT{
unsigned char EventId;
unsigned char IsMoreEvent;
}DOT11_NO_EVENT;
typedef struct _DOT11_REQUEST{
unsigned char EventId;
}DOT11_REQUEST;
typedef struct _DOT11_WPA2_MULTICAST_CIPHER{
unsigned char EventId;
unsigned char IsMoreEvent;
unsigned char MulticastCipher;
}DOT11_WPA2_MULTICAST_CIPHER;
typedef struct _DOT11_WPA_MULTICAST_CIPHER{
unsigned char EventId;
unsigned char IsMoreEvent;
unsigned char MulticastCipher;
}DOT11_WPA_MULTICAST_CIPHER;
typedef struct _DOT11_ASSOCIATION_IND{
unsigned char EventId;
unsigned char IsMoreEvent;
char MACAddr[MACADDRLEN];
unsigned short RSNIELen;
char RSNIE[MAXRSNIELEN]; // include ID and Length by kenny
}DOT11_ASSOCIATION_IND;
typedef struct _DOT11_ASSOCIATION_RSP{
unsigned char EventId;
unsigned char IsMoreEvent;
char MACAddr[MACADDRLEN];
unsigned char Status;
}DOT11_ASSOCIATIIN_RSP;
typedef struct _DOT11_REASSOCIATION_IND{
unsigned char EventId;
unsigned char IsMoreEvent;
char MACAddr[MACADDRLEN];
unsigned short RSNIELen;
char RSNIE[MAXRSNIELEN];
char OldAPaddr[MACADDRLEN];
}DOT11_REASSOCIATION_IND;
typedef struct _DOT11_REASSOCIATION_RSP{
unsigned char EventId;
unsigned char IsMoreEvent;
char MACAddr[MACADDRLEN];
unsigned char Status;
char CurrAPaddr[MACADDRLEN];
}DOT11_REASSOCIATIIN_RSP;
typedef struct _DOT11_AUTHENTICATION_IND{
unsigned char EventId;
unsigned char IsMoreEvent;
char MACAddr[MACADDRLEN];
}DOT11_AUTHENTICATION_IND;
typedef struct _DOT11_REAUTHENTICATION_IND{
unsigned char EventId;
unsigned char IsMoreEvent;
char MACAddr[MACADDRLEN];
}DOT11_REAUTHENTICATION_IND;
#ifdef WIFI_SIMPLE_CONFIG
typedef struct _DOT11_PROBE_REQUEST_IND{
unsigned char EventId;
unsigned char IsMoreEvent;
char MACAddr[MACADDRLEN];
unsigned short ProbeIELen;
char ProbeIE[PROBEIELEN];
}DOT11_PROBE_REQUEST_IND;
typedef struct _DOT11_WSC_ASSOC_IND{
unsigned char EventId;
unsigned char IsMoreEvent;
char MACAddr[MACADDRLEN];
unsigned short AssocIELen;
char AssocIE[PROBEIELEN];
unsigned char wscIE_included;
}DOT11_WSC_ASSOC_IND;
typedef struct _DOT11_GETSET_MIB {
unsigned char EventId;
unsigned char IsMoreEvent;
unsigned char cmd[50];
}DOT11_GETSET_MIB;
#endif
typedef struct _DOT11_DEAUTHENTICATION_IND{
unsigned char EventId;
unsigned char IsMoreEvent;
char MACAddr[MACADDRLEN];
unsigned long tx_packets; // == transmited packets
unsigned long rx_packets; // == received packets
unsigned long tx_bytes; // == transmited bytes
unsigned long rx_bytes; // == received bytes
unsigned long Reason;
}DOT11_DEAUTHENTICATION_IND;
typedef struct _DOT11_DISASSOCIATION_IND{
unsigned char EventId;
unsigned char IsMoreEvent;
char MACAddr[MACADDRLEN];
unsigned long tx_packets; // == transmited packets
unsigned long rx_packets; // == received packets
unsigned long tx_bytes; // == transmited bytes
unsigned long rx_bytes; // == received bytes
unsigned long Reason;
}DOT11_DISASSOCIATION_IND;
typedef struct _DOT11_DISCONNECT_REQ{
unsigned char EventId;
unsigned char IsMoreEvent;
unsigned short Reason;
char MACAddr[MACADDRLEN];
}DOT11_DISCONNECT_REQ;
typedef struct _DOT11_SET_802DOT11{
unsigned char EventId;
unsigned char IsMoreEvent;
unsigned char VariableType;
unsigned char VariableValue;
char MACAddr[MACADDRLEN];
}DOT11_SET_802DOT11;
typedef struct _DOT11_SET_KEY{
unsigned char EventId;
unsigned char IsMoreEvent;
unsigned long KeyIndex;
unsigned long KeyLen;
unsigned char KeyType;
unsigned char EncType;
unsigned char MACAddr[MACADDRLEN];
DOT11_KEY_RSC KeyRSC;
unsigned char KeyMaterial[64];
}DOT11_SET_KEY;
typedef struct _DOT11_DELETE_KEY{
unsigned char EventId;
unsigned char IsMoreEvent;
char MACAddr[MACADDRLEN];
unsigned char KeyType;
}DOT11_DELETE_KEY;
typedef struct _DOT11_SET_RSNIE{
unsigned char EventId;
unsigned char IsMoreEvent;
unsigned short Flag;
unsigned short RSNIELen;
char RSNIE[MAXRSNIELEN];
char MACAddr[MACADDRLEN];
}DOT11_SET_RSNIE;
typedef struct _DOT11_SET_PORT{
unsigned char EventId;
unsigned char PortStatus;
unsigned char PortType;
unsigned char MACAddr[MACADDRLEN];
}DOT11_SET_PORT;
typedef struct _DOT11_GKEY_TSC{
unsigned char EventId;
unsigned char IsMoreEvent;
unsigned char KeyTSC[8];
}DOT11_GKEY_TSC;
typedef struct _DOT11_MIC_FAILURE{
unsigned char EventId;
unsigned char IsMoreEvent;
char MACAddr[MACADDRLEN];
}DOT11_MIC_FAILURE;
typedef struct _DOT11_STA_QUERY_BSSID{
unsigned char EventId;
unsigned char IsMoreEvent;
unsigned long IsValid;
char Bssid[MACADDRLEN];
}DOT11_STA_QUERY_BSSID;
typedef struct _DOT11_STA_QUERY_SSID{
unsigned char EventId;
unsigned char IsMoreEvent;
unsigned long IsValid;
char ssid[32];
int ssid_len;
}DOT11_STA_QUERY_SSID;
typedef struct _DOT11_EAPOL_START{
unsigned char EventId;
unsigned char IsMoreEvent;
char MACAddr[MACADDRLEN];
}DOT11_EAPOL_START;
typedef struct _DOT11_SET_EXPIREDTIME{
unsigned char EventId;
unsigned char IsMoreEvent;
unsigned char MACAddr[MACADDRLEN];
unsigned long ExpireTime;
}DOT11_SET_EXPIREDTIME;
typedef struct _DOT11_QUERY_STATS{
unsigned char EventId;
unsigned char IsMoreEvent;
unsigned char MACAddr[MACADDRLEN];
unsigned long IsSuccess;
unsigned long tx_packets; // == transmited packets
unsigned long rx_packets; // == received packets
unsigned long tx_bytes; // == transmited bytes
unsigned long rx_bytes; // == received bytes
}DOT11_QUERY_STATS;
typedef struct _DOT11_EAP_PACKET{
unsigned char EventId;
unsigned char IsMoreEvent;
unsigned short packet_len;
unsigned char packet[1550];
}DOT11_EAP_PACKET;
#ifdef INCLUDE_WPS
#ifndef CONFIG_MSC
typedef struct _DOT11_EVENT_PACKET{
unsigned char EventId;
unsigned char EventType;
unsigned short packet_len;
unsigned char packet[1550];
}DOT11_EVENT_PACKET;
#endif
#endif
typedef DOT11_ASSOCIATION_IND DOT11_AUTH_IND;
#ifdef WIFI_SIMPLE_CONFIG
typedef struct _DOT11_WSC_PIN_IND{
unsigned char EventId;
unsigned char IsMoreEvent;
unsigned char code[256];
} DOT11_WSC_PIN_IND;
#ifdef CONFIG_RTL_COMAPI_CFGFILE
typedef struct _DOT11_WSC_IND{
unsigned char EventId;
unsigned char IsMoreEvent;
unsigned int value;
} DOT11_WSC_IND;
#endif //CONFIG_RTL_COMAPI_CFGFILE
#endif
#define DOT11_AI_REQFI_CAPABILITIES 1
#define DOT11_AI_REQFI_LISTENINTERVAL 2
#define DOT11_AI_REQFI_CURRENTAPADDRESS 4
#define DOT11_AI_RESFI_CAPABILITIES 1
#define DOT11_AI_RESFI_STATUSCODE 2
#define DOT11_AI_RESFI_ASSOCIATIONID 4
typedef struct _DOT11_ASSOCIATION_INFO
{
unsigned char EventId;
unsigned char IsMoreEvent;
unsigned char SupplicantAddress[MACADDRLEN];
UINT32 Length;
UINT16 AvailableRequestFixedIEs;
struct _DOT11_AI_REQFI {
UINT16 Capabilities;
UINT16 ListenInterval;
char CurrentAPAddress[MACADDRLEN];
} RequestFixedIEs;
UINT32 RequestIELength;
UINT32 OffsetRequestIEs;
UINT16 AvailableResponseFixedIEs;
struct _DOT11_AI_RESFI {
UINT16 Capabilities;
UINT16 StatusCode;
UINT16 AssociationId;
} ResponseFixedIEs;
UINT32 ResponseIELength;
UINT32 OffsetResponseIEs;
} DOT11_ASSOCIATION_INFO, *PDOT11_ASSOCIATION_INFO;
typedef struct _DOT11_INIT_QUEUE
{
unsigned char EventId;
unsigned char IsMoreEvent;
} DOT11_INIT_QUEUE, *PDOT11_INIT_QUEUE;
//*------The following are defined to handle the event Queue for security event--------*/
// For Event Queue related function
void DOT11_InitQueue(DOT11_QUEUE *q);
#ifndef WITHOUT_ENQUEUE
int DOT11_EnQueue(unsigned long task_priv, DOT11_QUEUE *q, unsigned char *item, int itemsize);
int DOT11_DeQueue(unsigned long task_priv, DOT11_QUEUE *q, unsigned char *item, int *itemsize);
#endif
void DOT11_PrintQueue(DOT11_QUEUE *q);
char *DOT11_ErrMsgQueue(int err);
#define DOT11_IsEmptyQueue(q) (q->NumItem==0 ? 1:0)
#define DOT11_IsFullQueue(q) (q->NumItem==q->MaxItem? 1:0)
#define DOT11_NumItemQueue(q) q->NumItem
typedef enum{
ERROR_BUFFER_TOO_SMALL = -1,
ERROR_INVALID_PARA = -2,
ERROR_INVALID_RSNIE = -13,
ERROR_INVALID_MULTICASTCIPHER = -18,
ERROR_INVALID_UNICASTCIPHER = -19,
ERROR_INVALID_AUTHKEYMANAGE = -20,
ERROR_UNSUPPORTED_RSNEVERSION = -21,
ERROR_INVALID_CAPABILITIES = -22
} INFO_ERROR;
#define RSN_STRERROR_BUFFER_TOO_SMALL "Input Buffer too small"
#define RSN_STRERROR_INVALID_PARAMETER "Invalid RSNIE Parameter"
#define RSN_STRERROR_INVALID_RSNIE "Invalid RSNIE"
#define RSN_STRERROR_INVALID_MULTICASTCIPHER "Multicast Cipher is not valid"
#define RSN_STRERROR_INVALID_UNICASTCIPHER "Unicast Cipher is not valid"
#define RSN_STRERROR_INVALID_AUTHKEYMANAGE "Authentication Key Management Protocol is not valid"
#define RSN_STRERROR_UNSUPPORTED_RSNEVERSION "Unsupported RSNE version"
#define RSN_STRERROR_INVALID_CAPABILITIES "Invalid RSNE Capabilities"
#define DOT11_s2n(s,c) (*((c))=(unsigned char)(((s)>> 8)&0xff), \
*((c)+1)=(unsigned char)(((s) )&0xff))
#define DOT11_n2s(c,s) (s =((unsigned short)(*((c))))<< 8, \
s|=((unsigned short)(*((c)+1))))
#define DOT11_lc2s(bc,s) (s = ((unsigned short)(*((bc)+1)))<< 8, \
s |= ((unsigned short)(*((bc)))))
void DOT11_Dump(char *fun, UINT8 *buf, int size, char *comment);
typedef enum _COUNTERMEASURE_TEST
{
TEST_TYPE_PAIRWISE_ERROR = 0,
TEST_TYPE_GROUP_ERROR = 1,
TEST_TYPE_SEND_BAD_UNICAST_PACKET = 2,
TEST_TYPE_SEND_BAD_BROADCAST_PACKET = 3
} COUNTERMEASURE_TEST;
#define MIC_TIMER_PERIOD RTL_SECONDS_TO_JIFFIES(60) //unit: 10 milli-seconds
#define REJECT_ASSOC_PERIOD RTL_SECONDS_TO_JIFFIES(60)
//*---------- The followings are for processing of RSN Information Element------------*/
#define RSN_ELEMENT_ID 0xDD
#define RSN_VER1 0x01
#define DOT11_MAX_CIPHER_ALGORITHMS 0x0a
#define DOT11_GROUPFLAG 0x02
#define DOT11_REPLAYBITSSHIFT 2
#define DOT11_REPLAYBITS 3
#define IsPairwiseUsingDefaultKey(Cap) ((Cap[0] & DOT11_GROUPFLAG)?TRUE:FALSE)
#define IsPreAuthentication(Cap) ((Cap[0] & 0x01)?TRUE:FALSE)
#define DOT11_GetNumOfRxTSC(Cap) (2<<((Cap[0] >> DOT11_REPLAYBITSSHIFT) & DOT11_REPLAYBITS))
#if defined(PACK_STRUCTURE) || defined(__ECOS)
#pragma pack(1)
#endif
typedef struct _DOT11_RSN_IE_HEADER {
UINT8 ElementID;
UINT8 Length;
UINT8 OUI[4];
UINT16 Version;
}DOT11_RSN_IE_HEADER;
typedef struct _DOT11_RSN_IE_SUITE{
UINT8 OUI[3];
UINT8 Type;
}DOT11_RSN_IE_SUITE;
typedef struct _DOT11_RSN_IE_COUNT_SUITE{
UINT16 SuiteCount;
DOT11_RSN_IE_SUITE dot11RSNIESuite[DOT11_MAX_CIPHER_ALGORITHMS];
}DOT11_RSN_IE_COUNT_SUITE, *PDOT11_RSN_IE_COUNT_SUITE;
typedef union _DOT11_RSN_CAPABILITY{
UINT16 shortData;
UINT8 charData[2];
#ifdef RTL_WPA2
struct
{
unsigned short Reserved1:2; // B7 B6
unsigned short GtksaReplayCounter:2; // B5 B4
unsigned short PtksaReplayCounter:2; // B3 B2
unsigned short NoPairwise:1; // B1
unsigned short PreAuthentication:1; // B0
unsigned short Reserved2:8;
}field;
#else
struct
{
unsigned short PreAuthentication:1;
unsigned short PairwiseAsDefaultKey:1;
unsigned short NumOfReplayCounter:2;
unsigned short Reserved:12;
}field;
#endif
}DOT11_RSN_CAPABILITY;
#if defined(PACK_STRUCTURE) || defined(__ECOS)
#pragma pack()
#endif
#endif // _8192CD_SECURITY_H_
|