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.
19 #include "common/defs.h"
21 #include "common/wpa_common.h"
23 typedef u8 macaddr[ETH_ALEN];
25 struct mac_acl_entry {
30 struct hostapd_radius_servers;
31 struct ft_remote_r0kh;
32 struct ft_remote_r1kh;
34 #define HOSTAPD_MAX_SSID_LEN 32
36 #define NUM_WEP_KEYS 4
37 struct hostapd_wep_keys {
39 u8 *key[NUM_WEP_KEYS];
40 size_t len[NUM_WEP_KEYS];
42 size_t default_len; /* key length used for dynamic key generation */
45 typedef enum hostap_security_policy {
46 SECURITY_PLAINTEXT = 0,
47 SECURITY_STATIC_WEP = 1,
48 SECURITY_IEEE_802_1X = 2,
54 char ssid[HOSTAPD_MAX_SSID_LEN + 1];
58 char vlan[IFNAMSIZ + 1];
59 secpolicy security_policy;
61 struct hostapd_wpa_psk *wpa_psk;
65 struct hostapd_wep_keys wep;
67 #define DYNAMIC_VLAN_DISABLED 0
68 #define DYNAMIC_VLAN_OPTIONAL 1
69 #define DYNAMIC_VLAN_REQUIRED 2
71 #ifdef CONFIG_FULL_DYNAMIC_VLAN
72 char *vlan_tagged_interface;
73 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
74 struct hostapd_wep_keys **dyn_vlan_keys;
75 size_t max_dyn_vlan_keys;
79 #define VLAN_ID_WILDCARD -1
82 struct hostapd_vlan *next;
83 int vlan_id; /* VLAN ID or -1 (VLAN_ID_WILDCARD) for wildcard entry */
84 char ifname[IFNAMSIZ + 1];
86 #ifdef CONFIG_FULL_DYNAMIC_VLAN
88 #define DVLAN_CLEAN_BR 0x1
89 #define DVLAN_CLEAN_VLAN 0x2
90 #define DVLAN_CLEAN_VLAN_PORT 0x4
91 #define DVLAN_CLEAN_WLAN_PORT 0x8
93 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
97 struct hostapd_wpa_psk {
98 struct hostapd_wpa_psk *next;
104 #define EAP_USER_MAX_METHODS 8
105 struct hostapd_eap_user {
106 struct hostapd_eap_user *next;
112 } methods[EAP_USER_MAX_METHODS];
117 unsigned int wildcard_prefix:1;
118 unsigned int password_hash:1; /* whether password is hashed with
119 * nt_password_hash() */
120 int ttls_auth; /* EAP_TTLS_AUTH_* bitfield */
124 #define NUM_TX_QUEUES 8
126 struct hostapd_tx_queue_params {
130 int burst; /* maximum burst time in 0.1 ms, i.e., 10 = 1 ms */
134 struct hostapd_wmm_ac_params {
138 int txop_limit; /* in units of 32us */
139 int admission_control_mandatory;
144 * struct hostapd_bss_config - Per-BSS configuration
146 struct hostapd_bss_config {
147 char iface[IFNAMSIZ + 1];
148 char bridge[IFNAMSIZ + 1];
150 enum hostapd_logger_level logger_syslog_level, logger_stdout_level;
152 unsigned int logger_syslog; /* module bitfield */
153 unsigned int logger_stdout; /* module bitfield */
155 char *dump_log_name; /* file name for state dump (SIGUSR1) */
157 int max_num_sta; /* maximum number of STAs in station table */
161 int ieee802_1x; /* use IEEE 802.1X */
163 int eap_server; /* Use internal EAP server instead of external
165 struct hostapd_eap_user *eap_user;
167 struct hostapd_ip_addr own_ip_addr;
168 char *nas_identifier;
169 struct hostapd_radius_servers *radius;
170 int acct_interim_interval;
172 struct hostapd_ssid ssid;
174 char *eap_req_id_text; /* optional displayable message sent with
175 * EAP Request-Identity */
176 size_t eap_req_id_text_len;
177 int eapol_key_index_workaround;
179 size_t default_wep_key_len;
180 int individual_wep_key_len;
181 int wep_rekeying_period;
182 int broadcast_key_idx_min, broadcast_key_idx_max;
183 int eap_reauth_period;
185 int ieee802_11f; /* use IEEE 802.11f (IAPP) */
186 char iapp_iface[IFNAMSIZ + 1]; /* interface used with IAPP broadcast
190 ACCEPT_UNLESS_DENIED = 0,
191 DENY_UNLESS_ACCEPTED = 1,
192 USE_EXTERNAL_RADIUS_AUTH = 2
194 struct mac_acl_entry *accept_mac;
196 struct mac_acl_entry *deny_mac;
199 int auth_algs; /* bitfield of allowed IEEE 802.11 authentication
200 * algorithms, WPA_AUTH_ALG_{OPEN,SHARED,LEAP} */
202 int wpa; /* bitfield of WPA_PROTO_WPA, WPA_PROTO_RSN */
204 #ifdef CONFIG_IEEE80211W
205 enum mfp_options ieee80211w;
206 /* dot11AssociationSAQueryMaximumTimeout (in TUs) */
207 unsigned int assoc_sa_query_max_timeout;
208 /* dot11AssociationSAQueryRetryTimeout (in TUs) */
209 int assoc_sa_query_retry_timeout;
210 #endif /* CONFIG_IEEE80211W */
214 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 size_t eap_fast_a_id_len;
246 char *eap_fast_a_id_info;
248 int pac_key_lifetime;
249 int pac_key_refresh_time;
250 int eap_sim_aka_result_ind;
253 char *radius_server_clients;
254 int radius_server_auth_port;
255 int radius_server_ipv6;
257 char *test_socket; /* UNIX domain socket path for driver_test */
259 int use_pae_group_addr; /* Whether to send EAPOL frames to PAE group
260 * address instead of individual address
261 * (for driver_wired.c).
264 int ap_max_inactivity;
265 int ignore_broadcast_ssid;
269 struct hostapd_vlan *vlan, *vlan_tail;
274 * Maximum listen interval that STAs can use when associating with this
275 * BSS. If a STA tries to use larger value, the association will be
276 * denied with status code 51.
278 u16 max_listen_interval;
280 int okc; /* Opportunistic Key Caching */
286 char *wps_pin_requests;
293 char *config_methods;
298 size_t extra_cred_len;
299 int wps_cred_processing;
301 size_t ap_settings_len;
304 char *manufacturer_url;
305 char *model_description;
308 #endif /* CONFIG_WPS */
313 * struct hostapd_config - Per-radio interface configuration
315 struct hostapd_config {
316 struct hostapd_bss_config *bss, *last_bss;
322 u8 send_probe_response;
324 hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */
330 CTS_PROTECTION_AUTOMATIC = 0,
331 CTS_PROTECTION_FORCE_ENABLED = 1,
332 CTS_PROTECTION_FORCE_DISABLED = 2,
333 CTS_PROTECTION_AUTOMATIC_NO_OLBC = 3,
334 } cts_protection_type;
336 int *supported_rates;
339 const struct wpa_driver_ops *driver;
341 int ap_table_max_size;
342 int ap_table_expiration_time;
344 char country[3]; /* first two octets: country code as described in
345 * ISO/IEC 3166-1. Third octet:
346 * ' ' (ascii 32): all environments
347 * 'O': Outdoor environemnt only
348 * 'I': Indoor environment only
353 struct hostapd_tx_queue_params tx_queue[NUM_TX_QUEUES];
356 * WMM AC parameters, in same order as 802.1D, i.e.
357 * 0 = BE (best effort)
358 * 1 = BK (background)
362 struct hostapd_wmm_ac_params wmm_ac_params[4];
365 INTERNAL_BRIDGE_DO_NOT_CONTROL = -1,
366 INTERNAL_BRIDGE_DISABLED = 0,
367 INTERNAL_BRIDGE_ENABLED = 1
370 #ifdef CONFIG_IEEE80211N
371 int ht_op_mode_fixed;
373 #endif /* CONFIG_IEEE80211N */
375 int secondary_channel;
379 int hostapd_mac_comp(const void *a, const void *b);
380 int hostapd_mac_comp_empty(const void *a);
381 struct hostapd_config * hostapd_config_defaults(void);
382 struct hostapd_config * hostapd_config_read(const char *fname);
383 void hostapd_config_free(struct hostapd_config *conf);
384 int hostapd_maclist_found(struct mac_acl_entry *list, int num_entries,
385 const u8 *addr, int *vlan_id);
386 int hostapd_rate_found(int *list, int rate);
387 int hostapd_wep_key_cmp(struct hostapd_wep_keys *a,
388 struct hostapd_wep_keys *b);
389 const u8 * hostapd_get_psk(const struct hostapd_bss_config *conf,
390 const u8 *addr, const u8 *prev_psk);
391 int hostapd_setup_wpa_psk(struct hostapd_bss_config *conf);
392 const char * hostapd_get_vlan_id_ifname(struct hostapd_vlan *vlan,
394 const struct hostapd_eap_user *
395 hostapd_get_eap_user(const struct hostapd_bss_config *conf, const u8 *identity,
396 size_t identity_len, int phase2);
398 #endif /* CONFIG_H */