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"
22 #ifdef CONFIG_IEEE80211N
23 #include "ieee802_11_defs.h"
24 #endif /* CONFIG_IEEE80211N */
30 typedef u8 macaddr[ETH_ALEN];
32 struct hostapd_radius_servers;
33 struct ft_remote_r0kh;
34 struct ft_remote_r1kh;
36 #define HOSTAPD_MAX_SSID_LEN 32
38 #define NUM_WEP_KEYS 4
39 struct hostapd_wep_keys {
41 u8 *key[NUM_WEP_KEYS];
42 size_t len[NUM_WEP_KEYS];
44 size_t default_len; /* key length used for dynamic key generation */
47 typedef enum hostap_security_policy {
48 SECURITY_PLAINTEXT = 0,
49 SECURITY_STATIC_WEP = 1,
50 SECURITY_IEEE_802_1X = 2,
56 char ssid[HOSTAPD_MAX_SSID_LEN + 1];
60 char vlan[IFNAMSIZ + 1];
61 secpolicy security_policy;
63 struct hostapd_wpa_psk *wpa_psk;
67 struct hostapd_wep_keys wep;
69 #define DYNAMIC_VLAN_DISABLED 0
70 #define DYNAMIC_VLAN_OPTIONAL 1
71 #define DYNAMIC_VLAN_REQUIRED 2
73 #ifdef CONFIG_FULL_DYNAMIC_VLAN
74 char *vlan_tagged_interface;
75 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
76 struct hostapd_wep_keys **dyn_vlan_keys;
77 size_t max_dyn_vlan_keys;
81 #define VLAN_ID_WILDCARD -1
84 struct hostapd_vlan *next;
85 int vlan_id; /* VLAN ID or -1 (VLAN_ID_WILDCARD) for wildcard entry */
86 char ifname[IFNAMSIZ + 1];
88 #ifdef CONFIG_FULL_DYNAMIC_VLAN
90 #define DVLAN_CLEAN_BR 0x1
91 #define DVLAN_CLEAN_VLAN 0x2
92 #define DVLAN_CLEAN_VLAN_PORT 0x4
93 #define DVLAN_CLEAN_WLAN_PORT 0x8
95 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
99 struct hostapd_wpa_psk {
100 struct hostapd_wpa_psk *next;
106 #define EAP_USER_MAX_METHODS 8
107 struct hostapd_eap_user {
108 struct hostapd_eap_user *next;
114 } methods[EAP_USER_MAX_METHODS];
119 unsigned int wildcard_prefix:1;
120 unsigned int password_hash:1; /* whether password is hashed with
121 * nt_password_hash() */
122 int ttls_auth; /* EAP_TTLS_AUTH_* bitfield */
126 #define NUM_TX_QUEUES 8
128 struct hostapd_tx_queue_params {
132 int burst; /* maximum burst time in 0.1 ms, i.e., 10 = 1 ms */
136 struct hostapd_wme_ac_params {
140 int txopLimit; /* in units of 32us */
141 int admission_control_mandatory;
146 * struct hostapd_bss_config - Per-BSS configuration
148 struct hostapd_bss_config {
149 char iface[IFNAMSIZ + 1];
150 char bridge[IFNAMSIZ + 1];
152 enum hostapd_logger_level logger_syslog_level, logger_stdout_level;
154 unsigned int logger_syslog; /* module bitfield */
155 unsigned int logger_stdout; /* module bitfield */
157 char *dump_log_name; /* file name for state dump (SIGUSR1) */
159 int max_num_sta; /* maximum number of STAs in station table */
163 int ieee802_1x; /* use IEEE 802.1X */
165 int eap_server; /* Use internal EAP server instead of external
167 struct hostapd_eap_user *eap_user;
169 struct hostapd_ip_addr own_ip_addr;
170 char *nas_identifier;
171 struct hostapd_radius_servers *radius;
173 struct hostapd_ssid ssid;
175 char *eap_req_id_text; /* optional displayable message sent with
176 * EAP Request-Identity */
177 size_t eap_req_id_text_len;
178 int eapol_key_index_workaround;
180 size_t default_wep_key_len;
181 int individual_wep_key_len;
182 int wep_rekeying_period;
183 int broadcast_key_idx_min, broadcast_key_idx_max;
184 int eap_reauth_period;
186 int ieee802_11f; /* use IEEE 802.11f (IAPP) */
187 char iapp_iface[IFNAMSIZ + 1]; /* interface used with IAPP broadcast
190 u8 assoc_ap_addr[ETH_ALEN];
191 int assoc_ap; /* whether assoc_ap_addr is set */
194 ACCEPT_UNLESS_DENIED = 0,
195 DENY_UNLESS_ACCEPTED = 1,
196 USE_EXTERNAL_RADIUS_AUTH = 2
203 int auth_algs; /* bitfield of allowed IEEE 802.11 authentication
204 * algorithms, WPA_AUTH_ALG_{OPEN,SHARED,LEAP} */
206 int wpa; /* bitfield of WPA_PROTO_WPA, WPA_PROTO_RSN */
208 #ifdef CONFIG_IEEE80211W
211 IEEE80211W_OPTIONAL = 1,
212 IEEE80211W_REQUIRED = 2
214 #endif /* CONFIG_IEEE80211W */
218 int wpa_strict_rekey;
222 char *rsn_preauth_interfaces;
225 #ifdef CONFIG_IEEE80211R
226 /* IEEE 802.11r - Fast BSS Transition */
227 u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN];
228 u8 r1_key_holder[FT_R1KH_ID_LEN];
230 u32 reassociation_deadline;
231 struct ft_remote_r0kh *r0kh_list;
232 struct ft_remote_r1kh *r1kh_list;
234 #endif /* CONFIG_IEEE80211R */
236 char *ctrl_interface; /* directory for UNIX domain sockets */
237 gid_t ctrl_interface_gid;
238 int ctrl_interface_gid_set;
243 char *private_key_passwd;
246 u8 *pac_opaque_encr_key;
248 int eap_sim_aka_result_ind;
251 char *radius_server_clients;
252 int radius_server_auth_port;
253 int radius_server_ipv6;
255 char *test_socket; /* UNIX domain socket path for driver_test */
257 int use_pae_group_addr; /* Whether to send EAPOL frames to PAE group
258 * address instead of individual address
259 * (for driver_wired.c).
262 int ap_max_inactivity;
263 int ignore_broadcast_ssid;
267 struct hostapd_vlan *vlan, *vlan_tail;
272 * Maximum listen interval that STAs can use when associating with this
273 * BSS. If a STA tries to use larger value, the association will be
274 * denied with status code 51.
276 u16 max_listen_interval;
278 int okc; /* Opportunistic Key Caching */
280 #ifdef CONFIG_IEEE80211N
282 /* TODO: these structures should not really be used here; move to
283 * struct hostapd_data or struct hostapd_iface and just include the
284 * needed values here for generating IEs elsewhere */
285 struct ht_cap_ie ht_capabilities;
286 struct ht_operation_ie ht_operation;
287 int ht_op_mode_fixed;
288 #endif /* CONFIG_IEEE80211N */
293 HOSTAPD_MODE_IEEE80211B,
294 HOSTAPD_MODE_IEEE80211G,
295 HOSTAPD_MODE_IEEE80211A,
301 * struct hostapd_config - Per-radio interface configuration
303 struct hostapd_config {
304 struct hostapd_bss_config *bss, *last_bss;
305 struct hostapd_radius_servers *radius;
311 u8 send_probe_response;
313 hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */
319 CTS_PROTECTION_AUTOMATIC = 0,
320 CTS_PROTECTION_FORCE_ENABLED = 1,
321 CTS_PROTECTION_FORCE_DISABLED = 2,
322 CTS_PROTECTION_AUTOMATIC_NO_OLBC = 3,
323 } cts_protection_type;
325 int *supported_rates;
328 const struct wpa_driver_ops *driver;
330 int passive_scan_interval; /* seconds, 0 = disabled */
331 int passive_scan_listen; /* usec */
332 int passive_scan_mode;
333 int ap_table_max_size;
334 int ap_table_expiration_time;
336 char country[3]; /* first two octets: country code as described in
337 * ISO/IEC 3166-1. Third octet:
338 * ' ' (ascii 32): all environments
339 * 'O': Outdoor environemnt only
340 * 'I': Indoor environment only
344 unsigned int ieee80211h; /* Enable/Disable 80211h */
346 struct hostapd_tx_queue_params tx_queue[NUM_TX_QUEUES];
349 * WME AC parameters, in same order as 802.1D, i.e.
350 * 0 = BE (best effort)
351 * 1 = BK (background)
355 struct hostapd_wme_ac_params wme_ac_params[4];
358 INTERNAL_BRIDGE_DO_NOT_CONTROL = -1,
359 INTERNAL_BRIDGE_DISABLED = 0,
360 INTERNAL_BRIDGE_ENABLED = 1
365 int hostapd_mac_comp(const void *a, const void *b);
366 int hostapd_mac_comp_empty(const void *a);
367 struct hostapd_config * hostapd_config_read(const char *fname);
368 void hostapd_config_free(struct hostapd_config *conf);
369 int hostapd_maclist_found(macaddr *list, int num_entries, const u8 *addr);
370 int hostapd_rate_found(int *list, int rate);
371 int hostapd_wep_key_cmp(struct hostapd_wep_keys *a,
372 struct hostapd_wep_keys *b);
373 const u8 * hostapd_get_psk(const struct hostapd_bss_config *conf,
374 const u8 *addr, const u8 *prev_psk);
375 int hostapd_setup_wpa_psk(struct hostapd_bss_config *conf);
376 const char * hostapd_get_vlan_id_ifname(struct hostapd_vlan *vlan,
378 const struct hostapd_eap_user *
379 hostapd_get_eap_user(const struct hostapd_bss_config *conf, const u8 *identity,
380 size_t identity_len, int phase2);
382 #endif /* CONFIG_H */