• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * hostapd / Initialization and configuration
3  * Copyright (c) 2002-2014, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef HOSTAPD_H
10 #define HOSTAPD_H
11 
12 #ifdef CONFIG_SQLITE
13 #include <sqlite3.h>
14 #endif /* CONFIG_SQLITE */
15 
16 #include "common/defs.h"
17 #include "utils/list.h"
18 #include "ap_config.h"
19 #include "drivers/driver.h"
20 #ifdef CONFIG_WPS
21 #include "wps/wps.h"
22 #endif /* CONFIG_WPS */
23 #define OCE_STA_CFON_ENABLED(hapd) \
24 	((hapd->conf->oce & OCE_STA_CFON) && \
25 	 (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_OCE_STA_CFON))
26 #define OCE_AP_ENABLED(hapd) \
27 	((hapd->conf->oce & OCE_AP) && \
28 	 (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_OCE_AP))
29 
30 struct wpa_ctrl_dst;
31 struct radius_server_data;
32 struct upnp_wps_device_sm;
33 struct hostapd_data;
34 struct sta_info;
35 struct ieee80211_ht_capabilities;
36 struct full_dynamic_vlan;
37 enum wps_event;
38 union wps_event_data;
39 #ifdef CONFIG_MESH
40 struct mesh_conf;
41 #endif /* CONFIG_MESH */
42 
43 #ifdef CONFIG_CTRL_IFACE_UDP
44 #define CTRL_IFACE_COOKIE_LEN 8
45 #endif /* CONFIG_CTRL_IFACE_UDP */
46 
47 struct hostapd_iface;
48 
49 struct hapd_interfaces {
50 	int (*reload_config)(struct hostapd_iface *iface);
51 	struct hostapd_config * (*config_read_cb)(const char *config_fname);
52 	int (*ctrl_iface_init)(struct hostapd_data *hapd);
53 	void (*ctrl_iface_deinit)(struct hostapd_data *hapd);
54 	int (*for_each_interface)(struct hapd_interfaces *interfaces,
55 				  int (*cb)(struct hostapd_iface *iface,
56 					    void *ctx), void *ctx);
57 	int (*driver_init)(struct hostapd_iface *iface);
58 
59 	size_t count;
60 	int global_ctrl_sock;
61 	struct dl_list global_ctrl_dst;
62 	char *global_iface_path;
63 	char *global_iface_name;
64 #ifndef CONFIG_NATIVE_WINDOWS
65 	gid_t ctrl_iface_group;
66 #endif /* CONFIG_NATIVE_WINDOWS */
67 	struct hostapd_iface **iface;
68 
69 	size_t terminate_on_error;
70 #ifndef CONFIG_NO_VLAN
71 	struct dynamic_iface *vlan_priv;
72 #endif /* CONFIG_NO_VLAN */
73 #ifdef CONFIG_ETH_P_OUI
74 	struct dl_list eth_p_oui; /* OUI Extended EtherType handlers */
75 #endif /* CONFIG_ETH_P_OUI */
76 	int eloop_initialized;
77 
78 #ifdef CONFIG_DPP
79 	struct dpp_global *dpp;
80 #endif /* CONFIG_DPP */
81 
82 #ifdef CONFIG_CTRL_IFACE_UDP
83        unsigned char ctrl_iface_cookie[CTRL_IFACE_COOKIE_LEN];
84 #endif /* CONFIG_CTRL_IFACE_UDP */
85 
86 };
87 
88 enum hostapd_chan_status {
89 	HOSTAPD_CHAN_VALID = 0, /* channel is ready */
90 	HOSTAPD_CHAN_INVALID = 1, /* no usable channel found */
91 	HOSTAPD_CHAN_ACS = 2, /* ACS work being performed */
92 };
93 
94 struct hostapd_probereq_cb {
95 	int (*cb)(void *ctx, const u8 *sa, const u8 *da, const u8 *bssid,
96 		  const u8 *ie, size_t ie_len, int ssi_signal);
97 	void *ctx;
98 };
99 
100 #define HOSTAPD_RATE_BASIC 0x00000001
101 
102 struct hostapd_rate_data {
103 	int rate; /* rate in 100 kbps */
104 	int flags; /* HOSTAPD_RATE_ flags */
105 };
106 
107 struct hostapd_frame_info {
108 	unsigned int freq;
109 	u32 channel;
110 	u32 datarate;
111 	int ssi_signal; /* dBm */
112 };
113 
114 enum wps_status {
115 	WPS_STATUS_SUCCESS = 1,
116 	WPS_STATUS_FAILURE
117 };
118 
119 enum pbc_status {
120 	WPS_PBC_STATUS_DISABLE,
121 	WPS_PBC_STATUS_ACTIVE,
122 	WPS_PBC_STATUS_TIMEOUT,
123 	WPS_PBC_STATUS_OVERLAP
124 };
125 
126 struct wps_stat {
127 	enum wps_status status;
128 	enum wps_error_indication failure_reason;
129 	enum pbc_status pbc_status;
130 	u8 peer_addr[ETH_ALEN];
131 };
132 
133 struct hostapd_neighbor_entry {
134 	struct dl_list list;
135 	u8 bssid[ETH_ALEN];
136 	struct wpa_ssid_value ssid;
137 	struct wpabuf *nr;
138 	struct wpabuf *lci;
139 	struct wpabuf *civic;
140 	/* LCI update time */
141 	struct os_time lci_date;
142 	int stationary;
143 	u32 short_ssid;
144 	u8 bss_parameters;
145 };
146 
147 struct hostapd_sae_commit_queue {
148 	struct dl_list list;
149 	int rssi;
150 	size_t len;
151 	u8 msg[];
152 };
153 
154 /**
155  * struct hostapd_data - hostapd per-BSS data structure
156  */
157 struct hostapd_data {
158 	struct hostapd_iface *iface;
159 	struct hostapd_config *iconf;
160 	struct hostapd_bss_config *conf;
161 	int interface_added; /* virtual interface added for this BSS */
162 	unsigned int started:1;
163 	unsigned int disabled:1;
164 	unsigned int reenable_beacon:1;
165 
166 	u8 own_addr[ETH_ALEN];
167 
168 	int num_sta; /* number of entries in sta_list */
169 	struct sta_info *sta_list; /* STA info list head */
170 #define STA_HASH_SIZE 256
171 #define STA_HASH(sta) (sta[5])
172 	struct sta_info *sta_hash[STA_HASH_SIZE];
173 
174 	/*
175 	 * Bitfield for indicating which AIDs are allocated. Only AID values
176 	 * 1-2007 are used and as such, the bit at index 0 corresponds to AID
177 	 * 1.
178 	 */
179 #ifndef EXT_CODE_CROP
180 #define AID_WORDS ((2008 + 31) / 32)
181 	u32 sta_aid[AID_WORDS];
182 #else
183 	/* max sta num is less than 32 */
184 	u32 sta_aid;
185 #endif /* EXT_CODE_CROP */
186 
187 	const struct wpa_driver_ops *driver;
188 	void *drv_priv;
189 #ifdef LOS_WPA_PATCH
190 	struct ctrl_iface_priv *ctrl_iface;
191 #endif /* LOS_WPA_PATCH */
192 	void (*new_assoc_sta_cb)(struct hostapd_data *hapd,
193 				 struct sta_info *sta, int reassoc);
194 
195 	void *msg_ctx; /* ctx for wpa_msg() calls */
196 	void *msg_ctx_parent; /* parent interface ctx for wpa_msg() calls */
197 
198 	struct radius_client_data *radius;
199 	u64 acct_session_id;
200 	struct radius_das_data *radius_das;
201 
202 	struct hostapd_cached_radius_acl *acl_cache;
203 	struct hostapd_acl_query_data *acl_queries;
204 
205 	struct wpa_authenticator *wpa_auth;
206 	struct eapol_authenticator *eapol_auth;
207 	struct eap_config *eap_cfg;
208 
209 	struct rsn_preauth_interface *preauth_iface;
210 	struct os_reltime michael_mic_failure;
211 	int michael_mic_failures;
212 	int tkip_countermeasures;
213 
214 	int ctrl_sock;
215 	struct dl_list ctrl_dst;
216 
217 	void *ssl_ctx;
218 	void *eap_sim_db_priv;
219 	struct radius_server_data *radius_srv;
220 	struct dl_list erp_keys; /* struct eap_server_erp_key */
221 
222 	int parameter_set_count;
223 
224 	/* Time Advertisement */
225 	u8 time_update_counter;
226 	struct wpabuf *time_adv;
227 
228 #ifdef CONFIG_FULL_DYNAMIC_VLAN
229 	struct full_dynamic_vlan *full_dynamic_vlan;
230 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
231 
232 	struct l2_packet_data *l2;
233 
234 #ifdef CONFIG_IEEE80211R_AP
235 	struct dl_list l2_queue;
236 	struct dl_list l2_oui_queue;
237 	struct eth_p_oui_ctx *oui_pull;
238 	struct eth_p_oui_ctx *oui_resp;
239 	struct eth_p_oui_ctx *oui_push;
240 	struct eth_p_oui_ctx *oui_sreq;
241 	struct eth_p_oui_ctx *oui_sresp;
242 #endif /* CONFIG_IEEE80211R_AP */
243 
244 	struct wps_context *wps;
245 
246 	int beacon_set_done;
247 	struct wpabuf *wps_beacon_ie;
248 	struct wpabuf *wps_probe_resp_ie;
249 #ifdef CONFIG_WPS
250 	unsigned int ap_pin_failures;
251 	unsigned int ap_pin_failures_consecutive;
252 	struct upnp_wps_device_sm *wps_upnp;
253 	unsigned int ap_pin_lockout_time;
254 
255 	struct wps_stat wps_stats;
256 #endif /* CONFIG_WPS */
257 
258 #ifdef CONFIG_MACSEC
259 	struct ieee802_1x_kay *kay;
260 #endif /* CONFIG_MACSEC */
261 
262 	struct hostapd_probereq_cb *probereq_cb;
263 	size_t num_probereq_cb;
264 
265 	void (*public_action_cb)(void *ctx, const u8 *buf, size_t len,
266 				 int freq);
267 	void *public_action_cb_ctx;
268 	void (*public_action_cb2)(void *ctx, const u8 *buf, size_t len,
269 				  int freq);
270 	void *public_action_cb2_ctx;
271 
272 	int (*vendor_action_cb)(void *ctx, const u8 *buf, size_t len,
273 				int freq);
274 	void *vendor_action_cb_ctx;
275 
276 	void (*wps_reg_success_cb)(void *ctx, const u8 *mac_addr,
277 				   const u8 *uuid_e);
278 	void *wps_reg_success_cb_ctx;
279 
280 	void (*wps_event_cb)(void *ctx, enum wps_event event,
281 			     union wps_event_data *data);
282 	void *wps_event_cb_ctx;
283 
284 	void (*sta_authorized_cb)(void *ctx, const u8 *mac_addr,
285 				  int authorized, const u8 *p2p_dev_addr);
286 	void *sta_authorized_cb_ctx;
287 
288 	void (*setup_complete_cb)(void *ctx);
289 	void *setup_complete_cb_ctx;
290 
291 	void (*new_psk_cb)(void *ctx, const u8 *mac_addr,
292 			   const u8 *p2p_dev_addr, const u8 *psk,
293 			   size_t psk_len);
294 	void *new_psk_cb_ctx;
295 
296 	/* channel switch parameters */
297 	struct hostapd_freq_params cs_freq_params;
298 	u8 cs_count;
299 	int cs_block_tx;
300 	unsigned int cs_c_off_beacon;
301 	unsigned int cs_c_off_proberesp;
302 	int csa_in_progress;
303 	unsigned int cs_c_off_ecsa_beacon;
304 	unsigned int cs_c_off_ecsa_proberesp;
305 
306 #ifdef CONFIG_P2P
307 	struct p2p_data *p2p;
308 	struct p2p_group *p2p_group;
309 	struct wpabuf *p2p_beacon_ie;
310 	struct wpabuf *p2p_probe_resp_ie;
311 
312 	/* Number of non-P2P association stations */
313 	int num_sta_no_p2p;
314 
315 	/* Periodic NoA (used only when no non-P2P clients in the group) */
316 	int noa_enabled;
317 	int noa_start;
318 	int noa_duration;
319 #endif /* CONFIG_P2P */
320 #ifdef CONFIG_PROXYARP
321 	struct l2_packet_data *sock_dhcp;
322 	struct l2_packet_data *sock_ndisc;
323 #endif /* CONFIG_PROXYARP */
324 #ifdef CONFIG_MESH
325 	int num_plinks;
326 	int max_plinks;
327 	void (*mesh_sta_free_cb)(struct hostapd_data *hapd,
328 				 struct sta_info *sta);
329 	struct wpabuf *mesh_pending_auth;
330 	struct os_reltime mesh_pending_auth_time;
331 	u8 mesh_required_peer[ETH_ALEN];
332 #endif /* CONFIG_MESH */
333 
334 #ifdef CONFIG_SQLITE
335 	struct hostapd_eap_user tmp_eap_user;
336 #endif /* CONFIG_SQLITE */
337 
338 #ifdef CONFIG_SAE
339 	/** Key used for generating SAE anti-clogging tokens */
340 	u8 comeback_key[8];
341 	struct os_reltime last_comeback_key_update;
342 	u16 comeback_idx;
343 	u16 comeback_pending_idx[256];
344 	int dot11RSNASAERetransPeriod; /* msec */
345 	struct dl_list sae_commit_queue; /* struct hostapd_sae_commit_queue */
346 #endif /* CONFIG_SAE */
347 
348 #ifdef CONFIG_TESTING_OPTIONS
349 	unsigned int ext_mgmt_frame_handling:1;
350 	unsigned int ext_eapol_frame_io:1;
351 
352 	struct l2_packet_data *l2_test;
353 
354 	enum wpa_alg last_gtk_alg;
355 	int last_gtk_key_idx;
356 	u8 last_gtk[WPA_GTK_MAX_LEN];
357 	size_t last_gtk_len;
358 
359 	enum wpa_alg last_igtk_alg;
360 	int last_igtk_key_idx;
361 	u8 last_igtk[WPA_IGTK_MAX_LEN];
362 	size_t last_igtk_len;
363 
364 	enum wpa_alg last_bigtk_alg;
365 	int last_bigtk_key_idx;
366 	u8 last_bigtk[WPA_BIGTK_MAX_LEN];
367 	size_t last_bigtk_len;
368 
369 	bool force_backlog_bytes;
370 #endif /* CONFIG_TESTING_OPTIONS */
371 
372 #ifdef CONFIG_MBO
373 	unsigned int mbo_assoc_disallow;
374 #endif /* CONFIG_MBO */
375 
376 	struct dl_list nr_db;
377 
378 	u8 beacon_req_token;
379 	u8 lci_req_token;
380 	u8 range_req_token;
381 	unsigned int lci_req_active:1;
382 	unsigned int range_req_active:1;
383 
384 	int dhcp_sock; /* UDP socket used with the DHCP server */
385 
386 	struct ptksa_cache *ptksa;
387 
388 #ifdef CONFIG_DPP
389 	int dpp_init_done;
390 	struct dpp_authentication *dpp_auth;
391 	u8 dpp_allowed_roles;
392 	int dpp_qr_mutual;
393 	int dpp_auth_ok_on_ack;
394 	int dpp_in_response_listen;
395 	struct gas_query_ap *gas;
396 	struct dpp_pkex *dpp_pkex;
397 	struct dpp_bootstrap_info *dpp_pkex_bi;
398 	char *dpp_pkex_code;
399 	char *dpp_pkex_identifier;
400 	char *dpp_pkex_auth_cmd;
401 	char *dpp_configurator_params;
402 	struct os_reltime dpp_last_init;
403 	struct os_reltime dpp_init_iter_start;
404 	unsigned int dpp_init_max_tries;
405 	unsigned int dpp_init_retry_time;
406 	unsigned int dpp_resp_wait_time;
407 	unsigned int dpp_resp_max_tries;
408 	unsigned int dpp_resp_retry_time;
409 #ifdef CONFIG_DPP2
410 	struct wpabuf *dpp_presence_announcement;
411 	struct dpp_bootstrap_info *dpp_chirp_bi;
412 	int dpp_chirp_freq;
413 	int *dpp_chirp_freqs;
414 	int dpp_chirp_iter;
415 	int dpp_chirp_round;
416 	int dpp_chirp_scan_done;
417 	int dpp_chirp_listen;
418 #endif /* CONFIG_DPP2 */
419 #ifdef CONFIG_TESTING_OPTIONS
420 	char *dpp_config_obj_override;
421 	char *dpp_discovery_override;
422 	char *dpp_groups_override;
423 	unsigned int dpp_ignore_netaccesskey_mismatch:1;
424 #endif /* CONFIG_TESTING_OPTIONS */
425 #endif /* CONFIG_DPP */
426 
427 #ifdef CONFIG_AIRTIME_POLICY
428 	unsigned int num_backlogged_sta;
429 	unsigned int airtime_weight;
430 #endif /* CONFIG_AIRTIME_POLICY */
431 
432 	u8 last_1x_eapol_key_replay_counter[8];
433 
434 #ifdef CONFIG_SQLITE
435 	sqlite3 *rad_attr_db;
436 #endif /* CONFIG_SQLITE */
437 
438 #ifdef CONFIG_CTRL_IFACE_UDP
439        unsigned char ctrl_iface_cookie[CTRL_IFACE_COOKIE_LEN];
440 #endif /* CONFIG_CTRL_IFACE_UDP */
441 };
442 
443 
444 struct hostapd_sta_info {
445 	struct dl_list list;
446 	u8 addr[ETH_ALEN];
447 	struct os_reltime last_seen;
448 	int ssi_signal;
449 #ifdef CONFIG_TAXONOMY
450 	struct wpabuf *probe_ie_taxonomy;
451 #endif /* CONFIG_TAXONOMY */
452 };
453 
454 /**
455  * struct hostapd_iface - hostapd per-interface data structure
456  */
457 struct hostapd_iface {
458 	struct hapd_interfaces *interfaces;
459 	void *owner;
460 	char *config_fname;
461 	struct hostapd_config *conf;
462 	char phy[16]; /* Name of the PHY (radio) */
463 
464 	enum hostapd_iface_state {
465 		HAPD_IFACE_UNINITIALIZED,
466 		HAPD_IFACE_DISABLED,
467 		HAPD_IFACE_COUNTRY_UPDATE,
468 		HAPD_IFACE_ACS,
469 		HAPD_IFACE_HT_SCAN,
470 		HAPD_IFACE_DFS,
471 		HAPD_IFACE_ENABLED
472 	} state;
473 
474 #ifdef CONFIG_MESH
475 	struct mesh_conf *mconf;
476 #endif /* CONFIG_MESH */
477 
478 	size_t num_bss;
479 	struct hostapd_data **bss;
480 
481 	unsigned int wait_channel_update:1;
482 	unsigned int cac_started:1;
483 #ifdef CONFIG_FST
484 	struct fst_iface *fst;
485 	const struct wpabuf *fst_ies;
486 #endif /* CONFIG_FST */
487 
488 	/*
489 	 * When set, indicates that the driver will handle the AP
490 	 * teardown: delete global keys, station keys, and stations.
491 	 */
492 	unsigned int driver_ap_teardown:1;
493 
494 	/*
495 	 * When set, indicates that this interface is part of list of
496 	 * interfaces that need to be started together (synchronously).
497 	 */
498 	unsigned int need_to_start_in_sync:1;
499 
500 	/* Ready to start but waiting for other interfaces to become ready. */
501 	unsigned int ready_to_start_in_sync:1;
502 
503 	int num_ap; /* number of entries in ap_list */
504 	struct ap_info *ap_list; /* AP info list head */
505 	struct ap_info *ap_hash[STA_HASH_SIZE];
506 
507 	u64 drv_flags;
508 	u64 drv_flags2;
509 
510 	/*
511 	 * A bitmap of supported protocols for probe response offload. See
512 	 * struct wpa_driver_capa in driver.h
513 	 */
514 	unsigned int probe_resp_offloads;
515 
516 	/* extended capabilities supported by the driver */
517 	const u8 *extended_capa, *extended_capa_mask;
518 	unsigned int extended_capa_len;
519 
520 	unsigned int drv_max_acl_mac_addrs;
521 
522 	struct hostapd_hw_modes *hw_features;
523 	int num_hw_features;
524 	struct hostapd_hw_modes *current_mode;
525 	/* Rates that are currently used (i.e., filtered copy of
526 	 * current_mode->channels */
527 	int num_rates;
528 	struct hostapd_rate_data *current_rates;
529 	int *basic_rates;
530 	int freq;
531 
532 	u16 hw_flags;
533 
534 	/* Number of associated Non-ERP stations (i.e., stations using 802.11b
535 	 * in 802.11g BSS) */
536 	int num_sta_non_erp;
537 
538 	/* Number of associated stations that do not support Short Slot Time */
539 	int num_sta_no_short_slot_time;
540 
541 	/* Number of associated stations that do not support Short Preamble */
542 	int num_sta_no_short_preamble;
543 
544 	int olbc; /* Overlapping Legacy BSS Condition */
545 
546 	/* Number of HT associated stations that do not support greenfield */
547 	int num_sta_ht_no_gf;
548 
549 	/* Number of associated non-HT stations */
550 	int num_sta_no_ht;
551 
552 	/* Number of HT associated stations 20 MHz */
553 	int num_sta_ht_20mhz;
554 
555 	/* Number of HT40 intolerant stations */
556 	int num_sta_ht40_intolerant;
557 
558 	/* Overlapping BSS information */
559 	int olbc_ht;
560 
561 	u16 ht_op_mode;
562 
563 	/* surveying helpers */
564 
565 	/* number of channels surveyed */
566 	unsigned int chans_surveyed;
567 
568 	/* lowest observed noise floor in dBm */
569 	s8 lowest_nf;
570 
571 	/* channel utilization calculation */
572 	u64 last_channel_time;
573 	u64 last_channel_time_busy;
574 	u8 channel_utilization;
575 
576 	unsigned int chan_util_samples_sum;
577 	unsigned int chan_util_num_sample_periods;
578 	unsigned int chan_util_average;
579 
580 	/* eCSA IE will be added only if operating class is specified */
581 	u8 cs_oper_class;
582 
583 	unsigned int dfs_cac_ms;
584 	struct os_reltime dfs_cac_start;
585 
586 	/* Latched with the actual secondary channel information and will be
587 	 * used while juggling between HT20 and HT40 modes. */
588 	int secondary_ch;
589 
590 #ifdef CONFIG_ACS
591 	unsigned int acs_num_completed_scans;
592 #endif /* CONFIG_ACS */
593 
594 	void (*scan_cb)(struct hostapd_iface *iface);
595 	int num_ht40_scan_tries;
596 
597 	struct dl_list sta_seen; /* struct hostapd_sta_info */
598 	unsigned int num_sta_seen;
599 
600 	u8 dfs_domain;
601 #ifdef CONFIG_AIRTIME_POLICY
602 	unsigned int airtime_quantum;
603 #endif /* CONFIG_AIRTIME_POLICY */
604 
605 	/* Previous WMM element information */
606 	struct hostapd_wmm_ac_params prev_wmm[WMM_AC_NUM];
607 
608 	int (*enable_iface_cb)(struct hostapd_iface *iface);
609 	int (*disable_iface_cb)(struct hostapd_iface *iface);
610 };
611 
612 /* hostapd.c */
613 int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
614 			       int (*cb)(struct hostapd_iface *iface,
615 					 void *ctx), void *ctx);
616 int hostapd_reload_config(struct hostapd_iface *iface);
617 void hostapd_reconfig_encryption(struct hostapd_data *hapd);
618 struct hostapd_data *
619 hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
620 		       struct hostapd_config *conf,
621 		       struct hostapd_bss_config *bss);
622 int hostapd_setup_interface(struct hostapd_iface *iface);
623 int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err);
624 void hostapd_interface_deinit(struct hostapd_iface *iface);
625 void hostapd_interface_free(struct hostapd_iface *iface);
626 struct hostapd_iface * hostapd_alloc_iface(void);
627 struct hostapd_iface * hostapd_init(struct hapd_interfaces *interfaces,
628 				    const char *config_file);
629 struct hostapd_iface *
630 hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy,
631 			   const char *config_fname, int debug);
632 void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
633 			   int reassoc);
634 void hostapd_interface_deinit_free(struct hostapd_iface *iface);
635 int hostapd_enable_iface(struct hostapd_iface *hapd_iface);
636 int hostapd_reload_iface(struct hostapd_iface *hapd_iface);
637 int hostapd_disable_iface(struct hostapd_iface *hapd_iface);
638 void hostapd_bss_deinit_no_free(struct hostapd_data *hapd);
639 void hostapd_free_hapd_data(struct hostapd_data *hapd);
640 void hostapd_cleanup_iface_partial(struct hostapd_iface *iface);
641 int hostapd_add_iface(struct hapd_interfaces *ifaces, char *buf);
642 int hostapd_remove_iface(struct hapd_interfaces *ifaces, char *buf);
643 void hostapd_channel_list_updated(struct hostapd_iface *iface, int initiator);
644 void hostapd_set_state(struct hostapd_iface *iface, enum hostapd_iface_state s);
645 const char * hostapd_state_text(enum hostapd_iface_state s);
646 int hostapd_csa_in_progress(struct hostapd_iface *iface);
647 void hostapd_chan_switch_config(struct hostapd_data *hapd,
648 				struct hostapd_freq_params *freq_params);
649 int hostapd_switch_channel(struct hostapd_data *hapd,
650 			   struct csa_settings *settings);
651 void
652 hostapd_switch_channel_fallback(struct hostapd_iface *iface,
653 				const struct hostapd_freq_params *freq_params);
654 void hostapd_cleanup_cs_params(struct hostapd_data *hapd);
655 void hostapd_periodic_iface(struct hostapd_iface *iface);
656 int hostapd_owe_trans_get_info(struct hostapd_data *hapd);
657 void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx);
658 
659 /* utils.c */
660 int hostapd_register_probereq_cb(struct hostapd_data *hapd,
661 				 int (*cb)(void *ctx, const u8 *sa,
662 					   const u8 *da, const u8 *bssid,
663 					   const u8 *ie, size_t ie_len,
664 					   int ssi_signal),
665 				 void *ctx);
666 void hostapd_prune_associations(struct hostapd_data *hapd, const u8 *addr);
667 
668 /* drv_callbacks.c (TODO: move to somewhere else?) */
669 void hostapd_notify_assoc_fils_finish(struct hostapd_data *hapd,
670 				      struct sta_info *sta);
671 int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
672 			const u8 *ie, size_t ielen, int reassoc);
673 void hostapd_notif_disassoc(struct hostapd_data *hapd, const u8 *addr);
674 void hostapd_event_sta_low_ack(struct hostapd_data *hapd, const u8 *addr);
675 void hostapd_event_connect_failed_reason(struct hostapd_data *hapd,
676 					 const u8 *addr, int reason_code);
677 int hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa, const u8 *da,
678 			 const u8 *bssid, const u8 *ie, size_t ie_len,
679 			 int ssi_signal);
680 void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht,
681 			     int offset, int width, int cf1, int cf2,
682 			     int finished);
683 struct survey_results;
684 void hostapd_event_get_survey(struct hostapd_iface *iface,
685 			      struct survey_results *survey_results);
686 void hostapd_acs_channel_selected(struct hostapd_data *hapd,
687 				  struct acs_selected_channels *acs_res);
688 
689 const struct hostapd_eap_user *
690 hostapd_get_eap_user(struct hostapd_data *hapd, const u8 *identity,
691 		     size_t identity_len, int phase2);
692 
693 struct hostapd_data * hostapd_get_iface(struct hapd_interfaces *interfaces,
694 					const char *ifname);
695 void hostapd_event_sta_opmode_changed(struct hostapd_data *hapd, const u8 *addr,
696 				      enum smps_mode smps_mode,
697 				      enum chan_width chan_width, u8 rx_nss);
698 
699 #ifdef CONFIG_FST
700 void fst_hostapd_fill_iface_obj(struct hostapd_data *hapd,
701 				struct fst_wpa_obj *iface_obj);
702 #endif /* CONFIG_FST */
703 
704 #endif /* HOSTAPD_H */
705