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