2 * hostapd / Configuration file
3 * Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi>
4 * Copyright (c) 2007-2008, Intel Corporation
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * Alternatively, this software may be distributed under the terms of BSD
13 * See README and COPYING for more details.
21 #include "wpa_common.h"
27 typedef u8 macaddr[ETH_ALEN];
29 struct hostapd_radius_servers;
30 struct ft_remote_r0kh;
31 struct ft_remote_r1kh;
33 #define HOSTAPD_MAX_SSID_LEN 32
35 #define NUM_WEP_KEYS 4
36 struct hostapd_wep_keys {
38 u8 *key[NUM_WEP_KEYS];
39 size_t len[NUM_WEP_KEYS];
41 size_t default_len; /* key length used for dynamic key generation */
44 typedef enum hostap_security_policy {
45 SECURITY_PLAINTEXT = 0,
46 SECURITY_STATIC_WEP = 1,
47 SECURITY_IEEE_802_1X = 2,
53 char ssid[HOSTAPD_MAX_SSID_LEN + 1];
57 char vlan[IFNAMSIZ + 1];
58 secpolicy security_policy;
60 struct hostapd_wpa_psk *wpa_psk;
64 struct hostapd_wep_keys wep;
66 #define DYNAMIC_VLAN_DISABLED 0
67 #define DYNAMIC_VLAN_OPTIONAL 1
68 #define DYNAMIC_VLAN_REQUIRED 2
70 #ifdef CONFIG_FULL_DYNAMIC_VLAN
71 char *vlan_tagged_interface;
72 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
73 struct hostapd_wep_keys **dyn_vlan_keys;
74 size_t max_dyn_vlan_keys;
78 #define VLAN_ID_WILDCARD -1
81 struct hostapd_vlan *next;
82 int vlan_id; /* VLAN ID or -1 (VLAN_ID_WILDCARD) for wildcard entry */
83 char ifname[IFNAMSIZ + 1];
85 #ifdef CONFIG_FULL_DYNAMIC_VLAN
87 #define DVLAN_CLEAN_BR 0x1
88 #define DVLAN_CLEAN_VLAN 0x2
89 #define DVLAN_CLEAN_VLAN_PORT 0x4
90 #define DVLAN_CLEAN_WLAN_PORT 0x8
92 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
96 struct hostapd_wpa_psk {
97 struct hostapd_wpa_psk *next;
103 #define EAP_USER_MAX_METHODS 8
104 struct hostapd_eap_user {
105 struct hostapd_eap_user *next;
111 } methods[EAP_USER_MAX_METHODS];
116 unsigned int wildcard_prefix:1;
117 unsigned int password_hash:1; /* whether password is hashed with
118 * nt_password_hash() */
119 int ttls_auth; /* EAP_TTLS_AUTH_* bitfield */
123 #define NUM_TX_QUEUES 8
125 struct hostapd_tx_queue_params {
129 int burst; /* maximum burst time in 0.1 ms, i.e., 10 = 1 ms */
133 struct hostapd_wme_ac_params {
137 int txopLimit; /* in units of 32us */
138 int admission_control_mandatory;
143 * struct hostapd_bss_config - Per-BSS configuration
145 struct hostapd_bss_config {
146 char iface[IFNAMSIZ + 1];
147 char bridge[IFNAMSIZ + 1];
149 enum hostapd_logger_level logger_syslog_level, logger_stdout_level;
151 unsigned int logger_syslog; /* module bitfield */
152 unsigned int logger_stdout; /* module bitfield */
154 char *dump_log_name; /* file name for state dump (SIGUSR1) */
156 int max_num_sta; /* maximum number of STAs in station table */
160 int ieee802_1x; /* use IEEE 802.1X */
162 int eap_server; /* Use internal EAP server instead of external
164 struct hostapd_eap_user *eap_user;
166 struct hostapd_ip_addr own_ip_addr;
167 char *nas_identifier;
168 struct hostapd_radius_servers *radius;
170 struct hostapd_ssid ssid;
172 char *eap_req_id_text; /* optional displayable message sent with
173 * EAP Request-Identity */
174 size_t eap_req_id_text_len;
175 int eapol_key_index_workaround;
177 size_t default_wep_key_len;
178 int individual_wep_key_len;
179 int wep_rekeying_period;
180 int broadcast_key_idx_min, broadcast_key_idx_max;
181 int eap_reauth_period;
183 int ieee802_11f; /* use IEEE 802.11f (IAPP) */
184 char iapp_iface[IFNAMSIZ + 1]; /* interface used with IAPP broadcast
187 u8 assoc_ap_addr[ETH_ALEN];
188 int assoc_ap; /* whether assoc_ap_addr is set */
191 ACCEPT_UNLESS_DENIED = 0,
192 DENY_UNLESS_ACCEPTED = 1,
193 USE_EXTERNAL_RADIUS_AUTH = 2
200 int auth_algs; /* bitfield of allowed IEEE 802.11 authentication
201 * algorithms, WPA_AUTH_ALG_{OPEN,SHARED,LEAP} */
203 int wpa; /* bitfield of WPA_PROTO_WPA, WPA_PROTO_RSN */
205 #ifdef CONFIG_IEEE80211W
208 IEEE80211W_OPTIONAL = 1,
209 IEEE80211W_REQUIRED = 2
211 #endif /* CONFIG_IEEE80211W */
215 int wpa_strict_rekey;
219 char *rsn_preauth_interfaces;
222 #ifdef CONFIG_IEEE80211R
223 /* IEEE 802.11r - Fast BSS Transition */
224 u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN];
225 u8 r1_key_holder[FT_R1KH_ID_LEN];
227 u32 reassociation_deadline;
228 struct ft_remote_r0kh *r0kh_list;
229 struct ft_remote_r1kh *r1kh_list;
231 #endif /* CONFIG_IEEE80211R */
233 char *ctrl_interface; /* directory for UNIX domain sockets */
234 gid_t ctrl_interface_gid;
235 int ctrl_interface_gid_set;
240 char *private_key_passwd;
243 u8 *pac_opaque_encr_key;
245 int eap_sim_aka_result_ind;
248 char *radius_server_clients;
249 int radius_server_auth_port;
250 int radius_server_ipv6;
252 char *test_socket; /* UNIX domain socket path for driver_test */
254 int use_pae_group_addr; /* Whether to send EAPOL frames to PAE group
255 * address instead of individual address
256 * (for driver_wired.c).
259 int ap_max_inactivity;
260 int ignore_broadcast_ssid;
264 struct hostapd_vlan *vlan, *vlan_tail;
269 * Maximum listen interval that STAs can use when associating with this
270 * BSS. If a STA tries to use larger value, the association will be
271 * denied with status code 51.
273 u16 max_listen_interval;
275 int okc; /* Opportunistic Key Caching */
277 #ifdef CONFIG_IEEE80211N
279 int ht_op_mode_fixed;
281 #endif /* CONFIG_IEEE80211N */
286 HOSTAPD_MODE_IEEE80211B,
287 HOSTAPD_MODE_IEEE80211G,
288 HOSTAPD_MODE_IEEE80211A,
294 * struct hostapd_config - Per-radio interface configuration
296 struct hostapd_config {
297 struct hostapd_bss_config *bss, *last_bss;
298 struct hostapd_radius_servers *radius;
304 u8 send_probe_response;
306 hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */
312 CTS_PROTECTION_AUTOMATIC = 0,
313 CTS_PROTECTION_FORCE_ENABLED = 1,
314 CTS_PROTECTION_FORCE_DISABLED = 2,
315 CTS_PROTECTION_AUTOMATIC_NO_OLBC = 3,
316 } cts_protection_type;
318 int *supported_rates;
321 const struct wpa_driver_ops *driver;
323 int passive_scan_interval; /* seconds, 0 = disabled */
324 int passive_scan_listen; /* usec */
325 int passive_scan_mode;
326 int ap_table_max_size;
327 int ap_table_expiration_time;
329 char country[3]; /* first two octets: country code as described in
330 * ISO/IEC 3166-1. Third octet:
331 * ' ' (ascii 32): all environments
332 * 'O': Outdoor environemnt only
333 * 'I': Indoor environment only
337 unsigned int ieee80211h; /* Enable/Disable 80211h */
339 struct hostapd_tx_queue_params tx_queue[NUM_TX_QUEUES];
342 * WME AC parameters, in same order as 802.1D, i.e.
343 * 0 = BE (best effort)
344 * 1 = BK (background)
348 struct hostapd_wme_ac_params wme_ac_params[4];
351 INTERNAL_BRIDGE_DO_NOT_CONTROL = -1,
352 INTERNAL_BRIDGE_DISABLED = 0,
353 INTERNAL_BRIDGE_ENABLED = 1
358 int hostapd_mac_comp(const void *a, const void *b);
359 int hostapd_mac_comp_empty(const void *a);
360 struct hostapd_config * hostapd_config_read(const char *fname);
361 void hostapd_config_free(struct hostapd_config *conf);
362 int hostapd_maclist_found(macaddr *list, int num_entries, const u8 *addr);
363 int hostapd_rate_found(int *list, int rate);
364 int hostapd_wep_key_cmp(struct hostapd_wep_keys *a,
365 struct hostapd_wep_keys *b);
366 const u8 * hostapd_get_psk(const struct hostapd_bss_config *conf,
367 const u8 *addr, const u8 *prev_psk);
368 int hostapd_setup_wpa_psk(struct hostapd_bss_config *conf);
369 const char * hostapd_get_vlan_id_ifname(struct hostapd_vlan *vlan,
371 const struct hostapd_eap_user *
372 hostapd_get_eap_user(const struct hostapd_bss_config *conf, const u8 *identity,
373 size_t identity_len, int phase2);
375 #endif /* CONFIG_H */