]>
Commit | Line | Data |
---|---|---|
6fc6879b JM |
1 | /* |
2 | * hostapd / Initialization and configuration | |
d3bddd8b | 3 | * Copyright (c) 2002-2014, Jouni Malinen <j@w1.fi> |
6fc6879b | 4 | * |
0f3d578e JM |
5 | * This software may be distributed under the terms of the BSD license. |
6 | * See README for more details. | |
6fc6879b JM |
7 | */ |
8 | ||
9 | #ifndef HOSTAPD_H | |
10 | #define HOSTAPD_H | |
11 | ||
45cefa0b | 12 | #include "common/defs.h" |
d3bddd8b | 13 | #include "utils/list.h" |
ee431d77 | 14 | #include "ap_config.h" |
13daed58 | 15 | #include "drivers/driver.h" |
45cefa0b | 16 | |
0f0aa2a6 AB |
17 | #define OCE_STA_CFON_ENABLED(hapd) \ |
18 | ((hapd->conf->oce & OCE_STA_CFON) && \ | |
19 | (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_OCE_STA_CFON)) | |
20 | #define OCE_AP_ENABLED(hapd) \ | |
21 | ((hapd->conf->oce & OCE_AP) && \ | |
22 | (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_OCE_AP)) | |
23 | ||
6fc6879b JM |
24 | struct wpa_ctrl_dst; |
25 | struct radius_server_data; | |
f620268f | 26 | struct upnp_wps_device_sm; |
bf65bc63 | 27 | struct hostapd_data; |
45cefa0b | 28 | struct sta_info; |
2ce86d9d | 29 | struct ieee80211_ht_capabilities; |
6fc6879b | 30 | struct full_dynamic_vlan; |
a0dee797 AGS |
31 | enum wps_event; |
32 | union wps_event_data; | |
8319e312 TP |
33 | #ifdef CONFIG_MESH |
34 | struct mesh_conf; | |
35 | #endif /* CONFIG_MESH */ | |
6fc6879b | 36 | |
3776ac73 JM |
37 | struct hostapd_iface; |
38 | ||
07bcdbb1 | 39 | struct hapd_interfaces { |
3776ac73 JM |
40 | int (*reload_config)(struct hostapd_iface *iface); |
41 | struct hostapd_config * (*config_read_cb)(const char *config_fname); | |
42 | int (*ctrl_iface_init)(struct hostapd_data *hapd); | |
43 | void (*ctrl_iface_deinit)(struct hostapd_data *hapd); | |
44 | int (*for_each_interface)(struct hapd_interfaces *interfaces, | |
45 | int (*cb)(struct hostapd_iface *iface, | |
46 | void *ctx), void *ctx); | |
75545652 | 47 | int (*driver_init)(struct hostapd_iface *iface); |
3776ac73 | 48 | |
07bcdbb1 | 49 | size_t count; |
c90fd485 | 50 | int global_ctrl_sock; |
89b781bc | 51 | struct dl_list global_ctrl_dst; |
c90fd485 SP |
52 | char *global_iface_path; |
53 | char *global_iface_name; | |
461e3ebe | 54 | #ifndef CONFIG_NATIVE_WINDOWS |
187f87f0 | 55 | gid_t ctrl_iface_group; |
461e3ebe | 56 | #endif /* CONFIG_NATIVE_WINDOWS */ |
07bcdbb1 | 57 | struct hostapd_iface **iface; |
2b6623ab JM |
58 | |
59 | size_t terminate_on_error; | |
132dfbe8 MB |
60 | #ifndef CONFIG_NO_VLAN |
61 | struct dynamic_iface *vlan_priv; | |
62 | #endif /* CONFIG_NO_VLAN */ | |
50bd8e0a MB |
63 | #ifdef CONFIG_ETH_P_OUI |
64 | struct dl_list eth_p_oui; /* OUI Extended EtherType handlers */ | |
65 | #endif /* CONFIG_ETH_P_OUI */ | |
cc27c8e6 | 66 | int eloop_initialized; |
7eb6bfb4 JM |
67 | |
68 | #ifdef CONFIG_DPP | |
87d8435c | 69 | struct dpp_global *dpp; |
7eb6bfb4 | 70 | #endif /* CONFIG_DPP */ |
07bcdbb1 JM |
71 | }; |
72 | ||
245e026e MK |
73 | enum hostapd_chan_status { |
74 | HOSTAPD_CHAN_VALID = 0, /* channel is ready */ | |
75 | HOSTAPD_CHAN_INVALID = 1, /* no usable channel found */ | |
76 | HOSTAPD_CHAN_ACS = 2, /* ACS work being performed */ | |
77 | }; | |
07bcdbb1 | 78 | |
fa16028d | 79 | struct hostapd_probereq_cb { |
04a85e44 | 80 | int (*cb)(void *ctx, const u8 *sa, const u8 *da, const u8 *bssid, |
baf513d6 | 81 | const u8 *ie, size_t ie_len, int ssi_signal); |
fa16028d JM |
82 | void *ctx; |
83 | }; | |
84 | ||
fb7842aa JM |
85 | #define HOSTAPD_RATE_BASIC 0x00000001 |
86 | ||
87 | struct hostapd_rate_data { | |
88 | int rate; /* rate in 100 kbps */ | |
89 | int flags; /* HOSTAPD_RATE_ flags */ | |
90 | }; | |
91 | ||
2a8b7416 | 92 | struct hostapd_frame_info { |
c5cc7a59 | 93 | unsigned int freq; |
2a8b7416 JM |
94 | u32 channel; |
95 | u32 datarate; | |
baf513d6 | 96 | int ssi_signal; /* dBm */ |
2a8b7416 JM |
97 | }; |
98 | ||
61b6520e JM |
99 | enum wps_status { |
100 | WPS_STATUS_SUCCESS = 1, | |
101 | WPS_STATUS_FAILURE | |
102 | }; | |
103 | ||
ae23935e JM |
104 | enum pbc_status { |
105 | WPS_PBC_STATUS_DISABLE, | |
106 | WPS_PBC_STATUS_ACTIVE, | |
107 | WPS_PBC_STATUS_TIMEOUT, | |
108 | WPS_PBC_STATUS_OVERLAP | |
109 | }; | |
110 | ||
61b6520e JM |
111 | struct wps_stat { |
112 | enum wps_status status; | |
113 | enum wps_error_indication failure_reason; | |
ae23935e | 114 | enum pbc_status pbc_status; |
e96872a4 | 115 | u8 peer_addr[ETH_ALEN]; |
61b6520e JM |
116 | }; |
117 | ||
9b4b2264 DS |
118 | struct hostapd_neighbor_entry { |
119 | struct dl_list list; | |
120 | u8 bssid[ETH_ALEN]; | |
121 | struct wpa_ssid_value ssid; | |
122 | struct wpabuf *nr; | |
123 | struct wpabuf *lci; | |
124 | struct wpabuf *civic; | |
125 | /* LCI update time */ | |
126 | struct os_time lci_date; | |
451a27b1 | 127 | int stationary; |
9b4b2264 | 128 | }; |
fb7842aa | 129 | |
ff9f40ae JM |
130 | struct hostapd_sae_commit_queue { |
131 | struct dl_list list; | |
132 | int rssi; | |
133 | size_t len; | |
134 | u8 msg[]; | |
135 | }; | |
136 | ||
6fc6879b JM |
137 | /** |
138 | * struct hostapd_data - hostapd per-BSS data structure | |
139 | */ | |
140 | struct hostapd_data { | |
141 | struct hostapd_iface *iface; | |
142 | struct hostapd_config *iconf; | |
143 | struct hostapd_bss_config *conf; | |
6023a788 | 144 | int interface_added; /* virtual interface added for this BSS */ |
36501a22 | 145 | unsigned int started:1; |
f33c8606 JM |
146 | unsigned int disabled:1; |
147 | unsigned int reenable_beacon:1; | |
6fc6879b JM |
148 | |
149 | u8 own_addr[ETH_ALEN]; | |
150 | ||
151 | int num_sta; /* number of entries in sta_list */ | |
152 | struct sta_info *sta_list; /* STA info list head */ | |
2991469c JM |
153 | #define STA_HASH_SIZE 256 |
154 | #define STA_HASH(sta) (sta[5]) | |
6fc6879b JM |
155 | struct sta_info *sta_hash[STA_HASH_SIZE]; |
156 | ||
2991469c JM |
157 | /* |
158 | * Bitfield for indicating which AIDs are allocated. Only AID values | |
159 | * 1-2007 are used and as such, the bit at index 0 corresponds to AID | |
160 | * 1. | |
6fc6879b | 161 | */ |
2991469c JM |
162 | #define AID_WORDS ((2008 + 31) / 32) |
163 | u32 sta_aid[AID_WORDS]; | |
6fc6879b | 164 | |
c5121837 | 165 | const struct wpa_driver_ops *driver; |
6fc6879b JM |
166 | void *drv_priv; |
167 | ||
d24df7c3 JM |
168 | void (*new_assoc_sta_cb)(struct hostapd_data *hapd, |
169 | struct sta_info *sta, int reassoc); | |
170 | ||
4f760fcc | 171 | void *msg_ctx; /* ctx for wpa_msg() calls */ |
8a5e75f6 | 172 | void *msg_ctx_parent; /* parent interface ctx for wpa_msg() calls */ |
4f760fcc | 173 | |
6fc6879b | 174 | struct radius_client_data *radius; |
4260e1a1 | 175 | u64 acct_session_id; |
b031338c | 176 | struct radius_das_data *radius_das; |
6fc6879b JM |
177 | |
178 | struct iapp_data *iapp; | |
179 | ||
6fc6879b JM |
180 | struct hostapd_cached_radius_acl *acl_cache; |
181 | struct hostapd_acl_query_data *acl_queries; | |
182 | ||
183 | struct wpa_authenticator *wpa_auth; | |
184 | struct eapol_authenticator *eapol_auth; | |
185 | ||
186 | struct rsn_preauth_interface *preauth_iface; | |
7ffe7d22 | 187 | struct os_reltime michael_mic_failure; |
6fc6879b JM |
188 | int michael_mic_failures; |
189 | int tkip_countermeasures; | |
190 | ||
191 | int ctrl_sock; | |
89b781bc | 192 | struct dl_list ctrl_dst; |
6fc6879b JM |
193 | |
194 | void *ssl_ctx; | |
195 | void *eap_sim_db_priv; | |
196 | struct radius_server_data *radius_srv; | |
d3bddd8b | 197 | struct dl_list erp_keys; /* struct eap_server_erp_key */ |
6fc6879b JM |
198 | |
199 | int parameter_set_count; | |
200 | ||
39b97072 JM |
201 | /* Time Advertisement */ |
202 | u8 time_update_counter; | |
203 | struct wpabuf *time_adv; | |
204 | ||
6fc6879b JM |
205 | #ifdef CONFIG_FULL_DYNAMIC_VLAN |
206 | struct full_dynamic_vlan *full_dynamic_vlan; | |
207 | #endif /* CONFIG_FULL_DYNAMIC_VLAN */ | |
208 | ||
209 | struct l2_packet_data *l2; | |
c5fee160 MB |
210 | |
211 | #ifdef CONFIG_IEEE80211R_AP | |
212 | struct dl_list l2_queue; | |
50bd8e0a MB |
213 | struct dl_list l2_oui_queue; |
214 | struct eth_p_oui_ctx *oui_pull; | |
215 | struct eth_p_oui_ctx *oui_resp; | |
216 | struct eth_p_oui_ctx *oui_push; | |
245fc96e MB |
217 | struct eth_p_oui_ctx *oui_sreq; |
218 | struct eth_p_oui_ctx *oui_sresp; | |
c5fee160 MB |
219 | #endif /* CONFIG_IEEE80211R_AP */ |
220 | ||
ad08c363 JM |
221 | struct wps_context *wps; |
222 | ||
bc45d427 | 223 | int beacon_set_done; |
14f79386 JM |
224 | struct wpabuf *wps_beacon_ie; |
225 | struct wpabuf *wps_probe_resp_ie; | |
84312359 | 226 | #ifdef CONFIG_WPS |
3b2cf800 | 227 | unsigned int ap_pin_failures; |
32cdcf15 | 228 | unsigned int ap_pin_failures_consecutive; |
f620268f | 229 | struct upnp_wps_device_sm *wps_upnp; |
94481410 | 230 | unsigned int ap_pin_lockout_time; |
61b6520e JM |
231 | |
232 | struct wps_stat wps_stats; | |
ad08c363 | 233 | #endif /* CONFIG_WPS */ |
fa16028d JM |
234 | |
235 | struct hostapd_probereq_cb *probereq_cb; | |
236 | size_t num_probereq_cb; | |
195420b8 | 237 | |
c706d5aa JM |
238 | void (*public_action_cb)(void *ctx, const u8 *buf, size_t len, |
239 | int freq); | |
240 | void *public_action_cb_ctx; | |
2d9ffe1e JM |
241 | void (*public_action_cb2)(void *ctx, const u8 *buf, size_t len, |
242 | int freq); | |
243 | void *public_action_cb2_ctx; | |
c706d5aa | 244 | |
e44f8bf2 JM |
245 | int (*vendor_action_cb)(void *ctx, const u8 *buf, size_t len, |
246 | int freq); | |
247 | void *vendor_action_cb_ctx; | |
248 | ||
195420b8 JM |
249 | void (*wps_reg_success_cb)(void *ctx, const u8 *mac_addr, |
250 | const u8 *uuid_e); | |
251 | void *wps_reg_success_cb_ctx; | |
c2af2afb | 252 | |
a0dee797 AGS |
253 | void (*wps_event_cb)(void *ctx, enum wps_event event, |
254 | union wps_event_data *data); | |
255 | void *wps_event_cb_ctx; | |
256 | ||
0661eed2 | 257 | void (*sta_authorized_cb)(void *ctx, const u8 *mac_addr, |
fbdcfd57 | 258 | int authorized, const u8 *p2p_dev_addr); |
0661eed2 JB |
259 | void *sta_authorized_cb_ctx; |
260 | ||
c76e5d7f JB |
261 | void (*setup_complete_cb)(void *ctx); |
262 | void *setup_complete_cb_ctx; | |
263 | ||
01a57fe4 JM |
264 | void (*new_psk_cb)(void *ctx, const u8 *mac_addr, |
265 | const u8 *p2p_dev_addr, const u8 *psk, | |
266 | size_t psk_len); | |
267 | void *new_psk_cb_ctx; | |
268 | ||
6782b684 MK |
269 | /* channel switch parameters */ |
270 | struct hostapd_freq_params cs_freq_params; | |
271 | u8 cs_count; | |
272 | int cs_block_tx; | |
273 | unsigned int cs_c_off_beacon; | |
274 | unsigned int cs_c_off_proberesp; | |
275 | int csa_in_progress; | |
6315bfdb AO |
276 | unsigned int cs_c_off_ecsa_beacon; |
277 | unsigned int cs_c_off_ecsa_proberesp; | |
6782b684 | 278 | |
c2af2afb | 279 | #ifdef CONFIG_P2P |
e44f8bf2 JM |
280 | struct p2p_data *p2p; |
281 | struct p2p_group *p2p_group; | |
c2af2afb JM |
282 | struct wpabuf *p2p_beacon_ie; |
283 | struct wpabuf *p2p_probe_resp_ie; | |
aefb53bd JM |
284 | |
285 | /* Number of non-P2P association stations */ | |
286 | int num_sta_no_p2p; | |
287 | ||
288 | /* Periodic NoA (used only when no non-P2P clients in the group) */ | |
289 | int noa_enabled; | |
290 | int noa_start; | |
291 | int noa_duration; | |
c2af2afb | 292 | #endif /* CONFIG_P2P */ |
7d597d46 KP |
293 | #ifdef CONFIG_PROXYARP |
294 | struct l2_packet_data *sock_dhcp; | |
bd00c431 | 295 | struct l2_packet_data *sock_ndisc; |
7d597d46 | 296 | #endif /* CONFIG_PROXYARP */ |
5f92659d BC |
297 | #ifdef CONFIG_MESH |
298 | int num_plinks; | |
299 | int max_plinks; | |
9684c756 SD |
300 | void (*mesh_sta_free_cb)(struct hostapd_data *hapd, |
301 | struct sta_info *sta); | |
3a322496 JM |
302 | struct wpabuf *mesh_pending_auth; |
303 | struct os_reltime mesh_pending_auth_time; | |
9f2cf23e | 304 | u8 mesh_required_peer[ETH_ALEN]; |
5f92659d | 305 | #endif /* CONFIG_MESH */ |
ee431d77 JM |
306 | |
307 | #ifdef CONFIG_SQLITE | |
308 | struct hostapd_eap_user tmp_eap_user; | |
309 | #endif /* CONFIG_SQLITE */ | |
d136c376 JM |
310 | |
311 | #ifdef CONFIG_SAE | |
312 | /** Key used for generating SAE anti-clogging tokens */ | |
313 | u8 sae_token_key[8]; | |
fe52c210 | 314 | struct os_reltime last_sae_token_key_update; |
a9af1da0 JM |
315 | u16 sae_token_idx; |
316 | u16 sae_pending_token_idx[256]; | |
ecd40fef | 317 | int dot11RSNASAERetransPeriod; /* msec */ |
ff9f40ae | 318 | struct dl_list sae_commit_queue; /* struct hostapd_sae_commit_queue */ |
d136c376 | 319 | #endif /* CONFIG_SAE */ |
93827f45 JM |
320 | |
321 | #ifdef CONFIG_TESTING_OPTIONS | |
9d4ff04a JM |
322 | unsigned int ext_mgmt_frame_handling:1; |
323 | unsigned int ext_eapol_frame_io:1; | |
4a6cc862 JM |
324 | |
325 | struct l2_packet_data *l2_test; | |
16579769 JM |
326 | |
327 | enum wpa_alg last_gtk_alg; | |
328 | int last_gtk_key_idx; | |
329 | u8 last_gtk[WPA_GTK_MAX_LEN]; | |
330 | size_t last_gtk_len; | |
331 | ||
332 | #ifdef CONFIG_IEEE80211W | |
333 | enum wpa_alg last_igtk_alg; | |
334 | int last_igtk_key_idx; | |
335 | u8 last_igtk[WPA_IGTK_MAX_LEN]; | |
336 | size_t last_igtk_len; | |
337 | #endif /* CONFIG_IEEE80211W */ | |
93827f45 | 338 | #endif /* CONFIG_TESTING_OPTIONS */ |
fb9a1c3e AS |
339 | |
340 | #ifdef CONFIG_MBO | |
341 | unsigned int mbo_assoc_disallow; | |
342 | #endif /* CONFIG_MBO */ | |
9b4b2264 DS |
343 | |
344 | struct dl_list nr_db; | |
f4f185a2 | 345 | |
90d9d7c3 | 346 | u8 beacon_req_token; |
f4f185a2 | 347 | u8 lci_req_token; |
220754c5 | 348 | u8 range_req_token; |
f4f185a2 | 349 | unsigned int lci_req_active:1; |
220754c5 | 350 | unsigned int range_req_active:1; |
91d91abf JM |
351 | |
352 | int dhcp_sock; /* UDP socket used with the DHCP server */ | |
9c2b8204 JM |
353 | |
354 | #ifdef CONFIG_DPP | |
9c2b8204 JM |
355 | int dpp_init_done; |
356 | struct dpp_authentication *dpp_auth; | |
357 | u8 dpp_allowed_roles; | |
358 | int dpp_qr_mutual; | |
359 | int dpp_auth_ok_on_ack; | |
80f71b71 | 360 | int dpp_in_response_listen; |
9c2b8204 | 361 | struct gas_query_ap *gas; |
efeada91 JM |
362 | struct dpp_pkex *dpp_pkex; |
363 | struct dpp_bootstrap_info *dpp_pkex_bi; | |
364 | char *dpp_pkex_code; | |
365 | char *dpp_pkex_identifier; | |
366 | char *dpp_pkex_auth_cmd; | |
6b140f0f | 367 | char *dpp_configurator_params; |
80f71b71 JM |
368 | struct os_reltime dpp_last_init; |
369 | struct os_reltime dpp_init_iter_start; | |
370 | unsigned int dpp_init_max_tries; | |
371 | unsigned int dpp_init_retry_time; | |
372 | unsigned int dpp_resp_wait_time; | |
373 | unsigned int dpp_resp_max_tries; | |
374 | unsigned int dpp_resp_retry_time; | |
9c2b8204 JM |
375 | #ifdef CONFIG_TESTING_OPTIONS |
376 | char *dpp_config_obj_override; | |
377 | char *dpp_discovery_override; | |
378 | char *dpp_groups_override; | |
9c2b8204 JM |
379 | unsigned int dpp_ignore_netaccesskey_mismatch:1; |
380 | #endif /* CONFIG_TESTING_OPTIONS */ | |
381 | #endif /* CONFIG_DPP */ | |
ef721751 THJ |
382 | |
383 | #ifdef CONFIG_AIRTIME_POLICY | |
384 | unsigned int num_backlogged_sta; | |
385 | unsigned int airtime_weight; | |
386 | #endif /* CONFIG_AIRTIME_POLICY */ | |
de94be0a JM |
387 | |
388 | u8 last_1x_eapol_key_replay_counter[8]; | |
6fc6879b JM |
389 | }; |
390 | ||
391 | ||
a65a9b8d JM |
392 | struct hostapd_sta_info { |
393 | struct dl_list list; | |
394 | u8 addr[ETH_ALEN]; | |
395 | struct os_reltime last_seen; | |
a818425d | 396 | int ssi_signal; |
44281940 DG |
397 | #ifdef CONFIG_TAXONOMY |
398 | struct wpabuf *probe_ie_taxonomy; | |
399 | #endif /* CONFIG_TAXONOMY */ | |
a65a9b8d JM |
400 | }; |
401 | ||
6fc6879b JM |
402 | /** |
403 | * struct hostapd_iface - hostapd per-interface data structure | |
404 | */ | |
405 | struct hostapd_iface { | |
9969e5a4 | 406 | struct hapd_interfaces *interfaces; |
0f2b2c19 | 407 | void *owner; |
6fc6879b JM |
408 | char *config_fname; |
409 | struct hostapd_config *conf; | |
5afaa067 | 410 | char phy[16]; /* Name of the PHY (radio) */ |
6fc6879b | 411 | |
e1c5faf0 JM |
412 | enum hostapd_iface_state { |
413 | HAPD_IFACE_UNINITIALIZED, | |
414 | HAPD_IFACE_DISABLED, | |
415 | HAPD_IFACE_COUNTRY_UPDATE, | |
416 | HAPD_IFACE_ACS, | |
417 | HAPD_IFACE_HT_SCAN, | |
418 | HAPD_IFACE_DFS, | |
419 | HAPD_IFACE_ENABLED | |
420 | } state; | |
421 | ||
8319e312 TP |
422 | #ifdef CONFIG_MESH |
423 | struct mesh_conf *mconf; | |
424 | #endif /* CONFIG_MESH */ | |
425 | ||
6fc6879b JM |
426 | size_t num_bss; |
427 | struct hostapd_data **bss; | |
428 | ||
f0793bf1 | 429 | unsigned int wait_channel_update:1; |
dc036d9e | 430 | unsigned int cac_started:1; |
6959145b AN |
431 | #ifdef CONFIG_FST |
432 | struct fst_iface *fst; | |
84bcb4e7 | 433 | const struct wpabuf *fst_ies; |
6959145b | 434 | #endif /* CONFIG_FST */ |
f0793bf1 | 435 | |
354c903f MB |
436 | /* |
437 | * When set, indicates that the driver will handle the AP | |
438 | * teardown: delete global keys, station keys, and stations. | |
439 | */ | |
440 | unsigned int driver_ap_teardown:1; | |
441 | ||
053693d2 SD |
442 | /* |
443 | * When set, indicates that this interface is part of list of | |
444 | * interfaces that need to be started together (synchronously). | |
445 | */ | |
446 | unsigned int need_to_start_in_sync:1; | |
447 | ||
448 | /* Ready to start but waiting for other interfaces to become ready. */ | |
449 | unsigned int ready_to_start_in_sync:1; | |
450 | ||
6fc6879b JM |
451 | int num_ap; /* number of entries in ap_list */ |
452 | struct ap_info *ap_list; /* AP info list head */ | |
453 | struct ap_info *ap_hash[STA_HASH_SIZE]; | |
6fc6879b | 454 | |
e3a8ad44 | 455 | u64 drv_flags; |
4f73d88a | 456 | |
04ee647d EP |
457 | /* SMPS modes supported by the driver (WPA_DRIVER_SMPS_MODE_*) */ |
458 | unsigned int smps_modes; | |
459 | ||
4f73d88a AN |
460 | /* |
461 | * A bitmap of supported protocols for probe response offload. See | |
462 | * struct wpa_driver_capa in driver.h | |
463 | */ | |
464 | unsigned int probe_resp_offloads; | |
465 | ||
8cd6b7bc JB |
466 | /* extended capabilities supported by the driver */ |
467 | const u8 *extended_capa, *extended_capa_mask; | |
468 | unsigned int extended_capa_len; | |
469 | ||
3cb953e4 JM |
470 | unsigned int drv_max_acl_mac_addrs; |
471 | ||
6fc6879b JM |
472 | struct hostapd_hw_modes *hw_features; |
473 | int num_hw_features; | |
474 | struct hostapd_hw_modes *current_mode; | |
475 | /* Rates that are currently used (i.e., filtered copy of | |
476 | * current_mode->channels */ | |
477 | int num_rates; | |
478 | struct hostapd_rate_data *current_rates; | |
e5693c47 | 479 | int *basic_rates; |
c706d5aa | 480 | int freq; |
6fc6879b JM |
481 | |
482 | u16 hw_flags; | |
483 | ||
484 | /* Number of associated Non-ERP stations (i.e., stations using 802.11b | |
485 | * in 802.11g BSS) */ | |
486 | int num_sta_non_erp; | |
487 | ||
488 | /* Number of associated stations that do not support Short Slot Time */ | |
489 | int num_sta_no_short_slot_time; | |
490 | ||
491 | /* Number of associated stations that do not support Short Preamble */ | |
492 | int num_sta_no_short_preamble; | |
493 | ||
494 | int olbc; /* Overlapping Legacy BSS Condition */ | |
495 | ||
de9289c8 JM |
496 | /* Number of HT associated stations that do not support greenfield */ |
497 | int num_sta_ht_no_gf; | |
498 | ||
499 | /* Number of associated non-HT stations */ | |
500 | int num_sta_no_ht; | |
501 | ||
502 | /* Number of HT associated stations 20 MHz */ | |
503 | int num_sta_ht_20mhz; | |
504 | ||
9c47f6a2 PX |
505 | /* Number of HT40 intolerant stations */ |
506 | int num_sta_ht40_intolerant; | |
507 | ||
de9289c8 JM |
508 | /* Overlapping BSS information */ |
509 | int olbc_ht; | |
510 | ||
edd360e1 | 511 | u16 ht_op_mode; |
0185007c MK |
512 | |
513 | /* surveying helpers */ | |
514 | ||
515 | /* number of channels surveyed */ | |
516 | unsigned int chans_surveyed; | |
517 | ||
518 | /* lowest observed noise floor in dBm */ | |
519 | s8 lowest_nf; | |
520 | ||
ec8f36af KP |
521 | /* channel utilization calculation */ |
522 | u64 last_channel_time; | |
523 | u64 last_channel_time_busy; | |
524 | u8 channel_utilization; | |
525 | ||
af832aa9 BP |
526 | unsigned int chan_util_samples_sum; |
527 | unsigned int chan_util_num_sample_periods; | |
528 | unsigned int chan_util_average; | |
529 | ||
6315bfdb AO |
530 | /* eCSA IE will be added only if operating class is specified */ |
531 | u8 cs_oper_class; | |
532 | ||
bbbacbf2 JD |
533 | unsigned int dfs_cac_ms; |
534 | struct os_reltime dfs_cac_start; | |
535 | ||
9c47f6a2 PX |
536 | /* Latched with the actual secondary channel information and will be |
537 | * used while juggling between HT20 and HT40 modes. */ | |
538 | int secondary_ch; | |
539 | ||
50f4f2a0 MK |
540 | #ifdef CONFIG_ACS |
541 | unsigned int acs_num_completed_scans; | |
542 | #endif /* CONFIG_ACS */ | |
543 | ||
ad1e68e6 | 544 | void (*scan_cb)(struct hostapd_iface *iface); |
5f0bca77 | 545 | int num_ht40_scan_tries; |
a65a9b8d JM |
546 | |
547 | struct dl_list sta_seen; /* struct hostapd_sta_info */ | |
548 | unsigned int num_sta_seen; | |
04f667fc VT |
549 | |
550 | u8 dfs_domain; | |
ef721751 THJ |
551 | #ifdef CONFIG_AIRTIME_POLICY |
552 | unsigned int airtime_quantum; | |
553 | #endif /* CONFIG_AIRTIME_POLICY */ | |
de6aafaa HD |
554 | |
555 | /* Previous WMM element information */ | |
556 | struct hostapd_wmm_ac_params prev_wmm[WMM_AC_NUM]; | |
6fc6879b JM |
557 | }; |
558 | ||
a4f21109 | 559 | /* hostapd.c */ |
07bcdbb1 JM |
560 | int hostapd_for_each_interface(struct hapd_interfaces *interfaces, |
561 | int (*cb)(struct hostapd_iface *iface, | |
562 | void *ctx), void *ctx); | |
ad08c363 | 563 | int hostapd_reload_config(struct hostapd_iface *iface); |
567df550 | 564 | void hostapd_reconfig_encryption(struct hostapd_data *hapd); |
b6a7859d JM |
565 | struct hostapd_data * |
566 | hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface, | |
567 | struct hostapd_config *conf, | |
568 | struct hostapd_bss_config *bss); | |
5c333467 | 569 | int hostapd_setup_interface(struct hostapd_iface *iface); |
ad1e68e6 | 570 | int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err); |
5c333467 | 571 | void hostapd_interface_deinit(struct hostapd_iface *iface); |
f7c47833 | 572 | void hostapd_interface_free(struct hostapd_iface *iface); |
5e993390 | 573 | struct hostapd_iface * hostapd_alloc_iface(void); |
66936c6a KP |
574 | struct hostapd_iface * hostapd_init(struct hapd_interfaces *interfaces, |
575 | const char *config_file); | |
a1fb5692 KP |
576 | struct hostapd_iface * |
577 | hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy, | |
578 | const char *config_fname, int debug); | |
a4f21109 JM |
579 | void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, |
580 | int reassoc); | |
75545652 SP |
581 | void hostapd_interface_deinit_free(struct hostapd_iface *iface); |
582 | int hostapd_enable_iface(struct hostapd_iface *hapd_iface); | |
583 | int hostapd_reload_iface(struct hostapd_iface *hapd_iface); | |
584 | int hostapd_disable_iface(struct hostapd_iface *hapd_iface); | |
06bb8c62 SP |
585 | int hostapd_add_iface(struct hapd_interfaces *ifaces, char *buf); |
586 | int hostapd_remove_iface(struct hapd_interfaces *ifaces, char *buf); | |
795baf77 | 587 | void hostapd_channel_list_updated(struct hostapd_iface *iface, int initiator); |
e1c5faf0 | 588 | void hostapd_set_state(struct hostapd_iface *iface, enum hostapd_iface_state s); |
5ae6449c | 589 | const char * hostapd_state_text(enum hostapd_iface_state s); |
4e0ab656 | 590 | int hostapd_csa_in_progress(struct hostapd_iface *iface); |
bda9c085 | 591 | void hostapd_chan_switch_vht_config(struct hostapd_data *hapd, int vht_enabled); |
bf281c12 AO |
592 | int hostapd_switch_channel(struct hostapd_data *hapd, |
593 | struct csa_settings *settings); | |
5841958f MK |
594 | void |
595 | hostapd_switch_channel_fallback(struct hostapd_iface *iface, | |
596 | const struct hostapd_freq_params *freq_params); | |
bf281c12 | 597 | void hostapd_cleanup_cs_params(struct hostapd_data *hapd); |
3188aaba | 598 | void hostapd_periodic_iface(struct hostapd_iface *iface); |
a8913881 | 599 | int hostapd_owe_trans_get_info(struct hostapd_data *hapd); |
5c333467 | 600 | |
a4f21109 | 601 | /* utils.c */ |
fa16028d | 602 | int hostapd_register_probereq_cb(struct hostapd_data *hapd, |
cd7d80f3 | 603 | int (*cb)(void *ctx, const u8 *sa, |
04a85e44 | 604 | const u8 *da, const u8 *bssid, |
baf513d6 JB |
605 | const u8 *ie, size_t ie_len, |
606 | int ssi_signal), | |
fa16028d | 607 | void *ctx); |
0aef3ec8 | 608 | void hostapd_prune_associations(struct hostapd_data *hapd, const u8 *addr); |
fa16028d | 609 | |
1d041bec | 610 | /* drv_callbacks.c (TODO: move to somewhere else?) */ |
8b5ddda5 JM |
611 | void hostapd_notify_assoc_fils_finish(struct hostapd_data *hapd, |
612 | struct sta_info *sta); | |
1d041bec | 613 | int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr, |
39b08b5f | 614 | const u8 *ie, size_t ielen, int reassoc); |
1d041bec | 615 | void hostapd_notif_disassoc(struct hostapd_data *hapd, const u8 *addr); |
0d7e5a3a | 616 | void hostapd_event_sta_low_ack(struct hostapd_data *hapd, const u8 *addr); |
3140803b RM |
617 | void hostapd_event_connect_failed_reason(struct hostapd_data *hapd, |
618 | const u8 *addr, int reason_code); | |
04a85e44 | 619 | int hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa, const u8 *da, |
baf513d6 JB |
620 | const u8 *bssid, const u8 *ie, size_t ie_len, |
621 | int ssi_signal); | |
1b487b8b | 622 | void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht, |
95f556f3 OD |
623 | int offset, int width, int cf1, int cf2, |
624 | int finished); | |
96bc5086 TB |
625 | struct survey_results; |
626 | void hostapd_event_get_survey(struct hostapd_iface *iface, | |
627 | struct survey_results *survey_results); | |
d9909717 TB |
628 | void hostapd_acs_channel_selected(struct hostapd_data *hapd, |
629 | struct acs_selected_channels *acs_res); | |
1d041bec | 630 | |
ee431d77 JM |
631 | const struct hostapd_eap_user * |
632 | hostapd_get_eap_user(struct hostapd_data *hapd, const u8 *identity, | |
633 | size_t identity_len, int phase2); | |
634 | ||
6959145b AN |
635 | struct hostapd_data * hostapd_get_iface(struct hapd_interfaces *interfaces, |
636 | const char *ifname); | |
ec2b5173 T |
637 | void hostapd_event_sta_opmode_changed(struct hostapd_data *hapd, const u8 *addr, |
638 | enum smps_mode smps_mode, | |
639 | enum chan_width chan_width, u8 rx_nss); | |
6959145b AN |
640 | |
641 | #ifdef CONFIG_FST | |
642 | void fst_hostapd_fill_iface_obj(struct hostapd_data *hapd, | |
643 | struct fst_wpa_obj *iface_obj); | |
644 | #endif /* CONFIG_FST */ | |
645 | ||
6fc6879b | 646 | #endif /* HOSTAPD_H */ |