blob: ecf258cddd4326256f6b489a6c0877576d37d860 [file] [log] [blame]
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001/*
2 * WPA Supplicant / Network configuration structures
Dmitry Shmidt391c59f2013-09-03 12:16:28 -07003 * Copyright (c) 2003-2013, 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 CONFIG_SSID_H
10#define CONFIG_SSID_H
11
12#include "common/defs.h"
Dmitry Shmidt391c59f2013-09-03 12:16:28 -070013#include "utils/list.h"
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070014#include "eap_peer/eap_config.h"
15
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070016#define DEFAULT_EAP_WORKAROUND ((unsigned int) -1)
17#define DEFAULT_EAPOL_FLAGS (EAPOL_FLAG_REQUIRE_KEY_UNICAST | \
18 EAPOL_FLAG_REQUIRE_KEY_BROADCAST)
19#define DEFAULT_PROTO (WPA_PROTO_WPA | WPA_PROTO_RSN)
20#define DEFAULT_KEY_MGMT (WPA_KEY_MGMT_PSK | WPA_KEY_MGMT_IEEE8021X)
Hai Shalomb755a2a2020-04-23 21:49:02 -070021#ifdef CONFIG_NO_TKIP
22#define DEFAULT_PAIRWISE (WPA_CIPHER_CCMP)
23#define DEFAULT_GROUP (WPA_CIPHER_CCMP)
24#else /* CONFIG_NO_TKIP */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070025#define DEFAULT_PAIRWISE (WPA_CIPHER_CCMP | WPA_CIPHER_TKIP)
Dmitry Shmidt41712582015-06-29 11:02:15 -070026#define DEFAULT_GROUP (WPA_CIPHER_CCMP | WPA_CIPHER_TKIP)
Hai Shalomb755a2a2020-04-23 21:49:02 -070027#endif /* CONFIG_NO_TKIP */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070028#define DEFAULT_FRAGMENT_SIZE 1398
29
Dmitry Shmidt04949592012-07-19 12:16:46 -070030#define DEFAULT_BG_SCAN_PERIOD -1
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -080031#define DEFAULT_MESH_MAX_RETRIES 2
32#define DEFAULT_MESH_RETRY_TIMEOUT 40
33#define DEFAULT_MESH_CONFIRM_TIMEOUT 40
34#define DEFAULT_MESH_HOLDING_TIMEOUT 40
Dmitry Shmidtd2986c22017-10-23 14:22:09 -070035#define DEFAULT_MESH_RSSI_THRESHOLD 1 /* no change */
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -080036#define DEFAULT_DISABLE_HT 0
37#define DEFAULT_DISABLE_HT40 0
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -080038#define DEFAULT_DISABLE_SGI 0
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -070039#define DEFAULT_DISABLE_LDPC 0
Hai Shalom74f70d42019-02-11 14:42:39 -080040#define DEFAULT_TX_STBC -1 /* no change */
41#define DEFAULT_RX_STBC -1 /* no change */
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -080042#define DEFAULT_DISABLE_MAX_AMSDU -1 /* no change */
43#define DEFAULT_AMPDU_FACTOR -1 /* no change */
44#define DEFAULT_AMPDU_DENSITY -1 /* no change */
Dmitry Shmidtf9bdef92014-04-25 10:46:36 -070045#define DEFAULT_USER_SELECTED_SIM 1
Hai Shalom74f70d42019-02-11 14:42:39 -080046#define DEFAULT_MAX_OPER_CHWIDTH -1
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -080047
Dmitry Shmidt391c59f2013-09-03 12:16:28 -070048struct psk_list_entry {
49 struct dl_list list;
50 u8 addr[ETH_ALEN];
51 u8 psk[32];
52 u8 p2p;
53};
54
Hai Shalom81f62d82019-07-22 12:10:00 -070055enum wpas_mode {
56 WPAS_MODE_INFRA = 0,
57 WPAS_MODE_IBSS = 1,
58 WPAS_MODE_AP = 2,
59 WPAS_MODE_P2P_GO = 3,
60 WPAS_MODE_P2P_GROUP_FORMATION = 4,
61 WPAS_MODE_MESH = 5,
62};
63
Hai Shalom899fcc72020-10-19 14:38:18 -070064enum sae_pk_mode {
65 SAE_PK_MODE_AUTOMATIC = 0,
66 SAE_PK_MODE_ONLY = 1,
67 SAE_PK_MODE_DISABLED = 2,
68};
69
Hai Shalom81f62d82019-07-22 12:10:00 -070070/**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070071 * struct wpa_ssid - Network configuration data
72 *
73 * This structure includes all the configuration variables for a network. This
74 * data is included in the per-interface configuration data as an element of
75 * the network list, struct wpa_config::ssid. Each network block in the
76 * configuration is mapped to a struct wpa_ssid instance.
77 */
78struct wpa_ssid {
79 /**
80 * next - Next network in global list
81 *
82 * This pointer can be used to iterate over all networks. The head of
83 * this list is stored in the ssid field of struct wpa_config.
84 */
85 struct wpa_ssid *next;
86
87 /**
88 * pnext - Next network in per-priority list
89 *
90 * This pointer can be used to iterate over all networks in the same
91 * priority class. The heads of these list are stored in the pssid
92 * fields of struct wpa_config.
93 */
94 struct wpa_ssid *pnext;
95
96 /**
97 * id - Unique id for the network
98 *
99 * This identifier is used as a unique identifier for each network
100 * block when using the control interface. Each network is allocated an
101 * id when it is being created, either when reading the configuration
102 * file or when a new network is added through the control interface.
103 */
104 int id;
105
106 /**
107 * priority - Priority group
108 *
109 * By default, all networks will get same priority group (0). If some
110 * of the networks are more desirable, this field can be used to change
111 * the order in which wpa_supplicant goes through the networks when
112 * selecting a BSS. The priority groups will be iterated in decreasing
113 * priority (i.e., the larger the priority value, the sooner the
114 * network is matched against the scan results). Within each priority
115 * group, networks will be selected based on security policy, signal
116 * strength, etc.
117 *
118 * Please note that AP scanning with scan_ssid=1 and ap_scan=2 mode are
119 * not using this priority to select the order for scanning. Instead,
120 * they try the networks in the order that used in the configuration
121 * file.
122 */
123 int priority;
124
125 /**
126 * ssid - Service set identifier (network name)
127 *
128 * This is the SSID for the network. For wireless interfaces, this is
129 * used to select which network will be used. If set to %NULL (or
130 * ssid_len=0), any SSID can be used. For wired interfaces, this must
131 * be set to %NULL. Note: SSID may contain any characters, even nul
132 * (ASCII 0) and as such, this should not be assumed to be a nul
133 * terminated string. ssid_len defines how many characters are valid
134 * and the ssid field is not guaranteed to be nul terminated.
135 */
136 u8 *ssid;
137
138 /**
139 * ssid_len - Length of the SSID
140 */
141 size_t ssid_len;
142
143 /**
144 * bssid - BSSID
145 *
146 * If set, this network block is used only when associating with the AP
147 * using the configured BSSID
148 *
149 * If this is a persistent P2P group (disabled == 2), this is the GO
150 * Device Address.
151 */
152 u8 bssid[ETH_ALEN];
153
154 /**
Dmitry Shmidtff787d52015-01-12 13:01:47 -0800155 * bssid_blacklist - List of inacceptable BSSIDs
156 */
157 u8 *bssid_blacklist;
158 size_t num_bssid_blacklist;
159
160 /**
161 * bssid_blacklist - List of acceptable BSSIDs
162 */
163 u8 *bssid_whitelist;
164 size_t num_bssid_whitelist;
165
166 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700167 * bssid_set - Whether BSSID is configured for this network
168 */
169 int bssid_set;
170
171 /**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700172 * bssid_hint - BSSID hint
173 *
174 * If set, this is configured to the driver as a preferred initial BSSID
175 * while connecting to this network.
176 */
177 u8 bssid_hint[ETH_ALEN];
178
179 /**
180 * bssid_hint_set - Whether BSSID hint is configured for this network
181 */
182 int bssid_hint_set;
183
184 /**
Dmitry Shmidt54605472013-11-08 11:10:19 -0800185 * go_p2p_dev_addr - GO's P2P Device Address or all zeros if not set
186 */
187 u8 go_p2p_dev_addr[ETH_ALEN];
188
189 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700190 * psk - WPA pre-shared key (256 bits)
191 */
192 u8 psk[32];
193
194 /**
195 * psk_set - Whether PSK field is configured
196 */
197 int psk_set;
198
199 /**
200 * passphrase - WPA ASCII passphrase
201 *
202 * If this is set, psk will be generated using the SSID and passphrase
203 * configured for the network. ASCII passphrase must be between 8 and
204 * 63 characters (inclusive).
205 */
206 char *passphrase;
207
208 /**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700209 * sae_password - SAE password
210 *
211 * This parameter can be used to set a password for SAE. By default, the
212 * passphrase value is used if this separate parameter is not used, but
213 * passphrase follows the WPA-PSK constraints (8..63 characters) even
214 * though SAE passwords do not have such constraints.
215 */
216 char *sae_password;
217
218 /**
Roshan Pius3a1667e2018-07-03 15:17:14 -0700219 * sae_password_id - SAE password identifier
220 *
221 * This parameter can be used to identify a specific SAE password. If
222 * not included, the default SAE password is used instead.
223 */
224 char *sae_password_id;
225
Hai Shalomc3565922019-10-28 11:58:20 -0700226 struct sae_pt *pt;
227
Roshan Pius3a1667e2018-07-03 15:17:14 -0700228 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -0700229 * ext_psk - PSK/passphrase name in external storage
230 *
231 * If this is set, PSK/passphrase will be fetched from external storage
232 * when requesting association with the network.
233 */
234 char *ext_psk;
235
236 /**
Dmitry Shmidt912c6ec2015-03-30 13:16:51 -0700237 * mem_only_psk - Whether to keep PSK/passphrase only in memory
238 *
239 * 0 = allow psk/passphrase to be stored to the configuration file
240 * 1 = do not store psk/passphrase to the configuration file
241 */
242 int mem_only_psk;
243
244 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700245 * pairwise_cipher - Bitfield of allowed pairwise ciphers, WPA_CIPHER_*
246 */
247 int pairwise_cipher;
248
249 /**
250 * group_cipher - Bitfield of allowed group ciphers, WPA_CIPHER_*
251 */
252 int group_cipher;
253
254 /**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700255 * group_mgmt_cipher - Bitfield of allowed group management ciphers
256 *
257 * This is a bitfield of WPA_CIPHER_AES_128_CMAC and WPA_CIPHER_BIP_*
258 * values. If 0, no constraint is used for the cipher, i.e., whatever
259 * the AP uses is accepted.
260 */
261 int group_mgmt_cipher;
262
263 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700264 * key_mgmt - Bitfield of allowed key management protocols
265 *
266 * WPA_KEY_MGMT_*
267 */
268 int key_mgmt;
269
270 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -0700271 * bg_scan_period - Background scan period in seconds, 0 to disable, or
272 * -1 to indicate no change to default driver configuration
273 */
274 int bg_scan_period;
275
276 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700277 * proto - Bitfield of allowed protocols, WPA_PROTO_*
278 */
279 int proto;
280
281 /**
282 * auth_alg - Bitfield of allowed authentication algorithms
283 *
284 * WPA_AUTH_ALG_*
285 */
286 int auth_alg;
287
288 /**
289 * scan_ssid - Scan this SSID with Probe Requests
290 *
291 * scan_ssid can be used to scan for APs using hidden SSIDs.
292 * Note: Many drivers do not support this. ap_mode=2 can be used with
Dmitry Shmidtd80a4012015-11-05 16:35:40 -0800293 * such drivers to use hidden SSIDs. Note2: Most nl80211-based drivers
294 * do support scan_ssid=1 and that should be used with them instead of
295 * ap_scan=2.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700296 */
297 int scan_ssid;
298
299#ifdef IEEE8021X_EAPOL
300#define EAPOL_FLAG_REQUIRE_KEY_UNICAST BIT(0)
301#define EAPOL_FLAG_REQUIRE_KEY_BROADCAST BIT(1)
302 /**
303 * eapol_flags - Bit field of IEEE 802.1X/EAPOL options (EAPOL_FLAG_*)
304 */
305 int eapol_flags;
306
307 /**
308 * eap - EAP peer configuration for this network
309 */
310 struct eap_peer_config eap;
311#endif /* IEEE8021X_EAPOL */
312
Hai Shalomfdcde762020-04-02 11:19:20 -0700313#ifdef CONFIG_WEP
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700314#define NUM_WEP_KEYS 4
315#define MAX_WEP_KEY_LEN 16
316 /**
317 * wep_key - WEP keys
318 */
319 u8 wep_key[NUM_WEP_KEYS][MAX_WEP_KEY_LEN];
320
321 /**
322 * wep_key_len - WEP key lengths
323 */
324 size_t wep_key_len[NUM_WEP_KEYS];
325
326 /**
327 * wep_tx_keyidx - Default key index for TX frames using WEP
328 */
329 int wep_tx_keyidx;
Hai Shalomfdcde762020-04-02 11:19:20 -0700330#endif /* CONFIG_WEP */
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700331
332 /**
333 * proactive_key_caching - Enable proactive key caching
334 *
335 * This field can be used to enable proactive key caching which is also
336 * known as opportunistic PMKSA caching for WPA2. This is disabled (0)
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800337 * by default unless default value is changed with the global okc=1
338 * parameter. Enable by setting this to 1.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700339 *
340 * Proactive key caching is used to make supplicant assume that the APs
341 * are using the same PMK and generate PMKSA cache entries without
342 * doing RSN pre-authentication. This requires support from the AP side
343 * and is normally used with wireless switches that co-locate the
344 * authenticator.
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800345 *
346 * Internally, special value -1 is used to indicate that the parameter
347 * was not specified in the configuration (i.e., default behavior is
348 * followed).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700349 */
350 int proactive_key_caching;
351
352 /**
353 * mixed_cell - Whether mixed cells are allowed
354 *
355 * This option can be used to configure whether so called mixed cells,
356 * i.e., networks that use both plaintext and encryption in the same
357 * SSID, are allowed. This is disabled (0) by default. Enable by
358 * setting this to 1.
359 */
360 int mixed_cell;
361
362#ifdef IEEE8021X_EAPOL
363
364 /**
365 * leap - Number of EAP methods using LEAP
366 *
367 * This field should be set to 1 if LEAP is enabled. This is used to
368 * select IEEE 802.11 authentication algorithm.
369 */
370 int leap;
371
372 /**
373 * non_leap - Number of EAP methods not using LEAP
374 *
375 * This field should be set to >0 if any EAP method other than LEAP is
376 * enabled. This is used to select IEEE 802.11 authentication
377 * algorithm.
378 */
379 int non_leap;
380
381 /**
382 * eap_workaround - EAP workarounds enabled
383 *
384 * wpa_supplicant supports number of "EAP workarounds" to work around
385 * interoperability issues with incorrectly behaving authentication
386 * servers. This is recommended to be enabled by default because some
387 * of the issues are present in large number of authentication servers.
388 *
389 * Strict EAP conformance mode can be configured by disabling
390 * workarounds with eap_workaround = 0.
391 */
392 unsigned int eap_workaround;
393
394#endif /* IEEE8021X_EAPOL */
395
396 /**
397 * mode - IEEE 802.11 operation mode (Infrastucture/IBSS)
398 *
399 * 0 = infrastructure (Managed) mode, i.e., associate with an AP.
400 *
401 * 1 = IBSS (ad-hoc, peer-to-peer)
402 *
403 * 2 = AP (access point)
404 *
405 * 3 = P2P Group Owner (can be set in the configuration file)
406 *
407 * 4 = P2P Group Formation (used internally; not in configuration
408 * files)
409 *
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800410 * 5 = Mesh
411 *
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800412 * Note: IBSS can only be used with key_mgmt NONE (plaintext and static
413 * WEP) and WPA-PSK (with proto=RSN). In addition, key_mgmt=WPA-NONE
414 * (fixed group key TKIP/CCMP) is available for backwards compatibility,
415 * but its use is deprecated. WPA-None requires following network block
416 * options: proto=WPA, key_mgmt=WPA-NONE, pairwise=NONE, group=TKIP (or
417 * CCMP, but not both), and psk must also be set (either directly or
418 * using ASCII passphrase).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700419 */
Hai Shalom81f62d82019-07-22 12:10:00 -0700420 enum wpas_mode mode;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700421
422 /**
Dmitry Shmidt57c2d392016-02-23 13:40:19 -0800423 * pbss - Whether to use PBSS. Relevant to DMG networks only.
Dmitry Shmidt849734c2016-05-27 09:59:01 -0700424 * 0 = do not use PBSS
425 * 1 = use PBSS
426 * 2 = don't care (not allowed in AP mode)
Dmitry Shmidt57c2d392016-02-23 13:40:19 -0800427 * Used together with mode configuration. When mode is AP, it
428 * means to start a PCP instead of a regular AP. When mode is INFRA it
Dmitry Shmidt849734c2016-05-27 09:59:01 -0700429 * means connect to a PCP instead of AP. In this mode you can also
430 * specify 2 (don't care) meaning connect to either AP or PCP.
431 * P2P_GO and P2P_GROUP_FORMATION modes must use PBSS in DMG network.
Dmitry Shmidt57c2d392016-02-23 13:40:19 -0800432 */
433 int pbss;
434
435 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700436 * disabled - Whether this network is currently disabled
437 *
438 * 0 = this network can be used (default).
439 * 1 = this network block is disabled (can be enabled through
440 * ctrl_iface, e.g., with wpa_cli or wpa_gui).
441 * 2 = this network block includes parameters for a persistent P2P
442 * group (can be used with P2P ctrl_iface commands)
443 */
444 int disabled;
445
446 /**
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800447 * disabled_for_connect - Whether this network was temporarily disabled
448 *
449 * This flag is used to reenable all the temporarily disabled networks
450 * after either the success or failure of a WPS connection.
451 */
452 int disabled_for_connect;
453
454 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700455 * id_str - Network identifier string for external scripts
456 *
457 * This value is passed to external ctrl_iface monitors in
458 * WPA_EVENT_CONNECTED event and wpa_cli sets this as WPA_ID_STR
459 * environment variable for action scripts.
460 */
461 char *id_str;
462
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700463 /**
464 * ieee80211w - Whether management frame protection is enabled
465 *
466 * This value is used to configure policy for management frame
467 * protection (IEEE 802.11w). 0 = disabled, 1 = optional, 2 = required.
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800468 * This is disabled by default unless the default value has been changed
469 * with the global pmf=1/2 parameter.
470 *
471 * Internally, special value 3 is used to indicate that the parameter
472 * was not specified in the configuration (i.e., default behavior is
473 * followed).
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700474 */
475 enum mfp_options ieee80211w;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700476
Hai Shalom74f70d42019-02-11 14:42:39 -0800477#ifdef CONFIG_OCV
478 /**
479 * ocv - Enable/disable operating channel validation
480 *
481 * If this parameter is set to 1, stations will exchange OCI element
482 * to cryptographically verify the operating channel. Setting this
483 * parameter to 0 disables this option. Default value: 0.
484 */
485 int ocv;
486#endif /* CONFIG_OCV */
487
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700488 /**
489 * frequency - Channel frequency in megahertz (MHz) for IBSS
490 *
491 * This value is used to configure the initial channel for IBSS (adhoc)
492 * networks, e.g., 2412 = IEEE 802.11b/g channel 1. It is ignored in
493 * the infrastructure mode. In addition, this value is only used by the
494 * station that creates the IBSS. If an IBSS network with the
495 * configured SSID is already present, the frequency of the network
496 * will be used instead of this configured value.
497 */
498 int frequency;
499
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800500 /**
Hai Shalomc3565922019-10-28 11:58:20 -0700501 * enable_edmg - Enable EDMG feature in STA/AP mode
502 *
503 * This flag is used for enabling the EDMG capability in STA/AP mode.
504 */
505 int enable_edmg;
506
507 /**
508 * edmg_channel - EDMG channel number
509 *
510 * This value is used to configure the EDMG channel bonding feature.
511 * In AP mode it defines the EDMG channel to start the AP on.
512 * in STA mode it defines the EDMG channel to use for connection
513 * (if supported by AP).
514 */
515 u8 edmg_channel;
516
517 /**
Dmitry Shmidt7f656022015-02-25 14:36:37 -0800518 * fixed_freq - Use fixed frequency for IBSS
519 */
520 int fixed_freq;
521
Dmitry Shmidt014a3ff2015-12-28 13:27:49 -0800522#ifdef CONFIG_ACS
523 /**
524 * ACS - Automatic Channel Selection for AP mode
525 *
526 * If present, it will be handled together with frequency.
527 * frequency will be used to determine hardware mode only, when it is
528 * used for both hardware mode and channel when used alone. This will
529 * force the channel to be set to 0, thus enabling ACS.
530 */
531 int acs;
532#endif /* CONFIG_ACS */
533
Dmitry Shmidt7f656022015-02-25 14:36:37 -0800534 /**
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800535 * mesh_basic_rates - BSS Basic rate set for mesh network
536 *
537 */
538 int *mesh_basic_rates;
539
540 /**
541 * Mesh network plink parameters
542 */
543 int dot11MeshMaxRetries;
544 int dot11MeshRetryTimeout; /* msec */
545 int dot11MeshConfirmTimeout; /* msec */
546 int dot11MeshHoldingTimeout; /* msec */
547
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700548 int ht;
Dmitry Shmidt61d9df32012-08-29 16:22:06 -0700549 int ht40;
550
Dmitry Shmidt68d0e3e2013-10-28 17:59:21 -0700551 int vht;
552
Hai Shalom74f70d42019-02-11 14:42:39 -0800553 int he;
554
Roshan Pius3a1667e2018-07-03 15:17:14 -0700555 int max_oper_chwidth;
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -0800556
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700557 unsigned int vht_center_freq1;
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -0800558 unsigned int vht_center_freq2;
559
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700560 /**
561 * wpa_ptk_rekey - Maximum lifetime for PTK in seconds
562 *
563 * This value can be used to enforce rekeying of PTK to mitigate some
564 * attacks against TKIP deficiencies.
565 */
566 int wpa_ptk_rekey;
567
Hai Shalomfdcde762020-04-02 11:19:20 -0700568 /** wpa_deny_ptk0_rekey - Control PTK0 rekeying
569 *
570 * Rekeying a pairwise key using only keyid 0 (PTK0 rekey) has many
571 * broken implementations and should be avoided when using or
572 * interacting with one.
573 *
574 * 0 = always rekey when configured/instructed
575 * 1 = only rekey when the local driver is explicitly indicating it can
576 * perform this operation without issues
577 * 2 = never allow PTK0 rekeys
578 */
579 enum ptk0_rekey_handling wpa_deny_ptk0_rekey;
580
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700581 /**
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -0700582 * group_rekey - Group rekeying time in seconds
583 *
584 * This value, if non-zero, is used as the dot11RSNAConfigGroupRekeyTime
585 * parameter when operating in Authenticator role in IBSS.
586 */
587 int group_rekey;
588
589 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700590 * scan_freq - Array of frequencies to scan or %NULL for all
591 *
592 * This is an optional zero-terminated array of frequencies in
593 * megahertz (MHz) to include in scan requests when searching for this
594 * network. This can be used to speed up scanning when the network is
595 * known to not use all possible channels.
596 */
597 int *scan_freq;
598
599 /**
600 * bgscan - Background scan and roaming parameters or %NULL if none
601 *
602 * This is an optional set of parameters for background scanning and
603 * roaming within a network (ESS) in following format:
604 * <bgscan module name>:<module parameters>
605 */
606 char *bgscan;
607
608 /**
Dmitry Shmidt04949592012-07-19 12:16:46 -0700609 * ignore_broadcast_ssid - Hide SSID in AP mode
610 *
611 * Send empty SSID in beacons and ignore probe request frames that do
612 * not specify full SSID, i.e., require stations to know SSID.
613 * default: disabled (0)
614 * 1 = send empty (length=0) SSID in beacon and ignore probe request
615 * for broadcast SSID
616 * 2 = clear SSID (ASCII 0), but keep the original length (this may be
617 * required with some clients that do not support empty SSID) and
618 * ignore probe requests for broadcast SSID
619 */
620 int ignore_broadcast_ssid;
621
622 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700623 * freq_list - Array of allowed frequencies or %NULL for all
624 *
625 * This is an optional zero-terminated array of frequencies in
626 * megahertz (MHz) to allow for selecting the BSS. If set, scan results
627 * that do not match any of the specified frequencies are not
628 * considered when selecting a BSS.
629 */
630 int *freq_list;
631
632 /**
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800633 * p2p_client_list - List of P2P Clients in a persistent group (GO)
634 *
635 * This is a list of P2P Clients (P2P Device Address) that have joined
636 * the persistent group. This is maintained on the GO for persistent
637 * group entries (disabled == 2).
638 */
639 u8 *p2p_client_list;
640
641 /**
642 * num_p2p_clients - Number of entries in p2p_client_list
643 */
644 size_t num_p2p_clients;
645
Dmitry Shmidt61d9df32012-08-29 16:22:06 -0700646#ifndef P2P_MAX_STORED_CLIENTS
647#define P2P_MAX_STORED_CLIENTS 100
648#endif /* P2P_MAX_STORED_CLIENTS */
649
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -0800650 /**
Dmitry Shmidt391c59f2013-09-03 12:16:28 -0700651 * psk_list - Per-client PSKs (struct psk_list_entry)
652 */
653 struct dl_list psk_list;
654
655 /**
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -0700656 * p2p_group - Network generated as a P2P group (used internally)
657 */
658 int p2p_group;
659
660 /**
661 * p2p_persistent_group - Whether this is a persistent group
662 */
663 int p2p_persistent_group;
664
665 /**
666 * temporary - Whether this network is temporary and not to be saved
667 */
668 int temporary;
669
670 /**
671 * export_keys - Whether keys may be exported
672 *
673 * This attribute will be set when keys are determined through
674 * WPS or similar so that they may be exported.
675 */
676 int export_keys;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -0800677
678#ifdef CONFIG_HT_OVERRIDES
679 /**
680 * disable_ht - Disable HT (IEEE 802.11n) for this network
681 *
682 * By default, use it if it is available, but this can be configured
683 * to 1 to have it disabled.
684 */
685 int disable_ht;
686
687 /**
688 * disable_ht40 - Disable HT40 for this network
689 *
690 * By default, use it if it is available, but this can be configured
691 * to 1 to have it disabled.
692 */
693 int disable_ht40;
694
695 /**
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -0800696 * disable_sgi - Disable SGI (Short Guard Interval) for this network
697 *
698 * By default, use it if it is available, but this can be configured
699 * to 1 to have it disabled.
700 */
701 int disable_sgi;
702
703 /**
Dmitry Shmidtdf5a7e42014-04-02 12:59:59 -0700704 * disable_ldpc - Disable LDPC for this network
705 *
706 * By default, use it if it is available, but this can be configured
707 * to 1 to have it disabled.
708 */
709 int disable_ldpc;
710
711 /**
Dmitry Shmidt61593f02014-04-21 16:27:35 -0700712 * ht40_intolerant - Indicate 40 MHz intolerant for this network
713 */
714 int ht40_intolerant;
715
716 /**
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -0800717 * disable_max_amsdu - Disable MAX A-MSDU
718 *
719 * A-MDSU will be 3839 bytes when disabled, or 7935
720 * when enabled (assuming it is otherwise supported)
721 * -1 (default) means do not apply any settings to the kernel.
722 */
723 int disable_max_amsdu;
724
725 /**
726 * ampdu_factor - Maximum A-MPDU Length Exponent
727 *
728 * Value: 0-3, see 7.3.2.56.3 in IEEE Std 802.11n-2009.
729 */
730 int ampdu_factor;
731
732 /**
733 * ampdu_density - Minimum A-MPDU Start Spacing
734 *
735 * Value: 0-7, see 7.3.2.56.3 in IEEE Std 802.11n-2009.
736 */
737 int ampdu_density;
738
739 /**
740 * ht_mcs - Allowed HT-MCS rates, in ASCII hex: ffff0000...
741 *
742 * By default (empty string): Use whatever the OS has configured.
743 */
744 char *ht_mcs;
Hai Shalom74f70d42019-02-11 14:42:39 -0800745
746 /**
747 * tx_stbc - Indicate STBC support for TX streams
748 *
749 * Value: -1..1, by default (-1): use whatever the OS or card has
750 * configured. See IEEE Std 802.11-2016, 9.4.2.56.2.
751 */
752 int tx_stbc;
753
754 /**
755 * rx_stbc - Indicate STBC support for RX streams
756 *
757 * Value: -1..3, by default (-1): use whatever the OS or card has
758 * configured. See IEEE Std 802.11-2016, 9.4.2.56.2.
759 */
760 int rx_stbc;
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -0800761#endif /* CONFIG_HT_OVERRIDES */
Dmitry Shmidt04949592012-07-19 12:16:46 -0700762
Dmitry Shmidt2f023192013-03-12 12:44:17 -0700763#ifdef CONFIG_VHT_OVERRIDES
764 /**
765 * disable_vht - Disable VHT (IEEE 802.11ac) for this network
766 *
767 * By default, use it if it is available, but this can be configured
768 * to 1 to have it disabled.
769 */
770 int disable_vht;
771
772 /**
773 * vht_capa - VHT capabilities to use
774 */
775 unsigned int vht_capa;
776
777 /**
778 * vht_capa_mask - mask for VHT capabilities
779 */
780 unsigned int vht_capa_mask;
781
782 int vht_rx_mcs_nss_1, vht_rx_mcs_nss_2,
783 vht_rx_mcs_nss_3, vht_rx_mcs_nss_4,
784 vht_rx_mcs_nss_5, vht_rx_mcs_nss_6,
785 vht_rx_mcs_nss_7, vht_rx_mcs_nss_8;
786 int vht_tx_mcs_nss_1, vht_tx_mcs_nss_2,
787 vht_tx_mcs_nss_3, vht_tx_mcs_nss_4,
788 vht_tx_mcs_nss_5, vht_tx_mcs_nss_6,
789 vht_tx_mcs_nss_7, vht_tx_mcs_nss_8;
790#endif /* CONFIG_VHT_OVERRIDES */
791
Hai Shalomfdcde762020-04-02 11:19:20 -0700792#ifdef CONFIG_HE_OVERRIDES
793 /**
794 * disable_he - Disable HE (IEEE 802.11ax) for this network
795 *
796 * By default, use it if it is available, but this can be configured
797 * to 1 to have it disabled.
798 */
799 int disable_he;
800#endif /* CONFIG_HE_OVERRIDES */
801
Dmitry Shmidt04949592012-07-19 12:16:46 -0700802 /**
803 * ap_max_inactivity - Timeout in seconds to detect STA's inactivity
804 *
805 * This timeout value is used in AP mode to clean up inactive stations.
806 * By default: 300 seconds.
807 */
808 int ap_max_inactivity;
809
810 /**
811 * dtim_period - DTIM period in Beacon intervals
812 * By default: 2
813 */
814 int dtim_period;
Dmitry Shmidt61d9df32012-08-29 16:22:06 -0700815
816 /**
Dmitry Shmidt7a5e50a2013-03-05 12:37:16 -0800817 * beacon_int - Beacon interval (default: 100 TU)
818 */
819 int beacon_int;
820
821 /**
Dmitry Shmidt61d9df32012-08-29 16:22:06 -0700822 * auth_failures - Number of consecutive authentication failures
823 */
824 unsigned int auth_failures;
825
826 /**
827 * disabled_until - Network block disabled until this time if non-zero
828 */
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -0800829 struct os_reltime disabled_until;
Dmitry Shmidtd5e49232012-12-03 15:08:10 -0800830
831 /**
832 * parent_cred - Pointer to parent wpa_cred entry
833 *
834 * This pointer can be used to delete temporary networks when a wpa_cred
835 * that was used to create them is removed. This pointer should not be
836 * dereferences since it may not be updated in all cases.
837 */
838 void *parent_cred;
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -0700839
840#ifdef CONFIG_MACSEC
841 /**
842 * macsec_policy - Determines the policy for MACsec secure session
843 *
844 * 0: MACsec not in use (default)
845 * 1: MACsec enabled - Should secure, accept key server's advice to
846 * determine whether to use a secure session or not.
847 */
848 int macsec_policy;
Dmitry Shmidtabb90a32016-12-05 15:34:39 -0800849
850 /**
851 * macsec_integ_only - Determines how MACsec are transmitted
852 *
853 * This setting applies only when MACsec is in use, i.e.,
854 * - macsec_policy is enabled
855 * - the key server has decided to enable MACsec
856 *
857 * 0: Encrypt traffic (default)
858 * 1: Integrity only
859 */
860 int macsec_integ_only;
861
862 /**
Hai Shalom74f70d42019-02-11 14:42:39 -0800863 * macsec_replay_protect - Enable MACsec replay protection
864 *
865 * This setting applies only when MACsec is in use, i.e.,
866 * - macsec_policy is enabled
867 * - the key server has decided to enable MACsec
868 *
869 * 0: Replay protection disabled (default)
870 * 1: Replay protection enabled
871 */
872 int macsec_replay_protect;
873
874 /**
875 * macsec_replay_window - MACsec replay protection window
876 *
877 * A window in which replay is tolerated, to allow receipt of frames
878 * that have been misordered by the network.
879 *
880 * This setting applies only when MACsec replay protection active, i.e.,
881 * - macsec_replay_protect is enabled
882 * - the key server has decided to enable MACsec
883 *
884 * 0: No replay window, strict check (default)
885 * 1..2^32-1: number of packets that could be misordered
886 */
887 u32 macsec_replay_window;
888
889 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -0800890 * macsec_port - MACsec port (in SCI)
891 *
892 * Port component of the SCI.
893 *
894 * Range: 1-65534 (default: 1)
895 */
896 int macsec_port;
897
898 /**
Dmitry Shmidt29333592017-01-09 12:27:11 -0800899 * mka_priority - Priority of MKA Actor
900 *
901 * Range: 0-255 (default: 255)
902 */
903 int mka_priority;
904
905 /**
Dmitry Shmidtabb90a32016-12-05 15:34:39 -0800906 * mka_ckn - MKA pre-shared CKN
907 */
Hai Shalom74f70d42019-02-11 14:42:39 -0800908#define MACSEC_CKN_MAX_LEN 32
909 size_t mka_ckn_len;
910 u8 mka_ckn[MACSEC_CKN_MAX_LEN];
Dmitry Shmidtabb90a32016-12-05 15:34:39 -0800911
912 /**
913 * mka_cak - MKA pre-shared CAK
914 */
Hai Shalom74f70d42019-02-11 14:42:39 -0800915#define MACSEC_CAK_MAX_LEN 32
916 size_t mka_cak_len;
917 u8 mka_cak[MACSEC_CAK_MAX_LEN];
Dmitry Shmidtabb90a32016-12-05 15:34:39 -0800918
919#define MKA_PSK_SET_CKN BIT(0)
920#define MKA_PSK_SET_CAK BIT(1)
921#define MKA_PSK_SET (MKA_PSK_SET_CKN | MKA_PSK_SET_CAK)
922 /**
923 * mka_psk_set - Whether mka_ckn and mka_cak are set
924 */
925 u8 mka_psk_set;
Dmitry Shmidt5a1480c2014-05-12 09:46:02 -0700926#endif /* CONFIG_MACSEC */
Dmitry Shmidtc2817022014-07-02 10:32:10 -0700927
928#ifdef CONFIG_HS20
929 int update_identifier;
Roshan Pius3a1667e2018-07-03 15:17:14 -0700930
931 /**
932 * roaming_consortium_selection - Roaming Consortium Selection
933 *
934 * The matching Roaming Consortium OI that was used to generate this
935 * network profile.
936 */
937 u8 *roaming_consortium_selection;
938
939 /**
940 * roaming_consortium_selection_len - roaming_consortium_selection len
941 */
942 size_t roaming_consortium_selection_len;
Dmitry Shmidtc2817022014-07-02 10:32:10 -0700943#endif /* CONFIG_HS20 */
Dmitry Shmidt661b4f72014-09-29 14:58:27 -0700944
945 unsigned int wps_run;
946
947 /**
948 * mac_addr - MAC address policy
949 *
950 * 0 = use permanent MAC address
951 * 1 = use random MAC address for each ESS connection
952 * 2 = like 1, but maintain OUI (with local admin bit set)
953 *
954 * Internally, special value -1 is used to indicate that the parameter
955 * was not specified in the configuration (i.e., default behavior is
956 * followed).
957 */
958 int mac_addr;
Dmitry Shmidt6c0da2b2015-01-05 13:08:17 -0800959
960 /**
961 * no_auto_peer - Do not automatically peer with compatible mesh peers
962 *
963 * When unset, the reception of a beacon from a another mesh peer in
964 * this MBSS will trigger a peering attempt.
965 */
966 int no_auto_peer;
Dmitry Shmidt849734c2016-05-27 09:59:01 -0700967
968 /**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700969 * mesh_rssi_threshold - Set mesh parameter mesh_rssi_threshold (dBm)
970 *
971 * -255..-1 = threshold value in dBm
972 * 0 = not using RSSI threshold
973 * 1 = do not change driver default
974 */
975 int mesh_rssi_threshold;
976
977 /**
Dmitry Shmidt849734c2016-05-27 09:59:01 -0700978 * wps_disabled - WPS disabled in AP mode
979 *
980 * 0 = WPS enabled and configured (default)
981 * 1 = WPS disabled
982 */
983 int wps_disabled;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -0700984
985 /**
986 * fils_dh_group - FILS DH Group
987 *
988 * 0 = PFS disabled with FILS shared key authentication
989 * 1-65535 DH Group to use for FILS PFS
990 */
991 int fils_dh_group;
992
993 /**
994 * dpp_connector - DPP Connector (signedConnector as string)
995 */
996 char *dpp_connector;
997
998 /**
999 * dpp_netaccesskey - DPP netAccessKey (own private key)
1000 */
1001 u8 *dpp_netaccesskey;
1002
1003 /**
1004 * dpp_netaccesskey_len - DPP netAccessKey length in octets
1005 */
1006 size_t dpp_netaccesskey_len;
1007
1008 /**
1009 * net_access_key_expiry - DPP netAccessKey expiry in UNIX time stamp
1010 *
1011 * 0 indicates no expiration.
1012 */
1013 unsigned int dpp_netaccesskey_expiry;
1014
1015 /**
1016 * dpp_csign - C-sign-key (Configurator public key)
1017 */
1018 u8 *dpp_csign;
1019
1020 /**
1021 * dpp_csign_len - C-sign-key length in octets
1022 */
1023 size_t dpp_csign_len;
1024
1025 /**
Hai Shalom899fcc72020-10-19 14:38:18 -07001026 * dpp_pp_key - ppKey (Configurator privacy protection public key)
1027 */
1028 u8 *dpp_pp_key;
1029
1030 /**
1031 * dpp_pp_key_len - ppKey length in octets
1032 */
1033 size_t dpp_pp_key_len;
1034
1035 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07001036 * dpp_pfs - DPP PFS
1037 * 0: allow PFS to be used or not used
1038 * 1: require PFS to be used (note: not compatible with DPP R1)
1039 * 2: do not allow PFS to be used
1040 */
1041 int dpp_pfs;
1042
1043 /**
1044 * dpp_pfs_fallback - DPP PFS fallback selection
1045 *
1046 * This is an internally used variable (i.e., not used in external
1047 * configuration) to track state of the DPP PFS fallback mechanism.
1048 */
1049 int dpp_pfs_fallback;
1050
1051 /**
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001052 * owe_group - OWE DH Group
1053 *
Roshan Pius3a1667e2018-07-03 15:17:14 -07001054 * 0 = use default (19) first and then try all supported groups one by
1055 * one if AP rejects the selected group
Dmitry Shmidtd2986c22017-10-23 14:22:09 -07001056 * 1-65535 DH Group to use for OWE
1057 *
1058 * Groups 19 (NIST P-256), 20 (NIST P-384), and 21 (NIST P-521) are
1059 * currently supported.
1060 */
1061 int owe_group;
Roshan Pius3a1667e2018-07-03 15:17:14 -07001062
1063 /**
1064 * owe_only - OWE-only mode (disable transition mode)
1065 *
1066 * 0 = enable transition mode (allow connection to either OWE or open
1067 * BSS)
1068 * 1 = disable transition mode (allow connection only with OWE)
1069 */
1070 int owe_only;
Hai Shalom39ba6fc2019-01-22 12:40:38 -08001071
1072 /**
Hai Shalomfdcde762020-04-02 11:19:20 -07001073 * owe_ptk_workaround - OWE PTK derivation workaround
1074 *
1075 * Initial OWE implementation used SHA256 when deriving the PTK for all
1076 * OWE groups. This was supposed to change to SHA384 for group 20 and
1077 * SHA512 for group 21. This parameter can be used to enable older
1078 * behavior mainly for testing purposes. There is no impact to group 19
1079 * behavior, but if enabled, this will make group 20 and 21 cases use
1080 * SHA256-based PTK derivation which will not work with the updated
1081 * OWE implementation on the AP side.
1082 */
1083 int owe_ptk_workaround;
1084
1085 /**
Hai Shalom39ba6fc2019-01-22 12:40:38 -08001086 * owe_transition_bss_select_count - OWE transition BSS select count
1087 *
1088 * This is an internally used variable (i.e., not used in external
1089 * configuration) to track the number of selection attempts done for
1090 * OWE BSS in transition mode. This allows fallback to an open BSS if
1091 * the selection attempts for OWE BSS exceed the configured threshold.
1092 */
1093 int owe_transition_bss_select_count;
Hai Shalom74f70d42019-02-11 14:42:39 -08001094
1095 /**
1096 * multi_ap_backhaul_sta - Multi-AP backhaul STA
1097 * 0 = normal (non-Multi-AP) station
1098 * 1 = Multi-AP backhaul station
1099 */
1100 int multi_ap_backhaul_sta;
Hai Shalom81f62d82019-07-22 12:10:00 -07001101
1102 /**
1103 * ft_eap_pmksa_caching - Whether FT-EAP PMKSA caching is allowed
1104 * 0 = do not try to use PMKSA caching with FT-EAP
1105 * 1 = try to use PMKSA caching with FT-EAP
1106 *
1107 * This controls whether to try to use PMKSA caching with FT-EAP for the
1108 * FT initial mobility domain association.
1109 */
1110 int ft_eap_pmksa_caching;
Hai Shalomfdcde762020-04-02 11:19:20 -07001111
1112 /**
1113 * beacon_prot - Whether Beacon protection is enabled
1114 *
1115 * This depends on management frame protection (ieee80211w) being
1116 * enabled.
1117 */
1118 int beacon_prot;
1119
1120 /**
1121 * transition_disable - Transition Disable indication
1122 * The AP can notify authenticated stations to disable transition mode
1123 * in their network profiles when the network has completed transition
1124 * steps, i.e., once sufficiently large number of APs in the ESS have
1125 * been updated to support the more secure alternative. When this
1126 * indication is used, the stations are expected to automatically
1127 * disable transition mode and less secure security options. This
1128 * includes use of WEP, TKIP (including use of TKIP as the group
1129 * cipher), and connections without PMF.
1130 * Bitmap bits:
1131 * bit 0 (0x01): WPA3-Personal (i.e., disable WPA2-Personal = WPA-PSK
1132 * and only allow SAE to be used)
1133 * bit 1 (0x02): SAE-PK (disable SAE without use of SAE-PK)
1134 * bit 2 (0x04): WPA3-Enterprise (move to requiring PMF)
1135 * bit 3 (0x08): Enhanced Open (disable use of open network; require
1136 * OWE)
1137 */
1138 u8 transition_disable;
Hai Shalom899fcc72020-10-19 14:38:18 -07001139
1140 /**
1141 * sae_pk - SAE-PK mode
1142 * 0 = automatic SAE/SAE-PK selection based on password; enable
1143 * transition mode (allow SAE authentication without SAE-PK)
1144 * 1 = SAE-PK only (disable transition mode; allow SAE authentication
1145 * only with SAE-PK)
1146 * 2 = disable SAE-PK (allow SAE authentication only without SAE-PK)
1147 */
1148 enum sae_pk_mode sae_pk;
1149
1150 /**
1151 * was_recently_reconfigured - Whether this SSID config has been changed
1152 * recently
1153 *
1154 * This is an internally used variable, i.e., not used in external
1155 * configuration.
1156 */
1157 bool was_recently_reconfigured;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001158};
1159
1160#endif /* CONFIG_SSID_H */