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