2 * WPA Supplicant / Configuration file structures
3 * Copyright (c) 2003-2012, Jouni Malinen <j@w1.fi>
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
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
29 #include "config_ssid.h"
31 #include "common/ieee802_11_common.h"
36 * next - Next credential in the list
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.
41 struct wpa_cred *next;
44 * id - Unique id for the credential
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
55 * priority - Priority group
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.
67 * pcsc - Use PC/SC and SIM/USIM card
72 * realm - Home Realm for Interworking
77 * username - Username for Interworking network selection
82 * password - Password for Interworking network selection
87 * ext_password - Whether password is a name for external storage
92 * ca_cert - CA certificate for Interworking network selection
97 * client_cert - File path to client certificate file (PEM/DER)
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.
104 * Alternatively, a named configuration blob can be used by setting
105 * this to blob://blob_name.
110 * private_key - File path to client private key file (PEM/DER/PFX)
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
118 * Windows certificate store can be used by leaving client_cert out and
119 * configuring private_key in one of the following formats:
121 * cert://substring_to_match
123 * hash://certificate_thumbprint_in_hex
125 * For example: private_key="hash://63093aa9c47f56ae88334c7b65a4"
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.
131 * Alternatively, a named configuration blob can be used by setting
132 * this to blob://blob_name.
137 * private_key_passwd - Password for private key file
139 char *private_key_passwd;
142 * imsi - IMSI in <MCC> | <MNC> | '-' | <MSIN> format
147 * milenage - Milenage parameters for SIM/USIM simulator in
148 * <Ki>:<OPc>:<SQN> format
153 * domain - Home service provider FQDN(s)
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
163 * num_domain - Number of FQDNs in the domain array
168 * roaming_consortium - Roaming Consortium OI
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.
178 u8 roaming_consortium[15];
181 * roaming_consortium_len - Length of roaming_consortium
183 size_t roaming_consortium_len;
186 * eap_method - EAP method to use
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.
192 struct eap_method_type *eap_method;
195 * phase1 - Phase 1 (outer authentication) parameters
197 * Pre-configured EAP parameters or %NULL.
202 * phase2 - Phase 2 (inner authentication) parameters
204 * Pre-configured EAP parameters or %NULL.
208 struct excluded_ssid {
209 u8 ssid[MAX_SSID_LEN];
212 size_t num_excluded_ssid;
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)
234 * struct wpa_config - wpa_supplicant configuration data
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
243 * ssid - Head of the global network list
245 * This is the head for the list of all the configured networks.
247 struct wpa_ssid *ssid;
250 * pssid - Per-priority network lists (in priority order)
252 struct wpa_ssid **pssid;
255 * num_prio - Number of different priorities used in the pssid lists
257 * This indicates how many per-priority network lists are included in
263 * cred - Head of the credential list
265 * This is the head for the list of all the configured credentials.
267 struct wpa_cred *cred;
270 * eapol_version - IEEE 802.1X/EAPOL version number
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).
282 * ap_scan - AP scanning/selection
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.
291 * 1: wpa_supplicant initiates scanning and AP selection (default).
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.
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.
311 * disable_scan_offload - Disable automatic offloading of scan requests
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.
317 int disable_scan_offload;
320 * ctrl_interface - Parameters for the control interface
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
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
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.
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)
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).
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
371 char *ctrl_interface;
374 * ctrl_interface_group - Control interface group (DEPRECATED)
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.
380 char *ctrl_interface_group;
383 * fast_reauth - EAP fast re-authentication (session resumption)
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.
393 * opensc_engine_path - Path to the OpenSSL engine for opensc
395 * This is an OpenSSL specific configuration option for loading OpenSC
396 * engine (engine_opensc.so); if %NULL, this engine is not loaded.
398 char *opensc_engine_path;
401 * pkcs11_engine_path - Path to the OpenSSL engine for PKCS#11
403 * This is an OpenSSL specific configuration option for loading PKCS#11
404 * engine (engine_pkcs11.so); if %NULL, this engine is not loaded.
406 char *pkcs11_engine_path;
409 * pkcs11_module_path - Path to the OpenSSL OpenSC/PKCS#11 module
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.
415 char *pkcs11_module_path;
418 * pcsc_reader - PC/SC reader name prefix
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.
427 * pcsc_pin - PIN for USIM, GSM SIM, and smartcards
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.
435 * driver_param - Driver interface parameters
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.
445 * dot11RSNAConfigPMKLifetime - Maximum lifetime of a PMK
447 * dot11 MIB variable for the maximum lifetime of a PMK in the PMK
448 * cache (unit: seconds).
450 unsigned int dot11RSNAConfigPMKLifetime;
453 * dot11RSNAConfigPMKReauthThreshold - PMK re-authentication threshold
455 * dot11 MIB variable for the percentage of the PMK lifetime
456 * that should expire before an IEEE 802.1X reauthentication occurs.
458 unsigned int dot11RSNAConfigPMKReauthThreshold;
461 * dot11RSNAConfigSATimeout - Security association timeout
463 * dot11 MIB variable for the maximum time a security association
464 * shall take to set up (unit: seconds).
466 unsigned int dot11RSNAConfigSATimeout;
469 * update_config - Is wpa_supplicant allowed to update configuration
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.
482 * blobs - Configuration blobs
484 struct wpa_config_blob *blobs;
487 * uuid - Universally Unique IDentifier (UUID; see RFC 4122) for WPS
492 * device_name - Device Name (WPS)
493 * User-friendly description of device; up to 32 octets encoded in
499 * manufacturer - Manufacturer (WPS)
500 * The manufacturer of the device (up to 64 ASCII characters)
505 * model_name - Model Name (WPS)
506 * Model of the device (up to 32 ASCII characters)
511 * model_number - Model Number (WPS)
512 * Additional device description (up to 32 ASCII characters)
517 * serial_number - Serial Number (WPS)
518 * Serial number of the device (up to 32 characters)
523 * device_type - Primary Device Type (WPS)
525 u8 device_type[WPS_DEV_TYPE_LEN];
528 * config_methods - Config Methods
530 * This is a space-separated list of supported WPS configuration
531 * methods. For example, "label virtual_display virtual_push_button
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.
538 char *config_methods;
541 * os_version - OS Version (WPS)
542 * 4-octet operating system version number
547 * country - Country code
549 * This is the ISO/IEC alpha2 country code for which we are operating
555 * wps_cred_processing - Credential processing
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)
563 int wps_cred_processing;
565 #define MAX_SEC_DEVICE_TYPES 5
567 * sec_device_types - Secondary Device Types (P2P)
569 u8 sec_device_type[MAX_SEC_DEVICE_TYPES][WPS_DEV_TYPE_LEN];
570 int num_sec_device_types;
572 int p2p_listen_reg_class;
573 int p2p_listen_channel;
574 int p2p_oper_reg_class;
575 int p2p_oper_channel;
577 char *p2p_ssid_postfix;
578 int persistent_reconnect;
580 unsigned int num_p2p_pref_chan;
581 struct p2p_channel *p2p_pref_chan;
582 int p2p_ignore_shared_freq;
584 struct wpabuf *wps_vendor_ext_m1;
586 #define MAX_WPS_VENDOR_EXT 10
588 * wps_vendor_ext - Vendor extension attributes in WPS
590 struct wpabuf *wps_vendor_ext[MAX_WPS_VENDOR_EXT];
593 * p2p_group_idle - Maximum idle time in seconds for P2P group
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.
611 * bss_max_count - Maximum number of BSS entries to keep in memory
613 unsigned int bss_max_count;
616 * bss_expiration_age - BSS entry age after which it can be expired
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.
621 unsigned int bss_expiration_age;
624 * bss_expiration_scan_count - Expire BSS after number of scans
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).
632 unsigned int bss_expiration_scan_count;
635 * filter_ssids - SSID-based scan result filtering
637 * 0 = do not filter scan results
638 * 1 = only include configured SSIDs in scan results/BSS table
643 * filter_rssi - RSSI-based scan result filtering
645 * 0 = do not filter scan results
646 * -n = filter scan results below -n dBm
651 * max_num_sta - Maximum number of STAs in an AP/P2P GO
653 unsigned int max_num_sta;
656 * freq_list - Array of allowed scan frequencies or %NULL for all
658 * This is an optional zero-terminated array of frequencies in
659 * megahertz (MHz) to allow for narrowing scanning range.
664 * scan_cur_freq - Whether to scan only the current channel
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.
672 * changed_parameters - Bitmap of changed parameters since last update
674 unsigned int changed_parameters;
677 * disassoc_low_ack - Disassocicate stations with massive packet loss
679 int disassoc_low_ack;
682 * interworking - Whether Interworking (IEEE 802.11u) is enabled
687 * access_network_type - Access Network Type
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).
693 int access_network_type;
696 * hessid - Homogenous ESS identifier
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.
710 * pbc_in_m1 - AP mode WPS probing workaround for PBC with Windows 7
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).
726 * autoscan - Automatic scan parameters or %NULL if none
728 * This is an optional set of parameters for automatic scanning
729 * within an interface in following format:
730 * <autoscan module name>:<module parameters>
735 * wps_nfc_pw_from_config - NFC Device Password was read from config
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.
741 int wps_nfc_pw_from_config;
744 * wps_nfc_dev_pw_id - NFC Device Password ID for password token
746 int wps_nfc_dev_pw_id;
749 * wps_nfc_dh_pubkey - NFC DH Public Key for password token
751 struct wpabuf *wps_nfc_dh_pubkey;
754 * wps_nfc_dh_privkey - NFC DH Private Key for password token
756 struct wpabuf *wps_nfc_dh_privkey;
759 * wps_nfc_dev_pw - NFC Device Password for password token
761 struct wpabuf *wps_nfc_dev_pw;
764 * ext_password_backend - External password backend or %NULL if none
766 * format: <backend name>[:<optional backend parameters>]
768 char *ext_password_backend;
771 * p2p_go_max_inactivity - Timeout in seconds to detect STA inactivity
773 * This timeout value is used in P2P GO mode to clean up
775 * By default: 300 seconds.
777 int p2p_go_max_inactivity;
779 struct hostapd_wmm_ac_params wmm_ac_params[4];
782 * auto_interworking - Whether to use network selection automatically
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
790 int auto_interworking;
793 * p2p_go_ht40 - Default mode for HT40 enable when operating as GO.
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)
803 * p2p_disabled - Whether P2P operations are disabled for this interface
808 * p2p_no_group_iface - Whether group interfaces can be used
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.
816 int p2p_no_group_iface;
819 * okc - Whether to enable opportunistic key caching by default
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
828 * pmf - Whether to enable/require PMF by default
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.
834 enum mfp_options pmf;
837 * sae_groups - Preference list of enabled groups for SAE
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.
847 * dtim_period - Default DTIM period in Beacon intervals
849 * This parameter can be used to set the default value for network
850 * blocks that do not specify dtim_period.
855 * beacon_int - Default Beacon interval in TU
857 * This parameter can be used to set the default value for network
858 * blocks that do not specify beacon_int.
863 * ap_vendor_elements: Vendor specific elements for Beacon/ProbeResp
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).
870 struct wpabuf *ap_vendor_elements;
873 * ignore_old_scan_res - Ignore scan results older than request
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.
880 int ignore_old_scan_res;
883 * sched_scan_interval - schedule scan interval
885 unsigned int sched_scan_interval;
889 /* Prototypes for common functions from config.c */
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 *),
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,
902 int wpa_config_set_quoted(struct wpa_ssid *ssid, const char *var,
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,
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);
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);
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 */
934 /* Prototypes for common functions from config.c */
935 int wpa_config_process_global(struct wpa_config *config, char *pos, int line);
938 /* Prototypes for backend specific functions from the selected config_*.c */
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
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().
951 * Each configuration backend needs to implement this function.
953 struct wpa_config * wpa_config_read(const char *name, struct wpa_config *cfgp);
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
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.
967 * Each configuration backend needs to implement this function.
969 int wpa_config_write(const char *name, struct wpa_config *config);
971 #endif /* CONFIG_H */