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