2 * hostapd / Configuration file
3 * Copyright (c) 2003-2006, 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 "config_types.h"
20 typedef u8 macaddr
[ETH_ALEN
];
22 struct hostapd_radius_servers
;
24 #define HOSTAPD_MAX_SSID_LEN 32
26 #define NUM_WEP_KEYS 4
27 struct hostapd_wep_keys
{
29 u8
*key
[NUM_WEP_KEYS
];
30 size_t len
[NUM_WEP_KEYS
];
32 size_t default_len
; /* key length used for dynamic key generation */
35 typedef enum hostap_security_policy
{
36 SECURITY_PLAINTEXT
= 0,
37 SECURITY_STATIC_WEP
= 1,
38 SECURITY_IEEE_802_1X
= 2,
44 char ssid
[HOSTAPD_MAX_SSID_LEN
+ 1];
48 char vlan
[IFNAMSIZ
+ 1];
49 secpolicy security_policy
;
51 struct hostapd_wpa_psk
*wpa_psk
;
55 struct hostapd_wep_keys wep
;
57 #define DYNAMIC_VLAN_DISABLED 0
58 #define DYNAMIC_VLAN_OPTIONAL 1
59 #define DYNAMIC_VLAN_REQUIRED 2
61 #ifdef CONFIG_FULL_DYNAMIC_VLAN
62 char *vlan_tagged_interface
;
63 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
64 struct hostapd_wep_keys
**dyn_vlan_keys
;
65 size_t max_dyn_vlan_keys
;
69 #define VLAN_ID_WILDCARD -1
72 struct hostapd_vlan
*next
;
73 int vlan_id
; /* VLAN ID or -1 (VLAN_ID_WILDCARD) for wildcard entry */
74 char ifname
[IFNAMSIZ
+ 1];
76 #ifdef CONFIG_FULL_DYNAMIC_VLAN
78 #define DVLAN_CLEAN_BR 0x1
79 #define DVLAN_CLEAN_VLAN 0x2
80 #define DVLAN_CLEAN_VLAN_PORT 0x4
81 #define DVLAN_CLEAN_WLAN_PORT 0x8
83 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
87 struct hostapd_wpa_psk
{
88 struct hostapd_wpa_psk
*next
;
94 #define EAP_USER_MAX_METHODS 8
95 struct hostapd_eap_user
{
96 struct hostapd_eap_user
*next
;
102 } methods
[EAP_USER_MAX_METHODS
];
107 unsigned int wildcard_prefix
:1;
108 unsigned int password_hash
:1; /* whether password is hashed with
109 * nt_password_hash() */
113 #define NUM_TX_QUEUES 8
115 struct hostapd_tx_queue_params
{
119 int burst
; /* maximum burst time in 0.1 ms, i.e., 10 = 1 ms */
123 struct hostapd_wme_ac_params
{
127 int txopLimit
; /* in units of 32us */
128 int admission_control_mandatory
;
133 * struct hostapd_bss_config - Per-BSS configuration
135 struct hostapd_bss_config
{
136 char iface
[IFNAMSIZ
+ 1];
137 char bridge
[IFNAMSIZ
+ 1];
140 HOSTAPD_LEVEL_DEBUG_VERBOSE
= 0,
141 HOSTAPD_LEVEL_DEBUG
= 1,
142 HOSTAPD_LEVEL_INFO
= 2,
143 HOSTAPD_LEVEL_NOTICE
= 3,
144 HOSTAPD_LEVEL_WARNING
= 4
145 } logger_syslog_level
, logger_stdout_level
;
147 #define HOSTAPD_MODULE_IEEE80211 BIT(0)
148 #define HOSTAPD_MODULE_IEEE8021X BIT(1)
149 #define HOSTAPD_MODULE_RADIUS BIT(2)
150 #define HOSTAPD_MODULE_WPA BIT(3)
151 #define HOSTAPD_MODULE_DRIVER BIT(4)
152 #define HOSTAPD_MODULE_IAPP BIT(5)
153 #define HOSTAPD_MODULE_MLME BIT(6)
154 unsigned int logger_syslog
; /* module bitfield */
155 unsigned int logger_stdout
; /* module bitfield */
157 enum { HOSTAPD_DEBUG_NO
= 0, HOSTAPD_DEBUG_MINIMAL
= 1,
158 HOSTAPD_DEBUG_VERBOSE
= 2,
159 HOSTAPD_DEBUG_MSGDUMPS
= 3,
160 HOSTAPD_DEBUG_EXCESSIVE
= 4 } debug
; /* debug verbosity level */
161 char *dump_log_name
; /* file name for state dump (SIGUSR1) */
163 int max_num_sta
; /* maximum number of STAs in station table */
167 int ieee802_1x
; /* use IEEE 802.1X */
169 int eap_server
; /* Use internal EAP server instead of external
171 struct hostapd_eap_user
*eap_user
;
173 struct hostapd_ip_addr own_ip_addr
;
174 char *nas_identifier
;
175 struct hostapd_radius_servers
*radius
;
177 struct hostapd_ssid ssid
;
179 char *eap_req_id_text
; /* optional displayable message sent with
180 * EAP Request-Identity */
181 size_t eap_req_id_text_len
;
182 int eapol_key_index_workaround
;
184 size_t default_wep_key_len
;
185 int individual_wep_key_len
;
186 int wep_rekeying_period
;
187 int broadcast_key_idx_min
, broadcast_key_idx_max
;
188 int eap_reauth_period
;
190 int ieee802_11f
; /* use IEEE 802.11f (IAPP) */
191 char iapp_iface
[IFNAMSIZ
+ 1]; /* interface used with IAPP broadcast
194 u8 assoc_ap_addr
[ETH_ALEN
];
195 int assoc_ap
; /* whether assoc_ap_addr is set */
198 ACCEPT_UNLESS_DENIED
= 0,
199 DENY_UNLESS_ACCEPTED
= 1,
200 USE_EXTERNAL_RADIUS_AUTH
= 2
207 #define HOSTAPD_AUTH_OPEN BIT(0)
208 #define HOSTAPD_AUTH_SHARED_KEY BIT(1)
209 int auth_algs
; /* bitfield of allowed IEEE 802.11 authentication
212 #define HOSTAPD_WPA_VERSION_WPA BIT(0)
213 #define HOSTAPD_WPA_VERSION_WPA2 BIT(1)
215 #define WPA_KEY_MGMT_IEEE8021X BIT(0)
216 #define WPA_KEY_MGMT_PSK BIT(1)
218 #define WPA_CIPHER_NONE BIT(0)
219 #define WPA_CIPHER_WEP40 BIT(1)
220 #define WPA_CIPHER_WEP104 BIT(2)
221 #define WPA_CIPHER_TKIP BIT(3)
222 #define WPA_CIPHER_CCMP BIT(4)
223 #ifdef CONFIG_IEEE80211W
224 #define WPA_CIPHER_AES_128_CMAC BIT(5)
227 IEEE80211W_OPTIONAL
= 1,
228 IEEE80211W_REQUIRED
= 2
230 #endif /* CONFIG_IEEE80211W */
234 int wpa_strict_rekey
;
237 char *rsn_preauth_interfaces
;
240 char *ctrl_interface
; /* directory for UNIX domain sockets */
241 gid_t ctrl_interface_gid
;
242 int ctrl_interface_gid_set
;
247 char *private_key_passwd
;
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
;
273 HOSTAPD_MODE_IEEE80211B
,
274 HOSTAPD_MODE_IEEE80211G
,
275 HOSTAPD_MODE_IEEE80211A
,
281 * struct hostapd_config - Per-radio interface configuration
283 struct hostapd_config
{
284 struct hostapd_bss_config
*bss
, *last_bss
;
285 struct hostapd_radius_servers
*radius
;
291 u8 send_probe_response
;
293 hostapd_hw_mode hw_mode
; /* HOSTAPD_MODE_IEEE80211A, .. */
299 CTS_PROTECTION_AUTOMATIC
= 0,
300 CTS_PROTECTION_FORCE_ENABLED
= 1,
301 CTS_PROTECTION_FORCE_DISABLED
= 2,
302 CTS_PROTECTION_AUTOMATIC_NO_OLBC
= 3,
303 } cts_protection_type
;
305 int *supported_rates
;
308 const struct driver_ops
*driver
;
310 int passive_scan_interval
; /* seconds, 0 = disabled */
311 int passive_scan_listen
; /* usec */
312 int passive_scan_mode
;
313 int ap_table_max_size
;
314 int ap_table_expiration_time
;
316 char country
[3]; /* first two octets: country code as described in
317 * ISO/IEC 3166-1. Third octet:
318 * ' ' (ascii 32): all environments
319 * 'O': Outdoor environemnt only
320 * 'I': Indoor environment only
324 unsigned int ieee80211h
; /* Enable/Disable 80211h */
326 struct hostapd_tx_queue_params tx_queue
[NUM_TX_QUEUES
];
329 * WME AC parameters, in same order as 802.1D, i.e.
330 * 0 = BE (best effort)
331 * 1 = BK (background)
335 struct hostapd_wme_ac_params wme_ac_params
[4];
338 INTERNAL_BRIDGE_DO_NOT_CONTROL
= -1,
339 INTERNAL_BRIDGE_DISABLED
= 0,
340 INTERNAL_BRIDGE_ENABLED
= 1
345 int hostapd_mac_comp(const void *a
, const void *b
);
346 int hostapd_mac_comp_empty(const void *a
);
347 struct hostapd_config
* hostapd_config_read(const char *fname
);
348 void hostapd_config_free(struct hostapd_config
*conf
);
349 int hostapd_maclist_found(macaddr
*list
, int num_entries
, const u8
*addr
);
350 int hostapd_rate_found(int *list
, int rate
);
351 int hostapd_wep_key_cmp(struct hostapd_wep_keys
*a
,
352 struct hostapd_wep_keys
*b
);
353 const u8
* hostapd_get_psk(const struct hostapd_bss_config
*conf
,
354 const u8
*addr
, const u8
*prev_psk
);
355 int hostapd_setup_wpa_psk(struct hostapd_bss_config
*conf
);
356 const char * hostapd_get_vlan_id_ifname(struct hostapd_vlan
*vlan
,
358 const struct hostapd_eap_user
*
359 hostapd_get_eap_user(const struct hostapd_bss_config
*conf
, const u8
*identity
,
360 size_t identity_len
, int phase2
);
362 #endif /* CONFIG_H */