xref: /freebsd/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h (revision 32a95656b51ebefcdf3e0b02c110825f59abd26f)
139beb93cSSam Leffler /*
239beb93cSSam Leffler  * wpa_supplicant - Internal definitions
35b9c547cSRui Paulo  * Copyright (c) 2003-2014, Jouni Malinen <j@w1.fi>
439beb93cSSam Leffler  *
5f05cddf9SRui Paulo  * This software may be distributed under the terms of the BSD license.
6f05cddf9SRui Paulo  * See README for more details.
739beb93cSSam Leffler  */
839beb93cSSam Leffler 
939beb93cSSam Leffler #ifndef WPA_SUPPLICANT_I_H
1039beb93cSSam Leffler #define WPA_SUPPLICANT_I_H
1139beb93cSSam Leffler 
1285732ac8SCy Schubert #include "utils/bitfield.h"
13e28a4053SRui Paulo #include "utils/list.h"
14e28a4053SRui Paulo #include "common/defs.h"
155b9c547cSRui Paulo #include "common/sae.h"
165b9c547cSRui Paulo #include "common/wpa_ctrl.h"
17c1d255d3SCy Schubert #include "crypto/sha384.h"
18c1d255d3SCy Schubert #include "eapol_supp/eapol_supp_sm.h"
195b9c547cSRui Paulo #include "wps/wps_defs.h"
20f05cddf9SRui Paulo #include "config_ssid.h"
215b9c547cSRui Paulo #include "wmm_ac.h"
2239beb93cSSam Leffler 
23325151a3SRui Paulo extern const char *const wpa_supplicant_version;
24325151a3SRui Paulo extern const char *const wpa_supplicant_license;
2539beb93cSSam Leffler #ifndef CONFIG_NO_STDOUT_DEBUG
26325151a3SRui Paulo extern const char *const wpa_supplicant_full_license1;
27325151a3SRui Paulo extern const char *const wpa_supplicant_full_license2;
28325151a3SRui Paulo extern const char *const wpa_supplicant_full_license3;
29325151a3SRui Paulo extern const char *const wpa_supplicant_full_license4;
30325151a3SRui Paulo extern const char *const wpa_supplicant_full_license5;
3139beb93cSSam Leffler #endif /* CONFIG_NO_STDOUT_DEBUG */
3239beb93cSSam Leffler 
3339beb93cSSam Leffler struct wpa_sm;
3439beb93cSSam Leffler struct wpa_supplicant;
35e28a4053SRui Paulo struct ibss_rsn;
36e28a4053SRui Paulo struct scan_info;
37e28a4053SRui Paulo struct wpa_bss;
38e28a4053SRui Paulo struct wpa_scan_results;
39f05cddf9SRui Paulo struct hostapd_hw_modes;
40f05cddf9SRui Paulo struct wpa_driver_associate_params;
41*32a95656SCy Schubert struct wpa_cred;
4239beb93cSSam Leffler 
4339beb93cSSam Leffler /*
4439beb93cSSam Leffler  * Forward declarations of private structures used within the ctrl_iface
4539beb93cSSam Leffler  * backends. Other parts of wpa_supplicant do not have access to data stored in
4639beb93cSSam Leffler  * these structures.
4739beb93cSSam Leffler  */
4839beb93cSSam Leffler struct ctrl_iface_priv;
4939beb93cSSam Leffler struct ctrl_iface_global_priv;
50e28a4053SRui Paulo struct wpas_dbus_priv;
51780fb4a2SCy Schubert struct wpas_binder_priv;
5239beb93cSSam Leffler 
5339beb93cSSam Leffler /**
5439beb93cSSam Leffler  * struct wpa_interface - Parameters for wpa_supplicant_add_iface()
5539beb93cSSam Leffler  */
5639beb93cSSam Leffler struct wpa_interface {
5739beb93cSSam Leffler 	/**
5839beb93cSSam Leffler 	 * confname - Configuration name (file or profile) name
5939beb93cSSam Leffler 	 *
6039beb93cSSam Leffler 	 * This can also be %NULL when a configuration file is not used. In
6139beb93cSSam Leffler 	 * that case, ctrl_interface must be set to allow the interface to be
6239beb93cSSam Leffler 	 * configured.
6339beb93cSSam Leffler 	 */
6439beb93cSSam Leffler 	const char *confname;
6539beb93cSSam Leffler 
6639beb93cSSam Leffler 	/**
675b9c547cSRui Paulo 	 * confanother - Additional configuration name (file or profile) name
685b9c547cSRui Paulo 	 *
695b9c547cSRui Paulo 	 * This can also be %NULL when the additional configuration file is not
705b9c547cSRui Paulo 	 * used.
715b9c547cSRui Paulo 	 */
725b9c547cSRui Paulo 	const char *confanother;
735b9c547cSRui Paulo 
745b9c547cSRui Paulo 	/**
7539beb93cSSam Leffler 	 * ctrl_interface - Control interface parameter
7639beb93cSSam Leffler 	 *
7739beb93cSSam Leffler 	 * If a configuration file is not used, this variable can be used to
7839beb93cSSam Leffler 	 * set the ctrl_interface parameter that would have otherwise been read
7939beb93cSSam Leffler 	 * from the configuration file. If both confname and ctrl_interface are
8039beb93cSSam Leffler 	 * set, ctrl_interface is used to override the value from configuration
8139beb93cSSam Leffler 	 * file.
8239beb93cSSam Leffler 	 */
8339beb93cSSam Leffler 	const char *ctrl_interface;
8439beb93cSSam Leffler 
8539beb93cSSam Leffler 	/**
8639beb93cSSam Leffler 	 * driver - Driver interface name, or %NULL to use the default driver
8739beb93cSSam Leffler 	 */
8839beb93cSSam Leffler 	const char *driver;
8939beb93cSSam Leffler 
9039beb93cSSam Leffler 	/**
9139beb93cSSam Leffler 	 * driver_param - Driver interface parameters
9239beb93cSSam Leffler 	 *
9339beb93cSSam Leffler 	 * If a configuration file is not used, this variable can be used to
9439beb93cSSam Leffler 	 * set the driver_param parameters that would have otherwise been read
9539beb93cSSam Leffler 	 * from the configuration file. If both confname and driver_param are
9639beb93cSSam Leffler 	 * set, driver_param is used to override the value from configuration
9739beb93cSSam Leffler 	 * file.
9839beb93cSSam Leffler 	 */
9939beb93cSSam Leffler 	const char *driver_param;
10039beb93cSSam Leffler 
10139beb93cSSam Leffler 	/**
10239beb93cSSam Leffler 	 * ifname - Interface name
10339beb93cSSam Leffler 	 */
10439beb93cSSam Leffler 	const char *ifname;
10539beb93cSSam Leffler 
10639beb93cSSam Leffler 	/**
10739beb93cSSam Leffler 	 * bridge_ifname - Optional bridge interface name
10839beb93cSSam Leffler 	 *
10939beb93cSSam Leffler 	 * If the driver interface (ifname) is included in a Linux bridge
11039beb93cSSam Leffler 	 * device, the bridge interface may need to be used for receiving EAPOL
11139beb93cSSam Leffler 	 * frames. This can be enabled by setting this variable to enable
11239beb93cSSam Leffler 	 * receiving of EAPOL frames from an additional interface.
11339beb93cSSam Leffler 	 */
11439beb93cSSam Leffler 	const char *bridge_ifname;
1155b9c547cSRui Paulo 
1165b9c547cSRui Paulo 	/**
1175b9c547cSRui Paulo 	 * p2p_mgmt - Interface used for P2P management (P2P Device operations)
1185b9c547cSRui Paulo 	 *
1195b9c547cSRui Paulo 	 * Indicates whether wpas_p2p_init() must be called for this interface.
1205b9c547cSRui Paulo 	 * This is used only when the driver supports a dedicated P2P Device
1215b9c547cSRui Paulo 	 * interface that is not a network interface.
1225b9c547cSRui Paulo 	 */
1235b9c547cSRui Paulo 	int p2p_mgmt;
124c1d255d3SCy Schubert 
125c1d255d3SCy Schubert #ifdef CONFIG_MATCH_IFACE
126c1d255d3SCy Schubert 	/**
127c1d255d3SCy Schubert 	 * matched - Interface was matched rather than specified
128c1d255d3SCy Schubert 	 *
129c1d255d3SCy Schubert 	 */
130c1d255d3SCy Schubert 	enum {
131c1d255d3SCy Schubert 		WPA_IFACE_NOT_MATCHED,
132c1d255d3SCy Schubert 		WPA_IFACE_MATCHED_NULL,
133c1d255d3SCy Schubert 		WPA_IFACE_MATCHED
134c1d255d3SCy Schubert 	} matched;
135c1d255d3SCy Schubert #endif /* CONFIG_MATCH_IFACE */
13639beb93cSSam Leffler };
13739beb93cSSam Leffler 
13839beb93cSSam Leffler /**
13939beb93cSSam Leffler  * struct wpa_params - Parameters for wpa_supplicant_init()
14039beb93cSSam Leffler  */
14139beb93cSSam Leffler struct wpa_params {
14239beb93cSSam Leffler 	/**
14339beb93cSSam Leffler 	 * daemonize - Run %wpa_supplicant in the background
14439beb93cSSam Leffler 	 */
14539beb93cSSam Leffler 	int daemonize;
14639beb93cSSam Leffler 
14739beb93cSSam Leffler 	/**
14839beb93cSSam Leffler 	 * wait_for_monitor - Wait for a monitor program before starting
14939beb93cSSam Leffler 	 */
15039beb93cSSam Leffler 	int wait_for_monitor;
15139beb93cSSam Leffler 
15239beb93cSSam Leffler 	/**
15339beb93cSSam Leffler 	 * pid_file - Path to a PID (process ID) file
15439beb93cSSam Leffler 	 *
15539beb93cSSam Leffler 	 * If this and daemonize are set, process ID of the background process
15639beb93cSSam Leffler 	 * will be written to the specified file.
15739beb93cSSam Leffler 	 */
15839beb93cSSam Leffler 	char *pid_file;
15939beb93cSSam Leffler 
16039beb93cSSam Leffler 	/**
16139beb93cSSam Leffler 	 * wpa_debug_level - Debugging verbosity level (e.g., MSG_INFO)
16239beb93cSSam Leffler 	 */
16339beb93cSSam Leffler 	int wpa_debug_level;
16439beb93cSSam Leffler 
16539beb93cSSam Leffler 	/**
16639beb93cSSam Leffler 	 * wpa_debug_show_keys - Whether keying material is included in debug
16739beb93cSSam Leffler 	 *
16839beb93cSSam Leffler 	 * This parameter can be used to allow keying material to be included
16939beb93cSSam Leffler 	 * in debug messages. This is a security risk and this option should
17039beb93cSSam Leffler 	 * not be enabled in normal configuration. If needed during
17139beb93cSSam Leffler 	 * development or while troubleshooting, this option can provide more
17239beb93cSSam Leffler 	 * details for figuring out what is happening.
17339beb93cSSam Leffler 	 */
17439beb93cSSam Leffler 	int wpa_debug_show_keys;
17539beb93cSSam Leffler 
17639beb93cSSam Leffler 	/**
17739beb93cSSam Leffler 	 * wpa_debug_timestamp - Whether to include timestamp in debug messages
17839beb93cSSam Leffler 	 */
17939beb93cSSam Leffler 	int wpa_debug_timestamp;
18039beb93cSSam Leffler 
18139beb93cSSam Leffler 	/**
18239beb93cSSam Leffler 	 * ctrl_interface - Global ctrl_iface path/parameter
18339beb93cSSam Leffler 	 */
18439beb93cSSam Leffler 	char *ctrl_interface;
18539beb93cSSam Leffler 
18639beb93cSSam Leffler 	/**
1875b9c547cSRui Paulo 	 * ctrl_interface_group - Global ctrl_iface group
1885b9c547cSRui Paulo 	 */
1895b9c547cSRui Paulo 	char *ctrl_interface_group;
1905b9c547cSRui Paulo 
1915b9c547cSRui Paulo 	/**
19239beb93cSSam Leffler 	 * dbus_ctrl_interface - Enable the DBus control interface
19339beb93cSSam Leffler 	 */
19439beb93cSSam Leffler 	int dbus_ctrl_interface;
19539beb93cSSam Leffler 
19639beb93cSSam Leffler 	/**
19739beb93cSSam Leffler 	 * wpa_debug_file_path - Path of debug file or %NULL to use stdout
19839beb93cSSam Leffler 	 */
19939beb93cSSam Leffler 	const char *wpa_debug_file_path;
2002aef0ff7SSam Leffler 
2012aef0ff7SSam Leffler 	/**
2022aef0ff7SSam Leffler 	 * wpa_debug_syslog - Enable log output through syslog
2032aef0ff7SSam Leffler 	 */
204e28a4053SRui Paulo 	int wpa_debug_syslog;
205e28a4053SRui Paulo 
206e28a4053SRui Paulo 	/**
207f05cddf9SRui Paulo 	 * wpa_debug_tracing - Enable log output through Linux tracing
208f05cddf9SRui Paulo 	 */
209f05cddf9SRui Paulo 	int wpa_debug_tracing;
210f05cddf9SRui Paulo 
211f05cddf9SRui Paulo 	/**
212e28a4053SRui Paulo 	 * override_driver - Optional driver parameter override
213e28a4053SRui Paulo 	 *
214e28a4053SRui Paulo 	 * This parameter can be used to override the driver parameter in
215e28a4053SRui Paulo 	 * dynamic interface addition to force a specific driver wrapper to be
216e28a4053SRui Paulo 	 * used instead.
217e28a4053SRui Paulo 	 */
218e28a4053SRui Paulo 	char *override_driver;
219e28a4053SRui Paulo 
220e28a4053SRui Paulo 	/**
221e28a4053SRui Paulo 	 * override_ctrl_interface - Optional ctrl_interface override
222e28a4053SRui Paulo 	 *
223e28a4053SRui Paulo 	 * This parameter can be used to override the ctrl_interface parameter
224e28a4053SRui Paulo 	 * in dynamic interface addition to force a control interface to be
225e28a4053SRui Paulo 	 * created.
226e28a4053SRui Paulo 	 */
227e28a4053SRui Paulo 	char *override_ctrl_interface;
228f05cddf9SRui Paulo 
229f05cddf9SRui Paulo 	/**
230f05cddf9SRui Paulo 	 * entropy_file - Optional entropy file
231f05cddf9SRui Paulo 	 *
232f05cddf9SRui Paulo 	 * This parameter can be used to configure wpa_supplicant to maintain
233f05cddf9SRui Paulo 	 * its internal entropy store over restarts.
234f05cddf9SRui Paulo 	 */
235f05cddf9SRui Paulo 	char *entropy_file;
236325151a3SRui Paulo 
237325151a3SRui Paulo #ifdef CONFIG_P2P
238325151a3SRui Paulo 	/**
239325151a3SRui Paulo 	 * conf_p2p_dev - Configuration file used to hold the
240325151a3SRui Paulo 	 * P2P Device configuration parameters.
241325151a3SRui Paulo 	 *
242325151a3SRui Paulo 	 * This can also be %NULL. In such a case, if a P2P Device dedicated
243325151a3SRui Paulo 	 * interfaces is created, the main configuration file will be used.
244325151a3SRui Paulo 	 */
245325151a3SRui Paulo 	char *conf_p2p_dev;
246325151a3SRui Paulo #endif /* CONFIG_P2P */
247325151a3SRui Paulo 
248780fb4a2SCy Schubert #ifdef CONFIG_MATCH_IFACE
249780fb4a2SCy Schubert 	/**
250780fb4a2SCy Schubert 	 * match_ifaces - Interface descriptions to match
251780fb4a2SCy Schubert 	 */
252780fb4a2SCy Schubert 	struct wpa_interface *match_ifaces;
253780fb4a2SCy Schubert 
254780fb4a2SCy Schubert 	/**
255780fb4a2SCy Schubert 	 * match_iface_count - Number of defined matching interfaces
256780fb4a2SCy Schubert 	 */
257780fb4a2SCy Schubert 	int match_iface_count;
258780fb4a2SCy Schubert #endif /* CONFIG_MATCH_IFACE */
25939beb93cSSam Leffler };
26039beb93cSSam Leffler 
261f05cddf9SRui Paulo struct p2p_srv_bonjour {
262f05cddf9SRui Paulo 	struct dl_list list;
263f05cddf9SRui Paulo 	struct wpabuf *query;
264f05cddf9SRui Paulo 	struct wpabuf *resp;
265f05cddf9SRui Paulo };
266f05cddf9SRui Paulo 
267f05cddf9SRui Paulo struct p2p_srv_upnp {
268f05cddf9SRui Paulo 	struct dl_list list;
269f05cddf9SRui Paulo 	u8 version;
270f05cddf9SRui Paulo 	char *service;
271f05cddf9SRui Paulo };
272f05cddf9SRui Paulo 
27339beb93cSSam Leffler /**
27439beb93cSSam Leffler  * struct wpa_global - Internal, global data for all %wpa_supplicant interfaces
27539beb93cSSam Leffler  *
27639beb93cSSam Leffler  * This structure is initialized by calling wpa_supplicant_init() when starting
27739beb93cSSam Leffler  * %wpa_supplicant.
27839beb93cSSam Leffler  */
27939beb93cSSam Leffler struct wpa_global {
28039beb93cSSam Leffler 	struct wpa_supplicant *ifaces;
28139beb93cSSam Leffler 	struct wpa_params params;
28239beb93cSSam Leffler 	struct ctrl_iface_global_priv *ctrl_iface;
283e28a4053SRui Paulo 	struct wpas_dbus_priv *dbus;
284780fb4a2SCy Schubert 	struct wpas_binder_priv *binder;
28539beb93cSSam Leffler 	void **drv_priv;
28639beb93cSSam Leffler 	size_t drv_count;
287e28a4053SRui Paulo 	struct os_time suspend_time;
288f05cddf9SRui Paulo 	struct p2p_data *p2p;
289f05cddf9SRui Paulo 	struct wpa_supplicant *p2p_init_wpa_s;
290f05cddf9SRui Paulo 	struct wpa_supplicant *p2p_group_formation;
2915b9c547cSRui Paulo 	struct wpa_supplicant *p2p_invite_group;
292f05cddf9SRui Paulo 	u8 p2p_dev_addr[ETH_ALEN];
2935b9c547cSRui Paulo 	struct os_reltime p2p_go_wait_client;
294f05cddf9SRui Paulo 	struct dl_list p2p_srv_bonjour; /* struct p2p_srv_bonjour */
295f05cddf9SRui Paulo 	struct dl_list p2p_srv_upnp; /* struct p2p_srv_upnp */
296f05cddf9SRui Paulo 	int p2p_disabled;
297f05cddf9SRui Paulo 	int cross_connection;
298c1d255d3SCy Schubert 	int p2p_long_listen; /* remaining time in long Listen state in ms */
2995b9c547cSRui Paulo 	struct wpa_freq_range_list p2p_disallow_freq;
3005b9c547cSRui Paulo 	struct wpa_freq_range_list p2p_go_avoid_freq;
301f05cddf9SRui Paulo 	enum wpa_conc_pref {
302f05cddf9SRui Paulo 		WPA_CONC_PREF_NOT_SET,
303f05cddf9SRui Paulo 		WPA_CONC_PREF_STA,
304f05cddf9SRui Paulo 		WPA_CONC_PREF_P2P
305f05cddf9SRui Paulo 	} conc_pref;
3065b9c547cSRui Paulo 	unsigned int p2p_per_sta_psk:1;
3075b9c547cSRui Paulo 	unsigned int p2p_fail_on_wps_complete:1;
3085b9c547cSRui Paulo 	unsigned int p2p_24ghz_social_channels:1;
3095b9c547cSRui Paulo 	unsigned int pending_p2ps_group:1;
3105b9c547cSRui Paulo 	unsigned int pending_group_iface_for_p2ps:1;
311780fb4a2SCy Schubert 	unsigned int pending_p2ps_group_freq;
312f05cddf9SRui Paulo 
313f05cddf9SRui Paulo #ifdef CONFIG_WIFI_DISPLAY
314f05cddf9SRui Paulo 	int wifi_display;
31585732ac8SCy Schubert #define MAX_WFD_SUBELEMS 12
316f05cddf9SRui Paulo 	struct wpabuf *wfd_subelem[MAX_WFD_SUBELEMS];
317f05cddf9SRui Paulo #endif /* CONFIG_WIFI_DISPLAY */
3185b9c547cSRui Paulo 
3195b9c547cSRui Paulo 	struct psk_list_entry *add_psk; /* From group formation */
32039beb93cSSam Leffler };
32139beb93cSSam Leffler 
32239beb93cSSam Leffler 
323f05cddf9SRui Paulo /**
3245b9c547cSRui Paulo  * struct wpa_radio - Internal data for per-radio information
3255b9c547cSRui Paulo  *
3265b9c547cSRui Paulo  * This structure is used to share data about configured interfaces
3275b9c547cSRui Paulo  * (struct wpa_supplicant) that share the same physical radio, e.g., to allow
3285b9c547cSRui Paulo  * better coordination of offchannel operations.
3295b9c547cSRui Paulo  */
3305b9c547cSRui Paulo struct wpa_radio {
3315b9c547cSRui Paulo 	char name[16]; /* from driver_ops get_radio_name() or empty if not
3325b9c547cSRui Paulo 			* available */
333c1d255d3SCy Schubert 	/** NULL if no external scan running. */
334c1d255d3SCy Schubert 	struct wpa_supplicant *external_scan_req_interface;
335780fb4a2SCy Schubert 	unsigned int num_active_works;
3365b9c547cSRui Paulo 	struct dl_list ifaces; /* struct wpa_supplicant::radio_list entries */
3375b9c547cSRui Paulo 	struct dl_list work; /* struct wpa_radio_work::list entries */
3385b9c547cSRui Paulo };
3395b9c547cSRui Paulo 
340c1d255d3SCy Schubert /**
341c1d255d3SCy Schubert  * Checks whether an external scan is running on a given radio.
342c1d255d3SCy Schubert  * @radio: Pointer to radio struct
343c1d255d3SCy Schubert  * Returns: true if an external scan is running, false otherwise.
344c1d255d3SCy Schubert  */
345c1d255d3SCy Schubert static inline bool external_scan_running(struct wpa_radio *radio)
346c1d255d3SCy Schubert {
347c1d255d3SCy Schubert 	return radio && radio->external_scan_req_interface;
348c1d255d3SCy Schubert }
349c1d255d3SCy Schubert 
350780fb4a2SCy Schubert #define MAX_ACTIVE_WORKS 2
351780fb4a2SCy Schubert 
352780fb4a2SCy Schubert 
3535b9c547cSRui Paulo /**
3545b9c547cSRui Paulo  * struct wpa_radio_work - Radio work item
3555b9c547cSRui Paulo  */
3565b9c547cSRui Paulo struct wpa_radio_work {
3575b9c547cSRui Paulo 	struct dl_list list;
3585b9c547cSRui Paulo 	unsigned int freq; /* known frequency (MHz) or 0 for multiple/unknown */
3595b9c547cSRui Paulo 	const char *type;
3605b9c547cSRui Paulo 	struct wpa_supplicant *wpa_s;
3615b9c547cSRui Paulo 	void (*cb)(struct wpa_radio_work *work, int deinit);
3625b9c547cSRui Paulo 	void *ctx;
3635b9c547cSRui Paulo 	unsigned int started:1;
3645b9c547cSRui Paulo 	struct os_reltime time;
365780fb4a2SCy Schubert 	unsigned int bands;
3665b9c547cSRui Paulo };
3675b9c547cSRui Paulo 
3685b9c547cSRui Paulo int radio_add_work(struct wpa_supplicant *wpa_s, unsigned int freq,
3695b9c547cSRui Paulo 		   const char *type, int next,
3705b9c547cSRui Paulo 		   void (*cb)(struct wpa_radio_work *work, int deinit),
3715b9c547cSRui Paulo 		   void *ctx);
3725b9c547cSRui Paulo void radio_work_done(struct wpa_radio_work *work);
3735b9c547cSRui Paulo void radio_remove_works(struct wpa_supplicant *wpa_s,
3745b9c547cSRui Paulo 			const char *type, int remove_all);
37585732ac8SCy Schubert void radio_remove_pending_work(struct wpa_supplicant *wpa_s, void *ctx);
3765b9c547cSRui Paulo void radio_work_check_next(struct wpa_supplicant *wpa_s);
3775b9c547cSRui Paulo struct wpa_radio_work *
3785b9c547cSRui Paulo radio_work_pending(struct wpa_supplicant *wpa_s, const char *type);
3795b9c547cSRui Paulo 
3805b9c547cSRui Paulo struct wpa_connect_work {
3815b9c547cSRui Paulo 	unsigned int sme:1;
3825b9c547cSRui Paulo 	unsigned int bss_removed:1;
3835b9c547cSRui Paulo 	struct wpa_bss *bss;
3845b9c547cSRui Paulo 	struct wpa_ssid *ssid;
3855b9c547cSRui Paulo };
3865b9c547cSRui Paulo 
3875b9c547cSRui Paulo int wpas_valid_bss_ssid(struct wpa_supplicant *wpa_s, struct wpa_bss *test_bss,
3885b9c547cSRui Paulo 			struct wpa_ssid *test_ssid);
3895b9c547cSRui Paulo void wpas_connect_work_free(struct wpa_connect_work *cwork);
3905b9c547cSRui Paulo void wpas_connect_work_done(struct wpa_supplicant *wpa_s);
3915b9c547cSRui Paulo 
3925b9c547cSRui Paulo struct wpa_external_work {
3935b9c547cSRui Paulo 	unsigned int id;
3945b9c547cSRui Paulo 	char type[100];
3955b9c547cSRui Paulo 	unsigned int timeout;
3965b9c547cSRui Paulo };
3975b9c547cSRui Paulo 
398780fb4a2SCy Schubert enum wpa_radio_work_band wpas_freq_to_band(int freq);
399780fb4a2SCy Schubert unsigned int wpas_get_bands(struct wpa_supplicant *wpa_s, const int *freqs);
400780fb4a2SCy Schubert 
4015b9c547cSRui Paulo /**
402f05cddf9SRui Paulo  * offchannel_send_action_result - Result of offchannel send Action frame
403f05cddf9SRui Paulo  */
404f05cddf9SRui Paulo enum offchannel_send_action_result {
405f05cddf9SRui Paulo 	OFFCHANNEL_SEND_ACTION_SUCCESS /**< Frame was send and acknowledged */,
406f05cddf9SRui Paulo 	OFFCHANNEL_SEND_ACTION_NO_ACK /**< Frame was sent, but not acknowledged
407f05cddf9SRui Paulo 				       */,
408f05cddf9SRui Paulo 	OFFCHANNEL_SEND_ACTION_FAILED /**< Frame was not sent due to a failure
409f05cddf9SRui Paulo 				       */
410f05cddf9SRui Paulo };
411f05cddf9SRui Paulo 
412f05cddf9SRui Paulo struct wps_ap_info {
413f05cddf9SRui Paulo 	u8 bssid[ETH_ALEN];
414f05cddf9SRui Paulo 	enum wps_ap_info_type {
415f05cddf9SRui Paulo 		WPS_AP_NOT_SEL_REG,
416f05cddf9SRui Paulo 		WPS_AP_SEL_REG,
417f05cddf9SRui Paulo 		WPS_AP_SEL_REG_OUR
418f05cddf9SRui Paulo 	} type;
419f05cddf9SRui Paulo 	unsigned int tries;
4205b9c547cSRui Paulo 	struct os_reltime last_attempt;
421325151a3SRui Paulo 	unsigned int pbc_active;
422325151a3SRui Paulo 	u8 uuid[WPS_UUID_LEN];
423f05cddf9SRui Paulo };
424f05cddf9SRui Paulo 
4255b9c547cSRui Paulo #define WPA_FREQ_USED_BY_INFRA_STATION BIT(0)
4265b9c547cSRui Paulo #define WPA_FREQ_USED_BY_P2P_CLIENT BIT(1)
4275b9c547cSRui Paulo 
4285b9c547cSRui Paulo struct wpa_used_freq_data {
4295b9c547cSRui Paulo 	int freq;
4305b9c547cSRui Paulo 	unsigned int flags;
4315b9c547cSRui Paulo };
4325b9c547cSRui Paulo 
4335b9c547cSRui Paulo #define RRM_NEIGHBOR_REPORT_TIMEOUT 1 /* 1 second for AP to send a report */
4345b9c547cSRui Paulo 
4355b9c547cSRui Paulo /*
4365b9c547cSRui Paulo  * struct rrm_data - Data used for managing RRM features
4375b9c547cSRui Paulo  */
4385b9c547cSRui Paulo struct rrm_data {
4395b9c547cSRui Paulo 	/* rrm_used - indication regarding the current connection */
4405b9c547cSRui Paulo 	unsigned int rrm_used:1;
4415b9c547cSRui Paulo 
4425b9c547cSRui Paulo 	/*
4435b9c547cSRui Paulo 	 * notify_neighbor_rep - Callback for notifying report requester
4445b9c547cSRui Paulo 	 */
4455b9c547cSRui Paulo 	void (*notify_neighbor_rep)(void *ctx, struct wpabuf *neighbor_rep);
4465b9c547cSRui Paulo 
4475b9c547cSRui Paulo 	/*
4485b9c547cSRui Paulo 	 * neighbor_rep_cb_ctx - Callback context
4495b9c547cSRui Paulo 	 * Received in the callback registration, and sent to the callback
4505b9c547cSRui Paulo 	 * function as a parameter.
4515b9c547cSRui Paulo 	 */
4525b9c547cSRui Paulo 	void *neighbor_rep_cb_ctx;
4535b9c547cSRui Paulo 
4545b9c547cSRui Paulo 	/* next_neighbor_rep_token - Next request's dialog token */
4555b9c547cSRui Paulo 	u8 next_neighbor_rep_token;
45685732ac8SCy Schubert 
45785732ac8SCy Schubert 	/* token - Dialog token of the current radio measurement */
45885732ac8SCy Schubert 	u8 token;
45985732ac8SCy Schubert 
46085732ac8SCy Schubert 	/* destination address of the current radio measurement request */
46185732ac8SCy Schubert 	u8 dst_addr[ETH_ALEN];
4625b9c547cSRui Paulo };
4635b9c547cSRui Paulo 
4645b9c547cSRui Paulo enum wpa_supplicant_test_failure {
4655b9c547cSRui Paulo 	WPAS_TEST_FAILURE_NONE,
4665b9c547cSRui Paulo 	WPAS_TEST_FAILURE_SCAN_TRIGGER,
4675b9c547cSRui Paulo };
4685b9c547cSRui Paulo 
469780fb4a2SCy Schubert struct icon_entry {
470780fb4a2SCy Schubert 	struct dl_list list;
471780fb4a2SCy Schubert 	u8 bssid[ETH_ALEN];
472780fb4a2SCy Schubert 	u8 dialog_token;
473780fb4a2SCy Schubert 	char *file_name;
474780fb4a2SCy Schubert 	u8 *image;
475780fb4a2SCy Schubert 	size_t image_len;
476780fb4a2SCy Schubert };
477780fb4a2SCy Schubert 
478780fb4a2SCy Schubert struct wpa_bss_tmp_disallowed {
479780fb4a2SCy Schubert 	struct dl_list list;
480780fb4a2SCy Schubert 	u8 bssid[ETH_ALEN];
4814bc52338SCy Schubert 	int rssi_threshold;
48285732ac8SCy Schubert };
48385732ac8SCy Schubert 
48485732ac8SCy Schubert struct beacon_rep_data {
48585732ac8SCy Schubert 	u8 token;
4864bc52338SCy Schubert 	u8 last_indication;
48785732ac8SCy Schubert 	struct wpa_driver_scan_params scan_params;
48885732ac8SCy Schubert 	u8 ssid[SSID_MAX_LEN];
48985732ac8SCy Schubert 	size_t ssid_len;
49085732ac8SCy Schubert 	u8 bssid[ETH_ALEN];
49185732ac8SCy Schubert 	enum beacon_report_detail report_detail;
49285732ac8SCy Schubert 	struct bitfield *eids;
49385732ac8SCy Schubert };
49485732ac8SCy Schubert 
49585732ac8SCy Schubert 
49685732ac8SCy Schubert struct external_pmksa_cache {
49785732ac8SCy Schubert 	struct dl_list list;
49885732ac8SCy Schubert 	void *pmksa_cache;
49985732ac8SCy Schubert };
50085732ac8SCy Schubert 
50185732ac8SCy Schubert struct fils_hlp_req {
50285732ac8SCy Schubert 	struct dl_list list;
50385732ac8SCy Schubert 	u8 dst[ETH_ALEN];
50485732ac8SCy Schubert 	struct wpabuf *pkt;
505780fb4a2SCy Schubert };
506780fb4a2SCy Schubert 
507c1d255d3SCy Schubert struct driver_signal_override {
508c1d255d3SCy Schubert 	struct dl_list list;
509c1d255d3SCy Schubert 	u8 bssid[ETH_ALEN];
510c1d255d3SCy Schubert 	int si_current_signal;
511c1d255d3SCy Schubert 	int si_avg_signal;
512c1d255d3SCy Schubert 	int si_avg_beacon_signal;
513c1d255d3SCy Schubert 	int si_current_noise;
514c1d255d3SCy Schubert 	int scan_level;
515c1d255d3SCy Schubert };
516c1d255d3SCy Schubert 
517c1d255d3SCy Schubert struct robust_av_data {
518c1d255d3SCy Schubert 	u8 dialog_token;
519c1d255d3SCy Schubert 	enum scs_request_type request_type;
520c1d255d3SCy Schubert 	u8 up_bitmap;
521c1d255d3SCy Schubert 	u8 up_limit;
522c1d255d3SCy Schubert 	u32 stream_timeout;
523c1d255d3SCy Schubert 	u8 frame_classifier[48];
524c1d255d3SCy Schubert 	size_t frame_classifier_len;
525c1d255d3SCy Schubert 	bool valid_config;
526c1d255d3SCy Schubert };
527c1d255d3SCy Schubert 
5284b72b91aSCy Schubert struct dscp_policy_status {
5294b72b91aSCy Schubert 	u8 id;
5304b72b91aSCy Schubert 	u8 status;
5314b72b91aSCy Schubert };
5324b72b91aSCy Schubert 
5334b72b91aSCy Schubert struct dscp_resp_data {
5344b72b91aSCy Schubert 	bool more;
5354b72b91aSCy Schubert 	bool reset;
5364b72b91aSCy Schubert 	bool solicited;
5374b72b91aSCy Schubert 	struct dscp_policy_status *policy;
5384b72b91aSCy Schubert 	int num_policies;
5394b72b91aSCy Schubert };
5404b72b91aSCy Schubert 
541c1d255d3SCy Schubert #ifdef CONFIG_PASN
542c1d255d3SCy Schubert 
543c1d255d3SCy Schubert struct pasn_fils {
544c1d255d3SCy Schubert 	u8 nonce[FILS_NONCE_LEN];
545c1d255d3SCy Schubert 	u8 anonce[FILS_NONCE_LEN];
546c1d255d3SCy Schubert 	u8 session[FILS_SESSION_LEN];
547c1d255d3SCy Schubert 	u8 erp_pmkid[PMKID_LEN];
548c1d255d3SCy Schubert 	bool completed;
549c1d255d3SCy Schubert };
550c1d255d3SCy Schubert 
551c1d255d3SCy Schubert struct wpas_pasn {
552c1d255d3SCy Schubert 	int akmp;
553c1d255d3SCy Schubert 	int cipher;
554c1d255d3SCy Schubert 	u16 group;
555c1d255d3SCy Schubert 	int freq;
556c1d255d3SCy Schubert 	size_t kdk_len;
557c1d255d3SCy Schubert 
558c1d255d3SCy Schubert 	u8 trans_seq;
559c1d255d3SCy Schubert 	u8 status;
560c1d255d3SCy Schubert 
561c1d255d3SCy Schubert 	u8 bssid[ETH_ALEN];
562c1d255d3SCy Schubert 	size_t pmk_len;
563c1d255d3SCy Schubert 	u8 pmk[PMK_LEN_MAX];
564c1d255d3SCy Schubert 	bool using_pmksa;
565c1d255d3SCy Schubert 
566c1d255d3SCy Schubert 	u8 hash[SHA384_MAC_LEN];
567c1d255d3SCy Schubert 
568c1d255d3SCy Schubert 	struct wpabuf *beacon_rsne_rsnxe;
569c1d255d3SCy Schubert 	struct wpa_ptk ptk;
570c1d255d3SCy Schubert 	struct crypto_ecdh *ecdh;
571c1d255d3SCy Schubert 
572c1d255d3SCy Schubert 	struct wpabuf *comeback;
573c1d255d3SCy Schubert 	u16 comeback_after;
574c1d255d3SCy Schubert 
575c1d255d3SCy Schubert #ifdef CONFIG_SAE
576c1d255d3SCy Schubert 	struct sae_data sae;
577c1d255d3SCy Schubert #endif /* CONFIG_SAE */
578c1d255d3SCy Schubert 
579c1d255d3SCy Schubert 	struct wpa_ssid *ssid;
580c1d255d3SCy Schubert 
581c1d255d3SCy Schubert #ifdef CONFIG_FILS
582c1d255d3SCy Schubert 	struct pasn_fils fils;
583c1d255d3SCy Schubert #endif /* CONFIG_FILS */
584c1d255d3SCy Schubert 
585c1d255d3SCy Schubert #ifdef CONFIG_IEEE80211R
586c1d255d3SCy Schubert 	u8 pmk_r1[PMK_LEN_MAX];
587c1d255d3SCy Schubert 	size_t pmk_r1_len;
588c1d255d3SCy Schubert 	u8 pmk_r1_name[WPA_PMK_NAME_LEN];
589c1d255d3SCy Schubert #endif /* CONFIG_IEEE80211R */
590c1d255d3SCy Schubert };
591c1d255d3SCy Schubert #endif /* CONFIG_PASN */
592c1d255d3SCy Schubert 
5934b72b91aSCy Schubert 
5944b72b91aSCy Schubert enum ip_version {
5954b72b91aSCy Schubert 	IPV4 = 4,
5964b72b91aSCy Schubert 	IPV6 = 6,
5974b72b91aSCy Schubert };
5984b72b91aSCy Schubert 
5994b72b91aSCy Schubert 
6004b72b91aSCy Schubert struct ipv4_params {
6014b72b91aSCy Schubert 	struct in_addr src_ip;
6024b72b91aSCy Schubert 	struct in_addr dst_ip;
6034b72b91aSCy Schubert 	u16 src_port;
6044b72b91aSCy Schubert 	u16 dst_port;
6054b72b91aSCy Schubert 	u8 dscp;
6064b72b91aSCy Schubert 	u8 protocol;
6074b72b91aSCy Schubert 	u8 param_mask;
6084b72b91aSCy Schubert };
6094b72b91aSCy Schubert 
6104b72b91aSCy Schubert 
6114b72b91aSCy Schubert struct ipv6_params {
6124b72b91aSCy Schubert 	struct in6_addr src_ip;
6134b72b91aSCy Schubert 	struct in6_addr dst_ip;
6144b72b91aSCy Schubert 	u16 src_port;
6154b72b91aSCy Schubert 	u16 dst_port;
6164b72b91aSCy Schubert 	u8 dscp;
6174b72b91aSCy Schubert 	u8 next_header;
6184b72b91aSCy Schubert 	u8 flow_label[3];
6194b72b91aSCy Schubert 	u8 param_mask;
6204b72b91aSCy Schubert };
6214b72b91aSCy Schubert 
6224b72b91aSCy Schubert 
6234b72b91aSCy Schubert struct type4_params {
6244b72b91aSCy Schubert 	u8 classifier_mask;
6254b72b91aSCy Schubert 	enum ip_version ip_version;
6264b72b91aSCy Schubert 	union {
6274b72b91aSCy Schubert 		struct ipv4_params v4;
6284b72b91aSCy Schubert 		struct ipv6_params v6;
6294b72b91aSCy Schubert 	} ip_params;
6304b72b91aSCy Schubert };
6314b72b91aSCy Schubert 
6324b72b91aSCy Schubert 
6334b72b91aSCy Schubert struct type10_params {
6344b72b91aSCy Schubert 	u8 prot_instance;
6354b72b91aSCy Schubert 	u8 prot_number;
6364b72b91aSCy Schubert 	u8 *filter_value;
6374b72b91aSCy Schubert 	u8 *filter_mask;
6384b72b91aSCy Schubert 	size_t filter_len;
6394b72b91aSCy Schubert };
6404b72b91aSCy Schubert 
6414b72b91aSCy Schubert 
6424b72b91aSCy Schubert struct tclas_element {
6434b72b91aSCy Schubert 	u8 user_priority;
6444b72b91aSCy Schubert 	u8 classifier_type;
6454b72b91aSCy Schubert 	union {
6464b72b91aSCy Schubert 		struct type4_params type4_param;
6474b72b91aSCy Schubert 		struct type10_params type10_param;
6484b72b91aSCy Schubert 	} frame_classifier;
6494b72b91aSCy Schubert };
6504b72b91aSCy Schubert 
6514b72b91aSCy Schubert 
6524b72b91aSCy Schubert struct scs_desc_elem {
6534b72b91aSCy Schubert 	u8 scs_id;
6544b72b91aSCy Schubert 	enum scs_request_type request_type;
6554b72b91aSCy Schubert 	u8 intra_access_priority;
6564b72b91aSCy Schubert 	bool scs_up_avail;
6574b72b91aSCy Schubert 	struct tclas_element *tclas_elems;
6584b72b91aSCy Schubert 	unsigned int num_tclas_elem;
6594b72b91aSCy Schubert 	u8 tclas_processing;
6604b72b91aSCy Schubert };
6614b72b91aSCy Schubert 
6624b72b91aSCy Schubert 
6634b72b91aSCy Schubert struct scs_robust_av_data {
6644b72b91aSCy Schubert 	struct scs_desc_elem *scs_desc_elems;
6654b72b91aSCy Schubert 	unsigned int num_scs_desc;
6664b72b91aSCy Schubert };
6674b72b91aSCy Schubert 
6684b72b91aSCy Schubert 
6694b72b91aSCy Schubert enum scs_response_status {
6704b72b91aSCy Schubert 	SCS_DESC_SENT = 0,
6714b72b91aSCy Schubert 	SCS_DESC_SUCCESS = 1,
6724b72b91aSCy Schubert };
6734b72b91aSCy Schubert 
6744b72b91aSCy Schubert 
6754b72b91aSCy Schubert struct active_scs_elem {
6764b72b91aSCy Schubert 	struct dl_list list;
6774b72b91aSCy Schubert 	u8 scs_id;
6784b72b91aSCy Schubert 	enum scs_response_status status;
6794b72b91aSCy Schubert };
6804b72b91aSCy Schubert 
6814b72b91aSCy Schubert 
68239beb93cSSam Leffler /**
68339beb93cSSam Leffler  * struct wpa_supplicant - Internal data for wpa_supplicant interface
68439beb93cSSam Leffler  *
68539beb93cSSam Leffler  * This structure contains the internal data for core wpa_supplicant code. This
68639beb93cSSam Leffler  * should be only used directly from the core code. However, a pointer to this
68739beb93cSSam Leffler  * data is used from other files as an arbitrary context pointer in calls to
68839beb93cSSam Leffler  * core functions.
68939beb93cSSam Leffler  */
69039beb93cSSam Leffler struct wpa_supplicant {
69139beb93cSSam Leffler 	struct wpa_global *global;
6925b9c547cSRui Paulo 	struct wpa_radio *radio; /* shared radio context */
6935b9c547cSRui Paulo 	struct dl_list radio_list; /* list head: struct wpa_radio::ifaces */
694f05cddf9SRui Paulo 	struct wpa_supplicant *parent;
695780fb4a2SCy Schubert 	struct wpa_supplicant *p2pdev;
69639beb93cSSam Leffler 	struct wpa_supplicant *next;
69739beb93cSSam Leffler 	struct l2_packet_data *l2;
69839beb93cSSam Leffler 	struct l2_packet_data *l2_br;
6994bc52338SCy Schubert 	struct os_reltime roam_start;
7004bc52338SCy Schubert 	struct os_reltime roam_time;
7014bc52338SCy Schubert 	struct os_reltime session_start;
7024bc52338SCy Schubert 	struct os_reltime session_length;
70339beb93cSSam Leffler 	unsigned char own_addr[ETH_ALEN];
7045b9c547cSRui Paulo 	unsigned char perm_addr[ETH_ALEN];
70539beb93cSSam Leffler 	char ifname[100];
706780fb4a2SCy Schubert #ifdef CONFIG_MATCH_IFACE
707780fb4a2SCy Schubert 	int matched;
708780fb4a2SCy Schubert #endif /* CONFIG_MATCH_IFACE */
709e28a4053SRui Paulo #ifdef CONFIG_CTRL_IFACE_DBUS_NEW
710e28a4053SRui Paulo 	char *dbus_new_path;
711f05cddf9SRui Paulo 	char *dbus_groupobj_path;
712f05cddf9SRui Paulo #ifdef CONFIG_AP
713f05cddf9SRui Paulo 	char *preq_notify_peer;
714f05cddf9SRui Paulo #endif /* CONFIG_AP */
715e28a4053SRui Paulo #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
716780fb4a2SCy Schubert #ifdef CONFIG_CTRL_IFACE_BINDER
717780fb4a2SCy Schubert 	const void *binder_object_key;
718780fb4a2SCy Schubert #endif /* CONFIG_CTRL_IFACE_BINDER */
71939beb93cSSam Leffler 	char bridge_ifname[16];
72039beb93cSSam Leffler 
72139beb93cSSam Leffler 	char *confname;
7225b9c547cSRui Paulo 	char *confanother;
7235b9c547cSRui Paulo 
72439beb93cSSam Leffler 	struct wpa_config *conf;
72539beb93cSSam Leffler 	int countermeasures;
7265b9c547cSRui Paulo 	struct os_reltime last_michael_mic_error;
72739beb93cSSam Leffler 	u8 bssid[ETH_ALEN];
72839beb93cSSam Leffler 	u8 pending_bssid[ETH_ALEN]; /* If wpa_state == WPA_ASSOCIATING, this
729f05cddf9SRui Paulo 				     * field contains the target BSSID. */
73039beb93cSSam Leffler 	int reassociate; /* reassociation requested */
731c1d255d3SCy Schubert 	bool roam_in_progress; /* roam in progress */
732780fb4a2SCy Schubert 	unsigned int reassoc_same_bss:1; /* reassociating to the same BSS */
733780fb4a2SCy Schubert 	unsigned int reassoc_same_ess:1; /* reassociating to the same ESS */
73439beb93cSSam Leffler 	int disconnected; /* all connections disabled; i.e., do no reassociate
73539beb93cSSam Leffler 			   * before this has been cleared */
73639beb93cSSam Leffler 	struct wpa_ssid *current_ssid;
7375b9c547cSRui Paulo 	struct wpa_ssid *last_ssid;
738e28a4053SRui Paulo 	struct wpa_bss *current_bss;
73939beb93cSSam Leffler 	int ap_ies_from_associnfo;
740e28a4053SRui Paulo 	unsigned int assoc_freq;
74185732ac8SCy Schubert 	u8 *last_con_fail_realm;
74285732ac8SCy Schubert 	size_t last_con_fail_realm_len;
74339beb93cSSam Leffler 
74439beb93cSSam Leffler 	/* Selected configuration (based on Beacon/ProbeResp WPA IE) */
74539beb93cSSam Leffler 	int pairwise_cipher;
746c1d255d3SCy Schubert 	int deny_ptk0_rekey;
74739beb93cSSam Leffler 	int group_cipher;
74839beb93cSSam Leffler 	int key_mgmt;
749f05cddf9SRui Paulo 	int wpa_proto;
75039beb93cSSam Leffler 	int mgmt_group_cipher;
75139beb93cSSam Leffler 
75239beb93cSSam Leffler 	void *drv_priv; /* private data used by driver_ops */
7533157ba21SRui Paulo 	void *global_drv_priv;
75439beb93cSSam Leffler 
755f05cddf9SRui Paulo 	u8 *bssid_filter;
756f05cddf9SRui Paulo 	size_t bssid_filter_count;
757f05cddf9SRui Paulo 
758f05cddf9SRui Paulo 	u8 *disallow_aps_bssid;
759f05cddf9SRui Paulo 	size_t disallow_aps_bssid_count;
760f05cddf9SRui Paulo 	struct wpa_ssid_value *disallow_aps_ssid;
761f05cddf9SRui Paulo 	size_t disallow_aps_ssid_count;
762f05cddf9SRui Paulo 
763c1d255d3SCy Schubert 	u32 setband_mask;
7645b9c547cSRui Paulo 
7655b9c547cSRui Paulo 	/* Preferred network for the next connection attempt */
7665b9c547cSRui Paulo 	struct wpa_ssid *next_ssid;
7675b9c547cSRui Paulo 
768f05cddf9SRui Paulo 	/* previous scan was wildcard when interleaving between
769f05cddf9SRui Paulo 	 * wildcard scans and specific SSID scan when max_ssids=1 */
770f05cddf9SRui Paulo 	int prev_scan_wildcard;
77139beb93cSSam Leffler 	struct wpa_ssid *prev_scan_ssid; /* previously scanned SSID;
77239beb93cSSam Leffler 					  * NULL = not yet initialized (start
773e28a4053SRui Paulo 					  * with wildcard SSID)
774e28a4053SRui Paulo 					  * WILDCARD_SSID_SCAN = wildcard
77539beb93cSSam Leffler 					  * SSID was used in the previous scan
77639beb93cSSam Leffler 					  */
777e28a4053SRui Paulo #define WILDCARD_SSID_SCAN ((struct wpa_ssid *) 1)
77839beb93cSSam Leffler 
779f05cddf9SRui Paulo 	struct wpa_ssid *prev_sched_ssid; /* last SSID used in sched scan */
780f05cddf9SRui Paulo 	int sched_scan_timeout;
781f05cddf9SRui Paulo 	int first_sched_scan;
782f05cddf9SRui Paulo 	int sched_scan_timed_out;
783780fb4a2SCy Schubert 	struct sched_scan_plan *sched_scan_plans;
784780fb4a2SCy Schubert 	size_t sched_scan_plans_num;
785f05cddf9SRui Paulo 
786e28a4053SRui Paulo 	void (*scan_res_handler)(struct wpa_supplicant *wpa_s,
787e28a4053SRui Paulo 				 struct wpa_scan_results *scan_res);
788c1d255d3SCy Schubert 	void (*scan_res_fail_handler)(struct wpa_supplicant *wpa_s);
789e28a4053SRui Paulo 	struct dl_list bss; /* struct wpa_bss::list */
790e28a4053SRui Paulo 	struct dl_list bss_id; /* struct wpa_bss::list_id */
791e28a4053SRui Paulo 	size_t num_bss;
792e28a4053SRui Paulo 	unsigned int bss_update_idx;
793e28a4053SRui Paulo 	unsigned int bss_next_id;
79439beb93cSSam Leffler 
795f05cddf9SRui Paulo 	 /*
796f05cddf9SRui Paulo 	  * Pointers to BSS entries in the order they were in the last scan
797f05cddf9SRui Paulo 	  * results.
798f05cddf9SRui Paulo 	  */
799f05cddf9SRui Paulo 	struct wpa_bss **last_scan_res;
800c1d255d3SCy Schubert 	size_t last_scan_res_used;
801c1d255d3SCy Schubert 	size_t last_scan_res_size;
8025b9c547cSRui Paulo 	struct os_reltime last_scan;
803f05cddf9SRui Paulo 
804325151a3SRui Paulo 	const struct wpa_driver_ops *driver;
80539beb93cSSam Leffler 	int interface_removed; /* whether the network interface has been
80639beb93cSSam Leffler 				* removed */
80739beb93cSSam Leffler 	struct wpa_sm *wpa;
808c1d255d3SCy Schubert 	struct ptksa_cache *ptksa;
809c1d255d3SCy Schubert 
81039beb93cSSam Leffler 	struct eapol_sm *eapol;
81139beb93cSSam Leffler 
81239beb93cSSam Leffler 	struct ctrl_iface_priv *ctrl_iface;
81339beb93cSSam Leffler 
814e28a4053SRui Paulo 	enum wpa_states wpa_state;
8155b9c547cSRui Paulo 	struct wpa_radio_work *scan_work;
8163157ba21SRui Paulo 	int scanning;
817f05cddf9SRui Paulo 	int sched_scanning;
818780fb4a2SCy Schubert 	unsigned int sched_scan_stop_req:1;
81939beb93cSSam Leffler 	int new_connection;
82039beb93cSSam Leffler 
82139beb93cSSam Leffler 	int eapol_received; /* number of EAPOL packets received after the
82239beb93cSSam Leffler 			     * previous association event */
82339beb93cSSam Leffler 
824c1d255d3SCy Schubert 	u8 rsnxe[20];
825c1d255d3SCy Schubert 	size_t rsnxe_len;
826c1d255d3SCy Schubert 
82739beb93cSSam Leffler 	struct scard_data *scard;
828f05cddf9SRui Paulo 	char imsi[20];
829f05cddf9SRui Paulo 	int mnc_len;
83039beb93cSSam Leffler 
83139beb93cSSam Leffler 	unsigned char last_eapol_src[ETH_ALEN];
83239beb93cSSam Leffler 
8335b9c547cSRui Paulo 	unsigned int keys_cleared; /* bitfield of key indexes that the driver is
8345b9c547cSRui Paulo 				    * known not to be configured with a key */
83539beb93cSSam Leffler 
836c1d255d3SCy Schubert 	struct wpa_bssid_ignore *bssid_ignore;
83739beb93cSSam Leffler 
838c1d255d3SCy Schubert 	/* Number of connection failures since last successful connection */
839c1d255d3SCy Schubert 	unsigned int consecutive_conn_failures;
84039beb93cSSam Leffler 
841f05cddf9SRui Paulo 	/**
842f05cddf9SRui Paulo 	 * scan_req - Type of the scan request
843f05cddf9SRui Paulo 	 */
844f05cddf9SRui Paulo 	enum scan_req_type {
845f05cddf9SRui Paulo 		/**
846f05cddf9SRui Paulo 		 * NORMAL_SCAN_REQ - Normal scan request
847f05cddf9SRui Paulo 		 *
848f05cddf9SRui Paulo 		 * This is used for scans initiated by wpa_supplicant to find an
849f05cddf9SRui Paulo 		 * AP for a connection.
850f05cddf9SRui Paulo 		 */
851f05cddf9SRui Paulo 		NORMAL_SCAN_REQ,
852f05cddf9SRui Paulo 
853f05cddf9SRui Paulo 		/**
854f05cddf9SRui Paulo 		 * INITIAL_SCAN_REQ - Initial scan request
855f05cddf9SRui Paulo 		 *
856f05cddf9SRui Paulo 		 * This is used for the first scan on an interface to force at
857f05cddf9SRui Paulo 		 * least one scan to be run even if the configuration does not
858f05cddf9SRui Paulo 		 * include any enabled networks.
859f05cddf9SRui Paulo 		 */
860f05cddf9SRui Paulo 		INITIAL_SCAN_REQ,
861f05cddf9SRui Paulo 
862f05cddf9SRui Paulo 		/**
863f05cddf9SRui Paulo 		 * MANUAL_SCAN_REQ - Manual scan request
864f05cddf9SRui Paulo 		 *
865f05cddf9SRui Paulo 		 * This is used for scans where the user request a scan or
866f05cddf9SRui Paulo 		 * a specific wpa_supplicant operation (e.g., WPS) requires scan
867f05cddf9SRui Paulo 		 * to be run.
868f05cddf9SRui Paulo 		 */
869f05cddf9SRui Paulo 		MANUAL_SCAN_REQ
8705b9c547cSRui Paulo 	} scan_req, last_scan_req;
8715b9c547cSRui Paulo 	enum wpa_states scan_prev_wpa_state;
8725b9c547cSRui Paulo 	struct os_reltime scan_trigger_time, scan_start_time;
873325151a3SRui Paulo 	/* Minimum freshness requirement for connection purposes */
874325151a3SRui Paulo 	struct os_reltime scan_min_time;
875f05cddf9SRui Paulo 	int scan_runs; /* number of scan runs since WPS was started */
876f05cddf9SRui Paulo 	int *next_scan_freqs;
87785732ac8SCy Schubert 	int *select_network_scan_freqs;
8785b9c547cSRui Paulo 	int *manual_scan_freqs;
8795b9c547cSRui Paulo 	int *manual_sched_scan_freqs;
8805b9c547cSRui Paulo 	unsigned int manual_scan_passive:1;
8815b9c547cSRui Paulo 	unsigned int manual_scan_use_id:1;
8825b9c547cSRui Paulo 	unsigned int manual_scan_only_new:1;
8835b9c547cSRui Paulo 	unsigned int own_scan_requested:1;
8845b9c547cSRui Paulo 	unsigned int own_scan_running:1;
8855b9c547cSRui Paulo 	unsigned int clear_driver_scan_cache:1;
8865b9c547cSRui Paulo 	unsigned int manual_scan_id;
887f05cddf9SRui Paulo 	int scan_interval; /* time in sec between scans to find suitable AP */
888f05cddf9SRui Paulo 	int normal_scans; /* normal scans run before sched_scan */
889f05cddf9SRui Paulo 	int scan_for_connection; /* whether the scan request was triggered for
890f05cddf9SRui Paulo 				  * finding a connection */
89185732ac8SCy Schubert 	/*
89285732ac8SCy Schubert 	 * A unique cookie representing the vendor scan request. This cookie is
89385732ac8SCy Schubert 	 * returned from the driver interface. 0 indicates that there is no
89485732ac8SCy Schubert 	 * pending vendor scan request.
89585732ac8SCy Schubert 	 */
89685732ac8SCy Schubert 	u64 curr_scan_cookie;
8975b9c547cSRui Paulo #define MAX_SCAN_ID 16
8985b9c547cSRui Paulo 	int scan_id[MAX_SCAN_ID];
8995b9c547cSRui Paulo 	unsigned int scan_id_count;
900780fb4a2SCy Schubert 	u8 next_scan_bssid[ETH_ALEN];
901c1d255d3SCy Schubert 	unsigned int next_scan_bssid_wildcard_ssid:1;
902f05cddf9SRui Paulo 
903325151a3SRui Paulo 	struct wpa_ssid_value *ssids_from_scan_req;
904325151a3SRui Paulo 	unsigned int num_ssids_from_scan_req;
905c1d255d3SCy Schubert 	int *last_scan_freqs;
906c1d255d3SCy Schubert 	unsigned int num_last_scan_freqs;
907c1d255d3SCy Schubert 	unsigned int suitable_network;
908c1d255d3SCy Schubert 	unsigned int no_suitable_network;
909325151a3SRui Paulo 
9105b9c547cSRui Paulo 	u64 drv_flags;
911c1d255d3SCy Schubert 	u64 drv_flags2;
912f05cddf9SRui Paulo 	unsigned int drv_enc;
9135b9c547cSRui Paulo 	unsigned int drv_rrm_flags;
914f05cddf9SRui Paulo 
915f05cddf9SRui Paulo 	/*
916f05cddf9SRui Paulo 	 * A bitmap of supported protocols for probe response offload. See
917f05cddf9SRui Paulo 	 * struct wpa_driver_capa in driver.h
918f05cddf9SRui Paulo 	 */
919f05cddf9SRui Paulo 	unsigned int probe_resp_offloads;
920f05cddf9SRui Paulo 
9215b9c547cSRui Paulo 	/* extended capabilities supported by the driver */
9225b9c547cSRui Paulo 	const u8 *extended_capa, *extended_capa_mask;
9235b9c547cSRui Paulo 	unsigned int extended_capa_len;
9245b9c547cSRui Paulo 
925e28a4053SRui Paulo 	int max_scan_ssids;
926f05cddf9SRui Paulo 	int max_sched_scan_ssids;
927780fb4a2SCy Schubert 	unsigned int max_sched_scan_plans;
928780fb4a2SCy Schubert 	unsigned int max_sched_scan_plan_interval;
929780fb4a2SCy Schubert 	unsigned int max_sched_scan_plan_iterations;
930f05cddf9SRui Paulo 	int sched_scan_supported;
931f05cddf9SRui Paulo 	unsigned int max_match_sets;
932e28a4053SRui Paulo 	unsigned int max_remain_on_chan;
933f05cddf9SRui Paulo 	unsigned int max_stations;
93439beb93cSSam Leffler 
93539beb93cSSam Leffler 	int pending_mic_error_report;
93639beb93cSSam Leffler 	int pending_mic_error_pairwise;
93739beb93cSSam Leffler 	int mic_errors_seen; /* Michael MIC errors with the current PTK */
93839beb93cSSam Leffler 
93939beb93cSSam Leffler 	struct wps_context *wps;
94039beb93cSSam Leffler 	int wps_success; /* WPS success event received */
941e28a4053SRui Paulo 	struct wps_er *wps_er;
9425b9c547cSRui Paulo 	unsigned int wps_run;
943325151a3SRui Paulo 	struct os_reltime wps_pin_start_time;
944c1d255d3SCy Schubert 	bool bssid_ignore_cleared;
9453157ba21SRui Paulo 
9463157ba21SRui Paulo 	struct wpabuf *pending_eapol_rx;
9475b9c547cSRui Paulo 	struct os_reltime pending_eapol_rx_time;
9483157ba21SRui Paulo 	u8 pending_eapol_rx_src[ETH_ALEN];
949f05cddf9SRui Paulo 	unsigned int last_eapol_matches_bssid:1;
9505b9c547cSRui Paulo 	unsigned int eap_expected_failure:1;
9515b9c547cSRui Paulo 	unsigned int reattach:1; /* reassociation to the same BSS requested */
9525b9c547cSRui Paulo 	unsigned int mac_addr_changed:1;
953325151a3SRui Paulo 	unsigned int added_vif:1;
954a2063804SGordon Tetlow 	unsigned int wnmsleep_used:1;
95585732ac8SCy Schubert 	unsigned int owe_transition_select:1;
95685732ac8SCy Schubert 	unsigned int owe_transition_search:1;
9574bc52338SCy Schubert 	unsigned int connection_set:1;
9584bc52338SCy Schubert 	unsigned int connection_ht:1;
9594bc52338SCy Schubert 	unsigned int connection_vht:1;
9604bc52338SCy Schubert 	unsigned int connection_he:1;
961c1d255d3SCy Schubert 	unsigned int disable_mbo_oce:1;
9625b9c547cSRui Paulo 
9635b9c547cSRui Paulo 	struct os_reltime last_mac_addr_change;
9645b9c547cSRui Paulo 	int last_mac_addr_style;
965e28a4053SRui Paulo 
966e28a4053SRui Paulo 	struct ibss_rsn *ibss_rsn;
967e28a4053SRui Paulo 
968f05cddf9SRui Paulo 	int set_sta_uapsd;
969f05cddf9SRui Paulo 	int sta_uapsd;
970f05cddf9SRui Paulo 	int set_ap_uapsd;
971f05cddf9SRui Paulo 	int ap_uapsd;
97285732ac8SCy Schubert 	int auth_alg;
97385732ac8SCy Schubert 	u16 last_owe_group;
974f05cddf9SRui Paulo 
975e28a4053SRui Paulo #ifdef CONFIG_SME
976e28a4053SRui Paulo 	struct {
977325151a3SRui Paulo 		u8 ssid[SSID_MAX_LEN];
978e28a4053SRui Paulo 		size_t ssid_len;
979e28a4053SRui Paulo 		int freq;
98085732ac8SCy Schubert 		u8 assoc_req_ie[1500];
981e28a4053SRui Paulo 		size_t assoc_req_ie_len;
982e28a4053SRui Paulo 		int mfp;
983e28a4053SRui Paulo 		int ft_used;
984e28a4053SRui Paulo 		u8 mobility_domain[2];
985e28a4053SRui Paulo 		u8 *ft_ies;
986e28a4053SRui Paulo 		size_t ft_ies_len;
987e28a4053SRui Paulo 		u8 prev_bssid[ETH_ALEN];
988e28a4053SRui Paulo 		int prev_bssid_set;
989e28a4053SRui Paulo 		int auth_alg;
990f05cddf9SRui Paulo 		int proto;
991f05cddf9SRui Paulo 
992f05cddf9SRui Paulo 		int sa_query_count; /* number of pending SA Query requests;
993f05cddf9SRui Paulo 				     * 0 = no SA Query in progress */
994f05cddf9SRui Paulo 		int sa_query_timed_out;
995f05cddf9SRui Paulo 		u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN *
996f05cddf9SRui Paulo 					* sa_query_count octets of pending
997f05cddf9SRui Paulo 					* SA Query transaction identifiers */
9985b9c547cSRui Paulo 		struct os_reltime sa_query_start;
9995b9c547cSRui Paulo 		struct os_reltime last_unprot_disconnect;
10005b9c547cSRui Paulo 		enum { HT_SEC_CHAN_UNKNOWN,
10015b9c547cSRui Paulo 		       HT_SEC_CHAN_ABOVE,
10025b9c547cSRui Paulo 		       HT_SEC_CHAN_BELOW } ht_sec_chan;
1003f05cddf9SRui Paulo 		u8 sched_obss_scan;
1004f05cddf9SRui Paulo 		u16 obss_scan_int;
1005f05cddf9SRui Paulo 		u16 bss_max_idle_period;
10065b9c547cSRui Paulo #ifdef CONFIG_SAE
10075b9c547cSRui Paulo 		struct sae_data sae;
10085b9c547cSRui Paulo 		struct wpabuf *sae_token;
10095b9c547cSRui Paulo 		int sae_group_index;
10105b9c547cSRui Paulo 		unsigned int sae_pmksa_caching:1;
101185732ac8SCy Schubert 		u16 seq_num;
1012206b73d0SCy Schubert 		u8 ext_auth_bssid[ETH_ALEN];
1013206b73d0SCy Schubert 		u8 ext_auth_ssid[SSID_MAX_LEN];
1014206b73d0SCy Schubert 		size_t ext_auth_ssid_len;
1015c1d255d3SCy Schubert 		int *sae_rejected_groups;
10165b9c547cSRui Paulo #endif /* CONFIG_SAE */
1017e28a4053SRui Paulo 	} sme;
1018e28a4053SRui Paulo #endif /* CONFIG_SME */
1019e28a4053SRui Paulo 
1020e28a4053SRui Paulo #ifdef CONFIG_AP
1021e28a4053SRui Paulo 	struct hostapd_iface *ap_iface;
1022e28a4053SRui Paulo 	void (*ap_configured_cb)(void *ctx, void *data);
1023e28a4053SRui Paulo 	void *ap_configured_cb_ctx;
1024e28a4053SRui Paulo 	void *ap_configured_cb_data;
1025e28a4053SRui Paulo #endif /* CONFIG_AP */
1026e28a4053SRui Paulo 
10275b9c547cSRui Paulo 	struct hostapd_iface *ifmsh;
10285b9c547cSRui Paulo #ifdef CONFIG_MESH
10295b9c547cSRui Paulo 	struct mesh_rsn *mesh_rsn;
10305b9c547cSRui Paulo 	int mesh_if_idx;
10315b9c547cSRui Paulo 	unsigned int mesh_if_created:1;
10325b9c547cSRui Paulo 	unsigned int mesh_ht_enabled:1;
1033780fb4a2SCy Schubert 	unsigned int mesh_vht_enabled:1;
1034206b73d0SCy Schubert 	unsigned int mesh_he_enabled:1;
10354bc52338SCy Schubert 	struct wpa_driver_mesh_join_params *mesh_params;
103685732ac8SCy Schubert #ifdef CONFIG_PMKSA_CACHE_EXTERNAL
103785732ac8SCy Schubert 	/* struct external_pmksa_cache::list */
103885732ac8SCy Schubert 	struct dl_list mesh_external_pmksa_cache;
103985732ac8SCy Schubert #endif /* CONFIG_PMKSA_CACHE_EXTERNAL */
10405b9c547cSRui Paulo #endif /* CONFIG_MESH */
10415b9c547cSRui Paulo 
1042f05cddf9SRui Paulo 	unsigned int off_channel_freq;
1043f05cddf9SRui Paulo 	struct wpabuf *pending_action_tx;
1044f05cddf9SRui Paulo 	u8 pending_action_src[ETH_ALEN];
1045f05cddf9SRui Paulo 	u8 pending_action_dst[ETH_ALEN];
1046f05cddf9SRui Paulo 	u8 pending_action_bssid[ETH_ALEN];
1047f05cddf9SRui Paulo 	unsigned int pending_action_freq;
1048f05cddf9SRui Paulo 	int pending_action_no_cck;
1049f05cddf9SRui Paulo 	int pending_action_without_roc;
10505b9c547cSRui Paulo 	unsigned int pending_action_tx_done:1;
1051f05cddf9SRui Paulo 	void (*pending_action_tx_status_cb)(struct wpa_supplicant *wpa_s,
1052f05cddf9SRui Paulo 					    unsigned int freq, const u8 *dst,
1053f05cddf9SRui Paulo 					    const u8 *src, const u8 *bssid,
1054f05cddf9SRui Paulo 					    const u8 *data, size_t data_len,
1055f05cddf9SRui Paulo 					    enum offchannel_send_action_result
1056f05cddf9SRui Paulo 					    result);
1057f05cddf9SRui Paulo 	unsigned int roc_waiting_drv_freq;
1058f05cddf9SRui Paulo 	int action_tx_wait_time;
105985732ac8SCy Schubert 	int action_tx_wait_time_used;
1060f05cddf9SRui Paulo 
10615b9c547cSRui Paulo 	int p2p_mgmt;
10625b9c547cSRui Paulo 
1063f05cddf9SRui Paulo #ifdef CONFIG_P2P
1064f05cddf9SRui Paulo 	struct p2p_go_neg_results *go_params;
1065f05cddf9SRui Paulo 	int create_p2p_iface;
1066f05cddf9SRui Paulo 	u8 pending_interface_addr[ETH_ALEN];
1067f05cddf9SRui Paulo 	char pending_interface_name[100];
1068f05cddf9SRui Paulo 	int pending_interface_type;
1069f05cddf9SRui Paulo 	int p2p_group_idx;
1070f05cddf9SRui Paulo 	unsigned int pending_listen_freq;
1071f05cddf9SRui Paulo 	unsigned int pending_listen_duration;
1072f05cddf9SRui Paulo 	enum {
1073f05cddf9SRui Paulo 		NOT_P2P_GROUP_INTERFACE,
1074f05cddf9SRui Paulo 		P2P_GROUP_INTERFACE_PENDING,
1075f05cddf9SRui Paulo 		P2P_GROUP_INTERFACE_GO,
1076f05cddf9SRui Paulo 		P2P_GROUP_INTERFACE_CLIENT
1077f05cddf9SRui Paulo 	} p2p_group_interface;
1078f05cddf9SRui Paulo 	struct p2p_group *p2p_group;
1079f05cddf9SRui Paulo 	char p2p_pin[10];
1080f05cddf9SRui Paulo 	int p2p_wps_method;
1081f05cddf9SRui Paulo 	u8 p2p_auth_invite[ETH_ALEN];
1082f05cddf9SRui Paulo 	int p2p_sd_over_ctrl_iface;
1083f05cddf9SRui Paulo 	int p2p_in_provisioning;
10845b9c547cSRui Paulo 	int p2p_in_invitation;
10855b9c547cSRui Paulo 	int p2p_invite_go_freq;
1086f05cddf9SRui Paulo 	int pending_invite_ssid_id;
1087f05cddf9SRui Paulo 	int show_group_started;
1088f05cddf9SRui Paulo 	u8 go_dev_addr[ETH_ALEN];
1089f05cddf9SRui Paulo 	int pending_pd_before_join;
1090f05cddf9SRui Paulo 	u8 pending_join_iface_addr[ETH_ALEN];
1091f05cddf9SRui Paulo 	u8 pending_join_dev_addr[ETH_ALEN];
1092f05cddf9SRui Paulo 	int pending_join_wps_method;
1093325151a3SRui Paulo 	u8 p2p_join_ssid[SSID_MAX_LEN];
10945b9c547cSRui Paulo 	size_t p2p_join_ssid_len;
1095f05cddf9SRui Paulo 	int p2p_join_scan_count;
1096f05cddf9SRui Paulo 	int auto_pd_scan_retry;
1097f05cddf9SRui Paulo 	int force_long_sd;
1098f05cddf9SRui Paulo 	u16 pending_pd_config_methods;
1099f05cddf9SRui Paulo 	enum {
11005b9c547cSRui Paulo 		NORMAL_PD, AUTO_PD_GO_NEG, AUTO_PD_JOIN, AUTO_PD_ASP
1101f05cddf9SRui Paulo 	} pending_pd_use;
1102f05cddf9SRui Paulo 
1103f05cddf9SRui Paulo 	/*
1104f05cddf9SRui Paulo 	 * Whether cross connection is disallowed by the AP to which this
1105f05cddf9SRui Paulo 	 * interface is associated (only valid if there is an association).
1106f05cddf9SRui Paulo 	 */
1107f05cddf9SRui Paulo 	int cross_connect_disallowed;
1108f05cddf9SRui Paulo 
1109f05cddf9SRui Paulo 	/*
1110f05cddf9SRui Paulo 	 * Whether this P2P group is configured to use cross connection (only
1111f05cddf9SRui Paulo 	 * valid if this is P2P GO interface). The actual cross connect packet
1112f05cddf9SRui Paulo 	 * forwarding may not be configured depending on the uplink status.
1113f05cddf9SRui Paulo 	 */
1114f05cddf9SRui Paulo 	int cross_connect_enabled;
1115f05cddf9SRui Paulo 
1116f05cddf9SRui Paulo 	/* Whether cross connection forwarding is in use at the moment. */
1117f05cddf9SRui Paulo 	int cross_connect_in_use;
1118f05cddf9SRui Paulo 
1119f05cddf9SRui Paulo 	/*
1120f05cddf9SRui Paulo 	 * Uplink interface name for cross connection
1121f05cddf9SRui Paulo 	 */
1122f05cddf9SRui Paulo 	char cross_connect_uplink[100];
1123f05cddf9SRui Paulo 
1124f05cddf9SRui Paulo 	unsigned int p2p_auto_join:1;
1125f05cddf9SRui Paulo 	unsigned int p2p_auto_pd:1;
112685732ac8SCy Schubert 	unsigned int p2p_go_do_acs:1;
1127f05cddf9SRui Paulo 	unsigned int p2p_persistent_group:1;
1128f05cddf9SRui Paulo 	unsigned int p2p_fallback_to_go_neg:1;
1129f05cddf9SRui Paulo 	unsigned int p2p_pd_before_go_neg:1;
1130f05cddf9SRui Paulo 	unsigned int p2p_go_ht40:1;
11315b9c547cSRui Paulo 	unsigned int p2p_go_vht:1;
1132c1d255d3SCy Schubert 	unsigned int p2p_go_edmg:1;
11334bc52338SCy Schubert 	unsigned int p2p_go_he:1;
1134f05cddf9SRui Paulo 	unsigned int user_initiated_pd:1;
11355b9c547cSRui Paulo 	unsigned int p2p_go_group_formation_completed:1;
11365b9c547cSRui Paulo 	unsigned int group_formation_reported:1;
11375b9c547cSRui Paulo 	unsigned int waiting_presence_resp;
11385b9c547cSRui Paulo 	int p2p_first_connection_timeout;
11395b9c547cSRui Paulo 	unsigned int p2p_nfc_tag_enabled:1;
11405b9c547cSRui Paulo 	unsigned int p2p_peer_oob_pk_hash_known:1;
11415b9c547cSRui Paulo 	unsigned int p2p_disable_ip_addr_req:1;
1142325151a3SRui Paulo 	unsigned int p2ps_method_config_any:1;
1143325151a3SRui Paulo 	unsigned int p2p_cli_probe:1;
11444b72b91aSCy Schubert 	unsigned int p2p_go_allow_dfs:1;
114585732ac8SCy Schubert 	enum hostapd_hw_mode p2p_go_acs_band;
1146f05cddf9SRui Paulo 	int p2p_persistent_go_freq;
1147f05cddf9SRui Paulo 	int p2p_persistent_id;
1148f05cddf9SRui Paulo 	int p2p_go_intent;
1149f05cddf9SRui Paulo 	int p2p_connect_freq;
11505b9c547cSRui Paulo 	struct os_reltime p2p_auto_started;
11515b9c547cSRui Paulo 	struct wpa_ssid *p2p_last_4way_hs_fail;
11525b9c547cSRui Paulo 	struct wpa_radio_work *p2p_scan_work;
11535b9c547cSRui Paulo 	struct wpa_radio_work *p2p_listen_work;
11545b9c547cSRui Paulo 	struct wpa_radio_work *p2p_send_action_work;
11555b9c547cSRui Paulo 
11565b9c547cSRui Paulo 	u16 p2p_oob_dev_pw_id; /* OOB Device Password Id for group formation */
11575b9c547cSRui Paulo 	struct wpabuf *p2p_oob_dev_pw; /* OOB Device Password for group
11585b9c547cSRui Paulo 					* formation */
11595b9c547cSRui Paulo 	u8 p2p_peer_oob_pubkey_hash[WPS_OOB_PUBKEY_HASH_LEN];
11605b9c547cSRui Paulo 	u8 p2p_ip_addr_info[3 * 4];
11615b9c547cSRui Paulo 
11625b9c547cSRui Paulo 	/* group common frequencies */
11635b9c547cSRui Paulo 	int *p2p_group_common_freqs;
11645b9c547cSRui Paulo 	unsigned int p2p_group_common_freqs_num;
11655b9c547cSRui Paulo 	u8 p2ps_join_addr[ETH_ALEN];
1166780fb4a2SCy Schubert 
1167780fb4a2SCy Schubert 	unsigned int p2p_go_max_oper_chwidth;
1168780fb4a2SCy Schubert 	unsigned int p2p_go_vht_center_freq2;
1169780fb4a2SCy Schubert 	int p2p_lo_started;
1170f05cddf9SRui Paulo #endif /* CONFIG_P2P */
1171f05cddf9SRui Paulo 
1172e28a4053SRui Paulo 	struct wpa_ssid *bgscan_ssid;
1173e28a4053SRui Paulo 	const struct bgscan_ops *bgscan;
1174e28a4053SRui Paulo 	void *bgscan_priv;
1175e28a4053SRui Paulo 
1176f05cddf9SRui Paulo 	const struct autoscan_ops *autoscan;
1177f05cddf9SRui Paulo 	struct wpa_driver_scan_params *autoscan_params;
1178f05cddf9SRui Paulo 	void *autoscan_priv;
1179f05cddf9SRui Paulo 
1180f05cddf9SRui Paulo 	struct wpa_ssid *connect_without_scan;
1181f05cddf9SRui Paulo 
1182f05cddf9SRui Paulo 	struct wps_ap_info *wps_ap;
1183f05cddf9SRui Paulo 	size_t num_wps_ap;
1184f05cddf9SRui Paulo 	int wps_ap_iter;
1185e28a4053SRui Paulo 
1186e28a4053SRui Paulo 	int after_wps;
1187f05cddf9SRui Paulo 	int known_wps_freq;
1188e28a4053SRui Paulo 	unsigned int wps_freq;
1189f05cddf9SRui Paulo 	int wps_fragment_size;
1190f05cddf9SRui Paulo 	int auto_reconnect_disabled;
1191f05cddf9SRui Paulo 
1192f05cddf9SRui Paulo 	 /* Channel preferences for AP/P2P GO use */
1193f05cddf9SRui Paulo 	int best_24_freq;
1194f05cddf9SRui Paulo 	int best_5_freq;
1195f05cddf9SRui Paulo 	int best_overall_freq;
1196f05cddf9SRui Paulo 
1197f05cddf9SRui Paulo 	struct gas_query *gas;
119885732ac8SCy Schubert 	struct gas_server *gas_server;
1199f05cddf9SRui Paulo 
1200f05cddf9SRui Paulo #ifdef CONFIG_INTERWORKING
1201f05cddf9SRui Paulo 	unsigned int fetch_anqp_in_progress:1;
1202f05cddf9SRui Paulo 	unsigned int network_select:1;
1203f05cddf9SRui Paulo 	unsigned int auto_select:1;
1204f05cddf9SRui Paulo 	unsigned int auto_network_select:1;
12055b9c547cSRui Paulo 	unsigned int interworking_fast_assoc_tried:1;
1206f05cddf9SRui Paulo 	unsigned int fetch_all_anqp:1;
12075b9c547cSRui Paulo 	unsigned int fetch_osu_info:1;
12085b9c547cSRui Paulo 	unsigned int fetch_osu_waiting_scan:1;
12095b9c547cSRui Paulo 	unsigned int fetch_osu_icon_in_progress:1;
12105b9c547cSRui Paulo 	struct wpa_bss *interworking_gas_bss;
12115b9c547cSRui Paulo 	unsigned int osu_icon_id;
1212780fb4a2SCy Schubert 	struct dl_list icon_head; /* struct icon_entry */
12135b9c547cSRui Paulo 	struct osu_provider *osu_prov;
12145b9c547cSRui Paulo 	size_t osu_prov_count;
12155b9c547cSRui Paulo 	struct os_reltime osu_icon_fetch_start;
12165b9c547cSRui Paulo 	unsigned int num_osu_scans;
12175b9c547cSRui Paulo 	unsigned int num_prov_found;
1218f05cddf9SRui Paulo #endif /* CONFIG_INTERWORKING */
1219f05cddf9SRui Paulo 	unsigned int drv_capa_known;
1220f05cddf9SRui Paulo 
1221f05cddf9SRui Paulo 	struct {
1222f05cddf9SRui Paulo 		struct hostapd_hw_modes *modes;
1223f05cddf9SRui Paulo 		u16 num_modes;
1224f05cddf9SRui Paulo 		u16 flags;
1225f05cddf9SRui Paulo 	} hw;
12265b9c547cSRui Paulo 	enum local_hw_capab {
12275b9c547cSRui Paulo 		CAPAB_NO_HT_VHT,
12285b9c547cSRui Paulo 		CAPAB_HT,
12295b9c547cSRui Paulo 		CAPAB_HT40,
12305b9c547cSRui Paulo 		CAPAB_VHT,
12315b9c547cSRui Paulo 	} hw_capab;
12325b9c547cSRui Paulo #ifdef CONFIG_MACSEC
12335b9c547cSRui Paulo 	struct ieee802_1x_kay *kay;
12345b9c547cSRui Paulo #endif /* CONFIG_MACSEC */
1235f05cddf9SRui Paulo 
1236f05cddf9SRui Paulo 	int pno;
12375b9c547cSRui Paulo 	int pno_sched_pending;
1238f05cddf9SRui Paulo 
1239f05cddf9SRui Paulo 	/* WLAN_REASON_* reason codes. Negative if locally generated. */
1240f05cddf9SRui Paulo 	int disconnect_reason;
1241f05cddf9SRui Paulo 
12424bc52338SCy Schubert 	/* WLAN_STATUS_* status codes from last received Authentication frame
12434bc52338SCy Schubert 	 * from the AP. */
12444bc52338SCy Schubert 	u16 auth_status_code;
12454bc52338SCy Schubert 
1246780fb4a2SCy Schubert 	/* WLAN_STATUS_* status codes from (Re)Association Response frame. */
1247780fb4a2SCy Schubert 	u16 assoc_status_code;
1248780fb4a2SCy Schubert 
1249f05cddf9SRui Paulo 	struct ext_password_data *ext_pw;
1250f05cddf9SRui Paulo 
12515b9c547cSRui Paulo 	struct wpabuf *last_gas_resp, *prev_gas_resp;
12525b9c547cSRui Paulo 	u8 last_gas_addr[ETH_ALEN], prev_gas_addr[ETH_ALEN];
12535b9c547cSRui Paulo 	u8 last_gas_dialog_token, prev_gas_dialog_token;
1254f05cddf9SRui Paulo 
1255f05cddf9SRui Paulo 	unsigned int no_keep_alive:1;
12565b9c547cSRui Paulo 	unsigned int ext_mgmt_frame_handling:1;
12575b9c547cSRui Paulo 	unsigned int ext_eapol_frame_io:1;
12585b9c547cSRui Paulo 	unsigned int wmm_ac_supported:1;
12595b9c547cSRui Paulo 	unsigned int ext_work_in_progress:1;
12605b9c547cSRui Paulo 	unsigned int own_disconnect_req:1;
1261c1d255d3SCy Schubert 	unsigned int own_reconnect_req:1;
126285732ac8SCy Schubert 	unsigned int ignore_post_flush_scan_res:1;
12635b9c547cSRui Paulo 
12645b9c547cSRui Paulo #define MAC_ADDR_RAND_SCAN       BIT(0)
12655b9c547cSRui Paulo #define MAC_ADDR_RAND_SCHED_SCAN BIT(1)
12665b9c547cSRui Paulo #define MAC_ADDR_RAND_PNO        BIT(2)
12675b9c547cSRui Paulo #define MAC_ADDR_RAND_ALL        (MAC_ADDR_RAND_SCAN | \
12685b9c547cSRui Paulo 				  MAC_ADDR_RAND_SCHED_SCAN | \
12695b9c547cSRui Paulo 				  MAC_ADDR_RAND_PNO)
12705b9c547cSRui Paulo 	unsigned int mac_addr_rand_supported;
12715b9c547cSRui Paulo 	unsigned int mac_addr_rand_enable;
12725b9c547cSRui Paulo 
12735b9c547cSRui Paulo 	/* MAC Address followed by mask (2 * ETH_ALEN) */
12745b9c547cSRui Paulo 	u8 *mac_addr_scan;
12755b9c547cSRui Paulo 	u8 *mac_addr_sched_scan;
12765b9c547cSRui Paulo 	u8 *mac_addr_pno;
12775b9c547cSRui Paulo 
12785b9c547cSRui Paulo #ifdef CONFIG_WNM
12795b9c547cSRui Paulo 	u8 wnm_dialog_token;
12805b9c547cSRui Paulo 	u8 wnm_reply;
12815b9c547cSRui Paulo 	u8 wnm_num_neighbor_report;
12825b9c547cSRui Paulo 	u8 wnm_mode;
12835b9c547cSRui Paulo 	u16 wnm_dissoc_timer;
12845b9c547cSRui Paulo 	u8 wnm_bss_termination_duration[12];
12855b9c547cSRui Paulo 	struct neighbor_report *wnm_neighbor_report_elements;
12865b9c547cSRui Paulo 	struct os_reltime wnm_cand_valid_until;
12875b9c547cSRui Paulo 	u8 wnm_cand_from_bss[ETH_ALEN];
12884bc52338SCy Schubert 	enum bss_trans_mgmt_status_code bss_tm_status;
128985732ac8SCy Schubert 	struct wpabuf *coloc_intf_elems;
129085732ac8SCy Schubert 	u8 coloc_intf_dialog_token;
129185732ac8SCy Schubert 	u8 coloc_intf_auto_report;
129285732ac8SCy Schubert 	u8 coloc_intf_timeout;
129385732ac8SCy Schubert #ifdef CONFIG_MBO
129485732ac8SCy Schubert 	unsigned int wnm_mbo_trans_reason_present:1;
129585732ac8SCy Schubert 	u8 wnm_mbo_transition_reason;
129685732ac8SCy Schubert #endif /* CONFIG_MBO */
12975b9c547cSRui Paulo #endif /* CONFIG_WNM */
12985b9c547cSRui Paulo 
12995b9c547cSRui Paulo #ifdef CONFIG_TESTING_GET_GTK
13005b9c547cSRui Paulo 	u8 last_gtk[32];
13015b9c547cSRui Paulo 	size_t last_gtk_len;
13025b9c547cSRui Paulo #endif /* CONFIG_TESTING_GET_GTK */
13035b9c547cSRui Paulo 
13045b9c547cSRui Paulo 	unsigned int num_multichan_concurrent;
13055b9c547cSRui Paulo 	struct wpa_radio_work *connect_work;
13065b9c547cSRui Paulo 
13075b9c547cSRui Paulo 	unsigned int ext_work_id;
13085b9c547cSRui Paulo 
13095b9c547cSRui Paulo 	struct wpabuf *vendor_elem[NUM_VENDOR_ELEM_FRAMES];
13105b9c547cSRui Paulo 
13115b9c547cSRui Paulo #ifdef CONFIG_TESTING_OPTIONS
13125b9c547cSRui Paulo 	struct l2_packet_data *l2_test;
13135b9c547cSRui Paulo 	unsigned int extra_roc_dur;
13145b9c547cSRui Paulo 	enum wpa_supplicant_test_failure test_failure;
131585732ac8SCy Schubert 	char *get_pref_freq_list_override;
1316780fb4a2SCy Schubert 	unsigned int reject_btm_req_reason;
1317780fb4a2SCy Schubert 	unsigned int p2p_go_csa_on_inv:1;
1318780fb4a2SCy Schubert 	unsigned int ignore_auth_resp:1;
1319780fb4a2SCy Schubert 	unsigned int ignore_assoc_disallow:1;
1320c1d255d3SCy Schubert 	unsigned int disable_sa_query:1;
132185732ac8SCy Schubert 	unsigned int testing_resend_assoc:1;
1322c1d255d3SCy Schubert 	unsigned int ignore_sae_h2e_only:1;
1323c1d255d3SCy Schubert 	int ft_rsnxe_used;
132485732ac8SCy Schubert 	struct wpabuf *sae_commit_override;
132585732ac8SCy Schubert 	enum wpa_alg last_tk_alg;
132685732ac8SCy Schubert 	u8 last_tk_addr[ETH_ALEN];
132785732ac8SCy Schubert 	int last_tk_key_idx;
132885732ac8SCy Schubert 	u8 last_tk[WPA_TK_MAX_LEN];
132985732ac8SCy Schubert 	size_t last_tk_len;
133085732ac8SCy Schubert 	struct wpabuf *last_assoc_req_wpa_ie;
1331c1d255d3SCy Schubert 	int *extra_sae_rejected_groups;
1332c1d255d3SCy Schubert 	struct wpabuf *rsne_override_eapol;
1333c1d255d3SCy Schubert 	struct wpabuf *rsnxe_override_assoc;
1334c1d255d3SCy Schubert 	struct wpabuf *rsnxe_override_eapol;
1335c1d255d3SCy Schubert 	struct dl_list drv_signal_override;
1336c1d255d3SCy Schubert 	unsigned int oci_freq_override_eapol;
1337c1d255d3SCy Schubert 	unsigned int oci_freq_override_saquery_req;
1338c1d255d3SCy Schubert 	unsigned int oci_freq_override_saquery_resp;
1339c1d255d3SCy Schubert 	unsigned int oci_freq_override_eapol_g2;
1340c1d255d3SCy Schubert 	unsigned int oci_freq_override_ft_assoc;
1341c1d255d3SCy Schubert 	unsigned int oci_freq_override_fils_assoc;
1342c1d255d3SCy Schubert 	unsigned int oci_freq_override_wnm_sleep;
13435b9c547cSRui Paulo #endif /* CONFIG_TESTING_OPTIONS */
13445b9c547cSRui Paulo 
13455b9c547cSRui Paulo 	struct wmm_ac_assoc_data *wmm_ac_assoc_info;
13465b9c547cSRui Paulo 	struct wmm_tspec_element *tspecs[WMM_AC_NUM][TS_DIR_IDX_COUNT];
13475b9c547cSRui Paulo 	struct wmm_ac_addts_request *addts_request;
13485b9c547cSRui Paulo 	u8 wmm_ac_last_dialog_token;
13495b9c547cSRui Paulo 	struct wmm_tspec_element *last_tspecs;
13505b9c547cSRui Paulo 	u8 last_tspecs_count;
13515b9c547cSRui Paulo 
13525b9c547cSRui Paulo 	struct rrm_data rrm;
135385732ac8SCy Schubert 	struct beacon_rep_data beacon_rep_data;
1354325151a3SRui Paulo 
1355325151a3SRui Paulo #ifdef CONFIG_FST
1356325151a3SRui Paulo 	struct fst_iface *fst;
1357325151a3SRui Paulo 	const struct wpabuf *fst_ies;
1358325151a3SRui Paulo 	struct wpabuf *received_mb_ies;
1359325151a3SRui Paulo #endif /* CONFIG_FST */
1360780fb4a2SCy Schubert 
1361780fb4a2SCy Schubert #ifdef CONFIG_MBO
1362780fb4a2SCy Schubert 	/* Multiband operation non-preferred channel */
1363780fb4a2SCy Schubert 	struct wpa_mbo_non_pref_channel {
1364780fb4a2SCy Schubert 		enum mbo_non_pref_chan_reason reason;
1365780fb4a2SCy Schubert 		u8 oper_class;
1366780fb4a2SCy Schubert 		u8 chan;
1367780fb4a2SCy Schubert 		u8 preference;
1368780fb4a2SCy Schubert 	} *non_pref_chan;
1369780fb4a2SCy Schubert 	size_t non_pref_chan_num;
1370780fb4a2SCy Schubert 	u8 mbo_wnm_token;
137185732ac8SCy Schubert 	/**
137285732ac8SCy Schubert 	 * enable_oce - Enable OCE if it is enabled by user and device also
137385732ac8SCy Schubert 	 *		supports OCE.
137485732ac8SCy Schubert 	 * User can enable OCE with wpa_config's 'oce' parameter as follows -
137585732ac8SCy Schubert 	 *  - Set BIT(0) to enable OCE in non-AP STA mode.
137685732ac8SCy Schubert 	 *  - Set BIT(1) to enable OCE in STA-CFON mode.
137785732ac8SCy Schubert 	 */
137885732ac8SCy Schubert 	u8 enable_oce;
1379780fb4a2SCy Schubert #endif /* CONFIG_MBO */
1380780fb4a2SCy Schubert 
1381780fb4a2SCy Schubert 	/*
1382780fb4a2SCy Schubert 	 * This should be under CONFIG_MBO, but it is left out to allow using
1383780fb4a2SCy Schubert 	 * the bss_temp_disallowed list for other purposes as well.
1384780fb4a2SCy Schubert 	 */
1385780fb4a2SCy Schubert 	struct dl_list bss_tmp_disallowed;
1386780fb4a2SCy Schubert 
1387780fb4a2SCy Schubert 	/*
1388780fb4a2SCy Schubert 	 * Content of a measurement report element with type 8 (LCI),
1389780fb4a2SCy Schubert 	 * own location.
1390780fb4a2SCy Schubert 	 */
1391780fb4a2SCy Schubert 	struct wpabuf *lci;
1392780fb4a2SCy Schubert 	struct os_reltime lci_time;
139385732ac8SCy Schubert 
139485732ac8SCy Schubert 	struct os_reltime beacon_rep_scan;
139585732ac8SCy Schubert 
139685732ac8SCy Schubert 	/* FILS HLP requests (struct fils_hlp_req) */
139785732ac8SCy Schubert 	struct dl_list fils_hlp_req;
139885732ac8SCy Schubert 
139985732ac8SCy Schubert 	struct sched_scan_relative_params {
140085732ac8SCy Schubert 		/**
140185732ac8SCy Schubert 		 * relative_rssi_set - Enable relatively preferred BSS reporting
140285732ac8SCy Schubert 		 *
140385732ac8SCy Schubert 		 * 0 = Disable reporting relatively preferred BSSs
140485732ac8SCy Schubert 		 * 1 = Enable reporting relatively preferred BSSs
140585732ac8SCy Schubert 		 */
140685732ac8SCy Schubert 		int relative_rssi_set;
140785732ac8SCy Schubert 
140885732ac8SCy Schubert 		/**
140985732ac8SCy Schubert 		 * relative_rssi - Relative RSSI for reporting better BSSs
141085732ac8SCy Schubert 		 *
141185732ac8SCy Schubert 		 * Amount of RSSI by which a BSS should be better than the
141285732ac8SCy Schubert 		 * current connected BSS so that the new BSS can be reported
141385732ac8SCy Schubert 		 * to user space. This applies to sched_scan operations.
141485732ac8SCy Schubert 		 */
141585732ac8SCy Schubert 		int relative_rssi;
141685732ac8SCy Schubert 
141785732ac8SCy Schubert 		/**
141885732ac8SCy Schubert 		 * relative_adjust_band - Band in which RSSI is to be adjusted
141985732ac8SCy Schubert 		 */
142085732ac8SCy Schubert 		enum set_band relative_adjust_band;
142185732ac8SCy Schubert 
142285732ac8SCy Schubert 		/**
142385732ac8SCy Schubert 		 * relative_adjust_rssi - RSSI adjustment
142485732ac8SCy Schubert 		 *
142585732ac8SCy Schubert 		 * An amount of relative_adjust_rssi should be added to the
142685732ac8SCy Schubert 		 * BSSs that belong to the relative_adjust_band while comparing
142785732ac8SCy Schubert 		 * with other bands for BSS reporting.
142885732ac8SCy Schubert 		 */
142985732ac8SCy Schubert 		int relative_adjust_rssi;
143085732ac8SCy Schubert 	} srp;
143185732ac8SCy Schubert 
143285732ac8SCy Schubert 	/* RIC elements for FT protocol */
143385732ac8SCy Schubert 	struct wpabuf *ric_ies;
143485732ac8SCy Schubert 
143585732ac8SCy Schubert 	int last_auth_timeout_sec;
143685732ac8SCy Schubert 
143785732ac8SCy Schubert #ifdef CONFIG_DPP
14384bc52338SCy Schubert 	struct dpp_global *dpp;
143985732ac8SCy Schubert 	struct dpp_authentication *dpp_auth;
144085732ac8SCy Schubert 	struct wpa_radio_work *dpp_listen_work;
144185732ac8SCy Schubert 	unsigned int dpp_pending_listen_freq;
144285732ac8SCy Schubert 	unsigned int dpp_listen_freq;
1443c1d255d3SCy Schubert 	struct os_reltime dpp_listen_end;
144485732ac8SCy Schubert 	u8 dpp_allowed_roles;
144585732ac8SCy Schubert 	int dpp_qr_mutual;
1446c1d255d3SCy Schubert 	int dpp_netrole;
144785732ac8SCy Schubert 	int dpp_auth_ok_on_ack;
144885732ac8SCy Schubert 	int dpp_in_response_listen;
144985732ac8SCy Schubert 	int dpp_gas_client;
145085732ac8SCy Schubert 	int dpp_gas_dialog_token;
145185732ac8SCy Schubert 	u8 dpp_intro_bssid[ETH_ALEN];
145285732ac8SCy Schubert 	void *dpp_intro_network;
145385732ac8SCy Schubert 	struct dpp_pkex *dpp_pkex;
145485732ac8SCy Schubert 	struct dpp_bootstrap_info *dpp_pkex_bi;
145585732ac8SCy Schubert 	char *dpp_pkex_code;
145685732ac8SCy Schubert 	char *dpp_pkex_identifier;
145785732ac8SCy Schubert 	char *dpp_pkex_auth_cmd;
145885732ac8SCy Schubert 	char *dpp_configurator_params;
145985732ac8SCy Schubert 	struct os_reltime dpp_last_init;
146085732ac8SCy Schubert 	struct os_reltime dpp_init_iter_start;
146185732ac8SCy Schubert 	unsigned int dpp_init_max_tries;
146285732ac8SCy Schubert 	unsigned int dpp_init_retry_time;
146385732ac8SCy Schubert 	unsigned int dpp_resp_wait_time;
146485732ac8SCy Schubert 	unsigned int dpp_resp_max_tries;
146585732ac8SCy Schubert 	unsigned int dpp_resp_retry_time;
1466c1d255d3SCy Schubert 	u8 dpp_last_ssid[SSID_MAX_LEN];
1467c1d255d3SCy Schubert 	size_t dpp_last_ssid_len;
1468c1d255d3SCy Schubert 	bool dpp_conf_backup_received;
14694bc52338SCy Schubert #ifdef CONFIG_DPP2
14704bc52338SCy Schubert 	struct dpp_pfs *dpp_pfs;
1471c1d255d3SCy Schubert 	int dpp_pfs_fallback;
1472c1d255d3SCy Schubert 	struct wpabuf *dpp_presence_announcement;
1473c1d255d3SCy Schubert 	struct dpp_bootstrap_info *dpp_chirp_bi;
1474c1d255d3SCy Schubert 	int dpp_chirp_freq;
1475c1d255d3SCy Schubert 	int *dpp_chirp_freqs;
1476c1d255d3SCy Schubert 	int dpp_chirp_iter;
1477c1d255d3SCy Schubert 	int dpp_chirp_round;
1478c1d255d3SCy Schubert 	int dpp_chirp_scan_done;
1479c1d255d3SCy Schubert 	int dpp_chirp_listen;
1480c1d255d3SCy Schubert 	struct wpa_ssid *dpp_reconfig_ssid;
1481c1d255d3SCy Schubert 	int dpp_reconfig_ssid_id;
1482c1d255d3SCy Schubert 	struct dpp_reconfig_id *dpp_reconfig_id;
14834bc52338SCy Schubert #endif /* CONFIG_DPP2 */
148485732ac8SCy Schubert #ifdef CONFIG_TESTING_OPTIONS
148585732ac8SCy Schubert 	char *dpp_config_obj_override;
148685732ac8SCy Schubert 	char *dpp_discovery_override;
148785732ac8SCy Schubert 	char *dpp_groups_override;
148885732ac8SCy Schubert 	unsigned int dpp_ignore_netaccesskey_mismatch:1;
148985732ac8SCy Schubert #endif /* CONFIG_TESTING_OPTIONS */
149085732ac8SCy Schubert #endif /* CONFIG_DPP */
149185732ac8SCy Schubert 
149285732ac8SCy Schubert #ifdef CONFIG_FILS
149385732ac8SCy Schubert 	unsigned int disable_fils:1;
149485732ac8SCy Schubert #endif /* CONFIG_FILS */
149585732ac8SCy Schubert 	unsigned int ieee80211ac:1;
14964bc52338SCy Schubert 	unsigned int enabled_4addr_mode:1;
14974bc52338SCy Schubert 	unsigned int multi_bss_support:1;
1498c1d255d3SCy Schubert 	unsigned int drv_authorized_port:1;
1499c1d255d3SCy Schubert 	unsigned int multi_ap_ie:1;
1500c1d255d3SCy Schubert 	unsigned int multi_ap_backhaul:1;
1501c1d255d3SCy Schubert 	unsigned int multi_ap_fronthaul:1;
1502c1d255d3SCy Schubert 	struct robust_av_data robust_av;
1503c1d255d3SCy Schubert 	bool mscs_setup_done;
1504c1d255d3SCy Schubert 
1505c1d255d3SCy Schubert #ifdef CONFIG_PASN
1506c1d255d3SCy Schubert 	struct wpas_pasn pasn;
1507c1d255d3SCy Schubert 	struct wpa_radio_work *pasn_auth_work;
1508c1d255d3SCy Schubert #endif /* CONFIG_PASN */
15094b72b91aSCy Schubert 	struct scs_robust_av_data scs_robust_av_req;
15104b72b91aSCy Schubert 	u8 scs_dialog_token;
15114b72b91aSCy Schubert #ifdef CONFIG_TESTING_OPTIONS
15124b72b91aSCy Schubert 	unsigned int disable_scs_support:1;
15134b72b91aSCy Schubert 	unsigned int disable_mscs_support:1;
15144b72b91aSCy Schubert #endif /* CONFIG_TESTING_OPTIONS */
15154b72b91aSCy Schubert 	struct dl_list active_scs_ids;
15164b72b91aSCy Schubert 	bool ongoing_scs_req;
15174b72b91aSCy Schubert 	u8 dscp_req_dialog_token;
15184b72b91aSCy Schubert 	u8 dscp_query_dialog_token;
15194b72b91aSCy Schubert 	unsigned int enable_dscp_policy_capa:1;
15204b72b91aSCy Schubert 	unsigned int connection_dscp:1;
15214b72b91aSCy Schubert 	unsigned int wait_for_dscp_req:1;
152239beb93cSSam Leffler };
152339beb93cSSam Leffler 
152439beb93cSSam Leffler 
152539beb93cSSam Leffler /* wpa_supplicant.c */
1526f05cddf9SRui Paulo void wpa_supplicant_apply_ht_overrides(
1527f05cddf9SRui Paulo 	struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
1528f05cddf9SRui Paulo 	struct wpa_driver_associate_params *params);
15295b9c547cSRui Paulo void wpa_supplicant_apply_vht_overrides(
15305b9c547cSRui Paulo 	struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
15315b9c547cSRui Paulo 	struct wpa_driver_associate_params *params);
1532c1d255d3SCy Schubert void wpa_supplicant_apply_he_overrides(
1533c1d255d3SCy Schubert 	struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
1534c1d255d3SCy Schubert 	struct wpa_driver_associate_params *params);
1535f05cddf9SRui Paulo 
1536e28a4053SRui Paulo int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
15375b9c547cSRui Paulo int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s,
15385b9c547cSRui Paulo 				    struct wpa_ssid *ssid);
1539e28a4053SRui Paulo 
154039beb93cSSam Leffler int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s);
154139beb93cSSam Leffler 
1542e28a4053SRui Paulo const char * wpa_supplicant_state_txt(enum wpa_states state);
1543f05cddf9SRui Paulo int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s);
154439beb93cSSam Leffler int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s);
1545c1d255d3SCy Schubert int wpa_supplicant_update_bridge_ifname(struct wpa_supplicant *wpa_s,
1546c1d255d3SCy Schubert 					const char *bridge_ifname);
15474b72b91aSCy Schubert void wpas_set_mgmt_group_cipher(struct wpa_supplicant *wpa_s,
15484b72b91aSCy Schubert 				struct wpa_ssid *ssid, struct wpa_ie_data *ie);
154939beb93cSSam Leffler int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
1550e28a4053SRui Paulo 			      struct wpa_bss *bss, struct wpa_ssid *ssid,
155139beb93cSSam Leffler 			      u8 *wpa_ie, size_t *wpa_ie_len);
1552c1d255d3SCy Schubert int wpas_restore_permanent_mac_addr(struct wpa_supplicant *wpa_s);
155339beb93cSSam Leffler void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
1554e28a4053SRui Paulo 			      struct wpa_bss *bss,
155539beb93cSSam Leffler 			      struct wpa_ssid *ssid);
155639beb93cSSam Leffler void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s,
155739beb93cSSam Leffler 				       struct wpa_ssid *ssid);
155839beb93cSSam Leffler void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s);
155939beb93cSSam Leffler void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr);
156039beb93cSSam Leffler void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
156139beb93cSSam Leffler 				     int sec, int usec);
156285732ac8SCy Schubert void wpas_auth_timeout_restart(struct wpa_supplicant *wpa_s, int sec_diff);
1563f05cddf9SRui Paulo void wpa_supplicant_reinit_autoscan(struct wpa_supplicant *wpa_s);
1564e28a4053SRui Paulo void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
1565e28a4053SRui Paulo 			      enum wpa_states state);
156639beb93cSSam Leffler struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s);
1567f05cddf9SRui Paulo const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s);
156839beb93cSSam Leffler void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
156939beb93cSSam Leffler void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
1570206b73d0SCy Schubert 				   u16 reason_code);
1571c1d255d3SCy Schubert void wpa_supplicant_reconnect(struct wpa_supplicant *wpa_s);
157239beb93cSSam Leffler 
1573780fb4a2SCy Schubert struct wpa_ssid * wpa_supplicant_add_network(struct wpa_supplicant *wpa_s);
1574780fb4a2SCy Schubert int wpa_supplicant_remove_network(struct wpa_supplicant *wpa_s, int id);
1575c1d255d3SCy Schubert int wpa_supplicant_remove_all_networks(struct wpa_supplicant *wpa_s);
1576e28a4053SRui Paulo void wpa_supplicant_enable_network(struct wpa_supplicant *wpa_s,
1577e28a4053SRui Paulo 				   struct wpa_ssid *ssid);
1578e28a4053SRui Paulo void wpa_supplicant_disable_network(struct wpa_supplicant *wpa_s,
1579e28a4053SRui Paulo 				    struct wpa_ssid *ssid);
1580e28a4053SRui Paulo void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s,
1581e28a4053SRui Paulo 				   struct wpa_ssid *ssid);
1582*32a95656SCy Schubert int wpas_remove_cred(struct wpa_supplicant *wpa_s, struct wpa_cred *cred);
1583*32a95656SCy Schubert int wpas_remove_all_creds(struct wpa_supplicant *wpa_s);
15845b9c547cSRui Paulo int wpas_set_pkcs11_engine_and_module_path(struct wpa_supplicant *wpa_s,
15855b9c547cSRui Paulo 					   const char *pkcs11_engine_path,
15865b9c547cSRui Paulo 					   const char *pkcs11_module_path);
1587e28a4053SRui Paulo int wpa_supplicant_set_ap_scan(struct wpa_supplicant *wpa_s,
1588e28a4053SRui Paulo 			       int ap_scan);
1589f05cddf9SRui Paulo int wpa_supplicant_set_bss_expiration_age(struct wpa_supplicant *wpa_s,
1590f05cddf9SRui Paulo 					  unsigned int expire_age);
1591f05cddf9SRui Paulo int wpa_supplicant_set_bss_expiration_count(struct wpa_supplicant *wpa_s,
1592f05cddf9SRui Paulo 					    unsigned int expire_count);
1593f05cddf9SRui Paulo int wpa_supplicant_set_scan_interval(struct wpa_supplicant *wpa_s,
1594f05cddf9SRui Paulo 				     int scan_interval);
1595e28a4053SRui Paulo int wpa_supplicant_set_debug_params(struct wpa_global *global,
1596e28a4053SRui Paulo 				    int debug_level, int debug_timestamp,
1597e28a4053SRui Paulo 				    int debug_show_keys);
1598f05cddf9SRui Paulo void free_hw_features(struct wpa_supplicant *wpa_s);
1599e28a4053SRui Paulo 
160039beb93cSSam Leffler void wpa_show_license(void);
160139beb93cSSam Leffler 
1602780fb4a2SCy Schubert struct wpa_interface * wpa_supplicant_match_iface(struct wpa_global *global,
1603780fb4a2SCy Schubert 						  const char *ifname);
160439beb93cSSam Leffler struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
16055b9c547cSRui Paulo 						 struct wpa_interface *iface,
16065b9c547cSRui Paulo 						 struct wpa_supplicant *parent);
160739beb93cSSam Leffler int wpa_supplicant_remove_iface(struct wpa_global *global,
1608f05cddf9SRui Paulo 				struct wpa_supplicant *wpa_s,
1609f05cddf9SRui Paulo 				int terminate);
161039beb93cSSam Leffler struct wpa_supplicant * wpa_supplicant_get_iface(struct wpa_global *global,
161139beb93cSSam Leffler 						 const char *ifname);
161239beb93cSSam Leffler struct wpa_global * wpa_supplicant_init(struct wpa_params *params);
161339beb93cSSam Leffler int wpa_supplicant_run(struct wpa_global *global);
161439beb93cSSam Leffler void wpa_supplicant_deinit(struct wpa_global *global);
161539beb93cSSam Leffler 
161639beb93cSSam Leffler int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
161739beb93cSSam Leffler 			      struct wpa_ssid *ssid);
1618e28a4053SRui Paulo void wpa_supplicant_terminate_proc(struct wpa_global *global);
1619e28a4053SRui Paulo void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
1620e28a4053SRui Paulo 			     const u8 *buf, size_t len);
1621f05cddf9SRui Paulo void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s);
1622f05cddf9SRui Paulo void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s);
1623f05cddf9SRui Paulo void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid);
162485732ac8SCy Schubert void fils_connection_failure(struct wpa_supplicant *wpa_s);
1625c1d255d3SCy Schubert void fils_pmksa_cache_flush(struct wpa_supplicant *wpa_s);
1626f05cddf9SRui Paulo int wpas_driver_bss_selection(struct wpa_supplicant *wpa_s);
1627f05cddf9SRui Paulo int wpas_is_p2p_prioritized(struct wpa_supplicant *wpa_s);
16285b9c547cSRui Paulo void wpas_auth_failed(struct wpa_supplicant *wpa_s, char *reason);
1629f05cddf9SRui Paulo void wpas_clear_temp_disabled(struct wpa_supplicant *wpa_s,
1630f05cddf9SRui Paulo 			      struct wpa_ssid *ssid, int clear_failures);
1631f05cddf9SRui Paulo int disallowed_bssid(struct wpa_supplicant *wpa_s, const u8 *bssid);
1632f05cddf9SRui Paulo int disallowed_ssid(struct wpa_supplicant *wpa_s, const u8 *ssid,
1633f05cddf9SRui Paulo 		    size_t ssid_len);
1634f05cddf9SRui Paulo void wpas_request_connection(struct wpa_supplicant *wpa_s);
1635780fb4a2SCy Schubert void wpas_request_disconnection(struct wpa_supplicant *wpa_s);
16365b9c547cSRui Paulo int wpas_build_ext_capab(struct wpa_supplicant *wpa_s, u8 *buf, size_t buflen);
16375b9c547cSRui Paulo int wpas_update_random_addr(struct wpa_supplicant *wpa_s, int style);
16385b9c547cSRui Paulo int wpas_update_random_addr_disassoc(struct wpa_supplicant *wpa_s);
16395b9c547cSRui Paulo void add_freq(int *freqs, int *num_freqs, int freq);
16405b9c547cSRui Paulo 
1641c1d255d3SCy Schubert int wpas_get_op_chan_phy(int freq, const u8 *ies, size_t ies_len,
1642c1d255d3SCy Schubert 			 u8 *op_class, u8 *chan, u8 *phy_type);
1643c1d255d3SCy Schubert 
1644c1d255d3SCy Schubert int wpas_twt_send_setup(struct wpa_supplicant *wpa_s, u8 dtok, int exponent,
1645c1d255d3SCy Schubert 			int mantissa, u8 min_twt, int setup_cmd, u64 twt,
1646c1d255d3SCy Schubert 			bool requestor, bool trigger, bool implicit,
1647c1d255d3SCy Schubert 			bool flow_type, u8 flow_id, bool protection,
1648c1d255d3SCy Schubert 			u8 twt_channel, u8 control);
1649c1d255d3SCy Schubert int wpas_twt_send_teardown(struct wpa_supplicant *wpa_s, u8 flags);
1650c1d255d3SCy Schubert 
16515b9c547cSRui Paulo void wpas_rrm_reset(struct wpa_supplicant *wpa_s);
16525b9c547cSRui Paulo void wpas_rrm_process_neighbor_rep(struct wpa_supplicant *wpa_s,
16535b9c547cSRui Paulo 				   const u8 *report, size_t report_len);
16545b9c547cSRui Paulo int wpas_rrm_send_neighbor_rep_request(struct wpa_supplicant *wpa_s,
1655780fb4a2SCy Schubert 				       const struct wpa_ssid_value *ssid,
1656780fb4a2SCy Schubert 				       int lci, int civic,
16575b9c547cSRui Paulo 				       void (*cb)(void *ctx,
16585b9c547cSRui Paulo 						  struct wpabuf *neighbor_rep),
16595b9c547cSRui Paulo 				       void *cb_ctx);
1660780fb4a2SCy Schubert void wpas_rrm_handle_radio_measurement_request(struct wpa_supplicant *wpa_s,
166185732ac8SCy Schubert 					       const u8 *src, const u8 *dst,
1662780fb4a2SCy Schubert 					       const u8 *frame, size_t len);
16635b9c547cSRui Paulo void wpas_rrm_handle_link_measurement_request(struct wpa_supplicant *wpa_s,
16645b9c547cSRui Paulo 					      const u8 *src,
16655b9c547cSRui Paulo 					      const u8 *frame, size_t len,
16665b9c547cSRui Paulo 					      int rssi);
166785732ac8SCy Schubert void wpas_rrm_refuse_request(struct wpa_supplicant *wpa_s);
166885732ac8SCy Schubert int wpas_beacon_rep_scan_process(struct wpa_supplicant *wpa_s,
166985732ac8SCy Schubert 				 struct wpa_scan_results *scan_res,
167085732ac8SCy Schubert 				 struct scan_info *info);
167185732ac8SCy Schubert void wpas_clear_beacon_rep_data(struct wpa_supplicant *wpa_s);
167285732ac8SCy Schubert void wpas_flush_fils_hlp_req(struct wpa_supplicant *wpa_s);
1673c1d255d3SCy Schubert void wpas_clear_disabled_interface(void *eloop_ctx, void *timeout_ctx);
1674c1d255d3SCy Schubert void wpa_supplicant_reset_bgscan(struct wpa_supplicant *wpa_s);
1675f05cddf9SRui Paulo 
1676780fb4a2SCy Schubert 
1677780fb4a2SCy Schubert /* MBO functions */
167885732ac8SCy Schubert int wpas_mbo_ie(struct wpa_supplicant *wpa_s, u8 *buf, size_t len,
167985732ac8SCy Schubert 		int add_oce_capa);
168085732ac8SCy Schubert const u8 * mbo_attr_from_mbo_ie(const u8 *mbo_ie, enum mbo_attr_id attr);
1681780fb4a2SCy Schubert const u8 * wpas_mbo_get_bss_attr(struct wpa_bss *bss, enum mbo_attr_id attr);
1682c1d255d3SCy Schubert void wpas_mbo_check_pmf(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
1683c1d255d3SCy Schubert 			struct wpa_ssid *ssid);
16844bc52338SCy Schubert const u8 * mbo_get_attr_from_ies(const u8 *ies, size_t ies_len,
16854bc52338SCy Schubert 				 enum mbo_attr_id attr);
1686780fb4a2SCy Schubert int wpas_mbo_update_non_pref_chan(struct wpa_supplicant *wpa_s,
1687780fb4a2SCy Schubert 				  const char *non_pref_chan);
1688780fb4a2SCy Schubert void wpas_mbo_scan_ie(struct wpa_supplicant *wpa_s, struct wpabuf *ie);
1689780fb4a2SCy Schubert void wpas_mbo_ie_trans_req(struct wpa_supplicant *wpa_s, const u8 *ie,
1690780fb4a2SCy Schubert 			   size_t len);
1691780fb4a2SCy Schubert size_t wpas_mbo_ie_bss_trans_reject(struct wpa_supplicant *wpa_s, u8 *pos,
1692780fb4a2SCy Schubert 				    size_t len,
1693780fb4a2SCy Schubert 				    enum mbo_transition_reject_reason reason);
1694780fb4a2SCy Schubert void wpas_mbo_update_cell_capa(struct wpa_supplicant *wpa_s, u8 mbo_cell_capa);
1695780fb4a2SCy Schubert struct wpabuf * mbo_build_anqp_buf(struct wpa_supplicant *wpa_s,
169685732ac8SCy Schubert 				   struct wpa_bss *bss, u32 mbo_subtypes);
169785732ac8SCy Schubert void mbo_parse_rx_anqp_resp(struct wpa_supplicant *wpa_s,
169885732ac8SCy Schubert 			    struct wpa_bss *bss, const u8 *sa,
169985732ac8SCy Schubert 			    const u8 *data, size_t slen);
17004bc52338SCy Schubert void wpas_update_mbo_connect_params(struct wpa_supplicant *wpa_s);
170185732ac8SCy Schubert 
170285732ac8SCy Schubert /* op_classes.c */
170385732ac8SCy Schubert enum chan_allowed {
17044b72b91aSCy Schubert 	NOT_ALLOWED, NO_IR, RADAR, ALLOWED
170585732ac8SCy Schubert };
170685732ac8SCy Schubert 
1707c1d255d3SCy Schubert enum chan_allowed verify_channel(struct hostapd_hw_modes *mode, u8 op_class,
1708c1d255d3SCy Schubert 				 u8 channel, u8 bw);
17094bc52338SCy Schubert size_t wpas_supp_op_class_ie(struct wpa_supplicant *wpa_s,
17104bc52338SCy Schubert 			     struct wpa_ssid *ssid,
1711c1d255d3SCy Schubert 			     struct wpa_bss *bss, u8 *pos, size_t len);
1712c1d255d3SCy Schubert int * wpas_supp_op_classes(struct wpa_supplicant *wpa_s);
1713780fb4a2SCy Schubert 
1714206b73d0SCy Schubert int wpas_enable_mac_addr_randomization(struct wpa_supplicant *wpa_s,
1715206b73d0SCy Schubert 				       unsigned int type, const u8 *addr,
1716206b73d0SCy Schubert 				       const u8 *mask);
1717206b73d0SCy Schubert int wpas_disable_mac_addr_randomization(struct wpa_supplicant *wpa_s,
1718206b73d0SCy Schubert 					unsigned int type);
1719206b73d0SCy Schubert 
1720f05cddf9SRui Paulo /**
1721f05cddf9SRui Paulo  * wpa_supplicant_ctrl_iface_ctrl_rsp_handle - Handle a control response
1722f05cddf9SRui Paulo  * @wpa_s: Pointer to wpa_supplicant data
1723f05cddf9SRui Paulo  * @ssid: Pointer to the network block the reply is for
1724f05cddf9SRui Paulo  * @field: field the response is a reply for
1725f05cddf9SRui Paulo  * @value: value (ie, password, etc) for @field
1726f05cddf9SRui Paulo  * Returns: 0 on success, non-zero on error
1727f05cddf9SRui Paulo  *
1728f05cddf9SRui Paulo  * Helper function to handle replies to control interface requests.
1729f05cddf9SRui Paulo  */
1730f05cddf9SRui Paulo int wpa_supplicant_ctrl_iface_ctrl_rsp_handle(struct wpa_supplicant *wpa_s,
1731f05cddf9SRui Paulo 					      struct wpa_ssid *ssid,
1732f05cddf9SRui Paulo 					      const char *field,
1733f05cddf9SRui Paulo 					      const char *value);
173439beb93cSSam Leffler 
17355b9c547cSRui Paulo void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
17365b9c547cSRui Paulo 			  const struct wpa_ssid *ssid,
17375b9c547cSRui Paulo 			  struct hostapd_freq_params *freq);
17385b9c547cSRui Paulo 
173939beb93cSSam Leffler /* events.c */
174039beb93cSSam Leffler void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s);
1741f05cddf9SRui Paulo int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
1742e28a4053SRui Paulo 			   struct wpa_bss *selected,
1743e28a4053SRui Paulo 			   struct wpa_ssid *ssid);
1744f05cddf9SRui Paulo void wpa_supplicant_stop_countermeasures(void *eloop_ctx, void *sock_ctx);
1745f05cddf9SRui Paulo void wpa_supplicant_delayed_mic_error_report(void *eloop_ctx, void *sock_ctx);
1746f05cddf9SRui Paulo void wnm_bss_keep_alive_deinit(struct wpa_supplicant *wpa_s);
17475b9c547cSRui Paulo int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s);
17485b9c547cSRui Paulo struct wpa_bss * wpa_supplicant_pick_network(struct wpa_supplicant *wpa_s,
17495b9c547cSRui Paulo 					     struct wpa_ssid **selected_ssid);
175085732ac8SCy Schubert int wpas_temp_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
17514bc52338SCy Schubert void wpa_supplicant_update_channel_list(struct wpa_supplicant *wpa_s,
17524bc52338SCy Schubert 					struct channel_list_changed *info);
1753c1d255d3SCy Schubert int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s,
1754c1d255d3SCy Schubert 					   struct wpa_bss *current_bss,
1755c1d255d3SCy Schubert 					   struct wpa_bss *seleceted);
175639beb93cSSam Leffler 
1757e28a4053SRui Paulo /* eap_register.c */
1758e28a4053SRui Paulo int eap_register_methods(void);
175939beb93cSSam Leffler 
1760f05cddf9SRui Paulo /**
1761325151a3SRui Paulo  * Utility method to tell if a given network is for persistent group storage
1762f05cddf9SRui Paulo  * @ssid: Network object
1763f05cddf9SRui Paulo  * Returns: 1 if network is a persistent group, 0 otherwise
1764f05cddf9SRui Paulo  */
1765f05cddf9SRui Paulo static inline int network_is_persistent_group(struct wpa_ssid *ssid)
1766f05cddf9SRui Paulo {
1767325151a3SRui Paulo 	return ssid->disabled == 2 && ssid->p2p_persistent_group;
1768f05cddf9SRui Paulo }
1769f05cddf9SRui Paulo 
1770206b73d0SCy Schubert 
1771206b73d0SCy Schubert static inline int wpas_mode_to_ieee80211_mode(enum wpas_mode mode)
1772206b73d0SCy Schubert {
1773206b73d0SCy Schubert 	switch (mode) {
1774206b73d0SCy Schubert 	default:
1775206b73d0SCy Schubert 	case WPAS_MODE_INFRA:
1776206b73d0SCy Schubert 		return IEEE80211_MODE_INFRA;
1777206b73d0SCy Schubert 	case WPAS_MODE_IBSS:
1778206b73d0SCy Schubert 		return IEEE80211_MODE_IBSS;
1779206b73d0SCy Schubert 	case WPAS_MODE_AP:
1780206b73d0SCy Schubert 	case WPAS_MODE_P2P_GO:
1781206b73d0SCy Schubert 	case WPAS_MODE_P2P_GROUP_FORMATION:
1782206b73d0SCy Schubert 		return IEEE80211_MODE_AP;
1783206b73d0SCy Schubert 	case WPAS_MODE_MESH:
1784206b73d0SCy Schubert 		return IEEE80211_MODE_MESH;
1785206b73d0SCy Schubert 	}
1786206b73d0SCy Schubert }
1787206b73d0SCy Schubert 
1788206b73d0SCy Schubert 
1789f05cddf9SRui Paulo int wpas_network_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
17905b9c547cSRui Paulo int wpas_get_ssid_pmf(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
17914b72b91aSCy Schubert int pmf_in_use(struct wpa_supplicant *wpa_s, const u8 *addr);
1792f05cddf9SRui Paulo 
1793f05cddf9SRui Paulo int wpas_init_ext_pw(struct wpa_supplicant *wpa_s);
1794f05cddf9SRui Paulo 
17955b9c547cSRui Paulo void dump_freq_data(struct wpa_supplicant *wpa_s, const char *title,
17965b9c547cSRui Paulo 		    struct wpa_used_freq_data *freqs_data,
17975b9c547cSRui Paulo 		    unsigned int len);
17985b9c547cSRui Paulo 
17995b9c547cSRui Paulo int get_shared_radio_freqs_data(struct wpa_supplicant *wpa_s,
18005b9c547cSRui Paulo 				struct wpa_used_freq_data *freqs_data,
18015b9c547cSRui Paulo 				unsigned int len);
18025b9c547cSRui Paulo int get_shared_radio_freqs(struct wpa_supplicant *wpa_s,
18035b9c547cSRui Paulo 			   int *freq_array, unsigned int len);
18045b9c547cSRui Paulo 
1805325151a3SRui Paulo void wpas_network_reenabled(void *eloop_ctx, void *timeout_ctx);
1806325151a3SRui Paulo 
1807780fb4a2SCy Schubert void wpas_vendor_elem_update(struct wpa_supplicant *wpa_s);
1808780fb4a2SCy Schubert struct wpa_supplicant * wpas_vendor_elem(struct wpa_supplicant *wpa_s,
1809780fb4a2SCy Schubert 					 enum wpa_vendor_elem_frame frame);
1810780fb4a2SCy Schubert int wpas_vendor_elem_remove(struct wpa_supplicant *wpa_s, int frame,
1811780fb4a2SCy Schubert 			    const u8 *elem, size_t len);
1812780fb4a2SCy Schubert 
1813325151a3SRui Paulo #ifdef CONFIG_FST
1814325151a3SRui Paulo 
1815325151a3SRui Paulo struct fst_wpa_obj;
1816325151a3SRui Paulo 
1817325151a3SRui Paulo void fst_wpa_supplicant_fill_iface_obj(struct wpa_supplicant *wpa_s,
1818325151a3SRui Paulo 				       struct fst_wpa_obj *iface_obj);
1819325151a3SRui Paulo 
1820325151a3SRui Paulo #endif /* CONFIG_FST */
1821325151a3SRui Paulo 
1822780fb4a2SCy Schubert int wpas_sched_scan_plans_set(struct wpa_supplicant *wpa_s, const char *cmd);
1823780fb4a2SCy Schubert 
1824780fb4a2SCy Schubert struct hostapd_hw_modes * get_mode(struct hostapd_hw_modes *modes,
1825c1d255d3SCy Schubert 				   u16 num_modes, enum hostapd_hw_mode mode,
1826c1d255d3SCy Schubert 				   bool is_6ghz);
1827c1d255d3SCy Schubert struct hostapd_hw_modes * get_mode_with_freq(struct hostapd_hw_modes *modes,
1828c1d255d3SCy Schubert 					     u16 num_modes, int freq);
1829780fb4a2SCy Schubert 
1830780fb4a2SCy Schubert void wpa_bss_tmp_disallow(struct wpa_supplicant *wpa_s, const u8 *bssid,
18314bc52338SCy Schubert 			  unsigned int sec, int rssi_threshold);
18324bc52338SCy Schubert int wpa_is_bss_tmp_disallowed(struct wpa_supplicant *wpa_s,
18334bc52338SCy Schubert 			      struct wpa_bss *bss);
18344bc52338SCy Schubert void free_bss_tmp_disallowed(struct wpa_supplicant *wpa_s);
1835780fb4a2SCy Schubert 
1836780fb4a2SCy Schubert struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
1837780fb4a2SCy Schubert 				     int i, struct wpa_bss *bss,
1838780fb4a2SCy Schubert 				     struct wpa_ssid *group,
183985732ac8SCy Schubert 				     int only_first_ssid, int debug_print);
184085732ac8SCy Schubert 
184185732ac8SCy Schubert int wpas_ctrl_iface_get_pref_freq_list_override(struct wpa_supplicant *wpa_s,
184285732ac8SCy Schubert 						enum wpa_driver_if_type if_type,
184385732ac8SCy Schubert 						unsigned int *num,
184485732ac8SCy Schubert 						unsigned int *freq_list);
184585732ac8SCy Schubert 
184685732ac8SCy Schubert int wpa_is_fils_supported(struct wpa_supplicant *wpa_s);
184785732ac8SCy Schubert int wpa_is_fils_sk_pfs_supported(struct wpa_supplicant *wpa_s);
1848780fb4a2SCy Schubert 
1849c1d255d3SCy Schubert void wpas_clear_driver_signal_override(struct wpa_supplicant *wpa_s);
1850c1d255d3SCy Schubert 
1851c1d255d3SCy Schubert int wpas_send_mscs_req(struct wpa_supplicant *wpa_s);
1852c1d255d3SCy Schubert void wpas_populate_mscs_descriptor_ie(struct robust_av_data *robust_av,
1853c1d255d3SCy Schubert 				      struct wpabuf *buf);
1854c1d255d3SCy Schubert void wpas_handle_robust_av_recv_action(struct wpa_supplicant *wpa_s,
1855c1d255d3SCy Schubert 				       const u8 *src, const u8 *buf,
1856c1d255d3SCy Schubert 				       size_t len);
1857c1d255d3SCy Schubert void wpas_handle_assoc_resp_mscs(struct wpa_supplicant *wpa_s, const u8 *bssid,
1858c1d255d3SCy Schubert 				 const u8 *ies, size_t ies_len);
18594b72b91aSCy Schubert int wpas_send_scs_req(struct wpa_supplicant *wpa_s);
18604b72b91aSCy Schubert void free_up_tclas_elem(struct scs_desc_elem *elem);
18614b72b91aSCy Schubert void free_up_scs_desc(struct scs_robust_av_data *data);
18624b72b91aSCy Schubert void wpas_handle_robust_av_scs_recv_action(struct wpa_supplicant *wpa_s,
18634b72b91aSCy Schubert 					   const u8 *src, const u8 *buf,
18644b72b91aSCy Schubert 					   size_t len);
18654b72b91aSCy Schubert void wpas_scs_deinit(struct wpa_supplicant *wpa_s);
18664b72b91aSCy Schubert void wpas_handle_qos_mgmt_recv_action(struct wpa_supplicant *wpa_s,
18674b72b91aSCy Schubert 				      const u8 *src,
18684b72b91aSCy Schubert 				      const u8 *buf, size_t len);
18694b72b91aSCy Schubert void wpas_dscp_deinit(struct wpa_supplicant *wpa_s);
18704b72b91aSCy Schubert int wpas_send_dscp_response(struct wpa_supplicant *wpa_s,
18714b72b91aSCy Schubert 			    struct dscp_resp_data *resp_data);
18724b72b91aSCy Schubert void wpas_handle_assoc_resp_qos_mgmt(struct wpa_supplicant *wpa_s,
18734b72b91aSCy Schubert 				     const u8 *ies, size_t ies_len);
18744b72b91aSCy Schubert int wpas_send_dscp_query(struct wpa_supplicant *wpa_s, const char *domain_name,
18754b72b91aSCy Schubert 			 size_t domain_name_length);
1876c1d255d3SCy Schubert 
1877c1d255d3SCy Schubert int wpas_pasn_auth_start(struct wpa_supplicant *wpa_s,
1878c1d255d3SCy Schubert 			 const u8 *bssid, int akmp, int cipher,
1879c1d255d3SCy Schubert 			 u16 group, int network_id,
1880c1d255d3SCy Schubert 			 const u8 *comeback, size_t comeback_len);
1881c1d255d3SCy Schubert void wpas_pasn_auth_stop(struct wpa_supplicant *wpa_s);
1882c1d255d3SCy Schubert int wpas_pasn_auth_tx_status(struct wpa_supplicant *wpa_s,
1883c1d255d3SCy Schubert 			     const u8 *data, size_t data_len, u8 acked);
1884c1d255d3SCy Schubert int wpas_pasn_auth_rx(struct wpa_supplicant *wpa_s,
1885c1d255d3SCy Schubert 		      const struct ieee80211_mgmt *mgmt, size_t len);
1886c1d255d3SCy Schubert 
1887c1d255d3SCy Schubert int wpas_pasn_deauthenticate(struct wpa_supplicant *wpa_s, const u8 *bssid);
1888c1d255d3SCy Schubert 
188939beb93cSSam Leffler #endif /* WPA_SUPPLICANT_I_H */
1890