• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * WPA definitions shared between hostapd and wpa_supplicant
3  * Copyright (c) 2002-2005, Jouni Malinen <j@w1.fi>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  *
9  * Alternatively, this software may be distributed under the terms of BSD
10  * license.
11  *
12  * See README and COPYING for more details.
13  */
14 
15 #ifndef WPA_COMMON_H
16 #define WPA_COMMON_H
17 
18 #define WPA_REPLAY_COUNTER_LEN 8
19 #define WPA_NONCE_LEN 32
20 #define WPA_KEY_RSC_LEN 8
21 
22 
23 /* IEEE Std 802.1X-2004 */
24 
25 #ifdef _MSC_VER
26 #pragma pack(push, 1)
27 #endif /* _MSC_VER */
28 
29 struct ieee802_1x_hdr {
30 	u8 version;
31 	u8 type;
32 	u16 length;
33 	/* followed by length octets of data */
34 } STRUCT_PACKED;
35 
36 #ifdef _MSC_VER
37 #pragma pack(pop)
38 #endif /* _MSC_VER */
39 
40 #define EAPOL_VERSION 2
41 
42 enum { IEEE802_1X_TYPE_EAP_PACKET = 0,
43        IEEE802_1X_TYPE_EAPOL_START = 1,
44        IEEE802_1X_TYPE_EAPOL_LOGOFF = 2,
45        IEEE802_1X_TYPE_EAPOL_KEY = 3,
46        IEEE802_1X_TYPE_EAPOL_ENCAPSULATED_ASF_ALERT = 4
47 };
48 
49 enum { EAPOL_KEY_TYPE_RC4 = 1, EAPOL_KEY_TYPE_RSN = 2,
50        EAPOL_KEY_TYPE_WPA = 254 };
51 
52 #ifdef CONFIG_IEEE80211W
53 #define WPA_DGTK_LEN 16
54 #define WPA_DHV_LEN 16
55 #define WPA_IGTK_LEN 16
56 #endif /* CONFIG_IEEE80211W */
57 
58 #endif /* WPA_COMMON_H */
59