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"
26 typedef u8 macaddr
[ETH_ALEN
];
28 struct hostapd_radius_servers
;
29 struct ft_remote_r0kh
;
30 struct ft_remote_r1kh
;
32 #define HOSTAPD_MAX_SSID_LEN 32
34 #define NUM_WEP_KEYS 4
35 struct hostapd_wep_keys
{
37 u8
*key
[NUM_WEP_KEYS
];
38 size_t len
[NUM_WEP_KEYS
];
40 size_t default_len
; /* key length used for dynamic key generation */
43 typedef enum hostap_security_policy
{
44 SECURITY_PLAINTEXT
= 0,
45 SECURITY_STATIC_WEP
= 1,
46 SECURITY_IEEE_802_1X
= 2,
52 char ssid
[HOSTAPD_MAX_SSID_LEN
+ 1];
56 char vlan
[IFNAMSIZ
+ 1];
57 secpolicy security_policy
;
59 struct hostapd_wpa_psk
*wpa_psk
;
63 struct hostapd_wep_keys wep
;
65 #define DYNAMIC_VLAN_DISABLED 0
66 #define DYNAMIC_VLAN_OPTIONAL 1
67 #define DYNAMIC_VLAN_REQUIRED 2
69 #ifdef CONFIG_FULL_DYNAMIC_VLAN
70 char *vlan_tagged_interface
;
71 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
72 struct hostapd_wep_keys
**dyn_vlan_keys
;
73 size_t max_dyn_vlan_keys
;
77 #define VLAN_ID_WILDCARD -1
80 struct hostapd_vlan
*next
;
81 int vlan_id
; /* VLAN ID or -1 (VLAN_ID_WILDCARD) for wildcard entry */
82 char ifname
[IFNAMSIZ
+ 1];
84 #ifdef CONFIG_FULL_DYNAMIC_VLAN
86 #define DVLAN_CLEAN_BR 0x1
87 #define DVLAN_CLEAN_VLAN 0x2
88 #define DVLAN_CLEAN_VLAN_PORT 0x4
89 #define DVLAN_CLEAN_WLAN_PORT 0x8
91 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
95 struct hostapd_wpa_psk
{
96 struct hostapd_wpa_psk
*next
;
102 #define EAP_USER_MAX_METHODS 8
103 struct hostapd_eap_user
{
104 struct hostapd_eap_user
*next
;
110 } methods
[EAP_USER_MAX_METHODS
];
115 unsigned int wildcard_prefix
:1;
116 unsigned int password_hash
:1; /* whether password is hashed with
117 * nt_password_hash() */
118 int ttls_auth
; /* EAP_TTLS_AUTH_* bitfield */
122 #define NUM_TX_QUEUES 8
124 struct hostapd_tx_queue_params
{
128 int burst
; /* maximum burst time in 0.1 ms, i.e., 10 = 1 ms */
132 struct hostapd_wme_ac_params
{
136 int txopLimit
; /* in units of 32us */
137 int admission_control_mandatory
;
142 * struct hostapd_bss_config - Per-BSS configuration
144 struct hostapd_bss_config
{
145 char iface
[IFNAMSIZ
+ 1];
146 char bridge
[IFNAMSIZ
+ 1];
148 enum hostapd_logger_level logger_syslog_level
, logger_stdout_level
;
150 unsigned int logger_syslog
; /* module bitfield */
151 unsigned int logger_stdout
; /* module bitfield */
153 char *dump_log_name
; /* file name for state dump (SIGUSR1) */
155 int max_num_sta
; /* maximum number of STAs in station table */
159 int ieee802_1x
; /* use IEEE 802.1X */
161 int eap_server
; /* Use internal EAP server instead of external
163 struct hostapd_eap_user
*eap_user
;
165 struct hostapd_ip_addr own_ip_addr
;
166 char *nas_identifier
;
167 struct hostapd_radius_servers
*radius
;
169 struct hostapd_ssid ssid
;
171 char *eap_req_id_text
; /* optional displayable message sent with
172 * EAP Request-Identity */
173 size_t eap_req_id_text_len
;
174 int eapol_key_index_workaround
;
176 size_t default_wep_key_len
;
177 int individual_wep_key_len
;
178 int wep_rekeying_period
;
179 int broadcast_key_idx_min
, broadcast_key_idx_max
;
180 int eap_reauth_period
;
182 int ieee802_11f
; /* use IEEE 802.11f (IAPP) */
183 char iapp_iface
[IFNAMSIZ
+ 1]; /* interface used with IAPP broadcast
186 u8 assoc_ap_addr
[ETH_ALEN
];
187 int assoc_ap
; /* whether assoc_ap_addr is set */
190 ACCEPT_UNLESS_DENIED
= 0,
191 DENY_UNLESS_ACCEPTED
= 1,
192 USE_EXTERNAL_RADIUS_AUTH
= 2
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
207 IEEE80211W_OPTIONAL
= 1,
208 IEEE80211W_REQUIRED
= 2
210 #endif /* CONFIG_IEEE80211W */
214 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 int eap_sim_aka_result_ind
;
247 char *radius_server_clients
;
248 int radius_server_auth_port
;
249 int radius_server_ipv6
;
251 char *test_socket
; /* UNIX domain socket path for driver_test */
253 int use_pae_group_addr
; /* Whether to send EAPOL frames to PAE group
254 * address instead of individual address
255 * (for driver_wired.c).
258 int ap_max_inactivity
;
259 int ignore_broadcast_ssid
;
263 struct hostapd_vlan
*vlan
, *vlan_tail
;
268 * Maximum listen interval that STAs can use when associating with this
269 * BSS. If a STA tries to use larger value, the association will be
270 * denied with status code 51.
272 u16 max_listen_interval
;
274 int okc
; /* Opportunistic Key Caching */
279 HOSTAPD_MODE_IEEE80211B
,
280 HOSTAPD_MODE_IEEE80211G
,
281 HOSTAPD_MODE_IEEE80211A
,
287 * struct hostapd_config - Per-radio interface configuration
289 struct hostapd_config
{
290 struct hostapd_bss_config
*bss
, *last_bss
;
291 struct hostapd_radius_servers
*radius
;
297 u8 send_probe_response
;
299 hostapd_hw_mode hw_mode
; /* HOSTAPD_MODE_IEEE80211A, .. */
305 CTS_PROTECTION_AUTOMATIC
= 0,
306 CTS_PROTECTION_FORCE_ENABLED
= 1,
307 CTS_PROTECTION_FORCE_DISABLED
= 2,
308 CTS_PROTECTION_AUTOMATIC_NO_OLBC
= 3,
309 } cts_protection_type
;
311 int *supported_rates
;
314 const struct wpa_driver_ops
*driver
;
316 int passive_scan_interval
; /* seconds, 0 = disabled */
317 int passive_scan_listen
; /* usec */
318 int passive_scan_mode
;
319 int ap_table_max_size
;
320 int ap_table_expiration_time
;
322 char country
[3]; /* first two octets: country code as described in
323 * ISO/IEC 3166-1. Third octet:
324 * ' ' (ascii 32): all environments
325 * 'O': Outdoor environemnt only
326 * 'I': Indoor environment only
330 unsigned int ieee80211h
; /* Enable/Disable 80211h */
332 struct hostapd_tx_queue_params tx_queue
[NUM_TX_QUEUES
];
335 * WME AC parameters, in same order as 802.1D, i.e.
336 * 0 = BE (best effort)
337 * 1 = BK (background)
341 struct hostapd_wme_ac_params wme_ac_params
[4];
344 INTERNAL_BRIDGE_DO_NOT_CONTROL
= -1,
345 INTERNAL_BRIDGE_DISABLED
= 0,
346 INTERNAL_BRIDGE_ENABLED
= 1
351 int hostapd_mac_comp(const void *a
, const void *b
);
352 int hostapd_mac_comp_empty(const void *a
);
353 struct hostapd_config
* hostapd_config_read(const char *fname
);
354 void hostapd_config_free(struct hostapd_config
*conf
);
355 int hostapd_maclist_found(macaddr
*list
, int num_entries
, const u8
*addr
);
356 int hostapd_rate_found(int *list
, int rate
);
357 int hostapd_wep_key_cmp(struct hostapd_wep_keys
*a
,
358 struct hostapd_wep_keys
*b
);
359 const u8
* hostapd_get_psk(const struct hostapd_bss_config
*conf
,
360 const u8
*addr
, const u8
*prev_psk
);
361 int hostapd_setup_wpa_psk(struct hostapd_bss_config
*conf
);
362 const char * hostapd_get_vlan_id_ifname(struct hostapd_vlan
*vlan
,
364 const struct hostapd_eap_user
*
365 hostapd_get_eap_user(const struct hostapd_bss_config
*conf
, const u8
*identity
,
366 size_t identity_len
, int phase2
);
368 #endif /* CONFIG_H */