Remove mesh_ht_mode network block parameter
[mech_eap.git] / wpa_supplicant / config_ssid.h
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 MAX_SSID_LEN 32
17
18
19 #define DEFAULT_EAP_WORKAROUND ((unsigned int) -1)
20 #define DEFAULT_EAPOL_FLAGS (EAPOL_FLAG_REQUIRE_KEY_UNICAST | \
21                              EAPOL_FLAG_REQUIRE_KEY_BROADCAST)
22 #define DEFAULT_PROTO (WPA_PROTO_WPA | WPA_PROTO_RSN)
23 #define DEFAULT_KEY_MGMT (WPA_KEY_MGMT_PSK | WPA_KEY_MGMT_IEEE8021X)
24 #define DEFAULT_PAIRWISE (WPA_CIPHER_CCMP | WPA_CIPHER_TKIP)
25 #define DEFAULT_GROUP (WPA_CIPHER_CCMP | WPA_CIPHER_TKIP | \
26                        WPA_CIPHER_WEP104 | WPA_CIPHER_WEP40)
27 #define DEFAULT_FRAGMENT_SIZE 1398
28
29 #define DEFAULT_BG_SCAN_PERIOD -1
30 #define DEFAULT_MESH_MAX_RETRIES 2
31 #define DEFAULT_MESH_RETRY_TIMEOUT 40
32 #define DEFAULT_MESH_CONFIRM_TIMEOUT 40
33 #define DEFAULT_MESH_HOLDING_TIMEOUT 40
34 #define DEFAULT_DISABLE_HT 0
35 #define DEFAULT_DISABLE_HT40 0
36 #define DEFAULT_DISABLE_SGI 0
37 #define DEFAULT_DISABLE_LDPC 0
38 #define DEFAULT_DISABLE_MAX_AMSDU -1 /* no change */
39 #define DEFAULT_AMPDU_FACTOR -1 /* no change */
40 #define DEFAULT_AMPDU_DENSITY -1 /* no change */
41 #define DEFAULT_USER_SELECTED_SIM 1
42
43 struct psk_list_entry {
44         struct dl_list list;
45         u8 addr[ETH_ALEN];
46         u8 psk[32];
47         u8 p2p;
48 };
49
50 /**
51  * struct wpa_ssid - Network configuration data
52  *
53  * This structure includes all the configuration variables for a network. This
54  * data is included in the per-interface configuration data as an element of
55  * the network list, struct wpa_config::ssid. Each network block in the
56  * configuration is mapped to a struct wpa_ssid instance.
57  */
58 struct wpa_ssid {
59         /**
60          * next - Next network in global list
61          *
62          * This pointer can be used to iterate over all networks. The head of
63          * this list is stored in the ssid field of struct wpa_config.
64          */
65         struct wpa_ssid *next;
66
67         /**
68          * pnext - Next network in per-priority list
69          *
70          * This pointer can be used to iterate over all networks in the same
71          * priority class. The heads of these list are stored in the pssid
72          * fields of struct wpa_config.
73          */
74         struct wpa_ssid *pnext;
75
76         /**
77          * id - Unique id for the network
78          *
79          * This identifier is used as a unique identifier for each network
80          * block when using the control interface. Each network is allocated an
81          * id when it is being created, either when reading the configuration
82          * file or when a new network is added through the control interface.
83          */
84         int id;
85
86         /**
87          * priority - Priority group
88          *
89          * By default, all networks will get same priority group (0). If some
90          * of the networks are more desirable, this field can be used to change
91          * the order in which wpa_supplicant goes through the networks when
92          * selecting a BSS. The priority groups will be iterated in decreasing
93          * priority (i.e., the larger the priority value, the sooner the
94          * network is matched against the scan results). Within each priority
95          * group, networks will be selected based on security policy, signal
96          * strength, etc.
97          *
98          * Please note that AP scanning with scan_ssid=1 and ap_scan=2 mode are
99          * not using this priority to select the order for scanning. Instead,
100          * they try the networks in the order that used in the configuration
101          * file.
102          */
103         int priority;
104
105         /**
106          * ssid - Service set identifier (network name)
107          *
108          * This is the SSID for the network. For wireless interfaces, this is
109          * used to select which network will be used. If set to %NULL (or
110          * ssid_len=0), any SSID can be used. For wired interfaces, this must
111          * be set to %NULL. Note: SSID may contain any characters, even nul
112          * (ASCII 0) and as such, this should not be assumed to be a nul
113          * terminated string. ssid_len defines how many characters are valid
114          * and the ssid field is not guaranteed to be nul terminated.
115          */
116         u8 *ssid;
117
118         /**
119          * ssid_len - Length of the SSID
120          */
121         size_t ssid_len;
122
123         /**
124          * bssid - BSSID
125          *
126          * If set, this network block is used only when associating with the AP
127          * using the configured BSSID
128          *
129          * If this is a persistent P2P group (disabled == 2), this is the GO
130          * Device Address.
131          */
132         u8 bssid[ETH_ALEN];
133
134         /**
135          * bssid_set - Whether BSSID is configured for this network
136          */
137         int bssid_set;
138
139         /**
140          * go_p2p_dev_addr - GO's P2P Device Address or all zeros if not set
141          */
142         u8 go_p2p_dev_addr[ETH_ALEN];
143
144         /**
145          * psk - WPA pre-shared key (256 bits)
146          */
147         u8 psk[32];
148
149         /**
150          * psk_set - Whether PSK field is configured
151          */
152         int psk_set;
153
154         /**
155          * passphrase - WPA ASCII passphrase
156          *
157          * If this is set, psk will be generated using the SSID and passphrase
158          * configured for the network. ASCII passphrase must be between 8 and
159          * 63 characters (inclusive).
160          */
161         char *passphrase;
162
163         /**
164          * ext_psk - PSK/passphrase name in external storage
165          *
166          * If this is set, PSK/passphrase will be fetched from external storage
167          * when requesting association with the network.
168          */
169         char *ext_psk;
170
171         /**
172          * pairwise_cipher - Bitfield of allowed pairwise ciphers, WPA_CIPHER_*
173          */
174         int pairwise_cipher;
175
176         /**
177          * group_cipher - Bitfield of allowed group ciphers, WPA_CIPHER_*
178          */
179         int group_cipher;
180
181         /**
182          * key_mgmt - Bitfield of allowed key management protocols
183          *
184          * WPA_KEY_MGMT_*
185          */
186         int key_mgmt;
187
188         /**
189          * bg_scan_period - Background scan period in seconds, 0 to disable, or
190          * -1 to indicate no change to default driver configuration
191          */
192         int bg_scan_period;
193
194         /**
195          * proto - Bitfield of allowed protocols, WPA_PROTO_*
196          */
197         int proto;
198
199         /**
200          * auth_alg -  Bitfield of allowed authentication algorithms
201          *
202          * WPA_AUTH_ALG_*
203          */
204         int auth_alg;
205
206         /**
207          * scan_ssid - Scan this SSID with Probe Requests
208          *
209          * scan_ssid can be used to scan for APs using hidden SSIDs.
210          * Note: Many drivers do not support this. ap_mode=2 can be used with
211          * such drivers to use hidden SSIDs.
212          */
213         int scan_ssid;
214
215 #ifdef IEEE8021X_EAPOL
216 #define EAPOL_FLAG_REQUIRE_KEY_UNICAST BIT(0)
217 #define EAPOL_FLAG_REQUIRE_KEY_BROADCAST BIT(1)
218         /**
219          * eapol_flags - Bit field of IEEE 802.1X/EAPOL options (EAPOL_FLAG_*)
220          */
221         int eapol_flags;
222
223         /**
224          * eap - EAP peer configuration for this network
225          */
226         struct eap_peer_config eap;
227 #endif /* IEEE8021X_EAPOL */
228
229 #define NUM_WEP_KEYS 4
230 #define MAX_WEP_KEY_LEN 16
231         /**
232          * wep_key - WEP keys
233          */
234         u8 wep_key[NUM_WEP_KEYS][MAX_WEP_KEY_LEN];
235
236         /**
237          * wep_key_len - WEP key lengths
238          */
239         size_t wep_key_len[NUM_WEP_KEYS];
240
241         /**
242          * wep_tx_keyidx - Default key index for TX frames using WEP
243          */
244         int wep_tx_keyidx;
245
246         /**
247          * proactive_key_caching - Enable proactive key caching
248          *
249          * This field can be used to enable proactive key caching which is also
250          * known as opportunistic PMKSA caching for WPA2. This is disabled (0)
251          * by default unless default value is changed with the global okc=1
252          * parameter. Enable by setting this to 1.
253          *
254          * Proactive key caching is used to make supplicant assume that the APs
255          * are using the same PMK and generate PMKSA cache entries without
256          * doing RSN pre-authentication. This requires support from the AP side
257          * and is normally used with wireless switches that co-locate the
258          * authenticator.
259          *
260          * Internally, special value -1 is used to indicate that the parameter
261          * was not specified in the configuration (i.e., default behavior is
262          * followed).
263          */
264         int proactive_key_caching;
265
266         /**
267          * mixed_cell - Whether mixed cells are allowed
268          *
269          * This option can be used to configure whether so called mixed cells,
270          * i.e., networks that use both plaintext and encryption in the same
271          * SSID, are allowed. This is disabled (0) by default. Enable by
272          * setting this to 1.
273          */
274         int mixed_cell;
275
276 #ifdef IEEE8021X_EAPOL
277
278         /**
279          * leap - Number of EAP methods using LEAP
280          *
281          * This field should be set to 1 if LEAP is enabled. This is used to
282          * select IEEE 802.11 authentication algorithm.
283          */
284         int leap;
285
286         /**
287          * non_leap - Number of EAP methods not using LEAP
288          *
289          * This field should be set to >0 if any EAP method other than LEAP is
290          * enabled. This is used to select IEEE 802.11 authentication
291          * algorithm.
292          */
293         int non_leap;
294
295         /**
296          * eap_workaround - EAP workarounds enabled
297          *
298          * wpa_supplicant supports number of "EAP workarounds" to work around
299          * interoperability issues with incorrectly behaving authentication
300          * servers. This is recommended to be enabled by default because some
301          * of the issues are present in large number of authentication servers.
302          *
303          * Strict EAP conformance mode can be configured by disabling
304          * workarounds with eap_workaround = 0.
305          */
306         unsigned int eap_workaround;
307
308 #endif /* IEEE8021X_EAPOL */
309
310         /**
311          * mode - IEEE 802.11 operation mode (Infrastucture/IBSS)
312          *
313          * 0 = infrastructure (Managed) mode, i.e., associate with an AP.
314          *
315          * 1 = IBSS (ad-hoc, peer-to-peer)
316          *
317          * 2 = AP (access point)
318          *
319          * 3 = P2P Group Owner (can be set in the configuration file)
320          *
321          * 4 = P2P Group Formation (used internally; not in configuration
322          * files)
323          *
324          * 5 = Mesh
325          *
326          * Note: IBSS can only be used with key_mgmt NONE (plaintext and static
327          * WEP) and WPA-PSK (with proto=RSN). In addition, key_mgmt=WPA-NONE
328          * (fixed group key TKIP/CCMP) is available for backwards compatibility,
329          * but its use is deprecated. WPA-None requires following network block
330          * options: proto=WPA, key_mgmt=WPA-NONE, pairwise=NONE, group=TKIP (or
331          * CCMP, but not both), and psk must also be set (either directly or
332          * using ASCII passphrase).
333          */
334         enum wpas_mode {
335                 WPAS_MODE_INFRA = 0,
336                 WPAS_MODE_IBSS = 1,
337                 WPAS_MODE_AP = 2,
338                 WPAS_MODE_P2P_GO = 3,
339                 WPAS_MODE_P2P_GROUP_FORMATION = 4,
340                 WPAS_MODE_MESH = 5,
341         } mode;
342
343         /**
344          * disabled - Whether this network is currently disabled
345          *
346          * 0 = this network can be used (default).
347          * 1 = this network block is disabled (can be enabled through
348          * ctrl_iface, e.g., with wpa_cli or wpa_gui).
349          * 2 = this network block includes parameters for a persistent P2P
350          * group (can be used with P2P ctrl_iface commands)
351          */
352         int disabled;
353
354         /**
355          * disabled_for_connect - Whether this network was temporarily disabled
356          *
357          * This flag is used to reenable all the temporarily disabled networks
358          * after either the success or failure of a WPS connection.
359          */
360         int disabled_for_connect;
361
362         /**
363          * peerkey -  Whether PeerKey handshake for direct links is allowed
364          *
365          * This is only used when both RSN/WPA2 and IEEE 802.11e (QoS) are
366          * enabled.
367          *
368          * 0 = disabled (default)
369          * 1 = enabled
370          */
371         int peerkey;
372
373         /**
374          * id_str - Network identifier string for external scripts
375          *
376          * This value is passed to external ctrl_iface monitors in
377          * WPA_EVENT_CONNECTED event and wpa_cli sets this as WPA_ID_STR
378          * environment variable for action scripts.
379          */
380         char *id_str;
381
382 #ifdef CONFIG_IEEE80211W
383         /**
384          * ieee80211w - Whether management frame protection is enabled
385          *
386          * This value is used to configure policy for management frame
387          * protection (IEEE 802.11w). 0 = disabled, 1 = optional, 2 = required.
388          * This is disabled by default unless the default value has been changed
389          * with the global pmf=1/2 parameter.
390          *
391          * Internally, special value 3 is used to indicate that the parameter
392          * was not specified in the configuration (i.e., default behavior is
393          * followed).
394          */
395         enum mfp_options ieee80211w;
396 #endif /* CONFIG_IEEE80211W */
397
398         /**
399          * frequency - Channel frequency in megahertz (MHz) for IBSS
400          *
401          * This value is used to configure the initial channel for IBSS (adhoc)
402          * networks, e.g., 2412 = IEEE 802.11b/g channel 1. It is ignored in
403          * the infrastructure mode. In addition, this value is only used by the
404          * station that creates the IBSS. If an IBSS network with the
405          * configured SSID is already present, the frequency of the network
406          * will be used instead of this configured value.
407          */
408         int frequency;
409
410         /**
411          * mesh_basic_rates - BSS Basic rate set for mesh network
412          *
413          */
414         int *mesh_basic_rates;
415
416         /**
417          * Mesh network plink parameters
418          */
419         int dot11MeshMaxRetries;
420         int dot11MeshRetryTimeout; /* msec */
421         int dot11MeshConfirmTimeout; /* msec */
422         int dot11MeshHoldingTimeout; /* msec */
423
424         int ht40;
425
426         int vht;
427
428         /**
429          * wpa_ptk_rekey - Maximum lifetime for PTK in seconds
430          *
431          * This value can be used to enforce rekeying of PTK to mitigate some
432          * attacks against TKIP deficiencies.
433          */
434         int wpa_ptk_rekey;
435
436         /**
437          * scan_freq - Array of frequencies to scan or %NULL for all
438          *
439          * This is an optional zero-terminated array of frequencies in
440          * megahertz (MHz) to include in scan requests when searching for this
441          * network. This can be used to speed up scanning when the network is
442          * known to not use all possible channels.
443          */
444         int *scan_freq;
445
446         /**
447          * bgscan - Background scan and roaming parameters or %NULL if none
448          *
449          * This is an optional set of parameters for background scanning and
450          * roaming within a network (ESS) in following format:
451          * <bgscan module name>:<module parameters>
452          */
453         char *bgscan;
454
455         /**
456          * ignore_broadcast_ssid - Hide SSID in AP mode
457          *
458          * Send empty SSID in beacons and ignore probe request frames that do
459          * not specify full SSID, i.e., require stations to know SSID.
460          * default: disabled (0)
461          * 1 = send empty (length=0) SSID in beacon and ignore probe request
462          * for broadcast SSID
463          * 2 = clear SSID (ASCII 0), but keep the original length (this may be
464          * required with some clients that do not support empty SSID) and
465          * ignore probe requests for broadcast SSID
466          */
467         int ignore_broadcast_ssid;
468
469         /**
470          * freq_list - Array of allowed frequencies or %NULL for all
471          *
472          * This is an optional zero-terminated array of frequencies in
473          * megahertz (MHz) to allow for selecting the BSS. If set, scan results
474          * that do not match any of the specified frequencies are not
475          * considered when selecting a BSS.
476          */
477         int *freq_list;
478
479         /**
480          * p2p_client_list - List of P2P Clients in a persistent group (GO)
481          *
482          * This is a list of P2P Clients (P2P Device Address) that have joined
483          * the persistent group. This is maintained on the GO for persistent
484          * group entries (disabled == 2).
485          */
486         u8 *p2p_client_list;
487
488         /**
489          * num_p2p_clients - Number of entries in p2p_client_list
490          */
491         size_t num_p2p_clients;
492
493 #ifndef P2P_MAX_STORED_CLIENTS
494 #define P2P_MAX_STORED_CLIENTS 100
495 #endif /* P2P_MAX_STORED_CLIENTS */
496
497         /**
498          * psk_list - Per-client PSKs (struct psk_list_entry)
499          */
500         struct dl_list psk_list;
501
502         /**
503          * p2p_group - Network generated as a P2P group (used internally)
504          */
505         int p2p_group;
506
507         /**
508          * p2p_persistent_group - Whether this is a persistent group
509          */
510         int p2p_persistent_group;
511
512         /**
513          * temporary - Whether this network is temporary and not to be saved
514          */
515         int temporary;
516
517         /**
518          * export_keys - Whether keys may be exported
519          *
520          * This attribute will be set when keys are determined through
521          * WPS or similar so that they may be exported.
522          */
523         int export_keys;
524
525 #ifdef CONFIG_HT_OVERRIDES
526         /**
527          * disable_ht - Disable HT (IEEE 802.11n) for this network
528          *
529          * By default, use it if it is available, but this can be configured
530          * to 1 to have it disabled.
531          */
532         int disable_ht;
533
534         /**
535          * disable_ht40 - Disable HT40 for this network
536          *
537          * By default, use it if it is available, but this can be configured
538          * to 1 to have it disabled.
539          */
540         int disable_ht40;
541
542         /**
543          * disable_sgi - Disable SGI (Short Guard Interval) for this network
544          *
545          * By default, use it if it is available, but this can be configured
546          * to 1 to have it disabled.
547          */
548         int disable_sgi;
549
550         /**
551          * disable_ldpc - Disable LDPC for this network
552          *
553          * By default, use it if it is available, but this can be configured
554          * to 1 to have it disabled.
555          */
556         int disable_ldpc;
557
558         /**
559          * ht40_intolerant - Indicate 40 MHz intolerant for this network
560          */
561         int ht40_intolerant;
562
563         /**
564          * disable_max_amsdu - Disable MAX A-MSDU
565          *
566          * A-MDSU will be 3839 bytes when disabled, or 7935
567          * when enabled (assuming it is otherwise supported)
568          * -1 (default) means do not apply any settings to the kernel.
569          */
570         int disable_max_amsdu;
571
572         /**
573          * ampdu_factor - Maximum A-MPDU Length Exponent
574          *
575          * Value: 0-3, see 7.3.2.56.3 in IEEE Std 802.11n-2009.
576          */
577         int ampdu_factor;
578
579         /**
580          * ampdu_density - Minimum A-MPDU Start Spacing
581          *
582          * Value: 0-7, see 7.3.2.56.3 in IEEE Std 802.11n-2009.
583          */
584         int ampdu_density;
585
586         /**
587          * ht_mcs - Allowed HT-MCS rates, in ASCII hex: ffff0000...
588          *
589          * By default (empty string): Use whatever the OS has configured.
590          */
591         char *ht_mcs;
592 #endif /* CONFIG_HT_OVERRIDES */
593
594 #ifdef CONFIG_VHT_OVERRIDES
595         /**
596          * disable_vht - Disable VHT (IEEE 802.11ac) for this network
597          *
598          * By default, use it if it is available, but this can be configured
599          * to 1 to have it disabled.
600          */
601         int disable_vht;
602
603         /**
604          * vht_capa - VHT capabilities to use
605          */
606         unsigned int vht_capa;
607
608         /**
609          * vht_capa_mask - mask for VHT capabilities
610          */
611         unsigned int vht_capa_mask;
612
613         int vht_rx_mcs_nss_1, vht_rx_mcs_nss_2,
614             vht_rx_mcs_nss_3, vht_rx_mcs_nss_4,
615             vht_rx_mcs_nss_5, vht_rx_mcs_nss_6,
616             vht_rx_mcs_nss_7, vht_rx_mcs_nss_8;
617         int vht_tx_mcs_nss_1, vht_tx_mcs_nss_2,
618             vht_tx_mcs_nss_3, vht_tx_mcs_nss_4,
619             vht_tx_mcs_nss_5, vht_tx_mcs_nss_6,
620             vht_tx_mcs_nss_7, vht_tx_mcs_nss_8;
621 #endif /* CONFIG_VHT_OVERRIDES */
622
623         /**
624          * ap_max_inactivity - Timeout in seconds to detect STA's inactivity
625          *
626          * This timeout value is used in AP mode to clean up inactive stations.
627          * By default: 300 seconds.
628          */
629         int ap_max_inactivity;
630
631         /**
632          * dtim_period - DTIM period in Beacon intervals
633          * By default: 2
634          */
635         int dtim_period;
636
637         /**
638          * beacon_int - Beacon interval (default: 100 TU)
639          */
640         int beacon_int;
641
642         /**
643          * auth_failures - Number of consecutive authentication failures
644          */
645         unsigned int auth_failures;
646
647         /**
648          * disabled_until - Network block disabled until this time if non-zero
649          */
650         struct os_reltime disabled_until;
651
652         /**
653          * parent_cred - Pointer to parent wpa_cred entry
654          *
655          * This pointer can be used to delete temporary networks when a wpa_cred
656          * that was used to create them is removed. This pointer should not be
657          * dereferences since it may not be updated in all cases.
658          */
659         void *parent_cred;
660
661 #ifdef CONFIG_MACSEC
662         /**
663          * macsec_policy - Determines the policy for MACsec secure session
664          *
665          * 0: MACsec not in use (default)
666          * 1: MACsec enabled - Should secure, accept key server's advice to
667          *    determine whether to use a secure session or not.
668          */
669         int macsec_policy;
670 #endif /* CONFIG_MACSEC */
671
672 #ifdef CONFIG_HS20
673         int update_identifier;
674 #endif /* CONFIG_HS20 */
675
676         unsigned int wps_run;
677
678         /**
679          * mac_addr - MAC address policy
680          *
681          * 0 = use permanent MAC address
682          * 1 = use random MAC address for each ESS connection
683          * 2 = like 1, but maintain OUI (with local admin bit set)
684          *
685          * Internally, special value -1 is used to indicate that the parameter
686          * was not specified in the configuration (i.e., default behavior is
687          * followed).
688          */
689         int mac_addr;
690
691         /**
692          * no_auto_peer - Do not automatically peer with compatible mesh peers
693          *
694          * When unset, the reception of a beacon from a another mesh peer in
695          * this MBSS will trigger a peering attempt.
696          */
697         int no_auto_peer;
698 };
699
700 #endif /* CONFIG_SSID_H */