2 * WPA Supplicant - Common definitions
3 * Copyright (c) 2004-2008, Jouni Malinen <j@w1.fi>
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
18 typedef enum { FALSE = 0, TRUE = 1 } Boolean;
21 #define WPA_CIPHER_NONE BIT(0)
22 #define WPA_CIPHER_WEP40 BIT(1)
23 #define WPA_CIPHER_WEP104 BIT(2)
24 #define WPA_CIPHER_TKIP BIT(3)
25 #define WPA_CIPHER_CCMP BIT(4)
26 #ifdef CONFIG_IEEE80211W
27 #define WPA_CIPHER_AES_128_CMAC BIT(5)
28 #endif /* CONFIG_IEEE80211W */
29 #define WPA_CIPHER_GCMP BIT(6)
31 #define WPA_KEY_MGMT_IEEE8021X BIT(0)
32 #define WPA_KEY_MGMT_PSK BIT(1)
33 #define WPA_KEY_MGMT_NONE BIT(2)
34 #define WPA_KEY_MGMT_IEEE8021X_NO_WPA BIT(3)
35 #define WPA_KEY_MGMT_WPA_NONE BIT(4)
36 #define WPA_KEY_MGMT_FT_IEEE8021X BIT(5)
37 #define WPA_KEY_MGMT_FT_PSK BIT(6)
38 #define WPA_KEY_MGMT_IEEE8021X_SHA256 BIT(7)
39 #define WPA_KEY_MGMT_PSK_SHA256 BIT(8)
40 #define WPA_KEY_MGMT_WPS BIT(9)
42 static inline int wpa_key_mgmt_wpa_ieee8021x(int akm)
44 return !!(akm & (WPA_KEY_MGMT_IEEE8021X |
45 WPA_KEY_MGMT_FT_IEEE8021X |
46 WPA_KEY_MGMT_IEEE8021X_SHA256));
49 static inline int wpa_key_mgmt_wpa_psk(int akm)
51 return !!(akm & (WPA_KEY_MGMT_PSK |
53 WPA_KEY_MGMT_PSK_SHA256));
56 static inline int wpa_key_mgmt_ft(int akm)
58 return !!(akm & (WPA_KEY_MGMT_FT_PSK |
59 WPA_KEY_MGMT_FT_IEEE8021X));
62 static inline int wpa_key_mgmt_sha256(int akm)
64 return !!(akm & (WPA_KEY_MGMT_PSK_SHA256 |
65 WPA_KEY_MGMT_IEEE8021X_SHA256));
68 static inline int wpa_key_mgmt_wpa(int akm)
70 return wpa_key_mgmt_wpa_ieee8021x(akm) ||
71 wpa_key_mgmt_wpa_psk(akm);
74 static inline int wpa_key_mgmt_wpa_any(int akm)
76 return wpa_key_mgmt_wpa(akm) || (akm & WPA_KEY_MGMT_WPA_NONE);
80 #define WPA_PROTO_WPA BIT(0)
81 #define WPA_PROTO_RSN BIT(1)
83 #define WPA_AUTH_ALG_OPEN BIT(0)
84 #define WPA_AUTH_ALG_SHARED BIT(1)
85 #define WPA_AUTH_ALG_LEAP BIT(2)
86 #define WPA_AUTH_ALG_FT BIT(3)
100 * enum wpa_cipher - Cipher suites
112 * enum wpa_key_mgmt - Key management suites
118 KEY_MGMT_802_1X_NO_WPA,
122 KEY_MGMT_802_1X_SHA256,
128 * enum wpa_states - wpa_supplicant state
130 * These enumeration values are used to indicate the current wpa_supplicant
131 * state (wpa_s->wpa_state). The current state can be retrieved with
132 * wpa_supplicant_get_state() function and the state can be changed by calling
133 * wpa_supplicant_set_state(). In WPA state machine (wpa.c and preauth.c), the
134 * wrapper functions wpa_sm_get_state() and wpa_sm_set_state() should be used
135 * to access the state variable.
139 * WPA_DISCONNECTED - Disconnected state
141 * This state indicates that client is not associated, but is likely to
142 * start looking for an access point. This state is entered when a
143 * connection is lost.
148 * WPA_INTERFACE_DISABLED - Interface disabled
150 * This stat eis entered if the network interface is disabled, e.g.,
151 * due to rfkill. wpa_supplicant refuses any new operations that would
152 * use the radio until the interface has been enabled.
154 WPA_INTERFACE_DISABLED,
157 * WPA_INACTIVE - Inactive state (wpa_supplicant disabled)
159 * This state is entered if there are no enabled networks in the
160 * configuration. wpa_supplicant is not trying to associate with a new
161 * network and external interaction (e.g., ctrl_iface call to add or
162 * enable a network) is needed to start association.
167 * WPA_SCANNING - Scanning for a network
169 * This state is entered when wpa_supplicant starts scanning for a
175 * WPA_AUTHENTICATING - Trying to authenticate with a BSS/SSID
177 * This state is entered when wpa_supplicant has found a suitable BSS
178 * to authenticate with and the driver is configured to try to
179 * authenticate with this BSS. This state is used only with drivers
180 * that use wpa_supplicant as the SME.
185 * WPA_ASSOCIATING - Trying to associate with a BSS/SSID
187 * This state is entered when wpa_supplicant has found a suitable BSS
188 * to associate with and the driver is configured to try to associate
189 * with this BSS in ap_scan=1 mode. When using ap_scan=2 mode, this
190 * state is entered when the driver is configured to try to associate
191 * with a network using the configured SSID and security policy.
196 * WPA_ASSOCIATED - Association completed
198 * This state is entered when the driver reports that association has
199 * been successfully completed with an AP. If IEEE 802.1X is used
200 * (with or without WPA/WPA2), wpa_supplicant remains in this state
201 * until the IEEE 802.1X/EAPOL authentication has been completed.
206 * WPA_4WAY_HANDSHAKE - WPA 4-Way Key Handshake in progress
208 * This state is entered when WPA/WPA2 4-Way Handshake is started. In
209 * case of WPA-PSK, this happens when receiving the first EAPOL-Key
210 * frame after association. In case of WPA-EAP, this state is entered
211 * when the IEEE 802.1X/EAPOL authentication has been completed.
216 * WPA_GROUP_HANDSHAKE - WPA Group Key Handshake in progress
218 * This state is entered when 4-Way Key Handshake has been completed
219 * (i.e., when the supplicant sends out message 4/4) and when Group
220 * Key rekeying is started by the AP (i.e., when supplicant receives
226 * WPA_COMPLETED - All authentication completed
228 * This state is entered when the full authentication process is
229 * completed. In case of WPA2, this happens when the 4-Way Handshake is
230 * successfully completed. With WPA, this state is entered after the
231 * Group Key Handshake; with IEEE 802.1X (non-WPA) connection is
232 * completed after dynamic keys are received (or if not used, after
233 * the EAP authentication has been completed). With static WEP keys and
234 * plaintext connections, this state is entered when an association
235 * has been completed.
237 * This state indicates that the supplicant has completed its
238 * processing for the association phase and that data connection is
244 #define MLME_SETPROTECTION_PROTECT_TYPE_NONE 0
245 #define MLME_SETPROTECTION_PROTECT_TYPE_RX 1
246 #define MLME_SETPROTECTION_PROTECT_TYPE_TX 2
247 #define MLME_SETPROTECTION_PROTECT_TYPE_RX_TX 3
249 #define MLME_SETPROTECTION_KEY_TYPE_GROUP 0
250 #define MLME_SETPROTECTION_KEY_TYPE_PAIRWISE 1
254 * enum mfp_options - Management frame protection (IEEE 802.11w) options
257 NO_MGMT_FRAME_PROTECTION = 0,
258 MGMT_FRAME_PROTECTION_OPTIONAL = 1,
259 MGMT_FRAME_PROTECTION_REQUIRED = 2
263 * enum hostapd_hw_mode - Hardware mode
265 enum hostapd_hw_mode {
266 HOSTAPD_MODE_IEEE80211B,
267 HOSTAPD_MODE_IEEE80211G,
268 HOSTAPD_MODE_IEEE80211A,
273 * enum wpa_ctrl_req_type - Control interface request types
275 enum wpa_ctrl_req_type {
276 WPA_CTRL_REQ_UNKNOWN,
277 WPA_CTRL_REQ_EAP_IDENTITY,
278 WPA_CTRL_REQ_EAP_PASSWORD,
279 WPA_CTRL_REQ_EAP_NEW_PASSWORD,
280 WPA_CTRL_REQ_EAP_PIN,
281 WPA_CTRL_REQ_EAP_OTP,
282 WPA_CTRL_REQ_EAP_PASSPHRASE,
286 /* Maximum number of EAP methods to store for EAP server user information */
287 #define EAP_MAX_METHODS 8