2 * hostapd / Configuration file
3 * Copyright (c) 2003-2009, 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
12 * See README and COPYING for more details.
18 #include "common/defs.h"
20 #include "common/wpa_common.h"
22 typedef u8 macaddr[ETH_ALEN];
24 struct mac_acl_entry {
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_wmm_ac_params {
137 int txop_limit; /* 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;
169 int acct_interim_interval;
171 struct hostapd_ssid ssid;
173 char *eap_req_id_text; /* optional displayable message sent with
174 * EAP Request-Identity */
175 size_t eap_req_id_text_len;
176 int eapol_key_index_workaround;
178 size_t default_wep_key_len;
179 int individual_wep_key_len;
180 int wep_rekeying_period;
181 int broadcast_key_idx_min, broadcast_key_idx_max;
182 int eap_reauth_period;
184 int ieee802_11f; /* use IEEE 802.11f (IAPP) */
185 char iapp_iface[IFNAMSIZ + 1]; /* interface used with IAPP broadcast
189 ACCEPT_UNLESS_DENIED = 0,
190 DENY_UNLESS_ACCEPTED = 1,
191 USE_EXTERNAL_RADIUS_AUTH = 2
193 struct mac_acl_entry *accept_mac;
195 struct mac_acl_entry *deny_mac;
198 int auth_algs; /* bitfield of allowed IEEE 802.11 authentication
199 * algorithms, WPA_AUTH_ALG_{OPEN,SHARED,LEAP} */
201 int wpa; /* bitfield of WPA_PROTO_WPA, WPA_PROTO_RSN */
203 #ifdef CONFIG_IEEE80211W
204 enum mfp_options ieee80211w;
205 /* dot11AssociationSAQueryMaximumTimeout (in TUs) */
206 unsigned int assoc_sa_query_max_timeout;
207 /* dot11AssociationSAQueryRetryTimeout (in TUs) */
208 int assoc_sa_query_retry_timeout;
209 #endif /* CONFIG_IEEE80211W */
213 int wpa_strict_rekey;
218 char *rsn_preauth_interfaces;
221 #ifdef CONFIG_IEEE80211R
222 /* IEEE 802.11r - Fast BSS Transition */
223 u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN];
224 u8 r1_key_holder[FT_R1KH_ID_LEN];
226 u32 reassociation_deadline;
227 struct ft_remote_r0kh *r0kh_list;
228 struct ft_remote_r1kh *r1kh_list;
230 #endif /* CONFIG_IEEE80211R */
232 char *ctrl_interface; /* directory for UNIX domain sockets */
233 gid_t ctrl_interface_gid;
234 int ctrl_interface_gid_set;
239 char *private_key_passwd;
242 u8 *pac_opaque_encr_key;
244 size_t eap_fast_a_id_len;
245 char *eap_fast_a_id_info;
247 int pac_key_lifetime;
248 int pac_key_refresh_time;
249 int eap_sim_aka_result_ind;
252 char *radius_server_clients;
253 int radius_server_auth_port;
254 int radius_server_ipv6;
256 char *test_socket; /* UNIX domain socket path for driver_test */
258 int use_pae_group_addr; /* Whether to send EAPOL frames to PAE group
259 * address instead of individual address
260 * (for driver_wired.c).
263 int ap_max_inactivity;
264 int ignore_broadcast_ssid;
268 struct hostapd_vlan *vlan, *vlan_tail;
273 * Maximum listen interval that STAs can use when associating with this
274 * BSS. If a STA tries to use larger value, the association will be
275 * denied with status code 51.
277 u16 max_listen_interval;
279 int okc; /* Opportunistic Key Caching */
285 char *wps_pin_requests;
292 char *config_methods;
297 size_t extra_cred_len;
298 int wps_cred_processing;
300 size_t ap_settings_len;
303 char *manufacturer_url;
304 char *model_description;
307 #endif /* CONFIG_WPS */
312 * struct hostapd_config - Per-radio interface configuration
314 struct hostapd_config {
315 struct hostapd_bss_config *bss, *last_bss;
321 u8 send_probe_response;
323 hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */
329 CTS_PROTECTION_AUTOMATIC = 0,
330 CTS_PROTECTION_FORCE_ENABLED = 1,
331 CTS_PROTECTION_FORCE_DISABLED = 2,
332 CTS_PROTECTION_AUTOMATIC_NO_OLBC = 3,
333 } cts_protection_type;
335 int *supported_rates;
338 const struct wpa_driver_ops *driver;
340 int ap_table_max_size;
341 int ap_table_expiration_time;
343 char country[3]; /* first two octets: country code as described in
344 * ISO/IEC 3166-1. Third octet:
345 * ' ' (ascii 32): all environments
346 * 'O': Outdoor environemnt only
347 * 'I': Indoor environment only
352 struct hostapd_tx_queue_params tx_queue[NUM_TX_QUEUES];
355 * WMM AC parameters, in same order as 802.1D, i.e.
356 * 0 = BE (best effort)
357 * 1 = BK (background)
361 struct hostapd_wmm_ac_params wmm_ac_params[4];
363 int ht_op_mode_fixed;
366 int secondary_channel;
370 int hostapd_mac_comp(const void *a, const void *b);
371 int hostapd_mac_comp_empty(const void *a);
372 struct hostapd_config * hostapd_config_defaults(void);
373 struct hostapd_config * hostapd_config_read(const char *fname);
374 void hostapd_config_free(struct hostapd_config *conf);
375 int hostapd_maclist_found(struct mac_acl_entry *list, int num_entries,
376 const u8 *addr, int *vlan_id);
377 int hostapd_rate_found(int *list, int rate);
378 int hostapd_wep_key_cmp(struct hostapd_wep_keys *a,
379 struct hostapd_wep_keys *b);
380 const u8 * hostapd_get_psk(const struct hostapd_bss_config *conf,
381 const u8 *addr, const u8 *prev_psk);
382 int hostapd_setup_wpa_psk(struct hostapd_bss_config *conf);
383 const char * hostapd_get_vlan_id_ifname(struct hostapd_vlan *vlan,
385 const struct hostapd_eap_user *
386 hostapd_get_eap_user(const struct hostapd_bss_config *conf, const u8 *identity,
387 size_t identity_len, int phase2);
389 #endif /* CONFIG_H */