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