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"
27 typedef u8 macaddr
[ETH_ALEN
];
29 struct mac_acl_entry
{
34 struct hostapd_radius_servers
;
35 struct ft_remote_r0kh
;
36 struct ft_remote_r1kh
;
38 #define HOSTAPD_MAX_SSID_LEN 32
40 #define NUM_WEP_KEYS 4
41 struct hostapd_wep_keys
{
43 u8
*key
[NUM_WEP_KEYS
];
44 size_t len
[NUM_WEP_KEYS
];
46 size_t default_len
; /* key length used for dynamic key generation */
49 typedef enum hostap_security_policy
{
50 SECURITY_PLAINTEXT
= 0,
51 SECURITY_STATIC_WEP
= 1,
52 SECURITY_IEEE_802_1X
= 2,
58 char ssid
[HOSTAPD_MAX_SSID_LEN
+ 1];
62 char vlan
[IFNAMSIZ
+ 1];
63 secpolicy security_policy
;
65 struct hostapd_wpa_psk
*wpa_psk
;
69 struct hostapd_wep_keys wep
;
71 #define DYNAMIC_VLAN_DISABLED 0
72 #define DYNAMIC_VLAN_OPTIONAL 1
73 #define DYNAMIC_VLAN_REQUIRED 2
75 #ifdef CONFIG_FULL_DYNAMIC_VLAN
76 char *vlan_tagged_interface
;
77 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
78 struct hostapd_wep_keys
**dyn_vlan_keys
;
79 size_t max_dyn_vlan_keys
;
83 #define VLAN_ID_WILDCARD -1
86 struct hostapd_vlan
*next
;
87 int vlan_id
; /* VLAN ID or -1 (VLAN_ID_WILDCARD) for wildcard entry */
88 char ifname
[IFNAMSIZ
+ 1];
90 #ifdef CONFIG_FULL_DYNAMIC_VLAN
92 #define DVLAN_CLEAN_BR 0x1
93 #define DVLAN_CLEAN_VLAN 0x2
94 #define DVLAN_CLEAN_VLAN_PORT 0x4
95 #define DVLAN_CLEAN_WLAN_PORT 0x8
97 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
101 struct hostapd_wpa_psk
{
102 struct hostapd_wpa_psk
*next
;
108 #define EAP_USER_MAX_METHODS 8
109 struct hostapd_eap_user
{
110 struct hostapd_eap_user
*next
;
116 } methods
[EAP_USER_MAX_METHODS
];
121 unsigned int wildcard_prefix
:1;
122 unsigned int password_hash
:1; /* whether password is hashed with
123 * nt_password_hash() */
124 int ttls_auth
; /* EAP_TTLS_AUTH_* bitfield */
128 #define NUM_TX_QUEUES 8
130 struct hostapd_tx_queue_params
{
134 int burst
; /* maximum burst time in 0.1 ms, i.e., 10 = 1 ms */
138 struct hostapd_wmm_ac_params
{
142 int txop_limit
; /* in units of 32us */
143 int admission_control_mandatory
;
148 * struct hostapd_bss_config - Per-BSS configuration
150 struct hostapd_bss_config
{
151 char iface
[IFNAMSIZ
+ 1];
152 char bridge
[IFNAMSIZ
+ 1];
154 enum hostapd_logger_level logger_syslog_level
, logger_stdout_level
;
156 unsigned int logger_syslog
; /* module bitfield */
157 unsigned int logger_stdout
; /* module bitfield */
159 char *dump_log_name
; /* file name for state dump (SIGUSR1) */
161 int max_num_sta
; /* maximum number of STAs in station table */
165 int ieee802_1x
; /* use IEEE 802.1X */
167 int eap_server
; /* Use internal EAP server instead of external
169 struct hostapd_eap_user
*eap_user
;
171 struct hostapd_ip_addr own_ip_addr
;
172 char *nas_identifier
;
173 struct hostapd_radius_servers
*radius
;
175 struct hostapd_ssid ssid
;
177 char *eap_req_id_text
; /* optional displayable message sent with
178 * EAP Request-Identity */
179 size_t eap_req_id_text_len
;
180 int eapol_key_index_workaround
;
182 size_t default_wep_key_len
;
183 int individual_wep_key_len
;
184 int wep_rekeying_period
;
185 int broadcast_key_idx_min
, broadcast_key_idx_max
;
186 int eap_reauth_period
;
188 int ieee802_11f
; /* use IEEE 802.11f (IAPP) */
189 char iapp_iface
[IFNAMSIZ
+ 1]; /* interface used with IAPP broadcast
193 ACCEPT_UNLESS_DENIED
= 0,
194 DENY_UNLESS_ACCEPTED
= 1,
195 USE_EXTERNAL_RADIUS_AUTH
= 2
197 struct mac_acl_entry
*accept_mac
;
199 struct mac_acl_entry
*deny_mac
;
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
208 enum mfp_options ieee80211w
;
209 /* dot11AssociationSAQueryMaximumTimeout (in TUs) */
210 unsigned int assoc_sa_query_max_timeout
;
211 /* dot11AssociationSAQueryRetryTimeout (in TUs) */
212 int assoc_sa_query_retry_timeout
;
213 #endif /* CONFIG_IEEE80211W */
217 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 size_t eap_fast_a_id_len
;
249 char *eap_fast_a_id_info
;
251 int pac_key_lifetime
;
252 int pac_key_refresh_time
;
253 int eap_sim_aka_result_ind
;
256 char *radius_server_clients
;
257 int radius_server_auth_port
;
258 int radius_server_ipv6
;
260 char *test_socket
; /* UNIX domain socket path for driver_test */
262 int use_pae_group_addr
; /* Whether to send EAPOL frames to PAE group
263 * address instead of individual address
264 * (for driver_wired.c).
267 int ap_max_inactivity
;
268 int ignore_broadcast_ssid
;
272 struct hostapd_vlan
*vlan
, *vlan_tail
;
277 * Maximum listen interval that STAs can use when associating with this
278 * BSS. If a STA tries to use larger value, the association will be
279 * denied with status code 51.
281 u16 max_listen_interval
;
283 int okc
; /* Opportunistic Key Caching */
289 char *wps_pin_requests
;
296 char *config_methods
;
301 size_t extra_cred_len
;
302 int wps_cred_processing
;
304 size_t ap_settings_len
;
307 char *manufacturer_url
;
308 char *model_description
;
311 #endif /* CONFIG_WPS */
316 * struct hostapd_config - Per-radio interface configuration
318 struct hostapd_config
{
319 struct hostapd_bss_config
*bss
, *last_bss
;
325 u8 send_probe_response
;
327 hostapd_hw_mode hw_mode
; /* HOSTAPD_MODE_IEEE80211A, .. */
333 CTS_PROTECTION_AUTOMATIC
= 0,
334 CTS_PROTECTION_FORCE_ENABLED
= 1,
335 CTS_PROTECTION_FORCE_DISABLED
= 2,
336 CTS_PROTECTION_AUTOMATIC_NO_OLBC
= 3,
337 } cts_protection_type
;
339 int *supported_rates
;
342 const struct wpa_driver_ops
*driver
;
344 int passive_scan_interval
; /* seconds, 0 = disabled */
345 int passive_scan_listen
; /* usec */
346 int passive_scan_mode
;
347 int ap_table_max_size
;
348 int ap_table_expiration_time
;
350 char country
[3]; /* first two octets: country code as described in
351 * ISO/IEC 3166-1. Third octet:
352 * ' ' (ascii 32): all environments
353 * 'O': Outdoor environemnt only
354 * 'I': Indoor environment only
359 struct hostapd_tx_queue_params tx_queue
[NUM_TX_QUEUES
];
362 * WMM AC parameters, in same order as 802.1D, i.e.
363 * 0 = BE (best effort)
364 * 1 = BK (background)
368 struct hostapd_wmm_ac_params wmm_ac_params
[4];
371 INTERNAL_BRIDGE_DO_NOT_CONTROL
= -1,
372 INTERNAL_BRIDGE_DISABLED
= 0,
373 INTERNAL_BRIDGE_ENABLED
= 1
376 #ifdef CONFIG_IEEE80211N
377 int ht_op_mode_fixed
;
379 #endif /* CONFIG_IEEE80211N */
381 int secondary_channel
;
385 int hostapd_mac_comp(const void *a
, const void *b
);
386 int hostapd_mac_comp_empty(const void *a
);
387 struct hostapd_config
* hostapd_config_defaults(void);
388 struct hostapd_config
* hostapd_config_read(const char *fname
);
389 void hostapd_config_free(struct hostapd_config
*conf
);
390 int hostapd_maclist_found(struct mac_acl_entry
*list
, int num_entries
,
391 const u8
*addr
, int *vlan_id
);
392 int hostapd_rate_found(int *list
, int rate
);
393 int hostapd_wep_key_cmp(struct hostapd_wep_keys
*a
,
394 struct hostapd_wep_keys
*b
);
395 const u8
* hostapd_get_psk(const struct hostapd_bss_config
*conf
,
396 const u8
*addr
, const u8
*prev_psk
);
397 int hostapd_setup_wpa_psk(struct hostapd_bss_config
*conf
);
398 const char * hostapd_get_vlan_id_ifname(struct hostapd_vlan
*vlan
,
400 const struct hostapd_eap_user
*
401 hostapd_get_eap_user(const struct hostapd_bss_config
*conf
, const u8
*identity
,
402 size_t identity_len
, int phase2
);
404 #endif /* CONFIG_H */