blob: aa3c5cfe7fcf7e05dc35b3dbd192bf331709a20e [file] [log] [blame]
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001/*
2 * WPA Supplicant - Common definitions
Roshan Pius3a1667e2018-07-03 15:17:14 -07003 * Copyright (c) 2004-2018, Jouni Malinen <j@w1.fi>
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004 *
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08005 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007 */
8
9#ifndef DEFS_H
10#define DEFS_H
11
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070012#define WPA_CIPHER_NONE BIT(0)
13#define WPA_CIPHER_WEP40 BIT(1)
14#define WPA_CIPHER_WEP104 BIT(2)
15#define WPA_CIPHER_TKIP BIT(3)
16#define WPA_CIPHER_CCMP BIT(4)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070017#define WPA_CIPHER_AES_128_CMAC BIT(5)
Dmitry Shmidt61d9df32012-08-29 16:22:06 -070018#define WPA_CIPHER_GCMP BIT(6)
Dmitry Shmidtd5e49232012-12-03 15:08:10 -080019#define WPA_CIPHER_SMS4 BIT(7)
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -080020#define WPA_CIPHER_GCMP_256 BIT(8)
21#define WPA_CIPHER_CCMP_256 BIT(9)
22#define WPA_CIPHER_BIP_GMAC_128 BIT(11)
23#define WPA_CIPHER_BIP_GMAC_256 BIT(12)
24#define WPA_CIPHER_BIP_CMAC_256 BIT(13)
25#define WPA_CIPHER_GTK_NOT_USED BIT(14)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070026
27#define WPA_KEY_MGMT_IEEE8021X BIT(0)
28#define WPA_KEY_MGMT_PSK BIT(1)
29#define WPA_KEY_MGMT_NONE BIT(2)
30#define WPA_KEY_MGMT_IEEE8021X_NO_WPA BIT(3)
31#define WPA_KEY_MGMT_WPA_NONE BIT(4)
32#define WPA_KEY_MGMT_FT_IEEE8021X BIT(5)
33#define WPA_KEY_MGMT_FT_PSK BIT(6)
34#define WPA_KEY_MGMT_IEEE8021X_SHA256 BIT(7)
35#define WPA_KEY_MGMT_PSK_SHA256 BIT(8)
36#define WPA_KEY_MGMT_WPS BIT(9)
Dmitry Shmidtd5e49232012-12-03 15:08:10 -080037#define WPA_KEY_MGMT_SAE BIT(10)
38#define WPA_KEY_MGMT_FT_SAE BIT(11)
39#define WPA_KEY_MGMT_WAPI_PSK BIT(12)
40#define WPA_KEY_MGMT_WAPI_CERT BIT(13)
41#define WPA_KEY_MGMT_CCKM BIT(14)
Dmitry Shmidtf21452a2014-02-26 10:55:25 -080042#define WPA_KEY_MGMT_OSEN BIT(15)
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080043#define WPA_KEY_MGMT_IEEE8021X_SUITE_B BIT(16)
Dmitry Shmidt807291d2015-01-27 13:40:23 -080044#define WPA_KEY_MGMT_IEEE8021X_SUITE_B_192 BIT(17)
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -080045#define WPA_KEY_MGMT_FILS_SHA256 BIT(18)
46#define WPA_KEY_MGMT_FILS_SHA384 BIT(19)
47#define WPA_KEY_MGMT_FT_FILS_SHA256 BIT(20)
48#define WPA_KEY_MGMT_FT_FILS_SHA384 BIT(21)
Dmitry Shmidtd2986c22017-10-23 14:22:09 -070049#define WPA_KEY_MGMT_OWE BIT(22)
50#define WPA_KEY_MGMT_DPP BIT(23)
Roshan Pius3a1667e2018-07-03 15:17:14 -070051#define WPA_KEY_MGMT_FT_IEEE8021X_SHA384 BIT(24)
Hai Shalom60840252021-02-19 19:02:11 -080052#define WPA_KEY_MGMT_PASN BIT(25)
Sunil Ravi89eba102022-09-13 21:04:37 -070053#define WPA_KEY_MGMT_SAE_EXT_KEY BIT(26)
54#define WPA_KEY_MGMT_FT_SAE_EXT_KEY BIT(27)
Hai Shalom60840252021-02-19 19:02:11 -080055
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070056
Hai Shalom74f70d42019-02-11 14:42:39 -080057#define WPA_KEY_MGMT_FT (WPA_KEY_MGMT_FT_PSK | \
58 WPA_KEY_MGMT_FT_IEEE8021X | \
59 WPA_KEY_MGMT_FT_IEEE8021X_SHA384 | \
60 WPA_KEY_MGMT_FT_SAE | \
Sunil Ravi89eba102022-09-13 21:04:37 -070061 WPA_KEY_MGMT_FT_SAE_EXT_KEY | \
Hai Shalom74f70d42019-02-11 14:42:39 -080062 WPA_KEY_MGMT_FT_FILS_SHA256 | \
63 WPA_KEY_MGMT_FT_FILS_SHA384)
64
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070065static inline int wpa_key_mgmt_wpa_ieee8021x(int akm)
66{
67 return !!(akm & (WPA_KEY_MGMT_IEEE8021X |
68 WPA_KEY_MGMT_FT_IEEE8021X |
Roshan Pius3a1667e2018-07-03 15:17:14 -070069 WPA_KEY_MGMT_FT_IEEE8021X_SHA384 |
Dmitry Shmidtd5e49232012-12-03 15:08:10 -080070 WPA_KEY_MGMT_CCKM |
Dmitry Shmidtf21452a2014-02-26 10:55:25 -080071 WPA_KEY_MGMT_OSEN |
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080072 WPA_KEY_MGMT_IEEE8021X_SHA256 |
Dmitry Shmidt807291d2015-01-27 13:40:23 -080073 WPA_KEY_MGMT_IEEE8021X_SUITE_B |
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -080074 WPA_KEY_MGMT_IEEE8021X_SUITE_B_192 |
75 WPA_KEY_MGMT_FILS_SHA256 |
76 WPA_KEY_MGMT_FILS_SHA384 |
77 WPA_KEY_MGMT_FT_FILS_SHA256 |
78 WPA_KEY_MGMT_FT_FILS_SHA384));
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070079}
80
Hai Shalomfdcde762020-04-02 11:19:20 -070081static inline int wpa_key_mgmt_wpa_psk_no_sae(int akm)
82{
83 return !!(akm & (WPA_KEY_MGMT_PSK |
84 WPA_KEY_MGMT_FT_PSK |
85 WPA_KEY_MGMT_PSK_SHA256));
86}
87
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070088static inline int wpa_key_mgmt_wpa_psk(int akm)
89{
90 return !!(akm & (WPA_KEY_MGMT_PSK |
91 WPA_KEY_MGMT_FT_PSK |
Dmitry Shmidtd5e49232012-12-03 15:08:10 -080092 WPA_KEY_MGMT_PSK_SHA256 |
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -080093 WPA_KEY_MGMT_SAE |
Sunil Ravi89eba102022-09-13 21:04:37 -070094 WPA_KEY_MGMT_SAE_EXT_KEY |
95 WPA_KEY_MGMT_FT_SAE |
96 WPA_KEY_MGMT_FT_SAE_EXT_KEY));
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070097}
98
99static inline int wpa_key_mgmt_ft(int akm)
100{
Hai Shalom74f70d42019-02-11 14:42:39 -0800101 return !!(akm & WPA_KEY_MGMT_FT);
102}
103
104static inline int wpa_key_mgmt_only_ft(int akm)
105{
106 int ft = wpa_key_mgmt_ft(akm);
107 akm &= ~WPA_KEY_MGMT_FT;
108 return ft && !akm;
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800109}
110
111static inline int wpa_key_mgmt_ft_psk(int akm)
112{
113 return !!(akm & WPA_KEY_MGMT_FT_PSK);
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800114}
115
116static inline int wpa_key_mgmt_sae(int akm)
117{
118 return !!(akm & (WPA_KEY_MGMT_SAE |
Sunil Ravi89eba102022-09-13 21:04:37 -0700119 WPA_KEY_MGMT_SAE_EXT_KEY |
120 WPA_KEY_MGMT_FT_SAE |
121 WPA_KEY_MGMT_FT_SAE_EXT_KEY));
122}
123
124static inline int wpa_key_mgmt_sae_ext_key(int akm)
125{
126 return !!(akm & (WPA_KEY_MGMT_SAE_EXT_KEY |
127 WPA_KEY_MGMT_FT_SAE_EXT_KEY));
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700128}
129
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800130static inline int wpa_key_mgmt_fils(int akm)
131{
132 return !!(akm & (WPA_KEY_MGMT_FILS_SHA256 |
133 WPA_KEY_MGMT_FILS_SHA384 |
134 WPA_KEY_MGMT_FT_FILS_SHA256 |
135 WPA_KEY_MGMT_FT_FILS_SHA384));
136}
137
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700138static inline int wpa_key_mgmt_sha256(int akm)
139{
Sunil Ravi77d572f2023-01-17 23:58:31 +0000140 return !!(akm & (WPA_KEY_MGMT_FT_IEEE8021X |
141 WPA_KEY_MGMT_PSK_SHA256 |
Dmitry Shmidtf21452a2014-02-26 10:55:25 -0800142 WPA_KEY_MGMT_IEEE8021X_SHA256 |
Roshan Pius3a1667e2018-07-03 15:17:14 -0700143 WPA_KEY_MGMT_SAE |
144 WPA_KEY_MGMT_FT_SAE |
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800145 WPA_KEY_MGMT_OSEN |
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800146 WPA_KEY_MGMT_IEEE8021X_SUITE_B |
147 WPA_KEY_MGMT_FILS_SHA256 |
148 WPA_KEY_MGMT_FT_FILS_SHA256));
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800149}
150
Dmitry Shmidt807291d2015-01-27 13:40:23 -0800151static inline int wpa_key_mgmt_sha384(int akm)
152{
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800153 return !!(akm & (WPA_KEY_MGMT_IEEE8021X_SUITE_B_192 |
Roshan Pius3a1667e2018-07-03 15:17:14 -0700154 WPA_KEY_MGMT_FT_IEEE8021X_SHA384 |
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800155 WPA_KEY_MGMT_FILS_SHA384 |
156 WPA_KEY_MGMT_FT_FILS_SHA384));
Dmitry Shmidt807291d2015-01-27 13:40:23 -0800157}
158
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800159static inline int wpa_key_mgmt_suite_b(int akm)
160{
Dmitry Shmidt807291d2015-01-27 13:40:23 -0800161 return !!(akm & (WPA_KEY_MGMT_IEEE8021X_SUITE_B |
162 WPA_KEY_MGMT_IEEE8021X_SUITE_B_192));
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700163}
164
165static inline int wpa_key_mgmt_wpa(int akm)
166{
167 return wpa_key_mgmt_wpa_ieee8021x(akm) ||
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800168 wpa_key_mgmt_wpa_psk(akm) ||
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800169 wpa_key_mgmt_fils(akm) ||
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700170 wpa_key_mgmt_sae(akm) ||
171 akm == WPA_KEY_MGMT_OWE ||
172 akm == WPA_KEY_MGMT_DPP;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700173}
174
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800175static inline int wpa_key_mgmt_wpa_any(int akm)
176{
177 return wpa_key_mgmt_wpa(akm) || (akm & WPA_KEY_MGMT_WPA_NONE);
178}
179
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800180static inline int wpa_key_mgmt_cckm(int akm)
181{
182 return akm == WPA_KEY_MGMT_CCKM;
183}
184
Sunil Ravi89eba102022-09-13 21:04:37 -0700185static inline int wpa_key_mgmt_cross_akm(int akm)
186{
187 return !!(akm & (WPA_KEY_MGMT_PSK |
188 WPA_KEY_MGMT_PSK_SHA256 |
189 WPA_KEY_MGMT_SAE |
190 WPA_KEY_MGMT_SAE_EXT_KEY));
191}
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700192
193#define WPA_PROTO_WPA BIT(0)
194#define WPA_PROTO_RSN BIT(1)
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800195#define WPA_PROTO_WAPI BIT(2)
Dmitry Shmidtf21452a2014-02-26 10:55:25 -0800196#define WPA_PROTO_OSEN BIT(3)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700197
198#define WPA_AUTH_ALG_OPEN BIT(0)
199#define WPA_AUTH_ALG_SHARED BIT(1)
200#define WPA_AUTH_ALG_LEAP BIT(2)
201#define WPA_AUTH_ALG_FT BIT(3)
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800202#define WPA_AUTH_ALG_SAE BIT(4)
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -0800203#define WPA_AUTH_ALG_FILS BIT(5)
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700204#define WPA_AUTH_ALG_FILS_SK_PFS BIT(6)
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700205
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700206static inline int wpa_auth_alg_fils(int alg)
207{
208 return !!(alg & (WPA_AUTH_ALG_FILS | WPA_AUTH_ALG_FILS_SK_PFS));
209}
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700210
211enum wpa_alg {
212 WPA_ALG_NONE,
213 WPA_ALG_WEP,
214 WPA_ALG_TKIP,
215 WPA_ALG_CCMP,
Hai Shalom4fbc08f2020-05-18 12:37:00 -0700216 WPA_ALG_BIP_CMAC_128,
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800217 WPA_ALG_GCMP,
218 WPA_ALG_SMS4,
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800219 WPA_ALG_KRK,
220 WPA_ALG_GCMP_256,
221 WPA_ALG_CCMP_256,
222 WPA_ALG_BIP_GMAC_128,
223 WPA_ALG_BIP_GMAC_256,
224 WPA_ALG_BIP_CMAC_256
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700225};
226
Hai Shalom4fbc08f2020-05-18 12:37:00 -0700227static inline int wpa_alg_bip(enum wpa_alg alg)
228{
229 return alg == WPA_ALG_BIP_CMAC_128 ||
230 alg == WPA_ALG_BIP_GMAC_128 ||
231 alg == WPA_ALG_BIP_GMAC_256 ||
232 alg == WPA_ALG_BIP_CMAC_256;
233}
234
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700235/**
236 * enum wpa_states - wpa_supplicant state
237 *
238 * These enumeration values are used to indicate the current wpa_supplicant
239 * state (wpa_s->wpa_state). The current state can be retrieved with
240 * wpa_supplicant_get_state() function and the state can be changed by calling
241 * wpa_supplicant_set_state(). In WPA state machine (wpa.c and preauth.c), the
242 * wrapper functions wpa_sm_get_state() and wpa_sm_set_state() should be used
243 * to access the state variable.
244 */
245enum wpa_states {
246 /**
247 * WPA_DISCONNECTED - Disconnected state
248 *
249 * This state indicates that client is not associated, but is likely to
250 * start looking for an access point. This state is entered when a
251 * connection is lost.
252 */
253 WPA_DISCONNECTED,
254
255 /**
256 * WPA_INTERFACE_DISABLED - Interface disabled
257 *
Dmitry Shmidtd80a4012015-11-05 16:35:40 -0800258 * This state is entered if the network interface is disabled, e.g.,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700259 * due to rfkill. wpa_supplicant refuses any new operations that would
260 * use the radio until the interface has been enabled.
261 */
262 WPA_INTERFACE_DISABLED,
263
264 /**
265 * WPA_INACTIVE - Inactive state (wpa_supplicant disabled)
266 *
267 * This state is entered if there are no enabled networks in the
268 * configuration. wpa_supplicant is not trying to associate with a new
269 * network and external interaction (e.g., ctrl_iface call to add or
270 * enable a network) is needed to start association.
271 */
272 WPA_INACTIVE,
273
274 /**
275 * WPA_SCANNING - Scanning for a network
276 *
277 * This state is entered when wpa_supplicant starts scanning for a
278 * network.
279 */
280 WPA_SCANNING,
281
282 /**
283 * WPA_AUTHENTICATING - Trying to authenticate with a BSS/SSID
284 *
285 * This state is entered when wpa_supplicant has found a suitable BSS
286 * to authenticate with and the driver is configured to try to
287 * authenticate with this BSS. This state is used only with drivers
288 * that use wpa_supplicant as the SME.
289 */
290 WPA_AUTHENTICATING,
291
292 /**
293 * WPA_ASSOCIATING - Trying to associate with a BSS/SSID
294 *
295 * This state is entered when wpa_supplicant has found a suitable BSS
296 * to associate with and the driver is configured to try to associate
297 * with this BSS in ap_scan=1 mode. When using ap_scan=2 mode, this
298 * state is entered when the driver is configured to try to associate
299 * with a network using the configured SSID and security policy.
300 */
301 WPA_ASSOCIATING,
302
303 /**
304 * WPA_ASSOCIATED - Association completed
305 *
306 * This state is entered when the driver reports that association has
307 * been successfully completed with an AP. If IEEE 802.1X is used
308 * (with or without WPA/WPA2), wpa_supplicant remains in this state
309 * until the IEEE 802.1X/EAPOL authentication has been completed.
310 */
311 WPA_ASSOCIATED,
312
313 /**
314 * WPA_4WAY_HANDSHAKE - WPA 4-Way Key Handshake in progress
315 *
316 * This state is entered when WPA/WPA2 4-Way Handshake is started. In
317 * case of WPA-PSK, this happens when receiving the first EAPOL-Key
318 * frame after association. In case of WPA-EAP, this state is entered
319 * when the IEEE 802.1X/EAPOL authentication has been completed.
320 */
321 WPA_4WAY_HANDSHAKE,
322
323 /**
324 * WPA_GROUP_HANDSHAKE - WPA Group Key Handshake in progress
325 *
326 * This state is entered when 4-Way Key Handshake has been completed
327 * (i.e., when the supplicant sends out message 4/4) and when Group
328 * Key rekeying is started by the AP (i.e., when supplicant receives
329 * message 1/2).
330 */
331 WPA_GROUP_HANDSHAKE,
332
333 /**
334 * WPA_COMPLETED - All authentication completed
335 *
336 * This state is entered when the full authentication process is
337 * completed. In case of WPA2, this happens when the 4-Way Handshake is
338 * successfully completed. With WPA, this state is entered after the
339 * Group Key Handshake; with IEEE 802.1X (non-WPA) connection is
340 * completed after dynamic keys are received (or if not used, after
341 * the EAP authentication has been completed). With static WEP keys and
342 * plaintext connections, this state is entered when an association
343 * has been completed.
344 *
345 * This state indicates that the supplicant has completed its
346 * processing for the association phase and that data connection is
347 * fully configured.
348 */
349 WPA_COMPLETED
350};
351
352#define MLME_SETPROTECTION_PROTECT_TYPE_NONE 0
353#define MLME_SETPROTECTION_PROTECT_TYPE_RX 1
354#define MLME_SETPROTECTION_PROTECT_TYPE_TX 2
355#define MLME_SETPROTECTION_PROTECT_TYPE_RX_TX 3
356
357#define MLME_SETPROTECTION_KEY_TYPE_GROUP 0
358#define MLME_SETPROTECTION_KEY_TYPE_PAIRWISE 1
359
360
361/**
362 * enum mfp_options - Management frame protection (IEEE 802.11w) options
363 */
364enum mfp_options {
365 NO_MGMT_FRAME_PROTECTION = 0,
366 MGMT_FRAME_PROTECTION_OPTIONAL = 1,
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800367 MGMT_FRAME_PROTECTION_REQUIRED = 2,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700368};
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800369#define MGMT_FRAME_PROTECTION_DEFAULT 3
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700370
371/**
372 * enum hostapd_hw_mode - Hardware mode
373 */
374enum hostapd_hw_mode {
375 HOSTAPD_MODE_IEEE80211B,
376 HOSTAPD_MODE_IEEE80211G,
377 HOSTAPD_MODE_IEEE80211A,
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -0800378 HOSTAPD_MODE_IEEE80211AD,
Dmitry Shmidtb1e52102015-05-29 12:36:29 -0700379 HOSTAPD_MODE_IEEE80211ANY,
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700380 NUM_HOSTAPD_MODES
381};
382
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800383/**
384 * enum wpa_ctrl_req_type - Control interface request types
385 */
386enum wpa_ctrl_req_type {
387 WPA_CTRL_REQ_UNKNOWN,
388 WPA_CTRL_REQ_EAP_IDENTITY,
389 WPA_CTRL_REQ_EAP_PASSWORD,
390 WPA_CTRL_REQ_EAP_NEW_PASSWORD,
391 WPA_CTRL_REQ_EAP_PIN,
392 WPA_CTRL_REQ_EAP_OTP,
393 WPA_CTRL_REQ_EAP_PASSPHRASE,
Dmitry Shmidt051af732013-10-22 13:52:46 -0700394 WPA_CTRL_REQ_SIM,
Dmitry Shmidt912c6ec2015-03-30 13:16:51 -0700395 WPA_CTRL_REQ_PSK_PASSPHRASE,
Dmitry Shmidt55840ad2015-12-14 12:45:46 -0800396 WPA_CTRL_REQ_EXT_CERT_CHECK,
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800397 NUM_WPA_CTRL_REQS
398};
399
400/* Maximum number of EAP methods to store for EAP server user information */
401#define EAP_MAX_METHODS 8
402
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800403enum mesh_plink_state {
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -0700404 PLINK_IDLE = 1,
405 PLINK_OPN_SNT,
406 PLINK_OPN_RCVD,
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800407 PLINK_CNF_RCVD,
408 PLINK_ESTAB,
409 PLINK_HOLDING,
Dmitry Shmidt58d12ad2016-07-28 10:07:03 -0700410 PLINK_BLOCKED, /* not defined in the IEEE 802.11 standard */
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800411};
412
Ravi Joshie6ccb162015-07-16 17:45:41 -0700413enum set_band {
Hai Shalom60840252021-02-19 19:02:11 -0800414 WPA_SETBAND_AUTO = 0,
415 WPA_SETBAND_5G = BIT(0),
416 WPA_SETBAND_2G = BIT(1),
417 WPA_SETBAND_6G = BIT(2),
Ravi Joshie6ccb162015-07-16 17:45:41 -0700418};
419
Dmitry Shmidt9c175262016-03-03 10:20:07 -0800420enum wpa_radio_work_band {
421 BAND_2_4_GHZ = BIT(0),
422 BAND_5_GHZ = BIT(1),
423 BAND_60_GHZ = BIT(2),
424};
425
Dmitry Shmidtabb90a32016-12-05 15:34:39 -0800426enum beacon_rate_type {
427 BEACON_RATE_LEGACY,
428 BEACON_RATE_HT,
Hai Shalom60840252021-02-19 19:02:11 -0800429 BEACON_RATE_VHT,
430 BEACON_RATE_HE
Dmitry Shmidtabb90a32016-12-05 15:34:39 -0800431};
432
Dmitry Shmidt29333592017-01-09 12:27:11 -0800433enum eap_proxy_sim_state {
434 SIM_STATE_ERROR,
435};
436
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700437#define OCE_STA BIT(0)
438#define OCE_STA_CFON BIT(1)
439#define OCE_AP BIT(2)
440
Hai Shalom74f70d42019-02-11 14:42:39 -0800441/* enum chan_width - Channel width definitions */
442enum chan_width {
443 CHAN_WIDTH_20_NOHT,
444 CHAN_WIDTH_20,
445 CHAN_WIDTH_40,
446 CHAN_WIDTH_80,
447 CHAN_WIDTH_80P80,
448 CHAN_WIDTH_160,
Ahmed ElArabawy0ff61c52019-12-26 12:38:39 -0800449 CHAN_WIDTH_2160,
450 CHAN_WIDTH_4320,
451 CHAN_WIDTH_6480,
452 CHAN_WIDTH_8640,
Sunil8cd6f4d2022-06-28 18:40:46 +0000453 CHAN_WIDTH_320,
Hai Shalom74f70d42019-02-11 14:42:39 -0800454 CHAN_WIDTH_UNKNOWN
455};
456
Sunil8cd6f4d2022-06-28 18:40:46 +0000457/* VHT/EDMG/etc. channel widths
458 * Note: The first four values are used in hostapd.conf and as such, must
459 * maintain their defined values. Other values are used internally. */
460enum oper_chan_width {
461 CONF_OPER_CHWIDTH_USE_HT = 0,
462 CONF_OPER_CHWIDTH_80MHZ = 1,
463 CONF_OPER_CHWIDTH_160MHZ = 2,
464 CONF_OPER_CHWIDTH_80P80MHZ = 3,
465 CONF_OPER_CHWIDTH_2160MHZ,
466 CONF_OPER_CHWIDTH_4320MHZ,
467 CONF_OPER_CHWIDTH_6480MHZ,
468 CONF_OPER_CHWIDTH_8640MHZ,
469 CONF_OPER_CHWIDTH_40MHZ_6GHZ,
470 CONF_OPER_CHWIDTH_320MHZ,
471};
472
Hai Shalomfdcde762020-04-02 11:19:20 -0700473enum key_flag {
474 KEY_FLAG_MODIFY = BIT(0),
475 KEY_FLAG_DEFAULT = BIT(1),
476 KEY_FLAG_RX = BIT(2),
477 KEY_FLAG_TX = BIT(3),
478 KEY_FLAG_GROUP = BIT(4),
479 KEY_FLAG_PAIRWISE = BIT(5),
480 KEY_FLAG_PMK = BIT(6),
481 /* Used flag combinations */
482 KEY_FLAG_RX_TX = KEY_FLAG_RX | KEY_FLAG_TX,
483 KEY_FLAG_GROUP_RX_TX = KEY_FLAG_GROUP | KEY_FLAG_RX_TX,
484 KEY_FLAG_GROUP_RX_TX_DEFAULT = KEY_FLAG_GROUP_RX_TX |
485 KEY_FLAG_DEFAULT,
486 KEY_FLAG_GROUP_RX = KEY_FLAG_GROUP | KEY_FLAG_RX,
487 KEY_FLAG_GROUP_TX_DEFAULT = KEY_FLAG_GROUP | KEY_FLAG_TX |
488 KEY_FLAG_DEFAULT,
489 KEY_FLAG_PAIRWISE_RX_TX = KEY_FLAG_PAIRWISE | KEY_FLAG_RX_TX,
490 KEY_FLAG_PAIRWISE_RX = KEY_FLAG_PAIRWISE | KEY_FLAG_RX,
491 KEY_FLAG_PAIRWISE_RX_TX_MODIFY = KEY_FLAG_PAIRWISE_RX_TX |
492 KEY_FLAG_MODIFY,
493 /* Max allowed flags for each key type */
494 KEY_FLAG_PAIRWISE_MASK = KEY_FLAG_PAIRWISE_RX_TX_MODIFY,
495 KEY_FLAG_GROUP_MASK = KEY_FLAG_GROUP_RX_TX_DEFAULT,
496 KEY_FLAG_PMK_MASK = KEY_FLAG_PMK,
497};
498
499static inline int check_key_flag(enum key_flag key_flag)
500{
501 return !!(!key_flag ||
502 ((key_flag & (KEY_FLAG_PAIRWISE | KEY_FLAG_MODIFY)) &&
503 (key_flag & ~KEY_FLAG_PAIRWISE_MASK)) ||
504 ((key_flag & KEY_FLAG_GROUP) &&
505 (key_flag & ~KEY_FLAG_GROUP_MASK)) ||
506 ((key_flag & KEY_FLAG_PMK) &&
507 (key_flag & ~KEY_FLAG_PMK_MASK)));
508}
509
510enum ptk0_rekey_handling {
511 PTK0_REKEY_ALLOW_ALWAYS,
512 PTK0_REKEY_ALLOW_LOCAL_OK,
513 PTK0_REKEY_ALLOW_NEVER
514};
515
Sunil8cd6f4d2022-06-28 18:40:46 +0000516enum frame_encryption {
517 FRAME_ENCRYPTION_UNKNOWN = -1,
518 FRAME_NOT_ENCRYPTED = 0,
519 FRAME_ENCRYPTED = 1
520};
521
Sunil Ravi89eba102022-09-13 21:04:37 -0700522#define MAX_NUM_MLD_LINKS 15
523
Veerendranath Jakkambc2fa492023-05-25 01:26:50 +0530524enum mlo_info_change_reason {
525 MLO_TID_TO_LINK_MAP = 0,
526 MLO_LINK_RECONFIG_AP_REMOVAL = 1
527};
528
Sunil Ravi77d572f2023-01-17 23:58:31 +0000529enum sae_pwe {
530 SAE_PWE_HUNT_AND_PECK = 0,
531 SAE_PWE_HASH_TO_ELEMENT = 1,
532 SAE_PWE_BOTH = 2,
533 SAE_PWE_FORCE_HUNT_AND_PECK = 3,
534 SAE_PWE_NOT_SET = 4,
535};
536
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700537#endif /* DEFS_H */