2 * WPA Supplicant / Network configuration structures
3 * Copyright (c) 2003-2008, Jouni Malinen <j@w1.fi>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
12 * See README and COPYING for more details.
18 #include "common/defs.h"
19 #include "eap_peer/eap_config.h"
21 #define MAX_SSID_LEN 32
24 #define DEFAULT_EAP_WORKAROUND ((unsigned int) -1)
25 #define DEFAULT_EAPOL_FLAGS (EAPOL_FLAG_REQUIRE_KEY_UNICAST | \
26 EAPOL_FLAG_REQUIRE_KEY_BROADCAST)
27 #define DEFAULT_PROTO (WPA_PROTO_WPA | WPA_PROTO_RSN)
28 #define DEFAULT_KEY_MGMT (WPA_KEY_MGMT_PSK | WPA_KEY_MGMT_IEEE8021X)
29 #define DEFAULT_PAIRWISE (WPA_CIPHER_CCMP | WPA_CIPHER_TKIP)
30 #define DEFAULT_GROUP (WPA_CIPHER_CCMP | WPA_CIPHER_TKIP | \
31 WPA_CIPHER_WEP104 | WPA_CIPHER_WEP40)
32 #define DEFAULT_FRAGMENT_SIZE 1398
35 * struct wpa_ssid - Network configuration data
37 * This structure includes all the configuration variables for a network. This
38 * data is included in the per-interface configuration data as an element of
39 * the network list, struct wpa_config::ssid. Each network block in the
40 * configuration is mapped to a struct wpa_ssid instance.
44 * next - Next network in global list
46 * This pointer can be used to iterate over all networks. The head of
47 * this list is stored in the ssid field of struct wpa_config.
49 struct wpa_ssid *next;
52 * pnext - Next network in per-priority list
54 * This pointer can be used to iterate over all networks in the same
55 * priority class. The heads of these list are stored in the pssid
56 * fields of struct wpa_config.
58 struct wpa_ssid *pnext;
61 * id - Unique id for the network
63 * This identifier is used as a unique identifier for each network
64 * block when using the control interface. Each network is allocated an
65 * id when it is being created, either when reading the configuration
66 * file or when a new network is added through the control interface.
71 * priority - Priority group
73 * By default, all networks will get same priority group (0). If some
74 * of the networks are more desirable, this field can be used to change
75 * the order in which wpa_supplicant goes through the networks when
76 * selecting a BSS. The priority groups will be iterated in decreasing
77 * priority (i.e., the larger the priority value, the sooner the
78 * network is matched against the scan results). Within each priority
79 * group, networks will be selected based on security policy, signal
82 * Please note that AP scanning with scan_ssid=1 and ap_scan=2 mode are
83 * not using this priority to select the order for scanning. Instead,
84 * they try the networks in the order that used in the configuration
90 * ssid - Service set identifier (network name)
92 * This is the SSID for the network. For wireless interfaces, this is
93 * used to select which network will be used. If set to %NULL (or
94 * ssid_len=0), any SSID can be used. For wired interfaces, this must
95 * be set to %NULL. Note: SSID may contain any characters, even nul
96 * (ASCII 0) and as such, this should not be assumed to be a nul
97 * terminated string. ssid_len defines how many characters are valid
98 * and the ssid field is not guaranteed to be nul terminated.
103 * ssid_len - Length of the SSID
110 * If set, this network block is used only when associating with the AP
111 * using the configured BSSID
113 * If this is a persistent P2P group (disabled == 2), this is the GO
119 * bssid_set - Whether BSSID is configured for this network
124 * psk - WPA pre-shared key (256 bits)
129 * psk_set - Whether PSK field is configured
134 * passphrase - WPA ASCII passphrase
136 * If this is set, psk will be generated using the SSID and passphrase
137 * configured for the network. ASCII passphrase must be between 8 and
138 * 63 characters (inclusive).
143 * pairwise_cipher - Bitfield of allowed pairwise ciphers, WPA_CIPHER_*
148 * group_cipher - Bitfield of allowed group ciphers, WPA_CIPHER_*
153 * key_mgmt - Bitfield of allowed key management protocols
160 * proto - Bitfield of allowed protocols, WPA_PROTO_*
165 * auth_alg - Bitfield of allowed authentication algorithms
172 * scan_ssid - Scan this SSID with Probe Requests
174 * scan_ssid can be used to scan for APs using hidden SSIDs.
175 * Note: Many drivers do not support this. ap_mode=2 can be used with
176 * such drivers to use hidden SSIDs.
180 #ifdef IEEE8021X_EAPOL
181 #define EAPOL_FLAG_REQUIRE_KEY_UNICAST BIT(0)
182 #define EAPOL_FLAG_REQUIRE_KEY_BROADCAST BIT(1)
184 * eapol_flags - Bit field of IEEE 802.1X/EAPOL options (EAPOL_FLAG_*)
189 * eap - EAP peer configuration for this network
191 struct eap_peer_config eap;
192 #endif /* IEEE8021X_EAPOL */
194 #define NUM_WEP_KEYS 4
195 #define MAX_WEP_KEY_LEN 16
199 u8 wep_key[NUM_WEP_KEYS][MAX_WEP_KEY_LEN];
202 * wep_key_len - WEP key lengths
204 size_t wep_key_len[NUM_WEP_KEYS];
207 * wep_tx_keyidx - Default key index for TX frames using WEP
212 * proactive_key_caching - Enable proactive key caching
214 * This field can be used to enable proactive key caching which is also
215 * known as opportunistic PMKSA caching for WPA2. This is disabled (0)
216 * by default. Enable by setting this to 1.
218 * Proactive key caching is used to make supplicant assume that the APs
219 * are using the same PMK and generate PMKSA cache entries without
220 * doing RSN pre-authentication. This requires support from the AP side
221 * and is normally used with wireless switches that co-locate the
224 int proactive_key_caching;
227 * mixed_cell - Whether mixed cells are allowed
229 * This option can be used to configure whether so called mixed cells,
230 * i.e., networks that use both plaintext and encryption in the same
231 * SSID, are allowed. This is disabled (0) by default. Enable by
236 #ifdef IEEE8021X_EAPOL
239 * leap - Number of EAP methods using LEAP
241 * This field should be set to 1 if LEAP is enabled. This is used to
242 * select IEEE 802.11 authentication algorithm.
247 * non_leap - Number of EAP methods not using LEAP
249 * This field should be set to >0 if any EAP method other than LEAP is
250 * enabled. This is used to select IEEE 802.11 authentication
256 * eap_workaround - EAP workarounds enabled
258 * wpa_supplicant supports number of "EAP workarounds" to work around
259 * interoperability issues with incorrectly behaving authentication
260 * servers. This is recommended to be enabled by default because some
261 * of the issues are present in large number of authentication servers.
263 * Strict EAP conformance mode can be configured by disabling
264 * workarounds with eap_workaround = 0.
266 unsigned int eap_workaround;
268 #endif /* IEEE8021X_EAPOL */
271 * mode - IEEE 802.11 operation mode (Infrastucture/IBSS)
273 * 0 = infrastructure (Managed) mode, i.e., associate with an AP.
275 * 1 = IBSS (ad-hoc, peer-to-peer)
277 * 2 = AP (access point)
279 * 3 = P2P Group Owner (can be set in the configuration file)
281 * 4 = P2P Group Formation (used internally; not in configuration
284 * Note: IBSS can only be used with key_mgmt NONE (plaintext and
285 * static WEP) and key_mgmt=WPA-NONE (fixed group key TKIP/CCMP). In
286 * addition, ap_scan has to be set to 2 for IBSS. WPA-None requires
287 * following network block options: proto=WPA, key_mgmt=WPA-NONE,
288 * pairwise=NONE, group=TKIP (or CCMP, but not both), and psk must also
289 * be set (either directly or using ASCII passphrase).
295 WPAS_MODE_P2P_GO = 3,
296 WPAS_MODE_P2P_GROUP_FORMATION = 4,
300 * disabled - Whether this network is currently disabled
302 * 0 = this network can be used (default).
303 * 1 = this network block is disabled (can be enabled through
304 * ctrl_iface, e.g., with wpa_cli or wpa_gui).
305 * 2 = this network block includes parameters for a persistent P2P
306 * group (can be used with P2P ctrl_iface commands)
311 * peerkey - Whether PeerKey handshake for direct links is allowed
313 * This is only used when both RSN/WPA2 and IEEE 802.11e (QoS) are
316 * 0 = disabled (default)
322 * id_str - Network identifier string for external scripts
324 * This value is passed to external ctrl_iface monitors in
325 * WPA_EVENT_CONNECTED event and wpa_cli sets this as WPA_ID_STR
326 * environment variable for action scripts.
330 #ifdef CONFIG_IEEE80211W
332 * ieee80211w - Whether management frame protection is enabled
334 * This value is used to configure policy for management frame
335 * protection (IEEE 802.11w). 0 = disabled, 1 = optional, 2 = required.
337 enum mfp_options ieee80211w;
338 #endif /* CONFIG_IEEE80211W */
341 * frequency - Channel frequency in megahertz (MHz) for IBSS
343 * This value is used to configure the initial channel for IBSS (adhoc)
344 * networks, e.g., 2412 = IEEE 802.11b/g channel 1. It is ignored in
345 * the infrastructure mode. In addition, this value is only used by the
346 * station that creates the IBSS. If an IBSS network with the
347 * configured SSID is already present, the frequency of the network
348 * will be used instead of this configured value.
353 * wpa_ptk_rekey - Maximum lifetime for PTK in seconds
355 * This value can be used to enforce rekeying of PTK to mitigate some
356 * attacks against TKIP deficiencies.
361 * scan_freq - Array of frequencies to scan or %NULL for all
363 * This is an optional zero-terminated array of frequencies in
364 * megahertz (MHz) to include in scan requests when searching for this
365 * network. This can be used to speed up scanning when the network is
366 * known to not use all possible channels.
371 * bgscan - Background scan and roaming parameters or %NULL if none
373 * This is an optional set of parameters for background scanning and
374 * roaming within a network (ESS) in following format:
375 * <bgscan module name>:<module parameters>
380 * freq_list - Array of allowed frequencies or %NULL for all
382 * This is an optional zero-terminated array of frequencies in
383 * megahertz (MHz) to allow for selecting the BSS. If set, scan results
384 * that do not match any of the specified frequencies are not
385 * considered when selecting a BSS.
390 * p2p_group - Network generated as a P2P group (used internally)
395 * p2p_persistent_group - Whether this is a persistent group
397 int p2p_persistent_group;
400 * temporary - Whether this network is temporary and not to be saved
405 * export_keys - Whether keys may be exported
407 * This attribute will be set when keys are determined through
408 * WPS or similar so that they may be exported.
413 #endif /* CONFIG_SSID_H */