HS 2.0R2: Add tracking of provisioning SP
[mech_eap.git] / wpa_supplicant / config.h
1 /*
2  * WPA Supplicant / Configuration file structures
3  * Copyright (c) 2003-2012, 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_H
10 #define CONFIG_H
11
12 #define DEFAULT_EAPOL_VERSION 1
13 #ifdef CONFIG_NO_SCAN_PROCESSING
14 #define DEFAULT_AP_SCAN 2
15 #else /* CONFIG_NO_SCAN_PROCESSING */
16 #define DEFAULT_AP_SCAN 1
17 #endif /* CONFIG_NO_SCAN_PROCESSING */
18 #define DEFAULT_FAST_REAUTH 1
19 #define DEFAULT_P2P_GO_INTENT 7
20 #define DEFAULT_P2P_INTRA_BSS 1
21 #define DEFAULT_P2P_GO_MAX_INACTIVITY (5 * 60)
22 #define DEFAULT_BSS_MAX_COUNT 200
23 #define DEFAULT_BSS_EXPIRATION_AGE 180
24 #define DEFAULT_BSS_EXPIRATION_SCAN_COUNT 2
25 #define DEFAULT_MAX_NUM_STA 128
26 #define DEFAULT_ACCESS_NETWORK_TYPE 15
27 #define DEFAULT_SCAN_CUR_FREQ 0
28
29 #include "config_ssid.h"
30 #include "wps/wps.h"
31 #include "common/ieee802_11_common.h"
32
33
34 struct wpa_cred {
35         /**
36          * next - Next credential in the list
37          *
38          * This pointer can be used to iterate over all credentials. The head
39          * of this list is stored in the cred field of struct wpa_config.
40          */
41         struct wpa_cred *next;
42
43         /**
44          * id - Unique id for the credential
45          *
46          * This identifier is used as a unique identifier for each credential
47          * block when using the control interface. Each credential is allocated
48          * an id when it is being created, either when reading the
49          * configuration file or when a new credential is added through the
50          * control interface.
51          */
52         int id;
53
54         /**
55          * temporary - Whether this credential is temporary and not to be saved
56          */
57         int temporary;
58
59         /**
60          * priority - Priority group
61          *
62          * By default, all networks and credentials get the same priority group
63          * (0). This field can be used to give higher priority for credentials
64          * (and similarly in struct wpa_ssid for network blocks) to change the
65          * Interworking automatic networking selection behavior. The matching
66          * network (based on either an enabled network block or a credential)
67          * with the highest priority value will be selected.
68          */
69         int priority;
70
71         /**
72          * pcsc - Use PC/SC and SIM/USIM card
73          */
74         int pcsc;
75
76         /**
77          * realm - Home Realm for Interworking
78          */
79         char *realm;
80
81         /**
82          * username - Username for Interworking network selection
83          */
84         char *username;
85
86         /**
87          * password - Password for Interworking network selection
88          */
89         char *password;
90
91         /**
92          * ext_password - Whether password is a name for external storage
93          */
94         int ext_password;
95
96         /**
97          * ca_cert - CA certificate for Interworking network selection
98          */
99         char *ca_cert;
100
101         /**
102          * client_cert - File path to client certificate file (PEM/DER)
103          *
104          * This field is used with Interworking networking selection for a case
105          * where client certificate/private key is used for authentication
106          * (EAP-TLS). Full path to the file should be used since working
107          * directory may change when wpa_supplicant is run in the background.
108          *
109          * Alternatively, a named configuration blob can be used by setting
110          * this to blob://blob_name.
111          */
112         char *client_cert;
113
114         /**
115          * private_key - File path to client private key file (PEM/DER/PFX)
116          *
117          * When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be
118          * commented out. Both the private key and certificate will be read
119          * from the PKCS#12 file in this case. Full path to the file should be
120          * used since working directory may change when wpa_supplicant is run
121          * in the background.
122          *
123          * Windows certificate store can be used by leaving client_cert out and
124          * configuring private_key in one of the following formats:
125          *
126          * cert://substring_to_match
127          *
128          * hash://certificate_thumbprint_in_hex
129          *
130          * For example: private_key="hash://63093aa9c47f56ae88334c7b65a4"
131          *
132          * Note that when running wpa_supplicant as an application, the user
133          * certificate store (My user account) is used, whereas computer store
134          * (Computer account) is used when running wpasvc as a service.
135          *
136          * Alternatively, a named configuration blob can be used by setting
137          * this to blob://blob_name.
138          */
139         char *private_key;
140
141         /**
142          * private_key_passwd - Password for private key file
143          */
144         char *private_key_passwd;
145
146         /**
147          * imsi - IMSI in <MCC> | <MNC> | '-' | <MSIN> format
148          */
149         char *imsi;
150
151         /**
152          * milenage - Milenage parameters for SIM/USIM simulator in
153          *      <Ki>:<OPc>:<SQN> format
154          */
155         char *milenage;
156
157         /**
158          * domain_suffix_match - Constraint for server domain name
159          *
160          * If set, this FQDN is used as a suffix match requirement for the AAA
161          * server certificate in SubjectAltName dNSName element(s). If a
162          * matching dNSName is found, this constraint is met. If no dNSName
163          * values are present, this constraint is matched against SubjetName CN
164          * using same suffix match comparison. Suffix match here means that the
165          * host/domain name is compared one label at a time starting from the
166          * top-level domain and all the labels in @domain_suffix_match shall be
167          * included in the certificate. The certificate may include additional
168          * sub-level labels in addition to the required labels.
169          *
170          * For example, domain_suffix_match=example.com would match
171          * test.example.com but would not match test-example.com.
172          */
173         char *domain_suffix_match;
174
175         /**
176          * domain - Home service provider FQDN(s)
177          *
178          * This is used to compare against the Domain Name List to figure out
179          * whether the AP is operated by the Home SP. Multiple domain entries
180          * can be used to configure alternative FQDNs that will be considered
181          * home networks.
182          */
183         char **domain;
184
185         /**
186          * num_domain - Number of FQDNs in the domain array
187          */
188         size_t num_domain;
189
190         /**
191          * roaming_consortium - Roaming Consortium OI
192          *
193          * If roaming_consortium_len is non-zero, this field contains the
194          * Roaming Consortium OI that can be used to determine which access
195          * points support authentication with this credential. This is an
196          * alternative to the use of the realm parameter. When using Roaming
197          * Consortium to match the network, the EAP parameters need to be
198          * pre-configured with the credential since the NAI Realm information
199          * may not be available or fetched.
200          */
201         u8 roaming_consortium[15];
202
203         /**
204          * roaming_consortium_len - Length of roaming_consortium
205          */
206         size_t roaming_consortium_len;
207
208         u8 required_roaming_consortium[15];
209         size_t required_roaming_consortium_len;
210
211         /**
212          * eap_method - EAP method to use
213          *
214          * Pre-configured EAP method to use with this credential or %NULL to
215          * indicate no EAP method is selected, i.e., the method will be
216          * selected automatically based on ANQP information.
217          */
218         struct eap_method_type *eap_method;
219
220         /**
221          * phase1 - Phase 1 (outer authentication) parameters
222          *
223          * Pre-configured EAP parameters or %NULL.
224          */
225         char *phase1;
226
227         /**
228          * phase2 - Phase 2 (inner authentication) parameters
229          *
230          * Pre-configured EAP parameters or %NULL.
231          */
232         char *phase2;
233
234         struct excluded_ssid {
235                 u8 ssid[MAX_SSID_LEN];
236                 size_t ssid_len;
237         } *excluded_ssid;
238         size_t num_excluded_ssid;
239
240         struct roaming_partner {
241                 char fqdn[128];
242                 int exact_match;
243                 u8 priority;
244                 char country[3];
245         } *roaming_partner;
246         size_t num_roaming_partner;
247
248         int update_identifier;
249
250         /**
251          * provisioning_sp - FQDN of the SP that provisioned the credential
252          */
253         char *provisioning_sp;
254 };
255
256
257 #define CFG_CHANGED_DEVICE_NAME BIT(0)
258 #define CFG_CHANGED_CONFIG_METHODS BIT(1)
259 #define CFG_CHANGED_DEVICE_TYPE BIT(2)
260 #define CFG_CHANGED_OS_VERSION BIT(3)
261 #define CFG_CHANGED_UUID BIT(4)
262 #define CFG_CHANGED_COUNTRY BIT(5)
263 #define CFG_CHANGED_SEC_DEVICE_TYPE BIT(6)
264 #define CFG_CHANGED_P2P_SSID_POSTFIX BIT(7)
265 #define CFG_CHANGED_WPS_STRING BIT(8)
266 #define CFG_CHANGED_P2P_INTRA_BSS BIT(9)
267 #define CFG_CHANGED_VENDOR_EXTENSION BIT(10)
268 #define CFG_CHANGED_P2P_LISTEN_CHANNEL BIT(11)
269 #define CFG_CHANGED_P2P_OPER_CHANNEL BIT(12)
270 #define CFG_CHANGED_P2P_PREF_CHAN BIT(13)
271 #define CFG_CHANGED_EXT_PW_BACKEND BIT(14)
272 #define CFG_CHANGED_NFC_PASSWORD_TOKEN BIT(15)
273
274 /**
275  * struct wpa_config - wpa_supplicant configuration data
276  *
277  * This data structure is presents the per-interface (radio) configuration
278  * data. In many cases, there is only one struct wpa_config instance, but if
279  * more than one network interface is being controlled, one instance is used
280  * for each.
281  */
282 struct wpa_config {
283         /**
284          * ssid - Head of the global network list
285          *
286          * This is the head for the list of all the configured networks.
287          */
288         struct wpa_ssid *ssid;
289
290         /**
291          * pssid - Per-priority network lists (in priority order)
292          */
293         struct wpa_ssid **pssid;
294
295         /**
296          * num_prio - Number of different priorities used in the pssid lists
297          *
298          * This indicates how many per-priority network lists are included in
299          * pssid.
300          */
301         int num_prio;
302
303         /**
304          * cred - Head of the credential list
305          *
306          * This is the head for the list of all the configured credentials.
307          */
308         struct wpa_cred *cred;
309
310         /**
311          * eapol_version - IEEE 802.1X/EAPOL version number
312          *
313          * wpa_supplicant is implemented based on IEEE Std 802.1X-2004 which
314          * defines EAPOL version 2. However, there are many APs that do not
315          * handle the new version number correctly (they seem to drop the
316          * frames completely). In order to make wpa_supplicant interoperate
317          * with these APs, the version number is set to 1 by default. This
318          * configuration value can be used to set it to the new version (2).
319          */
320         int eapol_version;
321
322         /**
323          * ap_scan - AP scanning/selection
324          *
325          * By default, wpa_supplicant requests driver to perform AP
326          * scanning and then uses the scan results to select a
327          * suitable AP. Another alternative is to allow the driver to
328          * take care of AP scanning and selection and use
329          * wpa_supplicant just to process EAPOL frames based on IEEE
330          * 802.11 association information from the driver.
331          *
332          * 1: wpa_supplicant initiates scanning and AP selection (default).
333          *
334          * 0: Driver takes care of scanning, AP selection, and IEEE 802.11
335          * association parameters (e.g., WPA IE generation); this mode can
336          * also be used with non-WPA drivers when using IEEE 802.1X mode;
337          * do not try to associate with APs (i.e., external program needs
338          * to control association). This mode must also be used when using
339          * wired Ethernet drivers.
340          *
341          * 2: like 0, but associate with APs using security policy and SSID
342          * (but not BSSID); this can be used, e.g., with ndiswrapper and NDIS
343          * drivers to enable operation with hidden SSIDs and optimized roaming;
344          * in this mode, the network blocks in the configuration are tried
345          * one by one until the driver reports successful association; each
346          * network block should have explicit security policy (i.e., only one
347          * option in the lists) for key_mgmt, pairwise, group, proto variables.
348          */
349         int ap_scan;
350
351         /**
352          * bgscan - Background scan and roaming parameters or %NULL if none
353          *
354          * This is an optional set of parameters for background scanning and
355          * roaming within a network (ESS). For more detailed information see
356          * ssid block documentation.
357          *
358          * The variable defines default bgscan behavior for all BSS station
359          * networks except for those which have their own bgscan configuration.
360          */
361          char *bgscan;
362
363         /**
364          * disable_scan_offload - Disable automatic offloading of scan requests
365          *
366          * By default, %wpa_supplicant tries to offload scanning if the driver
367          * indicates support for this (sched_scan). This configuration
368          * parameter can be used to disable this offloading mechanism.
369          */
370         int disable_scan_offload;
371
372         /**
373          * ctrl_interface - Parameters for the control interface
374          *
375          * If this is specified, %wpa_supplicant will open a control interface
376          * that is available for external programs to manage %wpa_supplicant.
377          * The meaning of this string depends on which control interface
378          * mechanism is used. For all cases, the existence of this parameter
379          * in configuration is used to determine whether the control interface
380          * is enabled.
381          *
382          * For UNIX domain sockets (default on Linux and BSD): This is a
383          * directory that will be created for UNIX domain sockets for listening
384          * to requests from external programs (CLI/GUI, etc.) for status
385          * information and configuration. The socket file will be named based
386          * on the interface name, so multiple %wpa_supplicant processes can be
387          * run at the same time if more than one interface is used.
388          * /var/run/wpa_supplicant is the recommended directory for sockets and
389          * by default, wpa_cli will use it when trying to connect with
390          * %wpa_supplicant.
391          *
392          * Access control for the control interface can be configured
393          * by setting the directory to allow only members of a group
394          * to use sockets. This way, it is possible to run
395          * %wpa_supplicant as root (since it needs to change network
396          * configuration and open raw sockets) and still allow GUI/CLI
397          * components to be run as non-root users. However, since the
398          * control interface can be used to change the network
399          * configuration, this access needs to be protected in many
400          * cases. By default, %wpa_supplicant is configured to use gid
401          * 0 (root). If you want to allow non-root users to use the
402          * control interface, add a new group and change this value to
403          * match with that group. Add users that should have control
404          * interface access to this group.
405          *
406          * When configuring both the directory and group, use following format:
407          * DIR=/var/run/wpa_supplicant GROUP=wheel
408          * DIR=/var/run/wpa_supplicant GROUP=0
409          * (group can be either group name or gid)
410          *
411          * For UDP connections (default on Windows): The value will be ignored.
412          * This variable is just used to select that the control interface is
413          * to be created. The value can be set to, e.g., udp
414          * (ctrl_interface=udp).
415          *
416          * For Windows Named Pipe: This value can be used to set the security
417          * descriptor for controlling access to the control interface. Security
418          * descriptor can be set using Security Descriptor String Format (see
419          * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/security_descriptor_string_format.asp).
420          * The descriptor string needs to be prefixed with SDDL=. For example,
421          * ctrl_interface=SDDL=D: would set an empty DACL (which will reject
422          * all connections).
423          */
424         char *ctrl_interface;
425
426         /**
427          * ctrl_interface_group - Control interface group (DEPRECATED)
428          *
429          * This variable is only used for backwards compatibility. Group for
430          * UNIX domain sockets should now be specified using GROUP=group in
431          * ctrl_interface variable.
432          */
433         char *ctrl_interface_group;
434
435         /**
436          * fast_reauth - EAP fast re-authentication (session resumption)
437          *
438          * By default, fast re-authentication is enabled for all EAP methods
439          * that support it. This variable can be used to disable fast
440          * re-authentication (by setting fast_reauth=0). Normally, there is no
441          * need to disable fast re-authentication.
442          */
443         int fast_reauth;
444
445         /**
446          * opensc_engine_path - Path to the OpenSSL engine for opensc
447          *
448          * This is an OpenSSL specific configuration option for loading OpenSC
449          * engine (engine_opensc.so); if %NULL, this engine is not loaded.
450          */
451         char *opensc_engine_path;
452
453         /**
454          * pkcs11_engine_path - Path to the OpenSSL engine for PKCS#11
455          *
456          * This is an OpenSSL specific configuration option for loading PKCS#11
457          * engine (engine_pkcs11.so); if %NULL, this engine is not loaded.
458          */
459         char *pkcs11_engine_path;
460
461         /**
462          * pkcs11_module_path - Path to the OpenSSL OpenSC/PKCS#11 module
463          *
464          * This is an OpenSSL specific configuration option for configuring
465          * path to OpenSC/PKCS#11 engine (opensc-pkcs11.so); if %NULL, this
466          * module is not loaded.
467          */
468         char *pkcs11_module_path;
469
470         /**
471          * pcsc_reader - PC/SC reader name prefix
472          *
473          * If not %NULL, PC/SC reader with a name that matches this prefix is
474          * initialized for SIM/USIM access. Empty string can be used to match
475          * the first available reader.
476          */
477         char *pcsc_reader;
478
479         /**
480          * pcsc_pin - PIN for USIM, GSM SIM, and smartcards
481          *
482          * This field is used to configure PIN for SIM/USIM for EAP-SIM and
483          * EAP-AKA. If left out, this will be asked through control interface.
484          */
485         char *pcsc_pin;
486
487         /**
488          * external_sim - Use external processing for SIM/USIM operations
489          */
490         int external_sim;
491
492         /**
493          * driver_param - Driver interface parameters
494          *
495          * This text string is passed to the selected driver interface with the
496          * optional struct wpa_driver_ops::set_param() handler. This can be
497          * used to configure driver specific options without having to add new
498          * driver interface functionality.
499          */
500         char *driver_param;
501
502         /**
503          * dot11RSNAConfigPMKLifetime - Maximum lifetime of a PMK
504          *
505          * dot11 MIB variable for the maximum lifetime of a PMK in the PMK
506          * cache (unit: seconds).
507          */
508         unsigned int dot11RSNAConfigPMKLifetime;
509
510         /**
511          * dot11RSNAConfigPMKReauthThreshold - PMK re-authentication threshold
512          *
513          * dot11 MIB variable for the percentage of the PMK lifetime
514          * that should expire before an IEEE 802.1X reauthentication occurs.
515          */
516         unsigned int dot11RSNAConfigPMKReauthThreshold;
517
518         /**
519          * dot11RSNAConfigSATimeout - Security association timeout
520          *
521          * dot11 MIB variable for the maximum time a security association
522          * shall take to set up (unit: seconds).
523          */
524         unsigned int dot11RSNAConfigSATimeout;
525
526         /**
527          * update_config - Is wpa_supplicant allowed to update configuration
528          *
529          * This variable control whether wpa_supplicant is allow to re-write
530          * its configuration with wpa_config_write(). If this is zero,
531          * configuration data is only changed in memory and the external data
532          * is not overriden. If this is non-zero, wpa_supplicant will update
533          * the configuration data (e.g., a file) whenever configuration is
534          * changed. This update may replace the old configuration which can
535          * remove comments from it in case of a text file configuration.
536          */
537         int update_config;
538
539         /**
540          * blobs - Configuration blobs
541          */
542         struct wpa_config_blob *blobs;
543
544         /**
545          * uuid - Universally Unique IDentifier (UUID; see RFC 4122) for WPS
546          */
547         u8 uuid[16];
548
549         /**
550          * device_name - Device Name (WPS)
551          * User-friendly description of device; up to 32 octets encoded in
552          * UTF-8
553          */
554         char *device_name;
555
556         /**
557          * manufacturer - Manufacturer (WPS)
558          * The manufacturer of the device (up to 64 ASCII characters)
559          */
560         char *manufacturer;
561
562         /**
563          * model_name - Model Name (WPS)
564          * Model of the device (up to 32 ASCII characters)
565          */
566         char *model_name;
567
568         /**
569          * model_number - Model Number (WPS)
570          * Additional device description (up to 32 ASCII characters)
571          */
572         char *model_number;
573
574         /**
575          * serial_number - Serial Number (WPS)
576          * Serial number of the device (up to 32 characters)
577          */
578         char *serial_number;
579
580         /**
581          * device_type - Primary Device Type (WPS)
582          */
583         u8 device_type[WPS_DEV_TYPE_LEN];
584
585         /**
586          * config_methods - Config Methods
587          *
588          * This is a space-separated list of supported WPS configuration
589          * methods. For example, "label virtual_display virtual_push_button
590          * keypad".
591          * Available methods: usba ethernet label display ext_nfc_token
592          * int_nfc_token nfc_interface push_button keypad
593          * virtual_display physical_display
594          * virtual_push_button physical_push_button.
595          */
596         char *config_methods;
597
598         /**
599          * os_version - OS Version (WPS)
600          * 4-octet operating system version number
601          */
602         u8 os_version[4];
603
604         /**
605          * country - Country code
606          *
607          * This is the ISO/IEC alpha2 country code for which we are operating
608          * in
609          */
610         char country[2];
611
612         /**
613          * wps_cred_processing - Credential processing
614          *
615          *   0 = process received credentials internally
616          *   1 = do not process received credentials; just pass them over
617          *      ctrl_iface to external program(s)
618          *   2 = process received credentials internally and pass them over
619          *      ctrl_iface to external program(s)
620          */
621         int wps_cred_processing;
622
623 #define MAX_SEC_DEVICE_TYPES 5
624         /**
625          * sec_device_types - Secondary Device Types (P2P)
626          */
627         u8 sec_device_type[MAX_SEC_DEVICE_TYPES][WPS_DEV_TYPE_LEN];
628         int num_sec_device_types;
629
630         int p2p_listen_reg_class;
631         int p2p_listen_channel;
632         int p2p_oper_reg_class;
633         int p2p_oper_channel;
634         int p2p_go_intent;
635         char *p2p_ssid_postfix;
636         int persistent_reconnect;
637         int p2p_intra_bss;
638         unsigned int num_p2p_pref_chan;
639         struct p2p_channel *p2p_pref_chan;
640         struct wpa_freq_range_list p2p_no_go_freq;
641         int p2p_add_cli_chan;
642         int p2p_ignore_shared_freq;
643
644         struct wpabuf *wps_vendor_ext_m1;
645
646 #define MAX_WPS_VENDOR_EXT 10
647         /**
648          * wps_vendor_ext - Vendor extension attributes in WPS
649          */
650         struct wpabuf *wps_vendor_ext[MAX_WPS_VENDOR_EXT];
651
652         /**
653          * p2p_group_idle - Maximum idle time in seconds for P2P group
654          *
655          * This value controls how long a P2P group is maintained after there
656          * is no other members in the group. As a GO, this means no associated
657          * stations in the group. As a P2P client, this means no GO seen in
658          * scan results. The maximum idle time is specified in seconds with 0
659          * indicating no time limit, i.e., the P2P group remains in active
660          * state indefinitely until explicitly removed. As a P2P client, the
661          * maximum idle time of P2P_MAX_CLIENT_IDLE seconds is enforced, i.e.,
662          * this parameter is mainly meant for GO use and for P2P client, it can
663          * only be used to reduce the default timeout to smaller value. A
664          * special value -1 can be used to configure immediate removal of the
665          * group for P2P client role on any disconnection after the data
666          * connection has been established.
667          */
668         int p2p_group_idle;
669
670         /**
671          * bss_max_count - Maximum number of BSS entries to keep in memory
672          */
673         unsigned int bss_max_count;
674
675         /**
676          * bss_expiration_age - BSS entry age after which it can be expired
677          *
678          * This value controls the time in seconds after which a BSS entry
679          * gets removed if it has not been updated or is not in use.
680          */
681         unsigned int bss_expiration_age;
682
683         /**
684          * bss_expiration_scan_count - Expire BSS after number of scans
685          *
686          * If the BSS entry has not been seen in this many scans, it will be
687          * removed. A value of 1 means that entry is removed after the first
688          * scan in which the BSSID is not seen. Larger values can be used
689          * to avoid BSS entries disappearing if they are not visible in
690          * every scan (e.g., low signal quality or interference).
691          */
692         unsigned int bss_expiration_scan_count;
693
694         /**
695          * filter_ssids - SSID-based scan result filtering
696          *
697          *   0 = do not filter scan results
698          *   1 = only include configured SSIDs in scan results/BSS table
699          */
700         int filter_ssids;
701
702         /**
703          * filter_rssi - RSSI-based scan result filtering
704          *
705          * 0 = do not filter scan results
706          * -n = filter scan results below -n dBm
707          */
708         int filter_rssi;
709
710         /**
711          * max_num_sta - Maximum number of STAs in an AP/P2P GO
712          */
713         unsigned int max_num_sta;
714
715         /**
716          * freq_list - Array of allowed scan frequencies or %NULL for all
717          *
718          * This is an optional zero-terminated array of frequencies in
719          * megahertz (MHz) to allow for narrowing scanning range.
720          */
721         int *freq_list;
722
723         /**
724          * scan_cur_freq - Whether to scan only the current channel
725          *
726          * If true, attempt to scan only the current channel if any other
727          * VIFs on this radio are already associated on a particular channel.
728          */
729         int scan_cur_freq;
730
731         /**
732          * changed_parameters - Bitmap of changed parameters since last update
733          */
734         unsigned int changed_parameters;
735
736         /**
737          * disassoc_low_ack - Disassocicate stations with massive packet loss
738          */
739         int disassoc_low_ack;
740
741         /**
742          * interworking - Whether Interworking (IEEE 802.11u) is enabled
743          */
744         int interworking;
745
746         /**
747          * access_network_type - Access Network Type
748          *
749          * When Interworking is enabled, scans will be limited to APs that
750          * advertise the specified Access Network Type (0..15; with 15
751          * indicating wildcard match).
752          */
753         int access_network_type;
754
755         /**
756          * hessid - Homogenous ESS identifier
757          *
758          * If this is set (any octet is non-zero), scans will be used to
759          * request response only from BSSes belonging to the specified
760          * Homogeneous ESS. This is used only if interworking is enabled.
761          */
762         u8 hessid[ETH_ALEN];
763
764         /**
765          * hs20 - Hotspot 2.0
766          */
767         int hs20;
768
769         /**
770          * pbc_in_m1 - AP mode WPS probing workaround for PBC with Windows 7
771          *
772          * Windows 7 uses incorrect way of figuring out AP's WPS capabilities
773          * by acting as a Registrar and using M1 from the AP. The config
774          * methods attribute in that message is supposed to indicate only the
775          * configuration method supported by the AP in Enrollee role, i.e., to
776          * add an external Registrar. For that case, PBC shall not be used and
777          * as such, the PushButton config method is removed from M1 by default.
778          * If pbc_in_m1=1 is included in the configuration file, the PushButton
779          * config method is left in M1 (if included in config_methods
780          * parameter) to allow Windows 7 to use PBC instead of PIN (e.g., from
781          * a label in the AP).
782          */
783         int pbc_in_m1;
784
785         /**
786          * autoscan - Automatic scan parameters or %NULL if none
787          *
788          * This is an optional set of parameters for automatic scanning
789          * within an interface in following format:
790          * <autoscan module name>:<module parameters>
791          */
792         char *autoscan;
793
794         /**
795          * wps_nfc_pw_from_config - NFC Device Password was read from config
796          *
797          * This parameter can be determined whether the NFC Device Password was
798          * included in the configuration (1) or generated dynamically (0). Only
799          * the former case is re-written back to the configuration file.
800          */
801         int wps_nfc_pw_from_config;
802
803         /**
804          * wps_nfc_dev_pw_id - NFC Device Password ID for password token
805          */
806         int wps_nfc_dev_pw_id;
807
808         /**
809          * wps_nfc_dh_pubkey - NFC DH Public Key for password token
810          */
811         struct wpabuf *wps_nfc_dh_pubkey;
812
813         /**
814          * wps_nfc_dh_privkey - NFC DH Private Key for password token
815          */
816         struct wpabuf *wps_nfc_dh_privkey;
817
818         /**
819          * wps_nfc_dev_pw - NFC Device Password for password token
820          */
821         struct wpabuf *wps_nfc_dev_pw;
822
823         /**
824          * ext_password_backend - External password backend or %NULL if none
825          *
826          * format: <backend name>[:<optional backend parameters>]
827          */
828         char *ext_password_backend;
829
830         /*
831          * p2p_go_max_inactivity - Timeout in seconds to detect STA inactivity
832          *
833          * This timeout value is used in P2P GO mode to clean up
834          * inactive stations.
835          * By default: 300 seconds.
836          */
837         int p2p_go_max_inactivity;
838
839         struct hostapd_wmm_ac_params wmm_ac_params[4];
840
841         /**
842          * auto_interworking - Whether to use network selection automatically
843          *
844          * 0 = do not automatically go through Interworking network selection
845          *     (i.e., require explicit interworking_select command for this)
846          * 1 = perform Interworking network selection if one or more
847          *     credentials have been configured and scan did not find a
848          *     matching network block
849          */
850         int auto_interworking;
851
852         /**
853          * p2p_go_ht40 - Default mode for HT40 enable when operating as GO.
854          *
855          * This will take effect for p2p_group_add, p2p_connect, and p2p_invite.
856          * Note that regulatory constraints and driver capabilities are
857          * consulted anyway, so setting it to 1 can't do real harm.
858          * By default: 0 (disabled)
859          */
860         int p2p_go_ht40;
861
862         /**
863          * p2p_go_vht - Default mode for VHT enable when operating as GO
864          *
865          * This will take effect for p2p_group_add, p2p_connect, and p2p_invite.
866          * Note that regulatory constraints and driver capabilities are
867          * consulted anyway, so setting it to 1 can't do real harm.
868          * By default: 0 (disabled)
869          */
870         int p2p_go_vht;
871
872         /**
873          * p2p_disabled - Whether P2P operations are disabled for this interface
874          */
875         int p2p_disabled;
876
877         /**
878          * p2p_no_group_iface - Whether group interfaces can be used
879          *
880          * By default, wpa_supplicant will create a separate interface for P2P
881          * group operations if the driver supports this. This functionality can
882          * be disabled by setting this parameter to 1. In that case, the same
883          * interface that was used for the P2P management operations is used
884          * also for the group operation.
885          */
886         int p2p_no_group_iface;
887
888         /**
889          * okc - Whether to enable opportunistic key caching by default
890          *
891          * By default, OKC is disabled unless enabled by the per-network
892          * proactive_key_caching=1 parameter. okc=1 can be used to change this
893          * default behavior.
894          */
895         int okc;
896
897         /**
898          * pmf - Whether to enable/require PMF by default
899          *
900          * By default, PMF is disabled unless enabled by the per-network
901          * ieee80211w=1 or ieee80211w=2 parameter. pmf=1/2 can be used to change
902          * this default behavior.
903          */
904         enum mfp_options pmf;
905
906         /**
907          * sae_groups - Preference list of enabled groups for SAE
908          *
909          * By default (if this parameter is not set), the mandatory group 19
910          * (ECC group defined over a 256-bit prime order field) is preferred,
911          * but other groups are also enabled. If this parameter is set, the
912          * groups will be tried in the indicated order.
913          */
914         int *sae_groups;
915
916         /**
917          * dtim_period - Default DTIM period in Beacon intervals
918          *
919          * This parameter can be used to set the default value for network
920          * blocks that do not specify dtim_period.
921          */
922         int dtim_period;
923
924         /**
925          * beacon_int - Default Beacon interval in TU
926          *
927          * This parameter can be used to set the default value for network
928          * blocks that do not specify beacon_int.
929          */
930         int beacon_int;
931
932         /**
933          * ap_vendor_elements: Vendor specific elements for Beacon/ProbeResp
934          *
935          * This parameter can be used to define additional vendor specific
936          * elements for Beacon and Probe Response frames in AP/P2P GO mode. The
937          * format for these element(s) is a hexdump of the raw information
938          * elements (id+len+payload for one or more elements).
939          */
940         struct wpabuf *ap_vendor_elements;
941
942         /**
943          * ignore_old_scan_res - Ignore scan results older than request
944          *
945          * The driver may have a cache of scan results that makes it return
946          * information that is older than our scan trigger. This parameter can
947          * be used to configure such old information to be ignored instead of
948          * allowing it to update the internal BSS table.
949          */
950         int ignore_old_scan_res;
951
952         /**
953          * sched_scan_interval -  schedule scan interval
954          */
955         unsigned int sched_scan_interval;
956
957         /**
958          * tdls_external_control - External control for TDLS setup requests
959          *
960          * Enable TDLS mode where external programs are given the control
961          * to specify the TDLS link to get established to the driver. The
962          * driver requests the TDLS setup to the supplicant only for the
963          * specified TDLS peers.
964          */
965         int tdls_external_control;
966
967         u8 ip_addr_go[4];
968         u8 ip_addr_mask[4];
969         u8 ip_addr_start[4];
970         u8 ip_addr_end[4];
971
972         /**
973          * osu_dir - OSU provider information directory
974          *
975          * If set, allow FETCH_OSU control interface command to be used to fetch
976          * OSU provider information into all APs and store the results in this
977          * directory.
978          */
979         char *osu_dir;
980 };
981
982
983 /* Prototypes for common functions from config.c */
984
985 void wpa_config_free(struct wpa_config *ssid);
986 void wpa_config_free_ssid(struct wpa_ssid *ssid);
987 void wpa_config_foreach_network(struct wpa_config *config,
988                                 void (*func)(void *, struct wpa_ssid *),
989                                 void *arg);
990 struct wpa_ssid * wpa_config_get_network(struct wpa_config *config, int id);
991 struct wpa_ssid * wpa_config_add_network(struct wpa_config *config);
992 int wpa_config_remove_network(struct wpa_config *config, int id);
993 void wpa_config_set_network_defaults(struct wpa_ssid *ssid);
994 int wpa_config_set(struct wpa_ssid *ssid, const char *var, const char *value,
995                    int line);
996 int wpa_config_set_quoted(struct wpa_ssid *ssid, const char *var,
997                           const char *value);
998 char ** wpa_config_get_all(struct wpa_ssid *ssid, int get_keys);
999 char * wpa_config_get(struct wpa_ssid *ssid, const char *var);
1000 char * wpa_config_get_no_key(struct wpa_ssid *ssid, const char *var);
1001 void wpa_config_update_psk(struct wpa_ssid *ssid);
1002 int wpa_config_add_prio_network(struct wpa_config *config,
1003                                 struct wpa_ssid *ssid);
1004 int wpa_config_update_prio_list(struct wpa_config *config);
1005 const struct wpa_config_blob * wpa_config_get_blob(struct wpa_config *config,
1006                                                    const char *name);
1007 void wpa_config_set_blob(struct wpa_config *config,
1008                          struct wpa_config_blob *blob);
1009 void wpa_config_free_blob(struct wpa_config_blob *blob);
1010 int wpa_config_remove_blob(struct wpa_config *config, const char *name);
1011 void wpa_config_flush_blobs(struct wpa_config *config);
1012
1013 struct wpa_cred * wpa_config_get_cred(struct wpa_config *config, int id);
1014 struct wpa_cred * wpa_config_add_cred(struct wpa_config *config);
1015 int wpa_config_remove_cred(struct wpa_config *config, int id);
1016 void wpa_config_free_cred(struct wpa_cred *cred);
1017 int wpa_config_set_cred(struct wpa_cred *cred, const char *var,
1018                         const char *value, int line);
1019
1020 struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
1021                                            const char *driver_param);
1022 #ifndef CONFIG_NO_STDOUT_DEBUG
1023 void wpa_config_debug_dump_networks(struct wpa_config *config);
1024 #else /* CONFIG_NO_STDOUT_DEBUG */
1025 #define wpa_config_debug_dump_networks(c) do { } while (0)
1026 #endif /* CONFIG_NO_STDOUT_DEBUG */
1027
1028
1029 /* Prototypes for common functions from config.c */
1030 int wpa_config_process_global(struct wpa_config *config, char *pos, int line);
1031
1032
1033 /* Prototypes for backend specific functions from the selected config_*.c */
1034
1035 /**
1036  * wpa_config_read - Read and parse configuration database
1037  * @name: Name of the configuration (e.g., path and file name for the
1038  * configuration file)
1039  * @cfgp: Pointer to previously allocated configuration data or %NULL if none
1040  * Returns: Pointer to allocated configuration data or %NULL on failure
1041  *
1042  * This function reads configuration data, parses its contents, and allocates
1043  * data structures needed for storing configuration information. The allocated
1044  * data can be freed with wpa_config_free().
1045  *
1046  * Each configuration backend needs to implement this function.
1047  */
1048 struct wpa_config * wpa_config_read(const char *name, struct wpa_config *cfgp);
1049
1050 /**
1051  * wpa_config_write - Write or update configuration data
1052  * @name: Name of the configuration (e.g., path and file name for the
1053  * configuration file)
1054  * @config: Configuration data from wpa_config_read()
1055  * Returns: 0 on success, -1 on failure
1056  *
1057  * This function write all configuration data into an external database (e.g.,
1058  * a text file) in a format that can be read with wpa_config_read(). This can
1059  * be used to allow wpa_supplicant to update its configuration, e.g., when a
1060  * new network is added or a password is changed.
1061  *
1062  * Each configuration backend needs to implement this function.
1063  */
1064 int wpa_config_write(const char *name, struct wpa_config *config);
1065
1066 #endif /* CONFIG_H */