1*03f9172cSAndroid Build Coastguard Worker /*
2*03f9172cSAndroid Build Coastguard Worker * hostapd / Initialization and configuration
3*03f9172cSAndroid Build Coastguard Worker * Copyright (c) 2002-2014, Jouni Malinen <[email protected]>
4*03f9172cSAndroid Build Coastguard Worker *
5*03f9172cSAndroid Build Coastguard Worker * This software may be distributed under the terms of the BSD license.
6*03f9172cSAndroid Build Coastguard Worker * See README for more details.
7*03f9172cSAndroid Build Coastguard Worker */
8*03f9172cSAndroid Build Coastguard Worker
9*03f9172cSAndroid Build Coastguard Worker #ifndef HOSTAPD_H
10*03f9172cSAndroid Build Coastguard Worker #define HOSTAPD_H
11*03f9172cSAndroid Build Coastguard Worker
12*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_SQLITE
13*03f9172cSAndroid Build Coastguard Worker #include <sqlite3.h>
14*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_SQLITE */
15*03f9172cSAndroid Build Coastguard Worker
16*03f9172cSAndroid Build Coastguard Worker #include "common/defs.h"
17*03f9172cSAndroid Build Coastguard Worker #include "common/dpp.h"
18*03f9172cSAndroid Build Coastguard Worker #include "utils/list.h"
19*03f9172cSAndroid Build Coastguard Worker #include "ap_config.h"
20*03f9172cSAndroid Build Coastguard Worker #include "drivers/driver.h"
21*03f9172cSAndroid Build Coastguard Worker
22*03f9172cSAndroid Build Coastguard Worker #define OCE_STA_CFON_ENABLED(hapd) \
23*03f9172cSAndroid Build Coastguard Worker ((hapd->conf->oce & OCE_STA_CFON) && \
24*03f9172cSAndroid Build Coastguard Worker (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_OCE_STA_CFON))
25*03f9172cSAndroid Build Coastguard Worker #define OCE_AP_ENABLED(hapd) \
26*03f9172cSAndroid Build Coastguard Worker ((hapd->conf->oce & OCE_AP) && \
27*03f9172cSAndroid Build Coastguard Worker (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_OCE_AP))
28*03f9172cSAndroid Build Coastguard Worker
29*03f9172cSAndroid Build Coastguard Worker struct wpa_ctrl_dst;
30*03f9172cSAndroid Build Coastguard Worker struct radius_server_data;
31*03f9172cSAndroid Build Coastguard Worker struct upnp_wps_device_sm;
32*03f9172cSAndroid Build Coastguard Worker struct hostapd_data;
33*03f9172cSAndroid Build Coastguard Worker struct sta_info;
34*03f9172cSAndroid Build Coastguard Worker struct ieee80211_ht_capabilities;
35*03f9172cSAndroid Build Coastguard Worker struct full_dynamic_vlan;
36*03f9172cSAndroid Build Coastguard Worker enum wps_event;
37*03f9172cSAndroid Build Coastguard Worker union wps_event_data;
38*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_MESH
39*03f9172cSAndroid Build Coastguard Worker struct mesh_conf;
40*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_MESH */
41*03f9172cSAndroid Build Coastguard Worker
42*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_CTRL_IFACE_UDP
43*03f9172cSAndroid Build Coastguard Worker #define CTRL_IFACE_COOKIE_LEN 8
44*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_CTRL_IFACE_UDP */
45*03f9172cSAndroid Build Coastguard Worker
46*03f9172cSAndroid Build Coastguard Worker struct hostapd_iface;
47*03f9172cSAndroid Build Coastguard Worker struct hostapd_mld;
48*03f9172cSAndroid Build Coastguard Worker
49*03f9172cSAndroid Build Coastguard Worker struct hapd_interfaces {
50*03f9172cSAndroid Build Coastguard Worker int (*reload_config)(struct hostapd_iface *iface);
51*03f9172cSAndroid Build Coastguard Worker struct hostapd_config * (*config_read_cb)(const char *config_fname);
52*03f9172cSAndroid Build Coastguard Worker int (*ctrl_iface_init)(struct hostapd_data *hapd);
53*03f9172cSAndroid Build Coastguard Worker void (*ctrl_iface_deinit)(struct hostapd_data *hapd);
54*03f9172cSAndroid Build Coastguard Worker int (*for_each_interface)(struct hapd_interfaces *interfaces,
55*03f9172cSAndroid Build Coastguard Worker int (*cb)(struct hostapd_iface *iface,
56*03f9172cSAndroid Build Coastguard Worker void *ctx), void *ctx);
57*03f9172cSAndroid Build Coastguard Worker int (*driver_init)(struct hostapd_iface *iface);
58*03f9172cSAndroid Build Coastguard Worker
59*03f9172cSAndroid Build Coastguard Worker size_t count;
60*03f9172cSAndroid Build Coastguard Worker int global_ctrl_sock;
61*03f9172cSAndroid Build Coastguard Worker struct dl_list global_ctrl_dst;
62*03f9172cSAndroid Build Coastguard Worker char *global_iface_path;
63*03f9172cSAndroid Build Coastguard Worker char *global_iface_name;
64*03f9172cSAndroid Build Coastguard Worker #ifndef CONFIG_NATIVE_WINDOWS
65*03f9172cSAndroid Build Coastguard Worker gid_t ctrl_iface_group;
66*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_NATIVE_WINDOWS */
67*03f9172cSAndroid Build Coastguard Worker struct hostapd_iface **iface;
68*03f9172cSAndroid Build Coastguard Worker
69*03f9172cSAndroid Build Coastguard Worker size_t terminate_on_error;
70*03f9172cSAndroid Build Coastguard Worker #ifndef CONFIG_NO_VLAN
71*03f9172cSAndroid Build Coastguard Worker struct dynamic_iface *vlan_priv;
72*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_NO_VLAN */
73*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_ETH_P_OUI
74*03f9172cSAndroid Build Coastguard Worker struct dl_list eth_p_oui; /* OUI Extended EtherType handlers */
75*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_ETH_P_OUI */
76*03f9172cSAndroid Build Coastguard Worker int eloop_initialized;
77*03f9172cSAndroid Build Coastguard Worker
78*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_DPP
79*03f9172cSAndroid Build Coastguard Worker struct dpp_global *dpp;
80*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_DPP3
81*03f9172cSAndroid Build Coastguard Worker struct os_reltime dpp_pb_time;
82*03f9172cSAndroid Build Coastguard Worker struct os_reltime dpp_pb_announce_time;
83*03f9172cSAndroid Build Coastguard Worker struct dpp_pb_info dpp_pb[DPP_PB_INFO_COUNT];
84*03f9172cSAndroid Build Coastguard Worker struct dpp_bootstrap_info *dpp_pb_bi;
85*03f9172cSAndroid Build Coastguard Worker u8 dpp_pb_c_nonce[DPP_MAX_NONCE_LEN];
86*03f9172cSAndroid Build Coastguard Worker u8 dpp_pb_resp_hash[SHA256_MAC_LEN];
87*03f9172cSAndroid Build Coastguard Worker struct os_reltime dpp_pb_last_resp;
88*03f9172cSAndroid Build Coastguard Worker bool dpp_pb_result_indicated;
89*03f9172cSAndroid Build Coastguard Worker char *dpp_pb_cmd;
90*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_DPP3 */
91*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_DPP */
92*03f9172cSAndroid Build Coastguard Worker
93*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_CTRL_IFACE_UDP
94*03f9172cSAndroid Build Coastguard Worker unsigned char ctrl_iface_cookie[CTRL_IFACE_COOKIE_LEN];
95*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_CTRL_IFACE_UDP */
96*03f9172cSAndroid Build Coastguard Worker
97*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_IEEE80211BE
98*03f9172cSAndroid Build Coastguard Worker struct hostapd_mld **mld;
99*03f9172cSAndroid Build Coastguard Worker size_t mld_count;
100*03f9172cSAndroid Build Coastguard Worker int (*mld_ctrl_iface_init)(struct hostapd_mld *mld);
101*03f9172cSAndroid Build Coastguard Worker void (*mld_ctrl_iface_deinit)(struct hostapd_mld *mld);
102*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_IEEE80211BE */
103*03f9172cSAndroid Build Coastguard Worker };
104*03f9172cSAndroid Build Coastguard Worker
105*03f9172cSAndroid Build Coastguard Worker enum hostapd_chan_status {
106*03f9172cSAndroid Build Coastguard Worker HOSTAPD_CHAN_VALID = 0, /* channel is ready */
107*03f9172cSAndroid Build Coastguard Worker HOSTAPD_CHAN_INVALID = 1, /* no usable channel found */
108*03f9172cSAndroid Build Coastguard Worker HOSTAPD_CHAN_ACS = 2, /* ACS work being performed */
109*03f9172cSAndroid Build Coastguard Worker HOSTAPD_CHAN_INVALID_NO_IR = 3, /* channel invalid due to AFC NO IR */
110*03f9172cSAndroid Build Coastguard Worker };
111*03f9172cSAndroid Build Coastguard Worker
112*03f9172cSAndroid Build Coastguard Worker struct hostapd_probereq_cb {
113*03f9172cSAndroid Build Coastguard Worker int (*cb)(void *ctx, const u8 *sa, const u8 *da, const u8 *bssid,
114*03f9172cSAndroid Build Coastguard Worker const u8 *ie, size_t ie_len, int ssi_signal);
115*03f9172cSAndroid Build Coastguard Worker void *ctx;
116*03f9172cSAndroid Build Coastguard Worker };
117*03f9172cSAndroid Build Coastguard Worker
118*03f9172cSAndroid Build Coastguard Worker #define HOSTAPD_RATE_BASIC 0x00000001
119*03f9172cSAndroid Build Coastguard Worker
120*03f9172cSAndroid Build Coastguard Worker struct hostapd_rate_data {
121*03f9172cSAndroid Build Coastguard Worker int rate; /* rate in 100 kbps */
122*03f9172cSAndroid Build Coastguard Worker int flags; /* HOSTAPD_RATE_ flags */
123*03f9172cSAndroid Build Coastguard Worker };
124*03f9172cSAndroid Build Coastguard Worker
125*03f9172cSAndroid Build Coastguard Worker struct hostapd_frame_info {
126*03f9172cSAndroid Build Coastguard Worker unsigned int freq;
127*03f9172cSAndroid Build Coastguard Worker u32 channel;
128*03f9172cSAndroid Build Coastguard Worker u32 datarate;
129*03f9172cSAndroid Build Coastguard Worker int ssi_signal; /* dBm */
130*03f9172cSAndroid Build Coastguard Worker };
131*03f9172cSAndroid Build Coastguard Worker
132*03f9172cSAndroid Build Coastguard Worker enum wps_status {
133*03f9172cSAndroid Build Coastguard Worker WPS_STATUS_SUCCESS = 1,
134*03f9172cSAndroid Build Coastguard Worker WPS_STATUS_FAILURE
135*03f9172cSAndroid Build Coastguard Worker };
136*03f9172cSAndroid Build Coastguard Worker
137*03f9172cSAndroid Build Coastguard Worker enum pbc_status {
138*03f9172cSAndroid Build Coastguard Worker WPS_PBC_STATUS_DISABLE,
139*03f9172cSAndroid Build Coastguard Worker WPS_PBC_STATUS_ACTIVE,
140*03f9172cSAndroid Build Coastguard Worker WPS_PBC_STATUS_TIMEOUT,
141*03f9172cSAndroid Build Coastguard Worker WPS_PBC_STATUS_OVERLAP
142*03f9172cSAndroid Build Coastguard Worker };
143*03f9172cSAndroid Build Coastguard Worker
144*03f9172cSAndroid Build Coastguard Worker struct wps_stat {
145*03f9172cSAndroid Build Coastguard Worker enum wps_status status;
146*03f9172cSAndroid Build Coastguard Worker enum wps_error_indication failure_reason;
147*03f9172cSAndroid Build Coastguard Worker enum pbc_status pbc_status;
148*03f9172cSAndroid Build Coastguard Worker u8 peer_addr[ETH_ALEN];
149*03f9172cSAndroid Build Coastguard Worker };
150*03f9172cSAndroid Build Coastguard Worker
151*03f9172cSAndroid Build Coastguard Worker struct hostapd_neighbor_entry {
152*03f9172cSAndroid Build Coastguard Worker struct dl_list list;
153*03f9172cSAndroid Build Coastguard Worker u8 bssid[ETH_ALEN];
154*03f9172cSAndroid Build Coastguard Worker struct wpa_ssid_value ssid;
155*03f9172cSAndroid Build Coastguard Worker struct wpabuf *nr;
156*03f9172cSAndroid Build Coastguard Worker struct wpabuf *lci;
157*03f9172cSAndroid Build Coastguard Worker struct wpabuf *civic;
158*03f9172cSAndroid Build Coastguard Worker /* LCI update time */
159*03f9172cSAndroid Build Coastguard Worker struct os_time lci_date;
160*03f9172cSAndroid Build Coastguard Worker int stationary;
161*03f9172cSAndroid Build Coastguard Worker u32 short_ssid;
162*03f9172cSAndroid Build Coastguard Worker u8 bss_parameters;
163*03f9172cSAndroid Build Coastguard Worker };
164*03f9172cSAndroid Build Coastguard Worker
165*03f9172cSAndroid Build Coastguard Worker struct hostapd_sae_commit_queue {
166*03f9172cSAndroid Build Coastguard Worker struct dl_list list;
167*03f9172cSAndroid Build Coastguard Worker int rssi;
168*03f9172cSAndroid Build Coastguard Worker size_t len;
169*03f9172cSAndroid Build Coastguard Worker u8 msg[];
170*03f9172cSAndroid Build Coastguard Worker };
171*03f9172cSAndroid Build Coastguard Worker
172*03f9172cSAndroid Build Coastguard Worker struct mld_link_info {
173*03f9172cSAndroid Build Coastguard Worker u8 valid:1;
174*03f9172cSAndroid Build Coastguard Worker u8 nstr_bitmap_len:2;
175*03f9172cSAndroid Build Coastguard Worker u8 local_addr[ETH_ALEN];
176*03f9172cSAndroid Build Coastguard Worker u8 peer_addr[ETH_ALEN];
177*03f9172cSAndroid Build Coastguard Worker
178*03f9172cSAndroid Build Coastguard Worker u8 nstr_bitmap[2];
179*03f9172cSAndroid Build Coastguard Worker
180*03f9172cSAndroid Build Coastguard Worker u16 capability;
181*03f9172cSAndroid Build Coastguard Worker
182*03f9172cSAndroid Build Coastguard Worker u16 status;
183*03f9172cSAndroid Build Coastguard Worker u16 resp_sta_profile_len;
184*03f9172cSAndroid Build Coastguard Worker u8 *resp_sta_profile;
185*03f9172cSAndroid Build Coastguard Worker };
186*03f9172cSAndroid Build Coastguard Worker
187*03f9172cSAndroid Build Coastguard Worker /**
188*03f9172cSAndroid Build Coastguard Worker * struct hostapd_data - hostapd per-BSS data structure
189*03f9172cSAndroid Build Coastguard Worker */
190*03f9172cSAndroid Build Coastguard Worker struct hostapd_data {
191*03f9172cSAndroid Build Coastguard Worker struct hostapd_iface *iface;
192*03f9172cSAndroid Build Coastguard Worker struct hostapd_config *iconf;
193*03f9172cSAndroid Build Coastguard Worker struct hostapd_bss_config *conf;
194*03f9172cSAndroid Build Coastguard Worker int interface_added; /* virtual interface added for this BSS */
195*03f9172cSAndroid Build Coastguard Worker unsigned int started:1;
196*03f9172cSAndroid Build Coastguard Worker unsigned int disabled:1;
197*03f9172cSAndroid Build Coastguard Worker unsigned int reenable_beacon:1;
198*03f9172cSAndroid Build Coastguard Worker
199*03f9172cSAndroid Build Coastguard Worker u8 own_addr[ETH_ALEN];
200*03f9172cSAndroid Build Coastguard Worker
201*03f9172cSAndroid Build Coastguard Worker int num_sta; /* number of entries in sta_list */
202*03f9172cSAndroid Build Coastguard Worker struct sta_info *sta_list; /* STA info list head */
203*03f9172cSAndroid Build Coastguard Worker #define STA_HASH_SIZE 256
204*03f9172cSAndroid Build Coastguard Worker #define STA_HASH(sta) (sta[5])
205*03f9172cSAndroid Build Coastguard Worker struct sta_info *sta_hash[STA_HASH_SIZE];
206*03f9172cSAndroid Build Coastguard Worker
207*03f9172cSAndroid Build Coastguard Worker /*
208*03f9172cSAndroid Build Coastguard Worker * Bitfield for indicating which AIDs are allocated. Only AID values
209*03f9172cSAndroid Build Coastguard Worker * 1-2007 are used and as such, the bit at index 0 corresponds to AID
210*03f9172cSAndroid Build Coastguard Worker * 1.
211*03f9172cSAndroid Build Coastguard Worker */
212*03f9172cSAndroid Build Coastguard Worker #define AID_WORDS ((2008 + 31) / 32)
213*03f9172cSAndroid Build Coastguard Worker u32 sta_aid[AID_WORDS];
214*03f9172cSAndroid Build Coastguard Worker
215*03f9172cSAndroid Build Coastguard Worker const struct wpa_driver_ops *driver;
216*03f9172cSAndroid Build Coastguard Worker void *drv_priv;
217*03f9172cSAndroid Build Coastguard Worker
218*03f9172cSAndroid Build Coastguard Worker void (*new_assoc_sta_cb)(struct hostapd_data *hapd,
219*03f9172cSAndroid Build Coastguard Worker struct sta_info *sta, int reassoc);
220*03f9172cSAndroid Build Coastguard Worker
221*03f9172cSAndroid Build Coastguard Worker void *msg_ctx; /* ctx for wpa_msg() calls */
222*03f9172cSAndroid Build Coastguard Worker void *msg_ctx_parent; /* parent interface ctx for wpa_msg() calls */
223*03f9172cSAndroid Build Coastguard Worker
224*03f9172cSAndroid Build Coastguard Worker struct radius_client_data *radius;
225*03f9172cSAndroid Build Coastguard Worker u64 acct_session_id;
226*03f9172cSAndroid Build Coastguard Worker struct radius_das_data *radius_das;
227*03f9172cSAndroid Build Coastguard Worker
228*03f9172cSAndroid Build Coastguard Worker struct hostapd_cached_radius_acl *acl_cache;
229*03f9172cSAndroid Build Coastguard Worker struct hostapd_acl_query_data *acl_queries;
230*03f9172cSAndroid Build Coastguard Worker
231*03f9172cSAndroid Build Coastguard Worker struct wpa_authenticator *wpa_auth;
232*03f9172cSAndroid Build Coastguard Worker struct eapol_authenticator *eapol_auth;
233*03f9172cSAndroid Build Coastguard Worker struct eap_config *eap_cfg;
234*03f9172cSAndroid Build Coastguard Worker
235*03f9172cSAndroid Build Coastguard Worker struct rsn_preauth_interface *preauth_iface;
236*03f9172cSAndroid Build Coastguard Worker struct os_reltime michael_mic_failure;
237*03f9172cSAndroid Build Coastguard Worker int michael_mic_failures;
238*03f9172cSAndroid Build Coastguard Worker int tkip_countermeasures;
239*03f9172cSAndroid Build Coastguard Worker
240*03f9172cSAndroid Build Coastguard Worker int ctrl_sock;
241*03f9172cSAndroid Build Coastguard Worker struct dl_list ctrl_dst;
242*03f9172cSAndroid Build Coastguard Worker
243*03f9172cSAndroid Build Coastguard Worker void *ssl_ctx;
244*03f9172cSAndroid Build Coastguard Worker void *eap_sim_db_priv;
245*03f9172cSAndroid Build Coastguard Worker struct crypto_rsa_key *imsi_privacy_key;
246*03f9172cSAndroid Build Coastguard Worker struct radius_server_data *radius_srv;
247*03f9172cSAndroid Build Coastguard Worker struct dl_list erp_keys; /* struct eap_server_erp_key */
248*03f9172cSAndroid Build Coastguard Worker
249*03f9172cSAndroid Build Coastguard Worker int parameter_set_count;
250*03f9172cSAndroid Build Coastguard Worker
251*03f9172cSAndroid Build Coastguard Worker /* Time Advertisement */
252*03f9172cSAndroid Build Coastguard Worker u8 time_update_counter;
253*03f9172cSAndroid Build Coastguard Worker struct wpabuf *time_adv;
254*03f9172cSAndroid Build Coastguard Worker
255*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_FULL_DYNAMIC_VLAN
256*03f9172cSAndroid Build Coastguard Worker struct full_dynamic_vlan *full_dynamic_vlan;
257*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_FULL_DYNAMIC_VLAN */
258*03f9172cSAndroid Build Coastguard Worker
259*03f9172cSAndroid Build Coastguard Worker struct l2_packet_data *l2;
260*03f9172cSAndroid Build Coastguard Worker
261*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_IEEE80211R_AP
262*03f9172cSAndroid Build Coastguard Worker struct dl_list l2_queue;
263*03f9172cSAndroid Build Coastguard Worker struct dl_list l2_oui_queue;
264*03f9172cSAndroid Build Coastguard Worker struct eth_p_oui_ctx *oui_pull;
265*03f9172cSAndroid Build Coastguard Worker struct eth_p_oui_ctx *oui_resp;
266*03f9172cSAndroid Build Coastguard Worker struct eth_p_oui_ctx *oui_push;
267*03f9172cSAndroid Build Coastguard Worker struct eth_p_oui_ctx *oui_sreq;
268*03f9172cSAndroid Build Coastguard Worker struct eth_p_oui_ctx *oui_sresp;
269*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_IEEE80211R_AP */
270*03f9172cSAndroid Build Coastguard Worker
271*03f9172cSAndroid Build Coastguard Worker struct wps_context *wps;
272*03f9172cSAndroid Build Coastguard Worker
273*03f9172cSAndroid Build Coastguard Worker int beacon_set_done;
274*03f9172cSAndroid Build Coastguard Worker struct wpabuf *wps_beacon_ie;
275*03f9172cSAndroid Build Coastguard Worker struct wpabuf *wps_probe_resp_ie;
276*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_WPS
277*03f9172cSAndroid Build Coastguard Worker unsigned int ap_pin_failures;
278*03f9172cSAndroid Build Coastguard Worker unsigned int ap_pin_failures_consecutive;
279*03f9172cSAndroid Build Coastguard Worker struct upnp_wps_device_sm *wps_upnp;
280*03f9172cSAndroid Build Coastguard Worker unsigned int ap_pin_lockout_time;
281*03f9172cSAndroid Build Coastguard Worker
282*03f9172cSAndroid Build Coastguard Worker struct wps_stat wps_stats;
283*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_WPS */
284*03f9172cSAndroid Build Coastguard Worker
285*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_MACSEC
286*03f9172cSAndroid Build Coastguard Worker struct ieee802_1x_kay *kay;
287*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_MACSEC */
288*03f9172cSAndroid Build Coastguard Worker
289*03f9172cSAndroid Build Coastguard Worker struct hostapd_probereq_cb *probereq_cb;
290*03f9172cSAndroid Build Coastguard Worker size_t num_probereq_cb;
291*03f9172cSAndroid Build Coastguard Worker
292*03f9172cSAndroid Build Coastguard Worker void (*public_action_cb)(void *ctx, const u8 *buf, size_t len,
293*03f9172cSAndroid Build Coastguard Worker int freq);
294*03f9172cSAndroid Build Coastguard Worker void *public_action_cb_ctx;
295*03f9172cSAndroid Build Coastguard Worker void (*public_action_cb2)(void *ctx, const u8 *buf, size_t len,
296*03f9172cSAndroid Build Coastguard Worker int freq);
297*03f9172cSAndroid Build Coastguard Worker void *public_action_cb2_ctx;
298*03f9172cSAndroid Build Coastguard Worker
299*03f9172cSAndroid Build Coastguard Worker int (*vendor_action_cb)(void *ctx, const u8 *buf, size_t len,
300*03f9172cSAndroid Build Coastguard Worker int freq);
301*03f9172cSAndroid Build Coastguard Worker void *vendor_action_cb_ctx;
302*03f9172cSAndroid Build Coastguard Worker
303*03f9172cSAndroid Build Coastguard Worker void (*wps_reg_success_cb)(void *ctx, const u8 *mac_addr,
304*03f9172cSAndroid Build Coastguard Worker const u8 *uuid_e);
305*03f9172cSAndroid Build Coastguard Worker void *wps_reg_success_cb_ctx;
306*03f9172cSAndroid Build Coastguard Worker
307*03f9172cSAndroid Build Coastguard Worker void (*wps_event_cb)(void *ctx, enum wps_event event,
308*03f9172cSAndroid Build Coastguard Worker union wps_event_data *data);
309*03f9172cSAndroid Build Coastguard Worker void *wps_event_cb_ctx;
310*03f9172cSAndroid Build Coastguard Worker
311*03f9172cSAndroid Build Coastguard Worker void (*sta_authorized_cb)(void *ctx, const u8 *mac_addr,
312*03f9172cSAndroid Build Coastguard Worker int authorized, const u8 *p2p_dev_addr,
313*03f9172cSAndroid Build Coastguard Worker const u8 *ip);
314*03f9172cSAndroid Build Coastguard Worker void *sta_authorized_cb_ctx;
315*03f9172cSAndroid Build Coastguard Worker
316*03f9172cSAndroid Build Coastguard Worker void (*setup_complete_cb)(void *ctx);
317*03f9172cSAndroid Build Coastguard Worker void *setup_complete_cb_ctx;
318*03f9172cSAndroid Build Coastguard Worker
319*03f9172cSAndroid Build Coastguard Worker void (*new_psk_cb)(void *ctx, const u8 *mac_addr,
320*03f9172cSAndroid Build Coastguard Worker const u8 *p2p_dev_addr, const u8 *psk,
321*03f9172cSAndroid Build Coastguard Worker size_t psk_len);
322*03f9172cSAndroid Build Coastguard Worker void *new_psk_cb_ctx;
323*03f9172cSAndroid Build Coastguard Worker
324*03f9172cSAndroid Build Coastguard Worker /* channel switch parameters */
325*03f9172cSAndroid Build Coastguard Worker struct hostapd_freq_params cs_freq_params;
326*03f9172cSAndroid Build Coastguard Worker u8 cs_count;
327*03f9172cSAndroid Build Coastguard Worker int cs_block_tx;
328*03f9172cSAndroid Build Coastguard Worker unsigned int cs_c_off_beacon;
329*03f9172cSAndroid Build Coastguard Worker unsigned int cs_c_off_proberesp;
330*03f9172cSAndroid Build Coastguard Worker int csa_in_progress;
331*03f9172cSAndroid Build Coastguard Worker unsigned int cs_c_off_ecsa_beacon;
332*03f9172cSAndroid Build Coastguard Worker unsigned int cs_c_off_ecsa_proberesp;
333*03f9172cSAndroid Build Coastguard Worker
334*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_IEEE80211AX
335*03f9172cSAndroid Build Coastguard Worker bool cca_in_progress;
336*03f9172cSAndroid Build Coastguard Worker u8 cca_count;
337*03f9172cSAndroid Build Coastguard Worker u8 cca_color;
338*03f9172cSAndroid Build Coastguard Worker unsigned int cca_c_off_beacon;
339*03f9172cSAndroid Build Coastguard Worker unsigned int cca_c_off_proberesp;
340*03f9172cSAndroid Build Coastguard Worker struct os_reltime first_color_collision;
341*03f9172cSAndroid Build Coastguard Worker struct os_reltime last_color_collision;
342*03f9172cSAndroid Build Coastguard Worker u64 color_collision_bitmap;
343*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_IEEE80211AX */
344*03f9172cSAndroid Build Coastguard Worker
345*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_P2P
346*03f9172cSAndroid Build Coastguard Worker struct p2p_data *p2p;
347*03f9172cSAndroid Build Coastguard Worker struct p2p_group *p2p_group;
348*03f9172cSAndroid Build Coastguard Worker struct wpabuf *p2p_beacon_ie;
349*03f9172cSAndroid Build Coastguard Worker struct wpabuf *p2p_probe_resp_ie;
350*03f9172cSAndroid Build Coastguard Worker
351*03f9172cSAndroid Build Coastguard Worker /* Number of non-P2P association stations */
352*03f9172cSAndroid Build Coastguard Worker int num_sta_no_p2p;
353*03f9172cSAndroid Build Coastguard Worker
354*03f9172cSAndroid Build Coastguard Worker /* Periodic NoA (used only when no non-P2P clients in the group) */
355*03f9172cSAndroid Build Coastguard Worker int noa_enabled;
356*03f9172cSAndroid Build Coastguard Worker int noa_start;
357*03f9172cSAndroid Build Coastguard Worker int noa_duration;
358*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_P2P */
359*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_PROXYARP
360*03f9172cSAndroid Build Coastguard Worker struct l2_packet_data *sock_dhcp;
361*03f9172cSAndroid Build Coastguard Worker struct l2_packet_data *sock_ndisc;
362*03f9172cSAndroid Build Coastguard Worker bool x_snoop_initialized;
363*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_PROXYARP */
364*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_MESH
365*03f9172cSAndroid Build Coastguard Worker int num_plinks;
366*03f9172cSAndroid Build Coastguard Worker int max_plinks;
367*03f9172cSAndroid Build Coastguard Worker void (*mesh_sta_free_cb)(struct hostapd_data *hapd,
368*03f9172cSAndroid Build Coastguard Worker struct sta_info *sta);
369*03f9172cSAndroid Build Coastguard Worker struct wpabuf *mesh_pending_auth;
370*03f9172cSAndroid Build Coastguard Worker struct os_reltime mesh_pending_auth_time;
371*03f9172cSAndroid Build Coastguard Worker u8 mesh_required_peer[ETH_ALEN];
372*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_MESH */
373*03f9172cSAndroid Build Coastguard Worker
374*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_SQLITE
375*03f9172cSAndroid Build Coastguard Worker struct hostapd_eap_user tmp_eap_user;
376*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_SQLITE */
377*03f9172cSAndroid Build Coastguard Worker
378*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_SAE
379*03f9172cSAndroid Build Coastguard Worker
380*03f9172cSAndroid Build Coastguard Worker #define COMEBACK_KEY_SIZE 8
381*03f9172cSAndroid Build Coastguard Worker #define COMEBACK_PENDING_IDX_SIZE 256
382*03f9172cSAndroid Build Coastguard Worker
383*03f9172cSAndroid Build Coastguard Worker /** Key used for generating SAE anti-clogging tokens */
384*03f9172cSAndroid Build Coastguard Worker u8 comeback_key[COMEBACK_KEY_SIZE];
385*03f9172cSAndroid Build Coastguard Worker struct os_reltime last_comeback_key_update;
386*03f9172cSAndroid Build Coastguard Worker u16 comeback_idx;
387*03f9172cSAndroid Build Coastguard Worker u16 comeback_pending_idx[COMEBACK_PENDING_IDX_SIZE];
388*03f9172cSAndroid Build Coastguard Worker int dot11RSNASAERetransPeriod; /* msec */
389*03f9172cSAndroid Build Coastguard Worker struct dl_list sae_commit_queue; /* struct hostapd_sae_commit_queue */
390*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_SAE */
391*03f9172cSAndroid Build Coastguard Worker
392*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_TESTING_OPTIONS
393*03f9172cSAndroid Build Coastguard Worker unsigned int ext_mgmt_frame_handling:1;
394*03f9172cSAndroid Build Coastguard Worker unsigned int ext_eapol_frame_io:1;
395*03f9172cSAndroid Build Coastguard Worker
396*03f9172cSAndroid Build Coastguard Worker struct l2_packet_data *l2_test;
397*03f9172cSAndroid Build Coastguard Worker
398*03f9172cSAndroid Build Coastguard Worker enum wpa_alg last_gtk_alg;
399*03f9172cSAndroid Build Coastguard Worker int last_gtk_key_idx;
400*03f9172cSAndroid Build Coastguard Worker u8 last_gtk[WPA_GTK_MAX_LEN];
401*03f9172cSAndroid Build Coastguard Worker size_t last_gtk_len;
402*03f9172cSAndroid Build Coastguard Worker
403*03f9172cSAndroid Build Coastguard Worker enum wpa_alg last_igtk_alg;
404*03f9172cSAndroid Build Coastguard Worker int last_igtk_key_idx;
405*03f9172cSAndroid Build Coastguard Worker u8 last_igtk[WPA_IGTK_MAX_LEN];
406*03f9172cSAndroid Build Coastguard Worker size_t last_igtk_len;
407*03f9172cSAndroid Build Coastguard Worker
408*03f9172cSAndroid Build Coastguard Worker enum wpa_alg last_bigtk_alg;
409*03f9172cSAndroid Build Coastguard Worker int last_bigtk_key_idx;
410*03f9172cSAndroid Build Coastguard Worker u8 last_bigtk[WPA_BIGTK_MAX_LEN];
411*03f9172cSAndroid Build Coastguard Worker size_t last_bigtk_len;
412*03f9172cSAndroid Build Coastguard Worker
413*03f9172cSAndroid Build Coastguard Worker bool force_backlog_bytes;
414*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_TESTING_OPTIONS */
415*03f9172cSAndroid Build Coastguard Worker
416*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_MBO
417*03f9172cSAndroid Build Coastguard Worker unsigned int mbo_assoc_disallow;
418*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_MBO */
419*03f9172cSAndroid Build Coastguard Worker
420*03f9172cSAndroid Build Coastguard Worker struct dl_list nr_db;
421*03f9172cSAndroid Build Coastguard Worker
422*03f9172cSAndroid Build Coastguard Worker u8 beacon_req_token;
423*03f9172cSAndroid Build Coastguard Worker u8 lci_req_token;
424*03f9172cSAndroid Build Coastguard Worker u8 range_req_token;
425*03f9172cSAndroid Build Coastguard Worker u8 link_measurement_req_token;
426*03f9172cSAndroid Build Coastguard Worker unsigned int lci_req_active:1;
427*03f9172cSAndroid Build Coastguard Worker unsigned int range_req_active:1;
428*03f9172cSAndroid Build Coastguard Worker unsigned int link_mesr_req_active:1;
429*03f9172cSAndroid Build Coastguard Worker
430*03f9172cSAndroid Build Coastguard Worker int dhcp_sock; /* UDP socket used with the DHCP server */
431*03f9172cSAndroid Build Coastguard Worker
432*03f9172cSAndroid Build Coastguard Worker struct ptksa_cache *ptksa;
433*03f9172cSAndroid Build Coastguard Worker
434*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_DPP
435*03f9172cSAndroid Build Coastguard Worker int dpp_init_done;
436*03f9172cSAndroid Build Coastguard Worker struct dpp_authentication *dpp_auth;
437*03f9172cSAndroid Build Coastguard Worker u8 dpp_allowed_roles;
438*03f9172cSAndroid Build Coastguard Worker int dpp_qr_mutual;
439*03f9172cSAndroid Build Coastguard Worker int dpp_auth_ok_on_ack;
440*03f9172cSAndroid Build Coastguard Worker int dpp_in_response_listen;
441*03f9172cSAndroid Build Coastguard Worker struct gas_query_ap *gas;
442*03f9172cSAndroid Build Coastguard Worker struct dpp_pkex *dpp_pkex;
443*03f9172cSAndroid Build Coastguard Worker struct dpp_bootstrap_info *dpp_pkex_bi;
444*03f9172cSAndroid Build Coastguard Worker char *dpp_pkex_code;
445*03f9172cSAndroid Build Coastguard Worker size_t dpp_pkex_code_len;
446*03f9172cSAndroid Build Coastguard Worker char *dpp_pkex_identifier;
447*03f9172cSAndroid Build Coastguard Worker enum dpp_pkex_ver dpp_pkex_ver;
448*03f9172cSAndroid Build Coastguard Worker char *dpp_pkex_auth_cmd;
449*03f9172cSAndroid Build Coastguard Worker char *dpp_configurator_params;
450*03f9172cSAndroid Build Coastguard Worker struct os_reltime dpp_last_init;
451*03f9172cSAndroid Build Coastguard Worker struct os_reltime dpp_init_iter_start;
452*03f9172cSAndroid Build Coastguard Worker unsigned int dpp_init_max_tries;
453*03f9172cSAndroid Build Coastguard Worker unsigned int dpp_init_retry_time;
454*03f9172cSAndroid Build Coastguard Worker unsigned int dpp_resp_wait_time;
455*03f9172cSAndroid Build Coastguard Worker unsigned int dpp_resp_max_tries;
456*03f9172cSAndroid Build Coastguard Worker unsigned int dpp_resp_retry_time;
457*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_DPP2
458*03f9172cSAndroid Build Coastguard Worker struct wpabuf *dpp_presence_announcement;
459*03f9172cSAndroid Build Coastguard Worker struct dpp_bootstrap_info *dpp_chirp_bi;
460*03f9172cSAndroid Build Coastguard Worker int dpp_chirp_freq;
461*03f9172cSAndroid Build Coastguard Worker int *dpp_chirp_freqs;
462*03f9172cSAndroid Build Coastguard Worker int dpp_chirp_iter;
463*03f9172cSAndroid Build Coastguard Worker int dpp_chirp_round;
464*03f9172cSAndroid Build Coastguard Worker int dpp_chirp_scan_done;
465*03f9172cSAndroid Build Coastguard Worker int dpp_chirp_listen;
466*03f9172cSAndroid Build Coastguard Worker struct os_reltime dpp_relay_last_needs_ctrl;
467*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_DPP2 */
468*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_TESTING_OPTIONS
469*03f9172cSAndroid Build Coastguard Worker char *dpp_config_obj_override;
470*03f9172cSAndroid Build Coastguard Worker char *dpp_discovery_override;
471*03f9172cSAndroid Build Coastguard Worker char *dpp_groups_override;
472*03f9172cSAndroid Build Coastguard Worker unsigned int dpp_ignore_netaccesskey_mismatch:1;
473*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_TESTING_OPTIONS */
474*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_DPP */
475*03f9172cSAndroid Build Coastguard Worker
476*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_AIRTIME_POLICY
477*03f9172cSAndroid Build Coastguard Worker unsigned int num_backlogged_sta;
478*03f9172cSAndroid Build Coastguard Worker unsigned int airtime_weight;
479*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_AIRTIME_POLICY */
480*03f9172cSAndroid Build Coastguard Worker
481*03f9172cSAndroid Build Coastguard Worker u8 last_1x_eapol_key_replay_counter[8];
482*03f9172cSAndroid Build Coastguard Worker
483*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_SQLITE
484*03f9172cSAndroid Build Coastguard Worker sqlite3 *rad_attr_db;
485*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_SQLITE */
486*03f9172cSAndroid Build Coastguard Worker
487*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_CTRL_IFACE_UDP
488*03f9172cSAndroid Build Coastguard Worker unsigned char ctrl_iface_cookie[CTRL_IFACE_COOKIE_LEN];
489*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_CTRL_IFACE_UDP */
490*03f9172cSAndroid Build Coastguard Worker
491*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_IEEE80211BE
492*03f9172cSAndroid Build Coastguard Worker u8 eht_mld_bss_param_change;
493*03f9172cSAndroid Build Coastguard Worker struct hostapd_mld *mld;
494*03f9172cSAndroid Build Coastguard Worker struct dl_list link;
495*03f9172cSAndroid Build Coastguard Worker u8 mld_link_id;
496*03f9172cSAndroid Build Coastguard Worker
497*03f9172cSAndroid Build Coastguard Worker /* Cached partner info for ML probe response */
498*03f9172cSAndroid Build Coastguard Worker struct mld_link_info partner_links[MAX_NUM_MLD_LINKS];
499*03f9172cSAndroid Build Coastguard Worker
500*03f9172cSAndroid Build Coastguard Worker /* 5 characters for "_link", up to 2 characters for <link ID>, so in
501*03f9172cSAndroid Build Coastguard Worker * total, additional 7 characters required. */
502*03f9172cSAndroid Build Coastguard Worker char ctrl_sock_iface[IFNAMSIZ + 7 + 1];
503*03f9172cSAndroid Build Coastguard Worker
504*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_TESTING_OPTIONS
505*03f9172cSAndroid Build Coastguard Worker u8 eht_mld_link_removal_count;
506*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_TESTING_OPTIONS */
507*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_IEEE80211BE */
508*03f9172cSAndroid Build Coastguard Worker
509*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_NAN_USD
510*03f9172cSAndroid Build Coastguard Worker struct nan_de *nan_de;
511*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_NAN_USD */
512*03f9172cSAndroid Build Coastguard Worker
513*03f9172cSAndroid Build Coastguard Worker u64 scan_cookie; /* Scan instance identifier for the ongoing HT40 scan
514*03f9172cSAndroid Build Coastguard Worker */
515*03f9172cSAndroid Build Coastguard Worker };
516*03f9172cSAndroid Build Coastguard Worker
517*03f9172cSAndroid Build Coastguard Worker
518*03f9172cSAndroid Build Coastguard Worker struct hostapd_sta_info {
519*03f9172cSAndroid Build Coastguard Worker struct dl_list list;
520*03f9172cSAndroid Build Coastguard Worker u8 addr[ETH_ALEN];
521*03f9172cSAndroid Build Coastguard Worker struct os_reltime last_seen;
522*03f9172cSAndroid Build Coastguard Worker int ssi_signal;
523*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_TAXONOMY
524*03f9172cSAndroid Build Coastguard Worker struct wpabuf *probe_ie_taxonomy;
525*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_TAXONOMY */
526*03f9172cSAndroid Build Coastguard Worker };
527*03f9172cSAndroid Build Coastguard Worker
528*03f9172cSAndroid Build Coastguard Worker enum hostapd_iface_state {
529*03f9172cSAndroid Build Coastguard Worker HAPD_IFACE_UNINITIALIZED,
530*03f9172cSAndroid Build Coastguard Worker HAPD_IFACE_DISABLED,
531*03f9172cSAndroid Build Coastguard Worker HAPD_IFACE_COUNTRY_UPDATE,
532*03f9172cSAndroid Build Coastguard Worker HAPD_IFACE_ACS,
533*03f9172cSAndroid Build Coastguard Worker HAPD_IFACE_HT_SCAN,
534*03f9172cSAndroid Build Coastguard Worker HAPD_IFACE_DFS,
535*03f9172cSAndroid Build Coastguard Worker HAPD_IFACE_NO_IR,
536*03f9172cSAndroid Build Coastguard Worker HAPD_IFACE_ENABLED
537*03f9172cSAndroid Build Coastguard Worker };
538*03f9172cSAndroid Build Coastguard Worker
539*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_IEEE80211BE
540*03f9172cSAndroid Build Coastguard Worker /**
541*03f9172cSAndroid Build Coastguard Worker * struct hostapd_mld - hostapd per-mld data structure
542*03f9172cSAndroid Build Coastguard Worker */
543*03f9172cSAndroid Build Coastguard Worker struct hostapd_mld {
544*03f9172cSAndroid Build Coastguard Worker char name[IFNAMSIZ + 1];
545*03f9172cSAndroid Build Coastguard Worker u8 mld_addr[ETH_ALEN];
546*03f9172cSAndroid Build Coastguard Worker u8 next_link_id;
547*03f9172cSAndroid Build Coastguard Worker u8 num_links;
548*03f9172cSAndroid Build Coastguard Worker /* Number of hostapd_data (hapd) referencing this. num_links cannot be
549*03f9172cSAndroid Build Coastguard Worker * used since num_links can go to 0 even when a BSS is disabled and
550*03f9172cSAndroid Build Coastguard Worker * when it is re-enabled, the MLD should exist and hence it cannot be
551*03f9172cSAndroid Build Coastguard Worker * freed when num_links is 0.
552*03f9172cSAndroid Build Coastguard Worker */
553*03f9172cSAndroid Build Coastguard Worker u8 refcount;
554*03f9172cSAndroid Build Coastguard Worker
555*03f9172cSAndroid Build Coastguard Worker struct hostapd_data *fbss;
556*03f9172cSAndroid Build Coastguard Worker struct dl_list links; /* List head of all affiliated links */
557*03f9172cSAndroid Build Coastguard Worker
558*03f9172cSAndroid Build Coastguard Worker int ctrl_sock;
559*03f9172cSAndroid Build Coastguard Worker struct dl_list ctrl_dst;
560*03f9172cSAndroid Build Coastguard Worker char *ctrl_interface; /* Directory for UNIX domain sockets */
561*03f9172cSAndroid Build Coastguard Worker };
562*03f9172cSAndroid Build Coastguard Worker
563*03f9172cSAndroid Build Coastguard Worker #define HOSTAPD_MLD_MAX_REF_COUNT 0xFF
564*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_IEEE80211BE */
565*03f9172cSAndroid Build Coastguard Worker
566*03f9172cSAndroid Build Coastguard Worker /**
567*03f9172cSAndroid Build Coastguard Worker * struct hostapd_iface - hostapd per-interface data structure
568*03f9172cSAndroid Build Coastguard Worker */
569*03f9172cSAndroid Build Coastguard Worker struct hostapd_iface {
570*03f9172cSAndroid Build Coastguard Worker struct hapd_interfaces *interfaces;
571*03f9172cSAndroid Build Coastguard Worker void *owner;
572*03f9172cSAndroid Build Coastguard Worker char *config_fname;
573*03f9172cSAndroid Build Coastguard Worker struct hostapd_config *conf;
574*03f9172cSAndroid Build Coastguard Worker char phy[16]; /* Name of the PHY (radio) */
575*03f9172cSAndroid Build Coastguard Worker
576*03f9172cSAndroid Build Coastguard Worker enum hostapd_iface_state state;
577*03f9172cSAndroid Build Coastguard Worker
578*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_MESH
579*03f9172cSAndroid Build Coastguard Worker struct mesh_conf *mconf;
580*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_MESH */
581*03f9172cSAndroid Build Coastguard Worker
582*03f9172cSAndroid Build Coastguard Worker size_t num_bss;
583*03f9172cSAndroid Build Coastguard Worker struct hostapd_data **bss;
584*03f9172cSAndroid Build Coastguard Worker
585*03f9172cSAndroid Build Coastguard Worker unsigned int wait_channel_update:1;
586*03f9172cSAndroid Build Coastguard Worker unsigned int cac_started:1;
587*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_FST
588*03f9172cSAndroid Build Coastguard Worker struct fst_iface *fst;
589*03f9172cSAndroid Build Coastguard Worker const struct wpabuf *fst_ies;
590*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_FST */
591*03f9172cSAndroid Build Coastguard Worker
592*03f9172cSAndroid Build Coastguard Worker /*
593*03f9172cSAndroid Build Coastguard Worker * When set, indicates that the driver will handle the AP
594*03f9172cSAndroid Build Coastguard Worker * teardown: delete global keys, station keys, and stations.
595*03f9172cSAndroid Build Coastguard Worker */
596*03f9172cSAndroid Build Coastguard Worker unsigned int driver_ap_teardown:1;
597*03f9172cSAndroid Build Coastguard Worker
598*03f9172cSAndroid Build Coastguard Worker /*
599*03f9172cSAndroid Build Coastguard Worker * When set, indicates that this interface is part of list of
600*03f9172cSAndroid Build Coastguard Worker * interfaces that need to be started together (synchronously).
601*03f9172cSAndroid Build Coastguard Worker */
602*03f9172cSAndroid Build Coastguard Worker unsigned int need_to_start_in_sync:1;
603*03f9172cSAndroid Build Coastguard Worker
604*03f9172cSAndroid Build Coastguard Worker /* Ready to start but waiting for other interfaces to become ready. */
605*03f9172cSAndroid Build Coastguard Worker unsigned int ready_to_start_in_sync:1;
606*03f9172cSAndroid Build Coastguard Worker
607*03f9172cSAndroid Build Coastguard Worker int num_ap; /* number of entries in ap_list */
608*03f9172cSAndroid Build Coastguard Worker struct ap_info *ap_list; /* AP info list head */
609*03f9172cSAndroid Build Coastguard Worker struct ap_info *ap_hash[STA_HASH_SIZE];
610*03f9172cSAndroid Build Coastguard Worker
611*03f9172cSAndroid Build Coastguard Worker u64 drv_flags;
612*03f9172cSAndroid Build Coastguard Worker u64 drv_flags2;
613*03f9172cSAndroid Build Coastguard Worker unsigned int drv_rrm_flags;
614*03f9172cSAndroid Build Coastguard Worker
615*03f9172cSAndroid Build Coastguard Worker /*
616*03f9172cSAndroid Build Coastguard Worker * A bitmap of supported protocols for probe response offload. See
617*03f9172cSAndroid Build Coastguard Worker * struct wpa_driver_capa in driver.h
618*03f9172cSAndroid Build Coastguard Worker */
619*03f9172cSAndroid Build Coastguard Worker unsigned int probe_resp_offloads;
620*03f9172cSAndroid Build Coastguard Worker
621*03f9172cSAndroid Build Coastguard Worker /* extended capabilities supported by the driver */
622*03f9172cSAndroid Build Coastguard Worker const u8 *extended_capa, *extended_capa_mask;
623*03f9172cSAndroid Build Coastguard Worker unsigned int extended_capa_len;
624*03f9172cSAndroid Build Coastguard Worker
625*03f9172cSAndroid Build Coastguard Worker u16 mld_eml_capa, mld_mld_capa;
626*03f9172cSAndroid Build Coastguard Worker
627*03f9172cSAndroid Build Coastguard Worker unsigned int drv_max_acl_mac_addrs;
628*03f9172cSAndroid Build Coastguard Worker
629*03f9172cSAndroid Build Coastguard Worker struct hostapd_hw_modes *hw_features;
630*03f9172cSAndroid Build Coastguard Worker int num_hw_features;
631*03f9172cSAndroid Build Coastguard Worker struct hostapd_hw_modes *current_mode;
632*03f9172cSAndroid Build Coastguard Worker /* Rates that are currently used (i.e., filtered copy of
633*03f9172cSAndroid Build Coastguard Worker * current_mode->channels */
634*03f9172cSAndroid Build Coastguard Worker int num_rates;
635*03f9172cSAndroid Build Coastguard Worker struct hostapd_rate_data *current_rates;
636*03f9172cSAndroid Build Coastguard Worker int *basic_rates;
637*03f9172cSAndroid Build Coastguard Worker int freq;
638*03f9172cSAndroid Build Coastguard Worker
639*03f9172cSAndroid Build Coastguard Worker bool radar_detected;
640*03f9172cSAndroid Build Coastguard Worker
641*03f9172cSAndroid Build Coastguard Worker /* Background radar configuration */
642*03f9172cSAndroid Build Coastguard Worker struct {
643*03f9172cSAndroid Build Coastguard Worker int channel;
644*03f9172cSAndroid Build Coastguard Worker int secondary_channel;
645*03f9172cSAndroid Build Coastguard Worker int freq;
646*03f9172cSAndroid Build Coastguard Worker int centr_freq_seg0_idx;
647*03f9172cSAndroid Build Coastguard Worker int centr_freq_seg1_idx;
648*03f9172cSAndroid Build Coastguard Worker /* Main chain is on temporary channel during
649*03f9172cSAndroid Build Coastguard Worker * CAC detection on radar offchain.
650*03f9172cSAndroid Build Coastguard Worker */
651*03f9172cSAndroid Build Coastguard Worker unsigned int temp_ch:1;
652*03f9172cSAndroid Build Coastguard Worker /* CAC started on radar offchain */
653*03f9172cSAndroid Build Coastguard Worker unsigned int cac_started:1;
654*03f9172cSAndroid Build Coastguard Worker } radar_background;
655*03f9172cSAndroid Build Coastguard Worker
656*03f9172cSAndroid Build Coastguard Worker u16 hw_flags;
657*03f9172cSAndroid Build Coastguard Worker
658*03f9172cSAndroid Build Coastguard Worker /* Number of associated Non-ERP stations (i.e., stations using 802.11b
659*03f9172cSAndroid Build Coastguard Worker * in 802.11g BSS) */
660*03f9172cSAndroid Build Coastguard Worker int num_sta_non_erp;
661*03f9172cSAndroid Build Coastguard Worker
662*03f9172cSAndroid Build Coastguard Worker /* Number of associated stations that do not support Short Slot Time */
663*03f9172cSAndroid Build Coastguard Worker int num_sta_no_short_slot_time;
664*03f9172cSAndroid Build Coastguard Worker
665*03f9172cSAndroid Build Coastguard Worker /* Number of associated stations that do not support Short Preamble */
666*03f9172cSAndroid Build Coastguard Worker int num_sta_no_short_preamble;
667*03f9172cSAndroid Build Coastguard Worker
668*03f9172cSAndroid Build Coastguard Worker int olbc; /* Overlapping Legacy BSS Condition */
669*03f9172cSAndroid Build Coastguard Worker
670*03f9172cSAndroid Build Coastguard Worker /* Number of HT associated stations that do not support greenfield */
671*03f9172cSAndroid Build Coastguard Worker int num_sta_ht_no_gf;
672*03f9172cSAndroid Build Coastguard Worker
673*03f9172cSAndroid Build Coastguard Worker /* Number of associated non-HT stations */
674*03f9172cSAndroid Build Coastguard Worker int num_sta_no_ht;
675*03f9172cSAndroid Build Coastguard Worker
676*03f9172cSAndroid Build Coastguard Worker /* Number of HT associated stations 20 MHz */
677*03f9172cSAndroid Build Coastguard Worker int num_sta_ht_20mhz;
678*03f9172cSAndroid Build Coastguard Worker
679*03f9172cSAndroid Build Coastguard Worker /* Number of HT40 intolerant stations */
680*03f9172cSAndroid Build Coastguard Worker int num_sta_ht40_intolerant;
681*03f9172cSAndroid Build Coastguard Worker
682*03f9172cSAndroid Build Coastguard Worker /* Overlapping BSS information */
683*03f9172cSAndroid Build Coastguard Worker int olbc_ht;
684*03f9172cSAndroid Build Coastguard Worker
685*03f9172cSAndroid Build Coastguard Worker u16 ht_op_mode;
686*03f9172cSAndroid Build Coastguard Worker
687*03f9172cSAndroid Build Coastguard Worker /* surveying helpers */
688*03f9172cSAndroid Build Coastguard Worker
689*03f9172cSAndroid Build Coastguard Worker /* number of channels surveyed */
690*03f9172cSAndroid Build Coastguard Worker unsigned int chans_surveyed;
691*03f9172cSAndroid Build Coastguard Worker
692*03f9172cSAndroid Build Coastguard Worker /* lowest observed noise floor in dBm */
693*03f9172cSAndroid Build Coastguard Worker s8 lowest_nf;
694*03f9172cSAndroid Build Coastguard Worker
695*03f9172cSAndroid Build Coastguard Worker /* channel utilization calculation */
696*03f9172cSAndroid Build Coastguard Worker u64 last_channel_time;
697*03f9172cSAndroid Build Coastguard Worker u64 last_channel_time_busy;
698*03f9172cSAndroid Build Coastguard Worker u8 channel_utilization;
699*03f9172cSAndroid Build Coastguard Worker
700*03f9172cSAndroid Build Coastguard Worker unsigned int chan_util_samples_sum;
701*03f9172cSAndroid Build Coastguard Worker unsigned int chan_util_num_sample_periods;
702*03f9172cSAndroid Build Coastguard Worker unsigned int chan_util_average;
703*03f9172cSAndroid Build Coastguard Worker
704*03f9172cSAndroid Build Coastguard Worker /* eCSA IE will be added only if operating class is specified */
705*03f9172cSAndroid Build Coastguard Worker u8 cs_oper_class;
706*03f9172cSAndroid Build Coastguard Worker
707*03f9172cSAndroid Build Coastguard Worker unsigned int dfs_cac_ms;
708*03f9172cSAndroid Build Coastguard Worker struct os_reltime dfs_cac_start;
709*03f9172cSAndroid Build Coastguard Worker
710*03f9172cSAndroid Build Coastguard Worker /* Latched with the actual secondary channel information and will be
711*03f9172cSAndroid Build Coastguard Worker * used while juggling between HT20 and HT40 modes. */
712*03f9172cSAndroid Build Coastguard Worker int secondary_ch;
713*03f9172cSAndroid Build Coastguard Worker
714*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_ACS
715*03f9172cSAndroid Build Coastguard Worker unsigned int acs_num_completed_scans;
716*03f9172cSAndroid Build Coastguard Worker unsigned int acs_num_retries;
717*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_ACS */
718*03f9172cSAndroid Build Coastguard Worker
719*03f9172cSAndroid Build Coastguard Worker void (*scan_cb)(struct hostapd_iface *iface);
720*03f9172cSAndroid Build Coastguard Worker int num_ht40_scan_tries;
721*03f9172cSAndroid Build Coastguard Worker
722*03f9172cSAndroid Build Coastguard Worker struct dl_list sta_seen; /* struct hostapd_sta_info */
723*03f9172cSAndroid Build Coastguard Worker unsigned int num_sta_seen;
724*03f9172cSAndroid Build Coastguard Worker
725*03f9172cSAndroid Build Coastguard Worker u8 dfs_domain;
726*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_AIRTIME_POLICY
727*03f9172cSAndroid Build Coastguard Worker unsigned int airtime_quantum;
728*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_AIRTIME_POLICY */
729*03f9172cSAndroid Build Coastguard Worker
730*03f9172cSAndroid Build Coastguard Worker /* Previous WMM element information */
731*03f9172cSAndroid Build Coastguard Worker struct hostapd_wmm_ac_params prev_wmm[WMM_AC_NUM];
732*03f9172cSAndroid Build Coastguard Worker
733*03f9172cSAndroid Build Coastguard Worker /* Maximum number of interfaces supported for MBSSID advertisement */
734*03f9172cSAndroid Build Coastguard Worker unsigned int mbssid_max_interfaces;
735*03f9172cSAndroid Build Coastguard Worker /* Maximum profile periodicity for enhanced MBSSID advertisement */
736*03f9172cSAndroid Build Coastguard Worker unsigned int ema_max_periodicity;
737*03f9172cSAndroid Build Coastguard Worker
738*03f9172cSAndroid Build Coastguard Worker int (*enable_iface_cb)(struct hostapd_iface *iface);
739*03f9172cSAndroid Build Coastguard Worker int (*disable_iface_cb)(struct hostapd_iface *iface);
740*03f9172cSAndroid Build Coastguard Worker
741*03f9172cSAndroid Build Coastguard Worker /* Configured freq of interface is NO_IR */
742*03f9172cSAndroid Build Coastguard Worker bool is_no_ir;
743*03f9172cSAndroid Build Coastguard Worker
744*03f9172cSAndroid Build Coastguard Worker bool is_ch_switch_dfs; /* Channel switch from ACS to DFS */
745*03f9172cSAndroid Build Coastguard Worker
746*03f9172cSAndroid Build Coastguard Worker struct hostapd_multi_hw_info *multi_hw_info;
747*03f9172cSAndroid Build Coastguard Worker unsigned int num_multi_hws;
748*03f9172cSAndroid Build Coastguard Worker struct hostapd_multi_hw_info *current_hw_info;
749*03f9172cSAndroid Build Coastguard Worker };
750*03f9172cSAndroid Build Coastguard Worker
751*03f9172cSAndroid Build Coastguard Worker /* hostapd.c */
752*03f9172cSAndroid Build Coastguard Worker int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
753*03f9172cSAndroid Build Coastguard Worker int (*cb)(struct hostapd_iface *iface,
754*03f9172cSAndroid Build Coastguard Worker void *ctx), void *ctx);
755*03f9172cSAndroid Build Coastguard Worker int hostapd_reload_config(struct hostapd_iface *iface);
756*03f9172cSAndroid Build Coastguard Worker void hostapd_reconfig_encryption(struct hostapd_data *hapd);
757*03f9172cSAndroid Build Coastguard Worker struct hostapd_data *
758*03f9172cSAndroid Build Coastguard Worker hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
759*03f9172cSAndroid Build Coastguard Worker struct hostapd_config *conf,
760*03f9172cSAndroid Build Coastguard Worker struct hostapd_bss_config *bss);
761*03f9172cSAndroid Build Coastguard Worker int hostapd_setup_interface(struct hostapd_iface *iface);
762*03f9172cSAndroid Build Coastguard Worker int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err);
763*03f9172cSAndroid Build Coastguard Worker void hostapd_interface_deinit(struct hostapd_iface *iface);
764*03f9172cSAndroid Build Coastguard Worker void hostapd_interface_free(struct hostapd_iface *iface);
765*03f9172cSAndroid Build Coastguard Worker struct hostapd_iface * hostapd_alloc_iface(void);
766*03f9172cSAndroid Build Coastguard Worker struct hostapd_iface * hostapd_init(struct hapd_interfaces *interfaces,
767*03f9172cSAndroid Build Coastguard Worker const char *config_file);
768*03f9172cSAndroid Build Coastguard Worker struct hostapd_iface *
769*03f9172cSAndroid Build Coastguard Worker hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy,
770*03f9172cSAndroid Build Coastguard Worker const char *config_fname, int debug);
771*03f9172cSAndroid Build Coastguard Worker void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
772*03f9172cSAndroid Build Coastguard Worker int reassoc);
773*03f9172cSAndroid Build Coastguard Worker void hostapd_interface_deinit_free(struct hostapd_iface *iface);
774*03f9172cSAndroid Build Coastguard Worker int hostapd_enable_iface(struct hostapd_iface *hapd_iface);
775*03f9172cSAndroid Build Coastguard Worker int hostapd_reload_iface(struct hostapd_iface *hapd_iface);
776*03f9172cSAndroid Build Coastguard Worker int hostapd_reload_bss_only(struct hostapd_data *bss);
777*03f9172cSAndroid Build Coastguard Worker int hostapd_disable_iface(struct hostapd_iface *hapd_iface);
778*03f9172cSAndroid Build Coastguard Worker void hostapd_bss_deinit_no_free(struct hostapd_data *hapd);
779*03f9172cSAndroid Build Coastguard Worker void hostapd_free_hapd_data(struct hostapd_data *hapd);
780*03f9172cSAndroid Build Coastguard Worker void hostapd_cleanup_iface_partial(struct hostapd_iface *iface);
781*03f9172cSAndroid Build Coastguard Worker int hostapd_add_iface(struct hapd_interfaces *ifaces, char *buf);
782*03f9172cSAndroid Build Coastguard Worker int hostapd_remove_iface(struct hapd_interfaces *ifaces, char *buf);
783*03f9172cSAndroid Build Coastguard Worker void hostapd_channel_list_updated(struct hostapd_iface *iface, int initiator);
784*03f9172cSAndroid Build Coastguard Worker void hostapd_set_state(struct hostapd_iface *iface, enum hostapd_iface_state s);
785*03f9172cSAndroid Build Coastguard Worker const char * hostapd_state_text(enum hostapd_iface_state s);
786*03f9172cSAndroid Build Coastguard Worker int hostapd_csa_in_progress(struct hostapd_iface *iface);
787*03f9172cSAndroid Build Coastguard Worker void hostapd_chan_switch_config(struct hostapd_data *hapd,
788*03f9172cSAndroid Build Coastguard Worker struct hostapd_freq_params *freq_params);
789*03f9172cSAndroid Build Coastguard Worker int hostapd_switch_channel(struct hostapd_data *hapd,
790*03f9172cSAndroid Build Coastguard Worker struct csa_settings *settings);
791*03f9172cSAndroid Build Coastguard Worker int hostapd_force_channel_switch(struct hostapd_iface *iface,
792*03f9172cSAndroid Build Coastguard Worker struct csa_settings *settings);
793*03f9172cSAndroid Build Coastguard Worker void
794*03f9172cSAndroid Build Coastguard Worker hostapd_switch_channel_fallback(struct hostapd_iface *iface,
795*03f9172cSAndroid Build Coastguard Worker const struct hostapd_freq_params *freq_params);
796*03f9172cSAndroid Build Coastguard Worker void hostapd_cleanup_cs_params(struct hostapd_data *hapd);
797*03f9172cSAndroid Build Coastguard Worker void hostapd_periodic_iface(struct hostapd_iface *iface);
798*03f9172cSAndroid Build Coastguard Worker int hostapd_owe_trans_get_info(struct hostapd_data *hapd);
799*03f9172cSAndroid Build Coastguard Worker void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx);
800*03f9172cSAndroid Build Coastguard Worker
801*03f9172cSAndroid Build Coastguard Worker void hostapd_switch_color(struct hostapd_data *hapd, u64 bitmap);
802*03f9172cSAndroid Build Coastguard Worker void hostapd_cleanup_cca_params(struct hostapd_data *hapd);
803*03f9172cSAndroid Build Coastguard Worker
804*03f9172cSAndroid Build Coastguard Worker /* utils.c */
805*03f9172cSAndroid Build Coastguard Worker int hostapd_register_probereq_cb(struct hostapd_data *hapd,
806*03f9172cSAndroid Build Coastguard Worker int (*cb)(void *ctx, const u8 *sa,
807*03f9172cSAndroid Build Coastguard Worker const u8 *da, const u8 *bssid,
808*03f9172cSAndroid Build Coastguard Worker const u8 *ie, size_t ie_len,
809*03f9172cSAndroid Build Coastguard Worker int ssi_signal),
810*03f9172cSAndroid Build Coastguard Worker void *ctx);
811*03f9172cSAndroid Build Coastguard Worker void hostapd_prune_associations(struct hostapd_data *hapd, const u8 *addr,
812*03f9172cSAndroid Build Coastguard Worker int mld_assoc_link_id);
813*03f9172cSAndroid Build Coastguard Worker
814*03f9172cSAndroid Build Coastguard Worker /* drv_callbacks.c (TODO: move to somewhere else?) */
815*03f9172cSAndroid Build Coastguard Worker void hostapd_notify_assoc_fils_finish(struct hostapd_data *hapd,
816*03f9172cSAndroid Build Coastguard Worker struct sta_info *sta);
817*03f9172cSAndroid Build Coastguard Worker int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
818*03f9172cSAndroid Build Coastguard Worker const u8 *req_ie, size_t req_ielen, const u8 *resp_ie,
819*03f9172cSAndroid Build Coastguard Worker size_t resp_ielen, const u8 *link_addr, int reassoc);
820*03f9172cSAndroid Build Coastguard Worker void hostapd_notif_disassoc(struct hostapd_data *hapd, const u8 *addr);
821*03f9172cSAndroid Build Coastguard Worker void hostapd_event_sta_low_ack(struct hostapd_data *hapd, const u8 *addr);
822*03f9172cSAndroid Build Coastguard Worker void hostapd_event_connect_failed_reason(struct hostapd_data *hapd,
823*03f9172cSAndroid Build Coastguard Worker const u8 *addr, int reason_code);
824*03f9172cSAndroid Build Coastguard Worker int hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa, const u8 *da,
825*03f9172cSAndroid Build Coastguard Worker const u8 *bssid, const u8 *ie, size_t ie_len,
826*03f9172cSAndroid Build Coastguard Worker int ssi_signal);
827*03f9172cSAndroid Build Coastguard Worker void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht,
828*03f9172cSAndroid Build Coastguard Worker int offset, int width, int cf1, int cf2,
829*03f9172cSAndroid Build Coastguard Worker u16 punct_bitmap, int finished);
830*03f9172cSAndroid Build Coastguard Worker struct survey_results;
831*03f9172cSAndroid Build Coastguard Worker void hostapd_event_get_survey(struct hostapd_iface *iface,
832*03f9172cSAndroid Build Coastguard Worker struct survey_results *survey_results);
833*03f9172cSAndroid Build Coastguard Worker void hostapd_acs_channel_selected(struct hostapd_data *hapd,
834*03f9172cSAndroid Build Coastguard Worker struct acs_selected_channels *acs_res);
835*03f9172cSAndroid Build Coastguard Worker
836*03f9172cSAndroid Build Coastguard Worker const struct hostapd_eap_user *
837*03f9172cSAndroid Build Coastguard Worker hostapd_get_eap_user(struct hostapd_data *hapd, const u8 *identity,
838*03f9172cSAndroid Build Coastguard Worker size_t identity_len, int phase2);
839*03f9172cSAndroid Build Coastguard Worker
840*03f9172cSAndroid Build Coastguard Worker struct hostapd_data * hostapd_get_iface(struct hapd_interfaces *interfaces,
841*03f9172cSAndroid Build Coastguard Worker const char *ifname);
842*03f9172cSAndroid Build Coastguard Worker void hostapd_event_sta_opmode_changed(struct hostapd_data *hapd, const u8 *addr,
843*03f9172cSAndroid Build Coastguard Worker enum smps_mode smps_mode,
844*03f9172cSAndroid Build Coastguard Worker enum chan_width chan_width, u8 rx_nss);
845*03f9172cSAndroid Build Coastguard Worker
846*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_FST
847*03f9172cSAndroid Build Coastguard Worker void fst_hostapd_fill_iface_obj(struct hostapd_data *hapd,
848*03f9172cSAndroid Build Coastguard Worker struct fst_wpa_obj *iface_obj);
849*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_FST */
850*03f9172cSAndroid Build Coastguard Worker
851*03f9172cSAndroid Build Coastguard Worker int hostapd_set_acl(struct hostapd_data *hapd);
852*03f9172cSAndroid Build Coastguard Worker struct hostapd_data * hostapd_mbssid_get_tx_bss(struct hostapd_data *hapd);
853*03f9172cSAndroid Build Coastguard Worker int hostapd_mbssid_get_bss_index(struct hostapd_data *hapd);
854*03f9172cSAndroid Build Coastguard Worker struct hostapd_data * hostapd_mld_get_link_bss(struct hostapd_data *hapd,
855*03f9172cSAndroid Build Coastguard Worker u8 link_id);
856*03f9172cSAndroid Build Coastguard Worker int hostapd_link_remove(struct hostapd_data *hapd, u32 count);
857*03f9172cSAndroid Build Coastguard Worker bool hostapd_is_ml_partner(struct hostapd_data *hapd1,
858*03f9172cSAndroid Build Coastguard Worker struct hostapd_data *hapd2);
859*03f9172cSAndroid Build Coastguard Worker u8 hostapd_get_mld_id(struct hostapd_data *hapd);
860*03f9172cSAndroid Build Coastguard Worker int hostapd_mld_add_link(struct hostapd_data *hapd);
861*03f9172cSAndroid Build Coastguard Worker int hostapd_mld_remove_link(struct hostapd_data *hapd);
862*03f9172cSAndroid Build Coastguard Worker struct hostapd_data * hostapd_mld_get_first_bss(struct hostapd_data *hapd);
863*03f9172cSAndroid Build Coastguard Worker
864*03f9172cSAndroid Build Coastguard Worker void free_beacon_data(struct beacon_data *beacon);
865*03f9172cSAndroid Build Coastguard Worker int hostapd_fill_cca_settings(struct hostapd_data *hapd,
866*03f9172cSAndroid Build Coastguard Worker struct cca_settings *settings);
867*03f9172cSAndroid Build Coastguard Worker
868*03f9172cSAndroid Build Coastguard Worker #ifdef CONFIG_IEEE80211BE
869*03f9172cSAndroid Build Coastguard Worker
870*03f9172cSAndroid Build Coastguard Worker bool hostapd_mld_is_first_bss(struct hostapd_data *hapd);
871*03f9172cSAndroid Build Coastguard Worker void hostapd_mld_interface_freed(struct hostapd_data *hapd);
872*03f9172cSAndroid Build Coastguard Worker
873*03f9172cSAndroid Build Coastguard Worker #define for_each_mld_link(partner, self) \
874*03f9172cSAndroid Build Coastguard Worker dl_list_for_each(partner, &self->mld->links, struct hostapd_data, link)
875*03f9172cSAndroid Build Coastguard Worker
876*03f9172cSAndroid Build Coastguard Worker #else /* CONFIG_IEEE80211BE */
877*03f9172cSAndroid Build Coastguard Worker
hostapd_mld_is_first_bss(struct hostapd_data * hapd)878*03f9172cSAndroid Build Coastguard Worker static inline bool hostapd_mld_is_first_bss(struct hostapd_data *hapd)
879*03f9172cSAndroid Build Coastguard Worker {
880*03f9172cSAndroid Build Coastguard Worker return true;
881*03f9172cSAndroid Build Coastguard Worker }
882*03f9172cSAndroid Build Coastguard Worker
883*03f9172cSAndroid Build Coastguard Worker #define for_each_mld_link(partner, self) \
884*03f9172cSAndroid Build Coastguard Worker if (false)
885*03f9172cSAndroid Build Coastguard Worker
886*03f9172cSAndroid Build Coastguard Worker #endif /* CONFIG_IEEE80211BE */
887*03f9172cSAndroid Build Coastguard Worker
888*03f9172cSAndroid Build Coastguard Worker u16 hostapd_get_punct_bitmap(struct hostapd_data *hapd);
889*03f9172cSAndroid Build Coastguard Worker
890*03f9172cSAndroid Build Coastguard Worker #endif /* HOSTAPD_H */
891