Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / network / WirelessManager / wpa_supplicant / config.h
blob754e4befeac3b5ed791f4fc460ad62faf1eacc37
1 /*
2 * WPA Supplicant / Configuration file structures
3 * Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
12 * See README and COPYING for more details.
15 #ifndef CONFIG_H
16 #define CONFIG_H
18 #define DEFAULT_EAPOL_VERSION 1
19 #ifdef CONFIG_NO_SCAN_PROCESSING
20 #define DEFAULT_AP_SCAN 2
21 #else /* CONFIG_NO_SCAN_PROCESSING */
22 #define DEFAULT_AP_SCAN 1
23 #endif /* CONFIG_NO_SCAN_PROCESSING */
24 #define DEFAULT_FAST_REAUTH 1
25 #define DEFAULT_BSS_MAX_COUNT 200
27 #include "config_ssid.h"
30 /**
31 * struct wpa_config - wpa_supplicant configuration data
33 * This data structure is presents the per-interface (radio) configuration
34 * data. In many cases, there is only one struct wpa_config instance, but if
35 * more than one network interface is being controlled, one instance is used
36 * for each.
38 struct wpa_config {
39 /**
40 * ssid - Head of the global network list
42 * This is the head for the list of all the configured networks.
44 struct wpa_ssid *ssid;
46 /**
47 * pssid - Per-priority network lists (in priority order)
49 struct wpa_ssid **pssid;
51 /**
52 * num_prio - Number of different priorities used in the pssid lists
54 * This indicates how many per-priority network lists are included in
55 * pssid.
57 int num_prio;
59 /**
60 * eapol_version - IEEE 802.1X/EAPOL version number
62 * wpa_supplicant is implemented based on IEEE Std 802.1X-2004 which
63 * defines EAPOL version 2. However, there are many APs that do not
64 * handle the new version number correctly (they seem to drop the
65 * frames completely). In order to make wpa_supplicant interoperate
66 * with these APs, the version number is set to 1 by default. This
67 * configuration value can be used to set it to the new version (2).
69 int eapol_version;
71 /**
72 * ap_scan - AP scanning/selection
74 * By default, wpa_supplicant requests driver to perform AP
75 * scanning and then uses the scan results to select a
76 * suitable AP. Another alternative is to allow the driver to
77 * take care of AP scanning and selection and use
78 * wpa_supplicant just to process EAPOL frames based on IEEE
79 * 802.11 association information from the driver.
81 * 1: wpa_supplicant initiates scanning and AP selection (default).
83 * 0: Driver takes care of scanning, AP selection, and IEEE 802.11
84 * association parameters (e.g., WPA IE generation); this mode can
85 * also be used with non-WPA drivers when using IEEE 802.1X mode;
86 * do not try to associate with APs (i.e., external program needs
87 * to control association). This mode must also be used when using
88 * wired Ethernet drivers.
90 * 2: like 0, but associate with APs using security policy and SSID
91 * (but not BSSID); this can be used, e.g., with ndiswrapper and NDIS
92 * drivers to enable operation with hidden SSIDs and optimized roaming;
93 * in this mode, the network blocks in the configuration are tried
94 * one by one until the driver reports successful association; each
95 * network block should have explicit security policy (i.e., only one
96 * option in the lists) for key_mgmt, pairwise, group, proto variables.
98 int ap_scan;
101 * ctrl_interface - Parameters for the control interface
103 * If this is specified, %wpa_supplicant will open a control interface
104 * that is available for external programs to manage %wpa_supplicant.
105 * The meaning of this string depends on which control interface
106 * mechanism is used. For all cases, the existance of this parameter
107 * in configuration is used to determine whether the control interface
108 * is enabled.
110 * For UNIX domain sockets (default on Linux and BSD): This is a
111 * directory that will be created for UNIX domain sockets for listening
112 * to requests from external programs (CLI/GUI, etc.) for status
113 * information and configuration. The socket file will be named based
114 * on the interface name, so multiple %wpa_supplicant processes can be
115 * run at the same time if more than one interface is used.
116 * /var/run/wpa_supplicant is the recommended directory for sockets and
117 * by default, wpa_cli will use it when trying to connect with
118 * %wpa_supplicant.
120 * Access control for the control interface can be configured
121 * by setting the directory to allow only members of a group
122 * to use sockets. This way, it is possible to run
123 * %wpa_supplicant as root (since it needs to change network
124 * configuration and open raw sockets) and still allow GUI/CLI
125 * components to be run as non-root users. However, since the
126 * control interface can be used to change the network
127 * configuration, this access needs to be protected in many
128 * cases. By default, %wpa_supplicant is configured to use gid
129 * 0 (root). If you want to allow non-root users to use the
130 * control interface, add a new group and change this value to
131 * match with that group. Add users that should have control
132 * interface access to this group.
134 * When configuring both the directory and group, use following format:
135 * DIR=/var/run/wpa_supplicant GROUP=wheel
136 * DIR=/var/run/wpa_supplicant GROUP=0
137 * (group can be either group name or gid)
139 * For UDP connections (default on Windows): The value will be ignored.
140 * This variable is just used to select that the control interface is
141 * to be created. The value can be set to, e.g., udp
142 * (ctrl_interface=udp).
144 * For Windows Named Pipe: This value can be used to set the security
145 * descriptor for controlling access to the control interface. Security
146 * descriptor can be set using Security Descriptor String Format (see
147 * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/security_descriptor_string_format.asp).
148 * The descriptor string needs to be prefixed with SDDL=. For example,
149 * ctrl_interface=SDDL=D: would set an empty DACL (which will reject
150 * all connections).
152 char *ctrl_interface;
155 * ctrl_interface_group - Control interface group (DEPRECATED)
157 * This variable is only used for backwards compatibility. Group for
158 * UNIX domain sockets should now be specified using GROUP=group in
159 * ctrl_interface variable.
161 char *ctrl_interface_group;
164 * fast_reauth - EAP fast re-authentication (session resumption)
166 * By default, fast re-authentication is enabled for all EAP methods
167 * that support it. This variable can be used to disable fast
168 * re-authentication (by setting fast_reauth=0). Normally, there is no
169 * need to disable fast re-authentication.
171 int fast_reauth;
174 * opensc_engine_path - Path to the OpenSSL engine for opensc
176 * This is an OpenSSL specific configuration option for loading OpenSC
177 * engine (engine_opensc.so); if %NULL, this engine is not loaded.
179 char *opensc_engine_path;
182 * pkcs11_engine_path - Path to the OpenSSL engine for PKCS#11
184 * This is an OpenSSL specific configuration option for loading PKCS#11
185 * engine (engine_pkcs11.so); if %NULL, this engine is not loaded.
187 char *pkcs11_engine_path;
190 * pkcs11_module_path - Path to the OpenSSL OpenSC/PKCS#11 module
192 * This is an OpenSSL specific configuration option for configuring
193 * path to OpenSC/PKCS#11 engine (opensc-pkcs11.so); if %NULL, this
194 * module is not loaded.
196 char *pkcs11_module_path;
199 * driver_param - Driver interface parameters
201 * This text string is passed to the selected driver interface with the
202 * optional struct wpa_driver_ops::set_param() handler. This can be
203 * used to configure driver specific options without having to add new
204 * driver interface functionality.
206 char *driver_param;
209 * dot11RSNAConfigPMKLifetime - Maximum lifetime of a PMK
211 * dot11 MIB variable for the maximum lifetime of a PMK in the PMK
212 * cache (unit: seconds).
214 unsigned int dot11RSNAConfigPMKLifetime;
217 * dot11RSNAConfigPMKReauthThreshold - PMK re-authentication threshold
219 * dot11 MIB variable for the percentage of the PMK lifetime
220 * that should expire before an IEEE 802.1X reauthentication occurs.
222 unsigned int dot11RSNAConfigPMKReauthThreshold;
225 * dot11RSNAConfigSATimeout - Security association timeout
227 * dot11 MIB variable for the maximum time a security association
228 * shall take to set up (unit: seconds).
230 unsigned int dot11RSNAConfigSATimeout;
233 * update_config - Is wpa_supplicant allowed to update configuration
235 * This variable control whether wpa_supplicant is allow to re-write
236 * its configuration with wpa_config_write(). If this is zero,
237 * configuration data is only changed in memory and the external data
238 * is not overriden. If this is non-zero, wpa_supplicant will update
239 * the configuration data (e.g., a file) whenever configuration is
240 * changed. This update may replace the old configuration which can
241 * remove comments from it in case of a text file configuration.
243 int update_config;
246 * blobs - Configuration blobs
248 struct wpa_config_blob *blobs;
251 * uuid - Universally Unique IDentifier (UUID; see RFC 4122) for WPS
253 u8 uuid[16];
256 * device_name - Device Name (WPS)
257 * User-friendly description of device; up to 32 octets encoded in
258 * UTF-8
260 char *device_name;
263 * manufacturer - Manufacturer (WPS)
264 * The manufacturer of the device (up to 64 ASCII characters)
266 char *manufacturer;
269 * model_name - Model Name (WPS)
270 * Model of the device (up to 32 ASCII characters)
272 char *model_name;
275 * model_number - Model Number (WPS)
276 * Additional device description (up to 32 ASCII characters)
278 char *model_number;
281 * serial_number - Serial Number (WPS)
282 * Serial number of the device (up to 32 characters)
284 char *serial_number;
287 * device_type - Primary Device Type (WPS)
288 * Used format: categ-OUI-subcateg
289 * categ = Category as an integer value
290 * OUI = OUI and type octet as a 4-octet hex-encoded value;
291 * 0050F204 for default WPS OUI
292 * subcateg = OUI-specific Sub Category as an integer value
293 * Examples:
294 * 1-0050F204-1 (Computer / PC)
295 * 1-0050F204-2 (Computer / Server)
296 * 5-0050F204-1 (Storage / NAS)
297 * 6-0050F204-1 (Network Infrastructure / AP)
299 char *device_type;
302 * config_methods - Config Methods
304 * This is a space-separated list of supported WPS configuration
305 * methods. For example, "label display push_button keypad".
306 * Available methods: usba ethernet label display ext_nfc_token
307 * int_nfc_token nfc_interface push_button keypad.
309 char *config_methods;
312 * os_version - OS Version (WPS)
313 * 4-octet operating system version number
315 u8 os_version[4];
318 * country - Country code
320 * This is the ISO/IEC alpha2 country code for which we are operating
321 * in
323 char country[2];
326 * wps_cred_processing - Credential processing
328 * 0 = process received credentials internally
329 * 1 = do not process received credentials; just pass them over
330 * ctrl_iface to external program(s)
331 * 2 = process received credentials internally and pass them over
332 * ctrl_iface to external program(s)
334 int wps_cred_processing;
337 * bss_max_count - Maximum number of BSS entries to keep in memory
339 unsigned int bss_max_count;
342 * filter_ssids - SSID-based scan result filtering
344 * 0 = do not filter scan results
345 * 1 = only include configured SSIDs in scan results/BSS table
347 int filter_ssids;
351 /* Prototypes for common functions from config.c */
353 void wpa_config_free(struct wpa_config *ssid);
354 void wpa_config_free_ssid(struct wpa_ssid *ssid);
355 struct wpa_ssid * wpa_config_get_network(struct wpa_config *config, int id);
356 struct wpa_ssid * wpa_config_add_network(struct wpa_config *config);
357 int wpa_config_remove_network(struct wpa_config *config, int id);
358 void wpa_config_set_network_defaults(struct wpa_ssid *ssid);
359 int wpa_config_set(struct wpa_ssid *ssid, const char *var, const char *value,
360 int line);
361 char ** wpa_config_get_all(struct wpa_ssid *ssid, int get_keys);
362 char * wpa_config_get(struct wpa_ssid *ssid, const char *var);
363 char * wpa_config_get_no_key(struct wpa_ssid *ssid, const char *var);
364 void wpa_config_update_psk(struct wpa_ssid *ssid);
365 int wpa_config_add_prio_network(struct wpa_config *config,
366 struct wpa_ssid *ssid);
367 int wpa_config_update_prio_list(struct wpa_config *config);
368 const struct wpa_config_blob * wpa_config_get_blob(struct wpa_config *config,
369 const char *name);
370 void wpa_config_set_blob(struct wpa_config *config,
371 struct wpa_config_blob *blob);
372 void wpa_config_free_blob(struct wpa_config_blob *blob);
373 int wpa_config_remove_blob(struct wpa_config *config, const char *name);
375 struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
376 const char *driver_param);
377 #ifndef CONFIG_NO_STDOUT_DEBUG
378 void wpa_config_debug_dump_networks(struct wpa_config *config);
379 #else /* CONFIG_NO_STDOUT_DEBUG */
380 #define wpa_config_debug_dump_networks(c) do { } while (0)
381 #endif /* CONFIG_NO_STDOUT_DEBUG */
384 /* Prototypes for backend specific functions from the selected config_*.c */
387 * wpa_config_read - Read and parse configuration database
388 * @name: Name of the configuration (e.g., path and file name for the
389 * configuration file)
390 * Returns: Pointer to allocated configuration data or %NULL on failure
392 * This function reads configuration data, parses its contents, and allocates
393 * data structures needed for storing configuration information. The allocated
394 * data can be freed with wpa_config_free().
396 * Each configuration backend needs to implement this function.
398 struct wpa_config * wpa_config_read(const char *name);
401 * wpa_config_write - Write or update configuration data
402 * @name: Name of the configuration (e.g., path and file name for the
403 * configuration file)
404 * @config: Configuration data from wpa_config_read()
405 * Returns: 0 on success, -1 on failure
407 * This function write all configuration data into an external database (e.g.,
408 * a text file) in a format that can be read with wpa_config_read(). This can
409 * be used to allow wpa_supplicant to update its configuration, e.g., when a
410 * new network is added or a password is changed.
412 * Each configuration backend needs to implement this function.
414 int wpa_config_write(const char *name, struct wpa_config *config);
416 #endif /* CONFIG_H */