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.
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
116
* bssid_set - Whether BSSID is configured for this network
121
* psk - WPA pre-shared key (256 bits)
126
* psk_set - Whether PSK field is configured
131
* passphrase - WPA ASCII passphrase
133
* If this is set, psk will be generated using the SSID and passphrase
134
* configured for the network. ASCII passphrase must be between 8 and
135
* 63 characters (inclusive).
140
* pairwise_cipher - Bitfield of allowed pairwise ciphers, WPA_CIPHER_*
145
* group_cipher - Bitfield of allowed group ciphers, WPA_CIPHER_*
150
* key_mgmt - Bitfield of allowed key management protocols
157
* proto - Bitfield of allowed protocols, WPA_PROTO_*
162
* auth_alg - Bitfield of allowed authentication algorithms
169
* scan_ssid - Scan this SSID with Probe Requests
171
* scan_ssid can be used to scan for APs using hidden SSIDs.
172
* Note: Many drivers do not support this. ap_mode=2 can be used with
173
* such drivers to use hidden SSIDs.
177
#ifdef IEEE8021X_EAPOL
178
#define EAPOL_FLAG_REQUIRE_KEY_UNICAST BIT(0)
179
#define EAPOL_FLAG_REQUIRE_KEY_BROADCAST BIT(1)
181
* eapol_flags - Bit field of IEEE 802.1X/EAPOL options (EAPOL_FLAG_*)
186
* eap - EAP peer configuration for this network
188
struct eap_peer_config eap;
189
#endif /* IEEE8021X_EAPOL */
191
#define NUM_WEP_KEYS 4
192
#define MAX_WEP_KEY_LEN 16
196
u8 wep_key[NUM_WEP_KEYS][MAX_WEP_KEY_LEN];
199
* wep_key_len - WEP key lengths
201
size_t wep_key_len[NUM_WEP_KEYS];
204
* wep_tx_keyidx - Default key index for TX frames using WEP
209
* proactive_key_caching - Enable proactive key caching
211
* This field can be used to enable proactive key caching which is also
212
* known as opportunistic PMKSA caching for WPA2. This is disabled (0)
213
* by default. Enable by setting this to 1.
215
* Proactive key caching is used to make supplicant assume that the APs
216
* are using the same PMK and generate PMKSA cache entries without
217
* doing RSN pre-authentication. This requires support from the AP side
218
* and is normally used with wireless switches that co-locate the
221
int proactive_key_caching;
224
* mixed_cell - Whether mixed cells are allowed
226
* This option can be used to configure whether so called mixed cells,
227
* i.e., networks that use both plaintext and encryption in the same
228
* SSID, are allowed. This is disabled (0) by default. Enable by
233
#ifdef IEEE8021X_EAPOL
236
* leap - Number of EAP methods using LEAP
238
* This field should be set to 1 if LEAP is enabled. This is used to
239
* select IEEE 802.11 authentication algorithm.
244
* non_leap - Number of EAP methods not using LEAP
246
* This field should be set to >0 if any EAP method other than LEAP is
247
* enabled. This is used to select IEEE 802.11 authentication
253
* eap_workaround - EAP workarounds enabled
255
* wpa_supplicant supports number of "EAP workarounds" to work around
256
* interoperability issues with incorrectly behaving authentication
257
* servers. This is recommended to be enabled by default because some
258
* of the issues are present in large number of authentication servers.
260
* Strict EAP conformance mode can be configured by disabling
261
* workarounds with eap_workaround = 0.
263
unsigned int eap_workaround;
265
#endif /* IEEE8021X_EAPOL */
268
* mode - IEEE 802.11 operation mode (Infrastucture/IBSS)
270
* 0 = infrastructure (Managed) mode, i.e., associate with an AP.
272
* 1 = IBSS (ad-hoc, peer-to-peer)
274
* Note: IBSS can only be used with key_mgmt NONE (plaintext and
275
* static WEP) and key_mgmt=WPA-NONE (fixed group key TKIP/CCMP). In
276
* addition, ap_scan has to be set to 2 for IBSS. WPA-None requires
277
* following network block options: proto=WPA, key_mgmt=WPA-NONE,
278
* pairwise=NONE, group=TKIP (or CCMP, but not both), and psk must also
279
* be set (either directly or using ASCII passphrase).
284
* disabled - Whether this network is currently disabled
286
* 0 = this network can be used (default).
287
* 1 = this network block is disabled (can be enabled through
288
* ctrl_iface, e.g., with wpa_cli or wpa_gui).
293
* peerkey - Whether PeerKey handshake for direct links is allowed
295
* This is only used when both RSN/WPA2 and IEEE 802.11e (QoS) are
298
* 0 = disabled (default)
304
* id_str - Network identifier string for external scripts
306
* This value is passed to external ctrl_iface monitors in
307
* WPA_EVENT_CONNECTED event and wpa_cli sets this as WPA_ID_STR
308
* environment variable for action scripts.
312
#ifdef CONFIG_IEEE80211W
314
* ieee80211w - Whether management frame protection is enabled
316
* This value is used to configure policy for management frame
317
* protection (IEEE 802.11w). 0 = disabled, 1 = optional, 2 = required.
321
IEEE80211W_OPTIONAL = 1,
322
IEEE80211W_REQUIRED = 2
324
#endif /* CONFIG_IEEE80211W */
327
* frequency - Channel frequency in megahertz (MHz) for IBSS
329
* This value is used to configure the initial channel for IBSS (adhoc)
330
* networks, e.g., 2412 = IEEE 802.11b/g channel 1. It is ignored in
331
* the infrastructure mode. In addition, this value is only used by the
332
* station that creates the IBSS. If an IBSS network with the
333
* configured SSID is already present, the frequency of the network
334
* will be used instead of this configured value.
339
#endif /* CONFIG_SSID_H */