Re-enable hardware UDP/TCP checksum calculation with pseudo header on
[dragonfly/port-amd64.git] / contrib / wpa_supplicant-0.4.9 / config.h
bloba38c1d117a7ea45e84dad8489b2b127077fe1b7f
1 /*
2 * WPA Supplicant / Configuration file structures
3 * Copyright (c) 2003-2005, Jouni Malinen <jkmaline@cc.hut.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 #ifdef CONFIG_CTRL_IFACE
19 #ifndef CONFIG_CTRL_IFACE_UDP
20 #include <grp.h>
21 #endif /* CONFIG_CTRL_IFACE_UDP */
22 #endif /* CONFIG_CTRL_IFACE */
24 #define DEFAULT_EAPOL_VERSION 1
25 #define DEFAULT_AP_SCAN 1
26 #define DEFAULT_FAST_REAUTH 1
28 #include "config_ssid.h"
30 /**
31 * struct wpa_config_blob - Named configuration blob
33 * This data structure is used to provide storage for binary objects to store
34 * abstract information like certificates and private keys inlined with the
35 * configuration data.
37 struct wpa_config_blob {
38 /**
39 * name - Blob name
41 char *name;
43 /**
44 * data - Pointer to binary data
46 u8 *data;
48 /**
49 * len - Length of binary data
51 size_t len;
53 /**
54 * next - Pointer to next blob in the configuration
56 struct wpa_config_blob *next;
60 /**
61 * struct wpa_config - wpa_supplicant configuration data
63 * This data structure is presents the per-interface (radio) configuration
64 * data. In many cases, there is only one struct wpa_config instance, but if
65 * more than one network interface is being controlled, one instance is used
66 * for each.
68 struct wpa_config {
69 /**
70 * ssid - Head of the global network list
72 * This is the head for the list of all the configured networks.
74 struct wpa_ssid *ssid;
76 /**
77 * pssid - Per-priority network lists (in priority order)
79 struct wpa_ssid **pssid;
81 /**
82 * num_prio - Number of different priorities used in the pssid lists
84 * This indicates how many per-priority network lists are included in
85 * pssid.
87 int num_prio;
89 /**
90 * eapol_version - IEEE 802.1X/EAPOL version number
92 * wpa_supplicant is implemented based on IEEE Std 802.1X-2004 which
93 * defines EAPOL version 2. However, there are many APs that do not
94 * handle the new version number correctly (they seem to drop the
95 * frames completely). In order to make wpa_supplicant interoperate
96 * with these APs, the version number is set to 1 by default. This
97 * configuration value can be used to set it to the new version (2).
99 int eapol_version;
102 * ap_scan - AP scanning/selection
104 * By default, wpa_supplicant requests driver to perform AP
105 * scanning and then uses the scan results to select a
106 * suitable AP. Another alternative is to allow the driver to
107 * take care of AP scanning and selection and use
108 * wpa_supplicant just to process EAPOL frames based on IEEE
109 * 802.11 association information from the driver.
111 * 1: wpa_supplicant initiates scanning and AP selection (default).
113 * 0: Driver takes care of scanning, AP selection, and IEEE 802.11
114 * association parameters (e.g., WPA IE generation); this mode can
115 * also be used with non-WPA drivers when using IEEE 802.1X mode;
116 * do not try to associate with APs (i.e., external program needs
117 * to control association). This mode must also be used when using
118 * wired Ethernet drivers.
120 * 2: like 0, but associate with APs using security policy and SSID
121 * (but not BSSID); this can be used, e.g., with ndiswrapper and NDIS
122 * drivers to enable operation with hidden SSIDs and optimized roaming;
123 * in this mode, the network blocks in the configuration are tried
124 * one by one until the driver reports successful association; each
125 * network block should have explicit security policy (i.e., only one
126 * option in the lists) for key_mgmt, pairwise, group, proto variables.
128 int ap_scan;
131 * ctrl_interface - Directory for UNIX domain sockets
133 * This variable is used to configure where the UNIX domain sockets
134 * for the control interface are created. If UDP-based ctrl_iface is
135 * used, this variable can be set to any string (i.e., %NULL is not
136 * allowed).
138 char *ctrl_interface;
140 #ifdef CONFIG_CTRL_IFACE
141 #ifndef CONFIG_CTRL_IFACE_UDP
143 * ctrl_interface_gid - Group identity for the UNIX domain sockets
145 * Access control for the control interface can be configured
146 * by setting the directory to allow only members of a group
147 * to use sockets. This way, it is possible to run
148 * wpa_supplicant as root (since it needs to change network
149 * configuration and open raw sockets) and still allow GUI/CLI
150 * components to be run as non-root users. However, since the
151 * control interface can be used to change the network
152 * configuration, this access needs to be protected in many
153 * cases. By default, wpa_supplicant is configured to use gid
154 * 0 (root). If you want to allow non-root users to use the
155 * control interface, add a new group and change this value to
156 * match with that group. Add users that should have control
157 * interface access to this group.
159 gid_t ctrl_interface_gid;
160 #endif /* CONFIG_CTRL_IFACE_UDP */
162 * ctrl_interface_gid_set - Whether ctrl_interface_gid is used
164 * If this variable is zero, ctrl_interface_gid value is not used and
165 * group will not be changed from the value it got by default
166 * when the directory or socket was created.
168 int ctrl_interface_gid_set;
169 #endif /* CONFIG_CTRL_IFACE */
172 * fast_reauth - EAP fast re-authentication (session resumption)
174 * By default, fast re-authentication is enabled for all EAP methods
175 * that support it. This variable can be used to disable fast
176 * re-authentication (by setting fast_reauth=0). Normally, there is no
177 * need to disable fast re-authentication.
179 int fast_reauth;
182 * opensc_engine_path - Path to the OpenSSL engine for opensc
184 * This is an OpenSSL specific configuration option for loading OpenSC
185 * engine (engine_opensc.so); if %NULL, this engine is not loaded.
187 char *opensc_engine_path;
190 * pkcs11_engine_path - Path to the OpenSSL engine for PKCS#11
192 * This is an OpenSSL specific configuration option for loading PKCS#11
193 * engine (engine_pkcs11.so); if %NULL, this engine is not loaded.
195 char *pkcs11_engine_path;
198 * pkcs11_module_path - Path to the OpenSSL OpenSC/PKCS#11 module
200 * This is an OpenSSL specific configuration option for configuring
201 * path to OpenSC/PKCS#11 engine (opensc-pkcs11.so); if %NULL, this
202 * module is not loaded.
204 char *pkcs11_module_path;
207 * driver_param - Driver interface parameters
209 * This text string is passed to the selected driver interface with the
210 * optional struct wpa_driver_ops::set_param() handler. This can be
211 * used to configure driver specific options without having to add new
212 * driver interface functionality.
214 char *driver_param;
217 * dot11RSNAConfigPMKLifetime - Maximum lifetime of a PMK
219 * dot11 MIB variable for the maximum lifetime of a PMK in the PMK
220 * cache (unit: seconds).
222 unsigned int dot11RSNAConfigPMKLifetime;
225 * dot11RSNAConfigPMKReauthThreshold - PMK re-authentication threshold
227 * dot11 MIB variable for the percentage of the PMK lifetime
228 * that should expire before an IEEE 802.1X reauthentication occurs.
230 unsigned int dot11RSNAConfigPMKReauthThreshold;
233 * dot11RSNAConfigSATimeout - Security association timeout
235 * dot11 MIB variable for the maximum time a security association
236 * shall take to set up (unit: seconds).
238 unsigned int dot11RSNAConfigSATimeout;
241 * update_config - Is wpa_supplicant allowed to update configuration
243 * This variable control whether wpa_supplicant is allow to re-write
244 * its configuration with wpa_config_write(). If this is zero,
245 * configuration data is only changed in memory and the external data
246 * is not overriden. If this is non-zero, wpa_supplicant will update
247 * the configuration data (e.g., a file) whenever configuration is
248 * changed. This update may replace the old configuration which can
249 * remove comments from it in case of a text file configuration.
251 int update_config;
254 * blobs - Configuration blobs
256 struct wpa_config_blob *blobs;
260 /* Prototypes for common functions from config.c */
262 void wpa_config_free(struct wpa_config *ssid);
263 void wpa_config_free_ssid(struct wpa_ssid *ssid);
264 struct wpa_ssid * wpa_config_get_network(struct wpa_config *config, int id);
265 struct wpa_ssid * wpa_config_add_network(struct wpa_config *config);
266 int wpa_config_remove_network(struct wpa_config *config, int id);
267 void wpa_config_set_network_defaults(struct wpa_ssid *ssid);
268 int wpa_config_set(struct wpa_ssid *ssid, const char *var, const char *value,
269 int line);
270 char * wpa_config_get(struct wpa_ssid *ssid, const char *var);
271 void wpa_config_update_psk(struct wpa_ssid *ssid);
272 int wpa_config_add_prio_network(struct wpa_config *config,
273 struct wpa_ssid *ssid);
275 const struct wpa_config_blob * wpa_config_get_blob(struct wpa_config *config,
276 const char *name);
277 void wpa_config_set_blob(struct wpa_config *config,
278 struct wpa_config_blob *blob);
279 void wpa_config_free_blob(struct wpa_config_blob *blob);
280 int wpa_config_remove_blob(struct wpa_config *config, const char *name);
281 struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
282 const char *driver_param);
285 /* Prototypes for backend specific functions from the selected config_*.c */
288 * wpa_config_read - Read and parse configuration database
289 * @name: Name of the configuration (e.g., path and file name for the
290 * configuration file)
291 * Returns: Pointer to allocated configuration data or %NULL on failure
293 * This function reads configuration data, parses its contents, and allocates
294 * data structures needed for storing configuration information. The allocated
295 * data can be freed with wpa_config_free().
297 * Each configuration backend needs to implement this function.
299 struct wpa_config * wpa_config_read(const char *name);
302 * wpa_config_write - Write or update configuration data
303 * @name: Name of the configuration (e.g., path and file name for the
304 * configuration file)
305 * @config: Configuration data from wpa_config_read()
306 * Returns: 0 on success, -1 on failure
308 * This function write all configuration data into an external database (e.g.,
309 * a text file) in a format that can be read with wpa_config_read(). This can
310 * be used to allow wpa_supplicant to update its configuration, e.g., when a
311 * new network is added or a password is changed.
313 * Each configuration backend needs to implement this function.
315 int wpa_config_write(const char *name, struct wpa_config *config);
317 #endif /* CONFIG_H */