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