2 * hostapd / Configuration file
3 * Copyright (c) 2003-2007, 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.
20 #include "wpa_common.h"
21 #ifdef CONFIG_IEEE80211N
22 #include "ieee802_11_defs.h"
23 #endif /* CONFIG_IEEE80211N */
29 typedef u8 macaddr[ETH_ALEN];
31 struct hostapd_radius_servers;
32 struct ft_remote_r0kh;
33 struct ft_remote_r1kh;
35 #define HOSTAPD_MAX_SSID_LEN 32
37 #define NUM_WEP_KEYS 4
38 struct hostapd_wep_keys {
40 u8 *key[NUM_WEP_KEYS];
41 size_t len[NUM_WEP_KEYS];
43 size_t default_len; /* key length used for dynamic key generation */
46 typedef enum hostap_security_policy {
47 SECURITY_PLAINTEXT = 0,
48 SECURITY_STATIC_WEP = 1,
49 SECURITY_IEEE_802_1X = 2,
55 char ssid[HOSTAPD_MAX_SSID_LEN + 1];
59 char vlan[IFNAMSIZ + 1];
60 secpolicy security_policy;
62 struct hostapd_wpa_psk *wpa_psk;
66 struct hostapd_wep_keys wep;
68 #define DYNAMIC_VLAN_DISABLED 0
69 #define DYNAMIC_VLAN_OPTIONAL 1
70 #define DYNAMIC_VLAN_REQUIRED 2
72 #ifdef CONFIG_FULL_DYNAMIC_VLAN
73 char *vlan_tagged_interface;
74 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
75 struct hostapd_wep_keys **dyn_vlan_keys;
76 size_t max_dyn_vlan_keys;
80 #define VLAN_ID_WILDCARD -1
83 struct hostapd_vlan *next;
84 int vlan_id; /* VLAN ID or -1 (VLAN_ID_WILDCARD) for wildcard entry */
85 char ifname[IFNAMSIZ + 1];
87 #ifdef CONFIG_FULL_DYNAMIC_VLAN
89 #define DVLAN_CLEAN_BR 0x1
90 #define DVLAN_CLEAN_VLAN 0x2
91 #define DVLAN_CLEAN_VLAN_PORT 0x4
92 #define DVLAN_CLEAN_WLAN_PORT 0x8
94 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
98 struct hostapd_wpa_psk {
99 struct hostapd_wpa_psk *next;
105 #define EAP_USER_MAX_METHODS 8
106 struct hostapd_eap_user {
107 struct hostapd_eap_user *next;
113 } methods[EAP_USER_MAX_METHODS];
118 unsigned int wildcard_prefix:1;
119 unsigned int password_hash:1; /* whether password is hashed with
120 * nt_password_hash() */
121 int ttls_auth; /* EAP_TTLS_AUTH_* bitfield */
125 #define NUM_TX_QUEUES 8
127 struct hostapd_tx_queue_params {
131 int burst; /* maximum burst time in 0.1 ms, i.e., 10 = 1 ms */
135 struct hostapd_wme_ac_params {
139 int txopLimit; /* in units of 32us */
140 int admission_control_mandatory;
145 * struct hostapd_bss_config - Per-BSS configuration
147 struct hostapd_bss_config {
148 char iface[IFNAMSIZ + 1];
149 char bridge[IFNAMSIZ + 1];
151 enum hostapd_logger_level logger_syslog_level, logger_stdout_level;
153 unsigned int logger_syslog; /* module bitfield */
154 unsigned int logger_stdout; /* module bitfield */
156 char *dump_log_name; /* file name for state dump (SIGUSR1) */
158 int max_num_sta; /* maximum number of STAs in station table */
162 int ieee802_1x; /* use IEEE 802.1X */
164 int eap_server; /* Use internal EAP server instead of external
166 struct hostapd_eap_user *eap_user;
168 struct hostapd_ip_addr own_ip_addr;
169 char *nas_identifier;
170 struct hostapd_radius_servers *radius;
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
189 u8 assoc_ap_addr[ETH_ALEN];
190 int assoc_ap; /* whether assoc_ap_addr is set */
193 ACCEPT_UNLESS_DENIED = 0,
194 DENY_UNLESS_ACCEPTED = 1,
195 USE_EXTERNAL_RADIUS_AUTH = 2
202 int auth_algs; /* bitfield of allowed IEEE 802.11 authentication
203 * algorithms, WPA_AUTH_ALG_{OPEN,SHARED,LEAP} */
205 int wpa; /* bitfield of WPA_PROTO_WPA, WPA_PROTO_RSN */
207 #ifdef CONFIG_IEEE80211W
210 IEEE80211W_OPTIONAL = 1,
211 IEEE80211W_REQUIRED = 2
213 #endif /* CONFIG_IEEE80211W */
217 int wpa_strict_rekey;
221 char *rsn_preauth_interfaces;
224 #ifdef CONFIG_IEEE80211R
225 /* IEEE 802.11r - Fast BSS Transition */
226 u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN];
227 u8 r1_key_holder[FT_R1KH_ID_LEN];
229 u32 reassociation_deadline;
230 struct ft_remote_r0kh *r0kh_list;
231 struct ft_remote_r1kh *r1kh_list;
233 #endif /* CONFIG_IEEE80211R */
235 char *ctrl_interface; /* directory for UNIX domain sockets */
236 gid_t ctrl_interface_gid;
237 int ctrl_interface_gid_set;
242 char *private_key_passwd;
245 u8 *pac_opaque_encr_key;
247 int eap_sim_aka_result_ind;
250 char *radius_server_clients;
251 int radius_server_auth_port;
252 int radius_server_ipv6;
254 char *test_socket; /* UNIX domain socket path for driver_test */
256 int use_pae_group_addr; /* Whether to send EAPOL frames to PAE group
257 * address instead of individual address
258 * (for driver_wired.c).
261 int ap_max_inactivity;
262 int ignore_broadcast_ssid;
266 struct hostapd_vlan *vlan, *vlan_tail;
271 * Maximum listen interval that STAs can use when associating with this
272 * BSS. If a STA tries to use larger value, the association will be
273 * denied with status code 51.
275 u16 max_listen_interval;
277 int okc; /* Opportunistic Key Caching */
279 #ifdef CONFIG_IEEE80211N
281 /* TODO: these structures should not really be used here; move to
282 * struct hostapd_data or struct hostapd_iface and just include the
283 * needed values here for generating IEs elsewhere */
284 struct ht_cap_ie ht_capabilities;
285 struct ht_operation_ie ht_operation;
286 int ht_op_mode_fixed;
287 #endif /* CONFIG_IEEE80211N */
292 HOSTAPD_MODE_IEEE80211B,
293 HOSTAPD_MODE_IEEE80211G,
294 HOSTAPD_MODE_IEEE80211A,
300 * struct hostapd_config - Per-radio interface configuration
302 struct hostapd_config {
303 struct hostapd_bss_config *bss, *last_bss;
304 struct hostapd_radius_servers *radius;
310 u8 send_probe_response;
312 hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */
318 CTS_PROTECTION_AUTOMATIC = 0,
319 CTS_PROTECTION_FORCE_ENABLED = 1,
320 CTS_PROTECTION_FORCE_DISABLED = 2,
321 CTS_PROTECTION_AUTOMATIC_NO_OLBC = 3,
322 } cts_protection_type;
324 int *supported_rates;
327 const struct wpa_driver_ops *driver;
329 int passive_scan_interval; /* seconds, 0 = disabled */
330 int passive_scan_listen; /* usec */
331 int passive_scan_mode;
332 int ap_table_max_size;
333 int ap_table_expiration_time;
335 char country[3]; /* first two octets: country code as described in
336 * ISO/IEC 3166-1. Third octet:
337 * ' ' (ascii 32): all environments
338 * 'O': Outdoor environemnt only
339 * 'I': Indoor environment only
343 unsigned int ieee80211h; /* Enable/Disable 80211h */
345 struct hostapd_tx_queue_params tx_queue[NUM_TX_QUEUES];
348 * WME AC parameters, in same order as 802.1D, i.e.
349 * 0 = BE (best effort)
350 * 1 = BK (background)
354 struct hostapd_wme_ac_params wme_ac_params[4];
357 INTERNAL_BRIDGE_DO_NOT_CONTROL = -1,
358 INTERNAL_BRIDGE_DISABLED = 0,
359 INTERNAL_BRIDGE_ENABLED = 1
364 int hostapd_mac_comp(const void *a, const void *b);
365 int hostapd_mac_comp_empty(const void *a);
366 struct hostapd_config * hostapd_config_read(const char *fname);
367 void hostapd_config_free(struct hostapd_config *conf);
368 int hostapd_maclist_found(macaddr *list, int num_entries, const u8 *addr);
369 int hostapd_rate_found(int *list, int rate);
370 int hostapd_wep_key_cmp(struct hostapd_wep_keys *a,
371 struct hostapd_wep_keys *b);
372 const u8 * hostapd_get_psk(const struct hostapd_bss_config *conf,
373 const u8 *addr, const u8 *prev_psk);
374 int hostapd_setup_wpa_psk(struct hostapd_bss_config *conf);
375 const char * hostapd_get_vlan_id_ifname(struct hostapd_vlan *vlan,
377 const struct hostapd_eap_user *
378 hostapd_get_eap_user(const struct hostapd_bss_config *conf, const u8 *identity,
379 size_t identity_len, int phase2);
381 #endif /* CONFIG_H */