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)
30 #define WPA_CIPHER_SMS4 BIT(7)
32 #define WPA_KEY_MGMT_IEEE8021X BIT(0)
33 #define WPA_KEY_MGMT_PSK BIT(1)
34 #define WPA_KEY_MGMT_NONE BIT(2)
35 #define WPA_KEY_MGMT_IEEE8021X_NO_WPA BIT(3)
36 #define WPA_KEY_MGMT_WPA_NONE BIT(4)
37 #define WPA_KEY_MGMT_FT_IEEE8021X BIT(5)
38 #define WPA_KEY_MGMT_FT_PSK BIT(6)
39 #define WPA_KEY_MGMT_IEEE8021X_SHA256 BIT(7)
40 #define WPA_KEY_MGMT_PSK_SHA256 BIT(8)
41 #define WPA_KEY_MGMT_WPS BIT(9)
42 #define WPA_KEY_MGMT_SAE BIT(10)
43 #define WPA_KEY_MGMT_FT_SAE BIT(11)
44 #define WPA_KEY_MGMT_WAPI_PSK BIT(12)
45 #define WPA_KEY_MGMT_WAPI_CERT BIT(13)
46 #define WPA_KEY_MGMT_CCKM BIT(14)
48 static inline int wpa_key_mgmt_wpa_ieee8021x(int akm)
50 return !!(akm & (WPA_KEY_MGMT_IEEE8021X |
51 WPA_KEY_MGMT_FT_IEEE8021X |
53 WPA_KEY_MGMT_IEEE8021X_SHA256));
56 static inline int wpa_key_mgmt_wpa_psk(int akm)
58 return !!(akm & (WPA_KEY_MGMT_PSK |
60 WPA_KEY_MGMT_PSK_SHA256 |
64 static inline int wpa_key_mgmt_ft(int akm)
66 return !!(akm & (WPA_KEY_MGMT_FT_PSK |
67 WPA_KEY_MGMT_FT_IEEE8021X |
68 WPA_KEY_MGMT_FT_SAE));
71 static inline int wpa_key_mgmt_sae(int akm)
73 return !!(akm & (WPA_KEY_MGMT_SAE |
74 WPA_KEY_MGMT_FT_SAE));
77 static inline int wpa_key_mgmt_sha256(int akm)
79 return !!(akm & (WPA_KEY_MGMT_PSK_SHA256 |
80 WPA_KEY_MGMT_IEEE8021X_SHA256));
83 static inline int wpa_key_mgmt_wpa(int akm)
85 return wpa_key_mgmt_wpa_ieee8021x(akm) ||
86 wpa_key_mgmt_wpa_psk(akm);
89 static inline int wpa_key_mgmt_wpa_any(int akm)
91 return wpa_key_mgmt_wpa(akm) || (akm & WPA_KEY_MGMT_WPA_NONE);
94 static inline int wpa_key_mgmt_cckm(int akm)
96 return akm == WPA_KEY_MGMT_CCKM;
100 #define WPA_PROTO_WPA BIT(0)
101 #define WPA_PROTO_RSN BIT(1)
102 #define WPA_PROTO_WAPI BIT(2)
104 #define WPA_AUTH_ALG_OPEN BIT(0)
105 #define WPA_AUTH_ALG_SHARED BIT(1)
106 #define WPA_AUTH_ALG_LEAP BIT(2)
107 #define WPA_AUTH_ALG_FT BIT(3)
108 #define WPA_AUTH_ALG_SAE BIT(4)
124 * enum wpa_cipher - Cipher suites
137 * enum wpa_key_mgmt - Key management suites
143 KEY_MGMT_802_1X_NO_WPA,
147 KEY_MGMT_802_1X_SHA256,
158 * enum wpa_states - wpa_supplicant state
160 * These enumeration values are used to indicate the current wpa_supplicant
161 * state (wpa_s->wpa_state). The current state can be retrieved with
162 * wpa_supplicant_get_state() function and the state can be changed by calling
163 * wpa_supplicant_set_state(). In WPA state machine (wpa.c and preauth.c), the
164 * wrapper functions wpa_sm_get_state() and wpa_sm_set_state() should be used
165 * to access the state variable.
169 * WPA_DISCONNECTED - Disconnected state
171 * This state indicates that client is not associated, but is likely to
172 * start looking for an access point. This state is entered when a
173 * connection is lost.
178 * WPA_INTERFACE_DISABLED - Interface disabled
180 * This stat eis entered if the network interface is disabled, e.g.,
181 * due to rfkill. wpa_supplicant refuses any new operations that would
182 * use the radio until the interface has been enabled.
184 WPA_INTERFACE_DISABLED,
187 * WPA_INACTIVE - Inactive state (wpa_supplicant disabled)
189 * This state is entered if there are no enabled networks in the
190 * configuration. wpa_supplicant is not trying to associate with a new
191 * network and external interaction (e.g., ctrl_iface call to add or
192 * enable a network) is needed to start association.
197 * WPA_SCANNING - Scanning for a network
199 * This state is entered when wpa_supplicant starts scanning for a
205 * WPA_AUTHENTICATING - Trying to authenticate with a BSS/SSID
207 * This state is entered when wpa_supplicant has found a suitable BSS
208 * to authenticate with and the driver is configured to try to
209 * authenticate with this BSS. This state is used only with drivers
210 * that use wpa_supplicant as the SME.
215 * WPA_ASSOCIATING - Trying to associate with a BSS/SSID
217 * This state is entered when wpa_supplicant has found a suitable BSS
218 * to associate with and the driver is configured to try to associate
219 * with this BSS in ap_scan=1 mode. When using ap_scan=2 mode, this
220 * state is entered when the driver is configured to try to associate
221 * with a network using the configured SSID and security policy.
226 * WPA_ASSOCIATED - Association completed
228 * This state is entered when the driver reports that association has
229 * been successfully completed with an AP. If IEEE 802.1X is used
230 * (with or without WPA/WPA2), wpa_supplicant remains in this state
231 * until the IEEE 802.1X/EAPOL authentication has been completed.
236 * WPA_4WAY_HANDSHAKE - WPA 4-Way Key Handshake in progress
238 * This state is entered when WPA/WPA2 4-Way Handshake is started. In
239 * case of WPA-PSK, this happens when receiving the first EAPOL-Key
240 * frame after association. In case of WPA-EAP, this state is entered
241 * when the IEEE 802.1X/EAPOL authentication has been completed.
246 * WPA_GROUP_HANDSHAKE - WPA Group Key Handshake in progress
248 * This state is entered when 4-Way Key Handshake has been completed
249 * (i.e., when the supplicant sends out message 4/4) and when Group
250 * Key rekeying is started by the AP (i.e., when supplicant receives
256 * WPA_COMPLETED - All authentication completed
258 * This state is entered when the full authentication process is
259 * completed. In case of WPA2, this happens when the 4-Way Handshake is
260 * successfully completed. With WPA, this state is entered after the
261 * Group Key Handshake; with IEEE 802.1X (non-WPA) connection is
262 * completed after dynamic keys are received (or if not used, after
263 * the EAP authentication has been completed). With static WEP keys and
264 * plaintext connections, this state is entered when an association
265 * has been completed.
267 * This state indicates that the supplicant has completed its
268 * processing for the association phase and that data connection is
274 #define MLME_SETPROTECTION_PROTECT_TYPE_NONE 0
275 #define MLME_SETPROTECTION_PROTECT_TYPE_RX 1
276 #define MLME_SETPROTECTION_PROTECT_TYPE_TX 2
277 #define MLME_SETPROTECTION_PROTECT_TYPE_RX_TX 3
279 #define MLME_SETPROTECTION_KEY_TYPE_GROUP 0
280 #define MLME_SETPROTECTION_KEY_TYPE_PAIRWISE 1
284 * enum mfp_options - Management frame protection (IEEE 802.11w) options
287 NO_MGMT_FRAME_PROTECTION = 0,
288 MGMT_FRAME_PROTECTION_OPTIONAL = 1,
289 MGMT_FRAME_PROTECTION_REQUIRED = 2,
291 #define MGMT_FRAME_PROTECTION_DEFAULT 3
294 * enum hostapd_hw_mode - Hardware mode
296 enum hostapd_hw_mode {
297 HOSTAPD_MODE_IEEE80211B,
298 HOSTAPD_MODE_IEEE80211G,
299 HOSTAPD_MODE_IEEE80211A,
300 HOSTAPD_MODE_IEEE80211AD,
305 * enum wpa_ctrl_req_type - Control interface request types
307 enum wpa_ctrl_req_type {
308 WPA_CTRL_REQ_UNKNOWN,
309 WPA_CTRL_REQ_EAP_IDENTITY,
310 WPA_CTRL_REQ_EAP_PASSWORD,
311 WPA_CTRL_REQ_EAP_NEW_PASSWORD,
312 WPA_CTRL_REQ_EAP_PIN,
313 WPA_CTRL_REQ_EAP_OTP,
314 WPA_CTRL_REQ_EAP_PASSPHRASE,
318 /* Maximum number of EAP methods to store for EAP server user information */
319 #define EAP_MAX_METHODS 8