Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1 | /* |
| 2 | * WPA Supplicant - Common definitions |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame^] | 3 | * Copyright (c) 2004-2018, Jouni Malinen <j@w1.fi> |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 4 | * |
Dmitry Shmidt | c5ec7f5 | 2012-03-06 16:33:24 -0800 | [diff] [blame] | 5 | * This software may be distributed under the terms of the BSD license. |
| 6 | * See README for more details. |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef DEFS_H |
| 10 | #define DEFS_H |
| 11 | |
| 12 | #ifdef FALSE |
| 13 | #undef FALSE |
| 14 | #endif |
| 15 | #ifdef TRUE |
| 16 | #undef TRUE |
| 17 | #endif |
| 18 | typedef enum { FALSE = 0, TRUE = 1 } Boolean; |
| 19 | |
| 20 | |
| 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) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 26 | #define WPA_CIPHER_AES_128_CMAC BIT(5) |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 27 | #define WPA_CIPHER_GCMP BIT(6) |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 28 | #define WPA_CIPHER_SMS4 BIT(7) |
Dmitry Shmidt | fb79edc | 2014-01-10 10:45:54 -0800 | [diff] [blame] | 29 | #define WPA_CIPHER_GCMP_256 BIT(8) |
| 30 | #define WPA_CIPHER_CCMP_256 BIT(9) |
| 31 | #define WPA_CIPHER_BIP_GMAC_128 BIT(11) |
| 32 | #define WPA_CIPHER_BIP_GMAC_256 BIT(12) |
| 33 | #define WPA_CIPHER_BIP_CMAC_256 BIT(13) |
| 34 | #define WPA_CIPHER_GTK_NOT_USED BIT(14) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 35 | |
| 36 | #define WPA_KEY_MGMT_IEEE8021X BIT(0) |
| 37 | #define WPA_KEY_MGMT_PSK BIT(1) |
| 38 | #define WPA_KEY_MGMT_NONE BIT(2) |
| 39 | #define WPA_KEY_MGMT_IEEE8021X_NO_WPA BIT(3) |
| 40 | #define WPA_KEY_MGMT_WPA_NONE BIT(4) |
| 41 | #define WPA_KEY_MGMT_FT_IEEE8021X BIT(5) |
| 42 | #define WPA_KEY_MGMT_FT_PSK BIT(6) |
| 43 | #define WPA_KEY_MGMT_IEEE8021X_SHA256 BIT(7) |
| 44 | #define WPA_KEY_MGMT_PSK_SHA256 BIT(8) |
| 45 | #define WPA_KEY_MGMT_WPS BIT(9) |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 46 | #define WPA_KEY_MGMT_SAE BIT(10) |
| 47 | #define WPA_KEY_MGMT_FT_SAE BIT(11) |
| 48 | #define WPA_KEY_MGMT_WAPI_PSK BIT(12) |
| 49 | #define WPA_KEY_MGMT_WAPI_CERT BIT(13) |
| 50 | #define WPA_KEY_MGMT_CCKM BIT(14) |
Dmitry Shmidt | f21452a | 2014-02-26 10:55:25 -0800 | [diff] [blame] | 51 | #define WPA_KEY_MGMT_OSEN BIT(15) |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 52 | #define WPA_KEY_MGMT_IEEE8021X_SUITE_B BIT(16) |
Dmitry Shmidt | 807291d | 2015-01-27 13:40:23 -0800 | [diff] [blame] | 53 | #define WPA_KEY_MGMT_IEEE8021X_SUITE_B_192 BIT(17) |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame] | 54 | #define WPA_KEY_MGMT_FILS_SHA256 BIT(18) |
| 55 | #define WPA_KEY_MGMT_FILS_SHA384 BIT(19) |
| 56 | #define WPA_KEY_MGMT_FT_FILS_SHA256 BIT(20) |
| 57 | #define WPA_KEY_MGMT_FT_FILS_SHA384 BIT(21) |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 58 | #define WPA_KEY_MGMT_OWE BIT(22) |
| 59 | #define WPA_KEY_MGMT_DPP BIT(23) |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame^] | 60 | #define WPA_KEY_MGMT_FT_IEEE8021X_SHA384 BIT(24) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 61 | |
| 62 | static inline int wpa_key_mgmt_wpa_ieee8021x(int akm) |
| 63 | { |
| 64 | return !!(akm & (WPA_KEY_MGMT_IEEE8021X | |
| 65 | WPA_KEY_MGMT_FT_IEEE8021X | |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame^] | 66 | WPA_KEY_MGMT_FT_IEEE8021X_SHA384 | |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 67 | WPA_KEY_MGMT_CCKM | |
Dmitry Shmidt | f21452a | 2014-02-26 10:55:25 -0800 | [diff] [blame] | 68 | WPA_KEY_MGMT_OSEN | |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 69 | WPA_KEY_MGMT_IEEE8021X_SHA256 | |
Dmitry Shmidt | 807291d | 2015-01-27 13:40:23 -0800 | [diff] [blame] | 70 | WPA_KEY_MGMT_IEEE8021X_SUITE_B | |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame] | 71 | WPA_KEY_MGMT_IEEE8021X_SUITE_B_192 | |
| 72 | WPA_KEY_MGMT_FILS_SHA256 | |
| 73 | WPA_KEY_MGMT_FILS_SHA384 | |
| 74 | WPA_KEY_MGMT_FT_FILS_SHA256 | |
| 75 | WPA_KEY_MGMT_FT_FILS_SHA384)); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | static inline int wpa_key_mgmt_wpa_psk(int akm) |
| 79 | { |
| 80 | return !!(akm & (WPA_KEY_MGMT_PSK | |
| 81 | WPA_KEY_MGMT_FT_PSK | |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 82 | WPA_KEY_MGMT_PSK_SHA256 | |
Dmitry Shmidt | fb79edc | 2014-01-10 10:45:54 -0800 | [diff] [blame] | 83 | WPA_KEY_MGMT_SAE | |
| 84 | WPA_KEY_MGMT_FT_SAE)); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | static inline int wpa_key_mgmt_ft(int akm) |
| 88 | { |
| 89 | return !!(akm & (WPA_KEY_MGMT_FT_PSK | |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 90 | WPA_KEY_MGMT_FT_IEEE8021X | |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame^] | 91 | WPA_KEY_MGMT_FT_IEEE8021X_SHA384 | |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame] | 92 | WPA_KEY_MGMT_FT_SAE | |
| 93 | WPA_KEY_MGMT_FT_FILS_SHA256 | |
| 94 | WPA_KEY_MGMT_FT_FILS_SHA384)); |
| 95 | } |
| 96 | |
| 97 | static inline int wpa_key_mgmt_ft_psk(int akm) |
| 98 | { |
| 99 | return !!(akm & WPA_KEY_MGMT_FT_PSK); |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 100 | } |
| 101 | |
| 102 | static inline int wpa_key_mgmt_sae(int akm) |
| 103 | { |
| 104 | return !!(akm & (WPA_KEY_MGMT_SAE | |
| 105 | WPA_KEY_MGMT_FT_SAE)); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 106 | } |
| 107 | |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame] | 108 | static inline int wpa_key_mgmt_fils(int akm) |
| 109 | { |
| 110 | return !!(akm & (WPA_KEY_MGMT_FILS_SHA256 | |
| 111 | WPA_KEY_MGMT_FILS_SHA384 | |
| 112 | WPA_KEY_MGMT_FT_FILS_SHA256 | |
| 113 | WPA_KEY_MGMT_FT_FILS_SHA384)); |
| 114 | } |
| 115 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 116 | static inline int wpa_key_mgmt_sha256(int akm) |
| 117 | { |
| 118 | return !!(akm & (WPA_KEY_MGMT_PSK_SHA256 | |
Dmitry Shmidt | f21452a | 2014-02-26 10:55:25 -0800 | [diff] [blame] | 119 | WPA_KEY_MGMT_IEEE8021X_SHA256 | |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame^] | 120 | WPA_KEY_MGMT_SAE | |
| 121 | WPA_KEY_MGMT_FT_SAE | |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 122 | WPA_KEY_MGMT_OSEN | |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame] | 123 | WPA_KEY_MGMT_IEEE8021X_SUITE_B | |
| 124 | WPA_KEY_MGMT_FILS_SHA256 | |
| 125 | WPA_KEY_MGMT_FT_FILS_SHA256)); |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 126 | } |
| 127 | |
Dmitry Shmidt | 807291d | 2015-01-27 13:40:23 -0800 | [diff] [blame] | 128 | static inline int wpa_key_mgmt_sha384(int akm) |
| 129 | { |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame] | 130 | return !!(akm & (WPA_KEY_MGMT_IEEE8021X_SUITE_B_192 | |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame^] | 131 | WPA_KEY_MGMT_FT_IEEE8021X_SHA384 | |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame] | 132 | WPA_KEY_MGMT_FILS_SHA384 | |
| 133 | WPA_KEY_MGMT_FT_FILS_SHA384)); |
Dmitry Shmidt | 807291d | 2015-01-27 13:40:23 -0800 | [diff] [blame] | 134 | } |
| 135 | |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 136 | static inline int wpa_key_mgmt_suite_b(int akm) |
| 137 | { |
Dmitry Shmidt | 807291d | 2015-01-27 13:40:23 -0800 | [diff] [blame] | 138 | return !!(akm & (WPA_KEY_MGMT_IEEE8021X_SUITE_B | |
| 139 | WPA_KEY_MGMT_IEEE8021X_SUITE_B_192)); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 140 | } |
| 141 | |
| 142 | static inline int wpa_key_mgmt_wpa(int akm) |
| 143 | { |
| 144 | return wpa_key_mgmt_wpa_ieee8021x(akm) || |
Dmitry Shmidt | fb79edc | 2014-01-10 10:45:54 -0800 | [diff] [blame] | 145 | wpa_key_mgmt_wpa_psk(akm) || |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame] | 146 | wpa_key_mgmt_fils(akm) || |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 147 | wpa_key_mgmt_sae(akm) || |
| 148 | akm == WPA_KEY_MGMT_OWE || |
| 149 | akm == WPA_KEY_MGMT_DPP; |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 150 | } |
| 151 | |
Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 152 | static inline int wpa_key_mgmt_wpa_any(int akm) |
| 153 | { |
| 154 | return wpa_key_mgmt_wpa(akm) || (akm & WPA_KEY_MGMT_WPA_NONE); |
| 155 | } |
| 156 | |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 157 | static inline int wpa_key_mgmt_cckm(int akm) |
| 158 | { |
| 159 | return akm == WPA_KEY_MGMT_CCKM; |
| 160 | } |
| 161 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 162 | |
| 163 | #define WPA_PROTO_WPA BIT(0) |
| 164 | #define WPA_PROTO_RSN BIT(1) |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 165 | #define WPA_PROTO_WAPI BIT(2) |
Dmitry Shmidt | f21452a | 2014-02-26 10:55:25 -0800 | [diff] [blame] | 166 | #define WPA_PROTO_OSEN BIT(3) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 167 | |
| 168 | #define WPA_AUTH_ALG_OPEN BIT(0) |
| 169 | #define WPA_AUTH_ALG_SHARED BIT(1) |
| 170 | #define WPA_AUTH_ALG_LEAP BIT(2) |
| 171 | #define WPA_AUTH_ALG_FT BIT(3) |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 172 | #define WPA_AUTH_ALG_SAE BIT(4) |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame] | 173 | #define WPA_AUTH_ALG_FILS BIT(5) |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 174 | #define WPA_AUTH_ALG_FILS_SK_PFS BIT(6) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 175 | |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 176 | static inline int wpa_auth_alg_fils(int alg) |
| 177 | { |
| 178 | return !!(alg & (WPA_AUTH_ALG_FILS | WPA_AUTH_ALG_FILS_SK_PFS)); |
| 179 | } |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 180 | |
| 181 | enum wpa_alg { |
| 182 | WPA_ALG_NONE, |
| 183 | WPA_ALG_WEP, |
| 184 | WPA_ALG_TKIP, |
| 185 | WPA_ALG_CCMP, |
| 186 | WPA_ALG_IGTK, |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 187 | WPA_ALG_PMK, |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 188 | WPA_ALG_GCMP, |
| 189 | WPA_ALG_SMS4, |
Dmitry Shmidt | fb79edc | 2014-01-10 10:45:54 -0800 | [diff] [blame] | 190 | WPA_ALG_KRK, |
| 191 | WPA_ALG_GCMP_256, |
| 192 | WPA_ALG_CCMP_256, |
| 193 | WPA_ALG_BIP_GMAC_128, |
| 194 | WPA_ALG_BIP_GMAC_256, |
| 195 | WPA_ALG_BIP_CMAC_256 |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 196 | }; |
| 197 | |
| 198 | /** |
| 199 | * enum wpa_states - wpa_supplicant state |
| 200 | * |
| 201 | * These enumeration values are used to indicate the current wpa_supplicant |
| 202 | * state (wpa_s->wpa_state). The current state can be retrieved with |
| 203 | * wpa_supplicant_get_state() function and the state can be changed by calling |
| 204 | * wpa_supplicant_set_state(). In WPA state machine (wpa.c and preauth.c), the |
| 205 | * wrapper functions wpa_sm_get_state() and wpa_sm_set_state() should be used |
| 206 | * to access the state variable. |
| 207 | */ |
| 208 | enum wpa_states { |
| 209 | /** |
| 210 | * WPA_DISCONNECTED - Disconnected state |
| 211 | * |
| 212 | * This state indicates that client is not associated, but is likely to |
| 213 | * start looking for an access point. This state is entered when a |
| 214 | * connection is lost. |
| 215 | */ |
| 216 | WPA_DISCONNECTED, |
| 217 | |
| 218 | /** |
| 219 | * WPA_INTERFACE_DISABLED - Interface disabled |
| 220 | * |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 221 | * This state is entered if the network interface is disabled, e.g., |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 222 | * due to rfkill. wpa_supplicant refuses any new operations that would |
| 223 | * use the radio until the interface has been enabled. |
| 224 | */ |
| 225 | WPA_INTERFACE_DISABLED, |
| 226 | |
| 227 | /** |
| 228 | * WPA_INACTIVE - Inactive state (wpa_supplicant disabled) |
| 229 | * |
| 230 | * This state is entered if there are no enabled networks in the |
| 231 | * configuration. wpa_supplicant is not trying to associate with a new |
| 232 | * network and external interaction (e.g., ctrl_iface call to add or |
| 233 | * enable a network) is needed to start association. |
| 234 | */ |
| 235 | WPA_INACTIVE, |
| 236 | |
| 237 | /** |
| 238 | * WPA_SCANNING - Scanning for a network |
| 239 | * |
| 240 | * This state is entered when wpa_supplicant starts scanning for a |
| 241 | * network. |
| 242 | */ |
| 243 | WPA_SCANNING, |
| 244 | |
| 245 | /** |
| 246 | * WPA_AUTHENTICATING - Trying to authenticate with a BSS/SSID |
| 247 | * |
| 248 | * This state is entered when wpa_supplicant has found a suitable BSS |
| 249 | * to authenticate with and the driver is configured to try to |
| 250 | * authenticate with this BSS. This state is used only with drivers |
| 251 | * that use wpa_supplicant as the SME. |
| 252 | */ |
| 253 | WPA_AUTHENTICATING, |
| 254 | |
| 255 | /** |
| 256 | * WPA_ASSOCIATING - Trying to associate with a BSS/SSID |
| 257 | * |
| 258 | * This state is entered when wpa_supplicant has found a suitable BSS |
| 259 | * to associate with and the driver is configured to try to associate |
| 260 | * with this BSS in ap_scan=1 mode. When using ap_scan=2 mode, this |
| 261 | * state is entered when the driver is configured to try to associate |
| 262 | * with a network using the configured SSID and security policy. |
| 263 | */ |
| 264 | WPA_ASSOCIATING, |
| 265 | |
| 266 | /** |
| 267 | * WPA_ASSOCIATED - Association completed |
| 268 | * |
| 269 | * This state is entered when the driver reports that association has |
| 270 | * been successfully completed with an AP. If IEEE 802.1X is used |
| 271 | * (with or without WPA/WPA2), wpa_supplicant remains in this state |
| 272 | * until the IEEE 802.1X/EAPOL authentication has been completed. |
| 273 | */ |
| 274 | WPA_ASSOCIATED, |
| 275 | |
| 276 | /** |
| 277 | * WPA_4WAY_HANDSHAKE - WPA 4-Way Key Handshake in progress |
| 278 | * |
| 279 | * This state is entered when WPA/WPA2 4-Way Handshake is started. In |
| 280 | * case of WPA-PSK, this happens when receiving the first EAPOL-Key |
| 281 | * frame after association. In case of WPA-EAP, this state is entered |
| 282 | * when the IEEE 802.1X/EAPOL authentication has been completed. |
| 283 | */ |
| 284 | WPA_4WAY_HANDSHAKE, |
| 285 | |
| 286 | /** |
| 287 | * WPA_GROUP_HANDSHAKE - WPA Group Key Handshake in progress |
| 288 | * |
| 289 | * This state is entered when 4-Way Key Handshake has been completed |
| 290 | * (i.e., when the supplicant sends out message 4/4) and when Group |
| 291 | * Key rekeying is started by the AP (i.e., when supplicant receives |
| 292 | * message 1/2). |
| 293 | */ |
| 294 | WPA_GROUP_HANDSHAKE, |
| 295 | |
| 296 | /** |
| 297 | * WPA_COMPLETED - All authentication completed |
| 298 | * |
| 299 | * This state is entered when the full authentication process is |
| 300 | * completed. In case of WPA2, this happens when the 4-Way Handshake is |
| 301 | * successfully completed. With WPA, this state is entered after the |
| 302 | * Group Key Handshake; with IEEE 802.1X (non-WPA) connection is |
| 303 | * completed after dynamic keys are received (or if not used, after |
| 304 | * the EAP authentication has been completed). With static WEP keys and |
| 305 | * plaintext connections, this state is entered when an association |
| 306 | * has been completed. |
| 307 | * |
| 308 | * This state indicates that the supplicant has completed its |
| 309 | * processing for the association phase and that data connection is |
| 310 | * fully configured. |
| 311 | */ |
| 312 | WPA_COMPLETED |
| 313 | }; |
| 314 | |
| 315 | #define MLME_SETPROTECTION_PROTECT_TYPE_NONE 0 |
| 316 | #define MLME_SETPROTECTION_PROTECT_TYPE_RX 1 |
| 317 | #define MLME_SETPROTECTION_PROTECT_TYPE_TX 2 |
| 318 | #define MLME_SETPROTECTION_PROTECT_TYPE_RX_TX 3 |
| 319 | |
| 320 | #define MLME_SETPROTECTION_KEY_TYPE_GROUP 0 |
| 321 | #define MLME_SETPROTECTION_KEY_TYPE_PAIRWISE 1 |
| 322 | |
| 323 | |
| 324 | /** |
| 325 | * enum mfp_options - Management frame protection (IEEE 802.11w) options |
| 326 | */ |
| 327 | enum mfp_options { |
| 328 | NO_MGMT_FRAME_PROTECTION = 0, |
| 329 | MGMT_FRAME_PROTECTION_OPTIONAL = 1, |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 330 | MGMT_FRAME_PROTECTION_REQUIRED = 2, |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 331 | }; |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 332 | #define MGMT_FRAME_PROTECTION_DEFAULT 3 |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 333 | |
| 334 | /** |
| 335 | * enum hostapd_hw_mode - Hardware mode |
| 336 | */ |
| 337 | enum hostapd_hw_mode { |
| 338 | HOSTAPD_MODE_IEEE80211B, |
| 339 | HOSTAPD_MODE_IEEE80211G, |
| 340 | HOSTAPD_MODE_IEEE80211A, |
Dmitry Shmidt | a54fa5f | 2013-01-15 13:53:35 -0800 | [diff] [blame] | 341 | HOSTAPD_MODE_IEEE80211AD, |
Dmitry Shmidt | b1e5210 | 2015-05-29 12:36:29 -0700 | [diff] [blame] | 342 | HOSTAPD_MODE_IEEE80211ANY, |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 343 | NUM_HOSTAPD_MODES |
| 344 | }; |
| 345 | |
Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 346 | /** |
| 347 | * enum wpa_ctrl_req_type - Control interface request types |
| 348 | */ |
| 349 | enum wpa_ctrl_req_type { |
| 350 | WPA_CTRL_REQ_UNKNOWN, |
| 351 | WPA_CTRL_REQ_EAP_IDENTITY, |
| 352 | WPA_CTRL_REQ_EAP_PASSWORD, |
| 353 | WPA_CTRL_REQ_EAP_NEW_PASSWORD, |
| 354 | WPA_CTRL_REQ_EAP_PIN, |
| 355 | WPA_CTRL_REQ_EAP_OTP, |
| 356 | WPA_CTRL_REQ_EAP_PASSPHRASE, |
Dmitry Shmidt | 051af73 | 2013-10-22 13:52:46 -0700 | [diff] [blame] | 357 | WPA_CTRL_REQ_SIM, |
Dmitry Shmidt | 912c6ec | 2015-03-30 13:16:51 -0700 | [diff] [blame] | 358 | WPA_CTRL_REQ_PSK_PASSPHRASE, |
Dmitry Shmidt | 55840ad | 2015-12-14 12:45:46 -0800 | [diff] [blame] | 359 | WPA_CTRL_REQ_EXT_CERT_CHECK, |
Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 360 | NUM_WPA_CTRL_REQS |
| 361 | }; |
| 362 | |
| 363 | /* Maximum number of EAP methods to store for EAP server user information */ |
| 364 | #define EAP_MAX_METHODS 8 |
| 365 | |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 366 | enum mesh_plink_state { |
Dmitry Shmidt | 58d12ad | 2016-07-28 10:07:03 -0700 | [diff] [blame] | 367 | PLINK_IDLE = 1, |
| 368 | PLINK_OPN_SNT, |
| 369 | PLINK_OPN_RCVD, |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 370 | PLINK_CNF_RCVD, |
| 371 | PLINK_ESTAB, |
| 372 | PLINK_HOLDING, |
Dmitry Shmidt | 58d12ad | 2016-07-28 10:07:03 -0700 | [diff] [blame] | 373 | PLINK_BLOCKED, /* not defined in the IEEE 802.11 standard */ |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 374 | }; |
| 375 | |
Ravi Joshi | e6ccb16 | 2015-07-16 17:45:41 -0700 | [diff] [blame] | 376 | enum set_band { |
| 377 | WPA_SETBAND_AUTO, |
| 378 | WPA_SETBAND_5G, |
| 379 | WPA_SETBAND_2G |
| 380 | }; |
| 381 | |
Dmitry Shmidt | 9c17526 | 2016-03-03 10:20:07 -0800 | [diff] [blame] | 382 | enum wpa_radio_work_band { |
| 383 | BAND_2_4_GHZ = BIT(0), |
| 384 | BAND_5_GHZ = BIT(1), |
| 385 | BAND_60_GHZ = BIT(2), |
| 386 | }; |
| 387 | |
Dmitry Shmidt | abb90a3 | 2016-12-05 15:34:39 -0800 | [diff] [blame] | 388 | enum beacon_rate_type { |
| 389 | BEACON_RATE_LEGACY, |
| 390 | BEACON_RATE_HT, |
| 391 | BEACON_RATE_VHT |
| 392 | }; |
| 393 | |
Dmitry Shmidt | 2933359 | 2017-01-09 12:27:11 -0800 | [diff] [blame] | 394 | enum eap_proxy_sim_state { |
| 395 | SIM_STATE_ERROR, |
| 396 | }; |
| 397 | |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 398 | #define OCE_STA BIT(0) |
| 399 | #define OCE_STA_CFON BIT(1) |
| 400 | #define OCE_AP BIT(2) |
| 401 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 402 | #endif /* DEFS_H */ |