xref: /freebsd/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h (revision 85732ac8bccbc0adcf5a261ea1ffec8ca7b3a92d)
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 
12*85732ac8SCy 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"
175b9c547cSRui Paulo #include "wps/wps_defs.h"
18f05cddf9SRui Paulo #include "config_ssid.h"
195b9c547cSRui Paulo #include "wmm_ac.h"
2039beb93cSSam Leffler 
21325151a3SRui Paulo extern const char *const wpa_supplicant_version;
22325151a3SRui Paulo extern const char *const wpa_supplicant_license;
2339beb93cSSam Leffler #ifndef CONFIG_NO_STDOUT_DEBUG
24325151a3SRui Paulo extern const char *const wpa_supplicant_full_license1;
25325151a3SRui Paulo extern const char *const wpa_supplicant_full_license2;
26325151a3SRui Paulo extern const char *const wpa_supplicant_full_license3;
27325151a3SRui Paulo extern const char *const wpa_supplicant_full_license4;
28325151a3SRui Paulo extern const char *const wpa_supplicant_full_license5;
2939beb93cSSam Leffler #endif /* CONFIG_NO_STDOUT_DEBUG */
3039beb93cSSam Leffler 
3139beb93cSSam Leffler struct wpa_sm;
3239beb93cSSam Leffler struct wpa_supplicant;
33e28a4053SRui Paulo struct ibss_rsn;
34e28a4053SRui Paulo struct scan_info;
35e28a4053SRui Paulo struct wpa_bss;
36e28a4053SRui Paulo struct wpa_scan_results;
37f05cddf9SRui Paulo struct hostapd_hw_modes;
38f05cddf9SRui Paulo struct wpa_driver_associate_params;
3939beb93cSSam Leffler 
4039beb93cSSam Leffler /*
4139beb93cSSam Leffler  * Forward declarations of private structures used within the ctrl_iface
4239beb93cSSam Leffler  * backends. Other parts of wpa_supplicant do not have access to data stored in
4339beb93cSSam Leffler  * these structures.
4439beb93cSSam Leffler  */
4539beb93cSSam Leffler struct ctrl_iface_priv;
4639beb93cSSam Leffler struct ctrl_iface_global_priv;
47e28a4053SRui Paulo struct wpas_dbus_priv;
48780fb4a2SCy Schubert struct wpas_binder_priv;
4939beb93cSSam Leffler 
5039beb93cSSam Leffler /**
5139beb93cSSam Leffler  * struct wpa_interface - Parameters for wpa_supplicant_add_iface()
5239beb93cSSam Leffler  */
5339beb93cSSam Leffler struct wpa_interface {
5439beb93cSSam Leffler 	/**
5539beb93cSSam Leffler 	 * confname - Configuration name (file or profile) name
5639beb93cSSam Leffler 	 *
5739beb93cSSam Leffler 	 * This can also be %NULL when a configuration file is not used. In
5839beb93cSSam Leffler 	 * that case, ctrl_interface must be set to allow the interface to be
5939beb93cSSam Leffler 	 * configured.
6039beb93cSSam Leffler 	 */
6139beb93cSSam Leffler 	const char *confname;
6239beb93cSSam Leffler 
6339beb93cSSam Leffler 	/**
645b9c547cSRui Paulo 	 * confanother - Additional configuration name (file or profile) name
655b9c547cSRui Paulo 	 *
665b9c547cSRui Paulo 	 * This can also be %NULL when the additional configuration file is not
675b9c547cSRui Paulo 	 * used.
685b9c547cSRui Paulo 	 */
695b9c547cSRui Paulo 	const char *confanother;
705b9c547cSRui Paulo 
715b9c547cSRui Paulo 	/**
7239beb93cSSam Leffler 	 * ctrl_interface - Control interface parameter
7339beb93cSSam Leffler 	 *
7439beb93cSSam Leffler 	 * If a configuration file is not used, this variable can be used to
7539beb93cSSam Leffler 	 * set the ctrl_interface parameter that would have otherwise been read
7639beb93cSSam Leffler 	 * from the configuration file. If both confname and ctrl_interface are
7739beb93cSSam Leffler 	 * set, ctrl_interface is used to override the value from configuration
7839beb93cSSam Leffler 	 * file.
7939beb93cSSam Leffler 	 */
8039beb93cSSam Leffler 	const char *ctrl_interface;
8139beb93cSSam Leffler 
8239beb93cSSam Leffler 	/**
8339beb93cSSam Leffler 	 * driver - Driver interface name, or %NULL to use the default driver
8439beb93cSSam Leffler 	 */
8539beb93cSSam Leffler 	const char *driver;
8639beb93cSSam Leffler 
8739beb93cSSam Leffler 	/**
8839beb93cSSam Leffler 	 * driver_param - Driver interface parameters
8939beb93cSSam Leffler 	 *
9039beb93cSSam Leffler 	 * If a configuration file is not used, this variable can be used to
9139beb93cSSam Leffler 	 * set the driver_param parameters that would have otherwise been read
9239beb93cSSam Leffler 	 * from the configuration file. If both confname and driver_param are
9339beb93cSSam Leffler 	 * set, driver_param is used to override the value from configuration
9439beb93cSSam Leffler 	 * file.
9539beb93cSSam Leffler 	 */
9639beb93cSSam Leffler 	const char *driver_param;
9739beb93cSSam Leffler 
9839beb93cSSam Leffler 	/**
9939beb93cSSam Leffler 	 * ifname - Interface name
10039beb93cSSam Leffler 	 */
10139beb93cSSam Leffler 	const char *ifname;
10239beb93cSSam Leffler 
10339beb93cSSam Leffler 	/**
10439beb93cSSam Leffler 	 * bridge_ifname - Optional bridge interface name
10539beb93cSSam Leffler 	 *
10639beb93cSSam Leffler 	 * If the driver interface (ifname) is included in a Linux bridge
10739beb93cSSam Leffler 	 * device, the bridge interface may need to be used for receiving EAPOL
10839beb93cSSam Leffler 	 * frames. This can be enabled by setting this variable to enable
10939beb93cSSam Leffler 	 * receiving of EAPOL frames from an additional interface.
11039beb93cSSam Leffler 	 */
11139beb93cSSam Leffler 	const char *bridge_ifname;
1125b9c547cSRui Paulo 
1135b9c547cSRui Paulo 	/**
1145b9c547cSRui Paulo 	 * p2p_mgmt - Interface used for P2P management (P2P Device operations)
1155b9c547cSRui Paulo 	 *
1165b9c547cSRui Paulo 	 * Indicates whether wpas_p2p_init() must be called for this interface.
1175b9c547cSRui Paulo 	 * This is used only when the driver supports a dedicated P2P Device
1185b9c547cSRui Paulo 	 * interface that is not a network interface.
1195b9c547cSRui Paulo 	 */
1205b9c547cSRui Paulo 	int p2p_mgmt;
12139beb93cSSam Leffler };
12239beb93cSSam Leffler 
12339beb93cSSam Leffler /**
12439beb93cSSam Leffler  * struct wpa_params - Parameters for wpa_supplicant_init()
12539beb93cSSam Leffler  */
12639beb93cSSam Leffler struct wpa_params {
12739beb93cSSam Leffler 	/**
12839beb93cSSam Leffler 	 * daemonize - Run %wpa_supplicant in the background
12939beb93cSSam Leffler 	 */
13039beb93cSSam Leffler 	int daemonize;
13139beb93cSSam Leffler 
13239beb93cSSam Leffler 	/**
13339beb93cSSam Leffler 	 * wait_for_monitor - Wait for a monitor program before starting
13439beb93cSSam Leffler 	 */
13539beb93cSSam Leffler 	int wait_for_monitor;
13639beb93cSSam Leffler 
13739beb93cSSam Leffler 	/**
13839beb93cSSam Leffler 	 * pid_file - Path to a PID (process ID) file
13939beb93cSSam Leffler 	 *
14039beb93cSSam Leffler 	 * If this and daemonize are set, process ID of the background process
14139beb93cSSam Leffler 	 * will be written to the specified file.
14239beb93cSSam Leffler 	 */
14339beb93cSSam Leffler 	char *pid_file;
14439beb93cSSam Leffler 
14539beb93cSSam Leffler 	/**
14639beb93cSSam Leffler 	 * wpa_debug_level - Debugging verbosity level (e.g., MSG_INFO)
14739beb93cSSam Leffler 	 */
14839beb93cSSam Leffler 	int wpa_debug_level;
14939beb93cSSam Leffler 
15039beb93cSSam Leffler 	/**
15139beb93cSSam Leffler 	 * wpa_debug_show_keys - Whether keying material is included in debug
15239beb93cSSam Leffler 	 *
15339beb93cSSam Leffler 	 * This parameter can be used to allow keying material to be included
15439beb93cSSam Leffler 	 * in debug messages. This is a security risk and this option should
15539beb93cSSam Leffler 	 * not be enabled in normal configuration. If needed during
15639beb93cSSam Leffler 	 * development or while troubleshooting, this option can provide more
15739beb93cSSam Leffler 	 * details for figuring out what is happening.
15839beb93cSSam Leffler 	 */
15939beb93cSSam Leffler 	int wpa_debug_show_keys;
16039beb93cSSam Leffler 
16139beb93cSSam Leffler 	/**
16239beb93cSSam Leffler 	 * wpa_debug_timestamp - Whether to include timestamp in debug messages
16339beb93cSSam Leffler 	 */
16439beb93cSSam Leffler 	int wpa_debug_timestamp;
16539beb93cSSam Leffler 
16639beb93cSSam Leffler 	/**
16739beb93cSSam Leffler 	 * ctrl_interface - Global ctrl_iface path/parameter
16839beb93cSSam Leffler 	 */
16939beb93cSSam Leffler 	char *ctrl_interface;
17039beb93cSSam Leffler 
17139beb93cSSam Leffler 	/**
1725b9c547cSRui Paulo 	 * ctrl_interface_group - Global ctrl_iface group
1735b9c547cSRui Paulo 	 */
1745b9c547cSRui Paulo 	char *ctrl_interface_group;
1755b9c547cSRui Paulo 
1765b9c547cSRui Paulo 	/**
17739beb93cSSam Leffler 	 * dbus_ctrl_interface - Enable the DBus control interface
17839beb93cSSam Leffler 	 */
17939beb93cSSam Leffler 	int dbus_ctrl_interface;
18039beb93cSSam Leffler 
18139beb93cSSam Leffler 	/**
18239beb93cSSam Leffler 	 * wpa_debug_file_path - Path of debug file or %NULL to use stdout
18339beb93cSSam Leffler 	 */
18439beb93cSSam Leffler 	const char *wpa_debug_file_path;
1852aef0ff7SSam Leffler 
1862aef0ff7SSam Leffler 	/**
1872aef0ff7SSam Leffler 	 * wpa_debug_syslog - Enable log output through syslog
1882aef0ff7SSam Leffler 	 */
189e28a4053SRui Paulo 	int wpa_debug_syslog;
190e28a4053SRui Paulo 
191e28a4053SRui Paulo 	/**
192f05cddf9SRui Paulo 	 * wpa_debug_tracing - Enable log output through Linux tracing
193f05cddf9SRui Paulo 	 */
194f05cddf9SRui Paulo 	int wpa_debug_tracing;
195f05cddf9SRui Paulo 
196f05cddf9SRui Paulo 	/**
197e28a4053SRui Paulo 	 * override_driver - Optional driver parameter override
198e28a4053SRui Paulo 	 *
199e28a4053SRui Paulo 	 * This parameter can be used to override the driver parameter in
200e28a4053SRui Paulo 	 * dynamic interface addition to force a specific driver wrapper to be
201e28a4053SRui Paulo 	 * used instead.
202e28a4053SRui Paulo 	 */
203e28a4053SRui Paulo 	char *override_driver;
204e28a4053SRui Paulo 
205e28a4053SRui Paulo 	/**
206e28a4053SRui Paulo 	 * override_ctrl_interface - Optional ctrl_interface override
207e28a4053SRui Paulo 	 *
208e28a4053SRui Paulo 	 * This parameter can be used to override the ctrl_interface parameter
209e28a4053SRui Paulo 	 * in dynamic interface addition to force a control interface to be
210e28a4053SRui Paulo 	 * created.
211e28a4053SRui Paulo 	 */
212e28a4053SRui Paulo 	char *override_ctrl_interface;
213f05cddf9SRui Paulo 
214f05cddf9SRui Paulo 	/**
215f05cddf9SRui Paulo 	 * entropy_file - Optional entropy file
216f05cddf9SRui Paulo 	 *
217f05cddf9SRui Paulo 	 * This parameter can be used to configure wpa_supplicant to maintain
218f05cddf9SRui Paulo 	 * its internal entropy store over restarts.
219f05cddf9SRui Paulo 	 */
220f05cddf9SRui Paulo 	char *entropy_file;
221325151a3SRui Paulo 
222325151a3SRui Paulo #ifdef CONFIG_P2P
223325151a3SRui Paulo 	/**
224325151a3SRui Paulo 	 * conf_p2p_dev - Configuration file used to hold the
225325151a3SRui Paulo 	 * P2P Device configuration parameters.
226325151a3SRui Paulo 	 *
227325151a3SRui Paulo 	 * This can also be %NULL. In such a case, if a P2P Device dedicated
228325151a3SRui Paulo 	 * interfaces is created, the main configuration file will be used.
229325151a3SRui Paulo 	 */
230325151a3SRui Paulo 	char *conf_p2p_dev;
231325151a3SRui Paulo #endif /* CONFIG_P2P */
232325151a3SRui Paulo 
233780fb4a2SCy Schubert #ifdef CONFIG_MATCH_IFACE
234780fb4a2SCy Schubert 	/**
235780fb4a2SCy Schubert 	 * match_ifaces - Interface descriptions to match
236780fb4a2SCy Schubert 	 */
237780fb4a2SCy Schubert 	struct wpa_interface *match_ifaces;
238780fb4a2SCy Schubert 
239780fb4a2SCy Schubert 	/**
240780fb4a2SCy Schubert 	 * match_iface_count - Number of defined matching interfaces
241780fb4a2SCy Schubert 	 */
242780fb4a2SCy Schubert 	int match_iface_count;
243780fb4a2SCy Schubert #endif /* CONFIG_MATCH_IFACE */
24439beb93cSSam Leffler };
24539beb93cSSam Leffler 
246f05cddf9SRui Paulo struct p2p_srv_bonjour {
247f05cddf9SRui Paulo 	struct dl_list list;
248f05cddf9SRui Paulo 	struct wpabuf *query;
249f05cddf9SRui Paulo 	struct wpabuf *resp;
250f05cddf9SRui Paulo };
251f05cddf9SRui Paulo 
252f05cddf9SRui Paulo struct p2p_srv_upnp {
253f05cddf9SRui Paulo 	struct dl_list list;
254f05cddf9SRui Paulo 	u8 version;
255f05cddf9SRui Paulo 	char *service;
256f05cddf9SRui Paulo };
257f05cddf9SRui Paulo 
25839beb93cSSam Leffler /**
25939beb93cSSam Leffler  * struct wpa_global - Internal, global data for all %wpa_supplicant interfaces
26039beb93cSSam Leffler  *
26139beb93cSSam Leffler  * This structure is initialized by calling wpa_supplicant_init() when starting
26239beb93cSSam Leffler  * %wpa_supplicant.
26339beb93cSSam Leffler  */
26439beb93cSSam Leffler struct wpa_global {
26539beb93cSSam Leffler 	struct wpa_supplicant *ifaces;
26639beb93cSSam Leffler 	struct wpa_params params;
26739beb93cSSam Leffler 	struct ctrl_iface_global_priv *ctrl_iface;
268e28a4053SRui Paulo 	struct wpas_dbus_priv *dbus;
269780fb4a2SCy Schubert 	struct wpas_binder_priv *binder;
27039beb93cSSam Leffler 	void **drv_priv;
27139beb93cSSam Leffler 	size_t drv_count;
272e28a4053SRui Paulo 	struct os_time suspend_time;
273f05cddf9SRui Paulo 	struct p2p_data *p2p;
274f05cddf9SRui Paulo 	struct wpa_supplicant *p2p_init_wpa_s;
275f05cddf9SRui Paulo 	struct wpa_supplicant *p2p_group_formation;
2765b9c547cSRui Paulo 	struct wpa_supplicant *p2p_invite_group;
277f05cddf9SRui Paulo 	u8 p2p_dev_addr[ETH_ALEN];
2785b9c547cSRui Paulo 	struct os_reltime p2p_go_wait_client;
279f05cddf9SRui Paulo 	struct dl_list p2p_srv_bonjour; /* struct p2p_srv_bonjour */
280f05cddf9SRui Paulo 	struct dl_list p2p_srv_upnp; /* struct p2p_srv_upnp */
281f05cddf9SRui Paulo 	int p2p_disabled;
282f05cddf9SRui Paulo 	int cross_connection;
2835b9c547cSRui Paulo 	struct wpa_freq_range_list p2p_disallow_freq;
2845b9c547cSRui Paulo 	struct wpa_freq_range_list p2p_go_avoid_freq;
285f05cddf9SRui Paulo 	enum wpa_conc_pref {
286f05cddf9SRui Paulo 		WPA_CONC_PREF_NOT_SET,
287f05cddf9SRui Paulo 		WPA_CONC_PREF_STA,
288f05cddf9SRui Paulo 		WPA_CONC_PREF_P2P
289f05cddf9SRui Paulo 	} conc_pref;
2905b9c547cSRui Paulo 	unsigned int p2p_per_sta_psk:1;
2915b9c547cSRui Paulo 	unsigned int p2p_fail_on_wps_complete:1;
2925b9c547cSRui Paulo 	unsigned int p2p_24ghz_social_channels:1;
2935b9c547cSRui Paulo 	unsigned int pending_p2ps_group:1;
2945b9c547cSRui Paulo 	unsigned int pending_group_iface_for_p2ps:1;
295780fb4a2SCy Schubert 	unsigned int pending_p2ps_group_freq;
296f05cddf9SRui Paulo 
297f05cddf9SRui Paulo #ifdef CONFIG_WIFI_DISPLAY
298f05cddf9SRui Paulo 	int wifi_display;
299*85732ac8SCy Schubert #define MAX_WFD_SUBELEMS 12
300f05cddf9SRui Paulo 	struct wpabuf *wfd_subelem[MAX_WFD_SUBELEMS];
301f05cddf9SRui Paulo #endif /* CONFIG_WIFI_DISPLAY */
3025b9c547cSRui Paulo 
3035b9c547cSRui Paulo 	struct psk_list_entry *add_psk; /* From group formation */
30439beb93cSSam Leffler };
30539beb93cSSam Leffler 
30639beb93cSSam Leffler 
307f05cddf9SRui Paulo /**
3085b9c547cSRui Paulo  * struct wpa_radio - Internal data for per-radio information
3095b9c547cSRui Paulo  *
3105b9c547cSRui Paulo  * This structure is used to share data about configured interfaces
3115b9c547cSRui Paulo  * (struct wpa_supplicant) that share the same physical radio, e.g., to allow
3125b9c547cSRui Paulo  * better coordination of offchannel operations.
3135b9c547cSRui Paulo  */
3145b9c547cSRui Paulo struct wpa_radio {
3155b9c547cSRui Paulo 	char name[16]; /* from driver_ops get_radio_name() or empty if not
3165b9c547cSRui Paulo 			* available */
3175b9c547cSRui Paulo 	unsigned int external_scan_running:1;
318780fb4a2SCy Schubert 	unsigned int num_active_works;
3195b9c547cSRui Paulo 	struct dl_list ifaces; /* struct wpa_supplicant::radio_list entries */
3205b9c547cSRui Paulo 	struct dl_list work; /* struct wpa_radio_work::list entries */
3215b9c547cSRui Paulo };
3225b9c547cSRui Paulo 
323780fb4a2SCy Schubert #define MAX_ACTIVE_WORKS 2
324780fb4a2SCy Schubert 
325780fb4a2SCy Schubert 
3265b9c547cSRui Paulo /**
3275b9c547cSRui Paulo  * struct wpa_radio_work - Radio work item
3285b9c547cSRui Paulo  */
3295b9c547cSRui Paulo struct wpa_radio_work {
3305b9c547cSRui Paulo 	struct dl_list list;
3315b9c547cSRui Paulo 	unsigned int freq; /* known frequency (MHz) or 0 for multiple/unknown */
3325b9c547cSRui Paulo 	const char *type;
3335b9c547cSRui Paulo 	struct wpa_supplicant *wpa_s;
3345b9c547cSRui Paulo 	void (*cb)(struct wpa_radio_work *work, int deinit);
3355b9c547cSRui Paulo 	void *ctx;
3365b9c547cSRui Paulo 	unsigned int started:1;
3375b9c547cSRui Paulo 	struct os_reltime time;
338780fb4a2SCy Schubert 	unsigned int bands;
3395b9c547cSRui Paulo };
3405b9c547cSRui Paulo 
3415b9c547cSRui Paulo int radio_add_work(struct wpa_supplicant *wpa_s, unsigned int freq,
3425b9c547cSRui Paulo 		   const char *type, int next,
3435b9c547cSRui Paulo 		   void (*cb)(struct wpa_radio_work *work, int deinit),
3445b9c547cSRui Paulo 		   void *ctx);
3455b9c547cSRui Paulo void radio_work_done(struct wpa_radio_work *work);
3465b9c547cSRui Paulo void radio_remove_works(struct wpa_supplicant *wpa_s,
3475b9c547cSRui Paulo 			const char *type, int remove_all);
348*85732ac8SCy Schubert void radio_remove_pending_work(struct wpa_supplicant *wpa_s, void *ctx);
3495b9c547cSRui Paulo void radio_work_check_next(struct wpa_supplicant *wpa_s);
3505b9c547cSRui Paulo struct wpa_radio_work *
3515b9c547cSRui Paulo radio_work_pending(struct wpa_supplicant *wpa_s, const char *type);
3525b9c547cSRui Paulo 
3535b9c547cSRui Paulo struct wpa_connect_work {
3545b9c547cSRui Paulo 	unsigned int sme:1;
3555b9c547cSRui Paulo 	unsigned int bss_removed:1;
3565b9c547cSRui Paulo 	struct wpa_bss *bss;
3575b9c547cSRui Paulo 	struct wpa_ssid *ssid;
3585b9c547cSRui Paulo };
3595b9c547cSRui Paulo 
3605b9c547cSRui Paulo int wpas_valid_bss_ssid(struct wpa_supplicant *wpa_s, struct wpa_bss *test_bss,
3615b9c547cSRui Paulo 			struct wpa_ssid *test_ssid);
3625b9c547cSRui Paulo void wpas_connect_work_free(struct wpa_connect_work *cwork);
3635b9c547cSRui Paulo void wpas_connect_work_done(struct wpa_supplicant *wpa_s);
3645b9c547cSRui Paulo 
3655b9c547cSRui Paulo struct wpa_external_work {
3665b9c547cSRui Paulo 	unsigned int id;
3675b9c547cSRui Paulo 	char type[100];
3685b9c547cSRui Paulo 	unsigned int timeout;
3695b9c547cSRui Paulo };
3705b9c547cSRui Paulo 
371780fb4a2SCy Schubert enum wpa_radio_work_band wpas_freq_to_band(int freq);
372780fb4a2SCy Schubert unsigned int wpas_get_bands(struct wpa_supplicant *wpa_s, const int *freqs);
373780fb4a2SCy Schubert 
3745b9c547cSRui Paulo /**
375f05cddf9SRui Paulo  * offchannel_send_action_result - Result of offchannel send Action frame
376f05cddf9SRui Paulo  */
377f05cddf9SRui Paulo enum offchannel_send_action_result {
378f05cddf9SRui Paulo 	OFFCHANNEL_SEND_ACTION_SUCCESS /**< Frame was send and acknowledged */,
379f05cddf9SRui Paulo 	OFFCHANNEL_SEND_ACTION_NO_ACK /**< Frame was sent, but not acknowledged
380f05cddf9SRui Paulo 				       */,
381f05cddf9SRui Paulo 	OFFCHANNEL_SEND_ACTION_FAILED /**< Frame was not sent due to a failure
382f05cddf9SRui Paulo 				       */
383f05cddf9SRui Paulo };
384f05cddf9SRui Paulo 
385f05cddf9SRui Paulo struct wps_ap_info {
386f05cddf9SRui Paulo 	u8 bssid[ETH_ALEN];
387f05cddf9SRui Paulo 	enum wps_ap_info_type {
388f05cddf9SRui Paulo 		WPS_AP_NOT_SEL_REG,
389f05cddf9SRui Paulo 		WPS_AP_SEL_REG,
390f05cddf9SRui Paulo 		WPS_AP_SEL_REG_OUR
391f05cddf9SRui Paulo 	} type;
392f05cddf9SRui Paulo 	unsigned int tries;
3935b9c547cSRui Paulo 	struct os_reltime last_attempt;
394325151a3SRui Paulo 	unsigned int pbc_active;
395325151a3SRui Paulo 	u8 uuid[WPS_UUID_LEN];
396f05cddf9SRui Paulo };
397f05cddf9SRui Paulo 
3985b9c547cSRui Paulo #define WPA_FREQ_USED_BY_INFRA_STATION BIT(0)
3995b9c547cSRui Paulo #define WPA_FREQ_USED_BY_P2P_CLIENT BIT(1)
4005b9c547cSRui Paulo 
4015b9c547cSRui Paulo struct wpa_used_freq_data {
4025b9c547cSRui Paulo 	int freq;
4035b9c547cSRui Paulo 	unsigned int flags;
4045b9c547cSRui Paulo };
4055b9c547cSRui Paulo 
4065b9c547cSRui Paulo #define RRM_NEIGHBOR_REPORT_TIMEOUT 1 /* 1 second for AP to send a report */
4075b9c547cSRui Paulo 
4085b9c547cSRui Paulo /*
4095b9c547cSRui Paulo  * struct rrm_data - Data used for managing RRM features
4105b9c547cSRui Paulo  */
4115b9c547cSRui Paulo struct rrm_data {
4125b9c547cSRui Paulo 	/* rrm_used - indication regarding the current connection */
4135b9c547cSRui Paulo 	unsigned int rrm_used:1;
4145b9c547cSRui Paulo 
4155b9c547cSRui Paulo 	/*
4165b9c547cSRui Paulo 	 * notify_neighbor_rep - Callback for notifying report requester
4175b9c547cSRui Paulo 	 */
4185b9c547cSRui Paulo 	void (*notify_neighbor_rep)(void *ctx, struct wpabuf *neighbor_rep);
4195b9c547cSRui Paulo 
4205b9c547cSRui Paulo 	/*
4215b9c547cSRui Paulo 	 * neighbor_rep_cb_ctx - Callback context
4225b9c547cSRui Paulo 	 * Received in the callback registration, and sent to the callback
4235b9c547cSRui Paulo 	 * function as a parameter.
4245b9c547cSRui Paulo 	 */
4255b9c547cSRui Paulo 	void *neighbor_rep_cb_ctx;
4265b9c547cSRui Paulo 
4275b9c547cSRui Paulo 	/* next_neighbor_rep_token - Next request's dialog token */
4285b9c547cSRui Paulo 	u8 next_neighbor_rep_token;
429*85732ac8SCy Schubert 
430*85732ac8SCy Schubert 	/* token - Dialog token of the current radio measurement */
431*85732ac8SCy Schubert 	u8 token;
432*85732ac8SCy Schubert 
433*85732ac8SCy Schubert 	/* destination address of the current radio measurement request */
434*85732ac8SCy Schubert 	u8 dst_addr[ETH_ALEN];
4355b9c547cSRui Paulo };
4365b9c547cSRui Paulo 
4375b9c547cSRui Paulo enum wpa_supplicant_test_failure {
4385b9c547cSRui Paulo 	WPAS_TEST_FAILURE_NONE,
4395b9c547cSRui Paulo 	WPAS_TEST_FAILURE_SCAN_TRIGGER,
4405b9c547cSRui Paulo };
4415b9c547cSRui Paulo 
442780fb4a2SCy Schubert struct icon_entry {
443780fb4a2SCy Schubert 	struct dl_list list;
444780fb4a2SCy Schubert 	u8 bssid[ETH_ALEN];
445780fb4a2SCy Schubert 	u8 dialog_token;
446780fb4a2SCy Schubert 	char *file_name;
447780fb4a2SCy Schubert 	u8 *image;
448780fb4a2SCy Schubert 	size_t image_len;
449780fb4a2SCy Schubert };
450780fb4a2SCy Schubert 
451780fb4a2SCy Schubert struct wpa_bss_tmp_disallowed {
452780fb4a2SCy Schubert 	struct dl_list list;
453780fb4a2SCy Schubert 	u8 bssid[ETH_ALEN];
454*85732ac8SCy Schubert };
455*85732ac8SCy Schubert 
456*85732ac8SCy Schubert struct beacon_rep_data {
457*85732ac8SCy Schubert 	u8 token;
458*85732ac8SCy Schubert 	struct wpa_driver_scan_params scan_params;
459*85732ac8SCy Schubert 	u8 ssid[SSID_MAX_LEN];
460*85732ac8SCy Schubert 	size_t ssid_len;
461*85732ac8SCy Schubert 	u8 bssid[ETH_ALEN];
462*85732ac8SCy Schubert 	enum beacon_report_detail report_detail;
463*85732ac8SCy Schubert 	struct bitfield *eids;
464*85732ac8SCy Schubert };
465*85732ac8SCy Schubert 
466*85732ac8SCy Schubert 
467*85732ac8SCy Schubert struct external_pmksa_cache {
468*85732ac8SCy Schubert 	struct dl_list list;
469*85732ac8SCy Schubert 	void *pmksa_cache;
470*85732ac8SCy Schubert };
471*85732ac8SCy Schubert 
472*85732ac8SCy Schubert struct fils_hlp_req {
473*85732ac8SCy Schubert 	struct dl_list list;
474*85732ac8SCy Schubert 	u8 dst[ETH_ALEN];
475*85732ac8SCy Schubert 	struct wpabuf *pkt;
476780fb4a2SCy Schubert };
477780fb4a2SCy Schubert 
47839beb93cSSam Leffler /**
47939beb93cSSam Leffler  * struct wpa_supplicant - Internal data for wpa_supplicant interface
48039beb93cSSam Leffler  *
48139beb93cSSam Leffler  * This structure contains the internal data for core wpa_supplicant code. This
48239beb93cSSam Leffler  * should be only used directly from the core code. However, a pointer to this
48339beb93cSSam Leffler  * data is used from other files as an arbitrary context pointer in calls to
48439beb93cSSam Leffler  * core functions.
48539beb93cSSam Leffler  */
48639beb93cSSam Leffler struct wpa_supplicant {
48739beb93cSSam Leffler 	struct wpa_global *global;
4885b9c547cSRui Paulo 	struct wpa_radio *radio; /* shared radio context */
4895b9c547cSRui Paulo 	struct dl_list radio_list; /* list head: struct wpa_radio::ifaces */
490f05cddf9SRui Paulo 	struct wpa_supplicant *parent;
491780fb4a2SCy Schubert 	struct wpa_supplicant *p2pdev;
49239beb93cSSam Leffler 	struct wpa_supplicant *next;
49339beb93cSSam Leffler 	struct l2_packet_data *l2;
49439beb93cSSam Leffler 	struct l2_packet_data *l2_br;
49539beb93cSSam Leffler 	unsigned char own_addr[ETH_ALEN];
4965b9c547cSRui Paulo 	unsigned char perm_addr[ETH_ALEN];
49739beb93cSSam Leffler 	char ifname[100];
498780fb4a2SCy Schubert #ifdef CONFIG_MATCH_IFACE
499780fb4a2SCy Schubert 	int matched;
500780fb4a2SCy Schubert #endif /* CONFIG_MATCH_IFACE */
50139beb93cSSam Leffler #ifdef CONFIG_CTRL_IFACE_DBUS
50239beb93cSSam Leffler 	char *dbus_path;
50339beb93cSSam Leffler #endif /* CONFIG_CTRL_IFACE_DBUS */
504e28a4053SRui Paulo #ifdef CONFIG_CTRL_IFACE_DBUS_NEW
505e28a4053SRui Paulo 	char *dbus_new_path;
506f05cddf9SRui Paulo 	char *dbus_groupobj_path;
507f05cddf9SRui Paulo #ifdef CONFIG_AP
508f05cddf9SRui Paulo 	char *preq_notify_peer;
509f05cddf9SRui Paulo #endif /* CONFIG_AP */
510e28a4053SRui Paulo #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
511780fb4a2SCy Schubert #ifdef CONFIG_CTRL_IFACE_BINDER
512780fb4a2SCy Schubert 	const void *binder_object_key;
513780fb4a2SCy Schubert #endif /* CONFIG_CTRL_IFACE_BINDER */
51439beb93cSSam Leffler 	char bridge_ifname[16];
51539beb93cSSam Leffler 
51639beb93cSSam Leffler 	char *confname;
5175b9c547cSRui Paulo 	char *confanother;
5185b9c547cSRui Paulo 
51939beb93cSSam Leffler 	struct wpa_config *conf;
52039beb93cSSam Leffler 	int countermeasures;
5215b9c547cSRui Paulo 	struct os_reltime last_michael_mic_error;
52239beb93cSSam Leffler 	u8 bssid[ETH_ALEN];
52339beb93cSSam Leffler 	u8 pending_bssid[ETH_ALEN]; /* If wpa_state == WPA_ASSOCIATING, this
524f05cddf9SRui Paulo 				     * field contains the target BSSID. */
52539beb93cSSam Leffler 	int reassociate; /* reassociation requested */
526780fb4a2SCy Schubert 	unsigned int reassoc_same_bss:1; /* reassociating to the same BSS */
527780fb4a2SCy Schubert 	unsigned int reassoc_same_ess:1; /* reassociating to the same ESS */
52839beb93cSSam Leffler 	int disconnected; /* all connections disabled; i.e., do no reassociate
52939beb93cSSam Leffler 			   * before this has been cleared */
53039beb93cSSam Leffler 	struct wpa_ssid *current_ssid;
5315b9c547cSRui Paulo 	struct wpa_ssid *last_ssid;
532e28a4053SRui Paulo 	struct wpa_bss *current_bss;
53339beb93cSSam Leffler 	int ap_ies_from_associnfo;
534e28a4053SRui Paulo 	unsigned int assoc_freq;
535*85732ac8SCy Schubert 	u8 *last_con_fail_realm;
536*85732ac8SCy Schubert 	size_t last_con_fail_realm_len;
53739beb93cSSam Leffler 
53839beb93cSSam Leffler 	/* Selected configuration (based on Beacon/ProbeResp WPA IE) */
53939beb93cSSam Leffler 	int pairwise_cipher;
54039beb93cSSam Leffler 	int group_cipher;
54139beb93cSSam Leffler 	int key_mgmt;
542f05cddf9SRui Paulo 	int wpa_proto;
54339beb93cSSam Leffler 	int mgmt_group_cipher;
54439beb93cSSam Leffler 
54539beb93cSSam Leffler 	void *drv_priv; /* private data used by driver_ops */
5463157ba21SRui Paulo 	void *global_drv_priv;
54739beb93cSSam Leffler 
548f05cddf9SRui Paulo 	u8 *bssid_filter;
549f05cddf9SRui Paulo 	size_t bssid_filter_count;
550f05cddf9SRui Paulo 
551f05cddf9SRui Paulo 	u8 *disallow_aps_bssid;
552f05cddf9SRui Paulo 	size_t disallow_aps_bssid_count;
553f05cddf9SRui Paulo 	struct wpa_ssid_value *disallow_aps_ssid;
554f05cddf9SRui Paulo 	size_t disallow_aps_ssid_count;
555f05cddf9SRui Paulo 
556325151a3SRui Paulo 	enum set_band setband;
5575b9c547cSRui Paulo 
5585b9c547cSRui Paulo 	/* Preferred network for the next connection attempt */
5595b9c547cSRui Paulo 	struct wpa_ssid *next_ssid;
5605b9c547cSRui Paulo 
561f05cddf9SRui Paulo 	/* previous scan was wildcard when interleaving between
562f05cddf9SRui Paulo 	 * wildcard scans and specific SSID scan when max_ssids=1 */
563f05cddf9SRui Paulo 	int prev_scan_wildcard;
56439beb93cSSam Leffler 	struct wpa_ssid *prev_scan_ssid; /* previously scanned SSID;
56539beb93cSSam Leffler 					  * NULL = not yet initialized (start
566e28a4053SRui Paulo 					  * with wildcard SSID)
567e28a4053SRui Paulo 					  * WILDCARD_SSID_SCAN = wildcard
56839beb93cSSam Leffler 					  * SSID was used in the previous scan
56939beb93cSSam Leffler 					  */
570e28a4053SRui Paulo #define WILDCARD_SSID_SCAN ((struct wpa_ssid *) 1)
57139beb93cSSam Leffler 
572f05cddf9SRui Paulo 	struct wpa_ssid *prev_sched_ssid; /* last SSID used in sched scan */
573f05cddf9SRui Paulo 	int sched_scan_timeout;
574f05cddf9SRui Paulo 	int first_sched_scan;
575f05cddf9SRui Paulo 	int sched_scan_timed_out;
576780fb4a2SCy Schubert 	struct sched_scan_plan *sched_scan_plans;
577780fb4a2SCy Schubert 	size_t sched_scan_plans_num;
578f05cddf9SRui Paulo 
579e28a4053SRui Paulo 	void (*scan_res_handler)(struct wpa_supplicant *wpa_s,
580e28a4053SRui Paulo 				 struct wpa_scan_results *scan_res);
581e28a4053SRui Paulo 	struct dl_list bss; /* struct wpa_bss::list */
582e28a4053SRui Paulo 	struct dl_list bss_id; /* struct wpa_bss::list_id */
583e28a4053SRui Paulo 	size_t num_bss;
584e28a4053SRui Paulo 	unsigned int bss_update_idx;
585e28a4053SRui Paulo 	unsigned int bss_next_id;
58639beb93cSSam Leffler 
587f05cddf9SRui Paulo 	 /*
588f05cddf9SRui Paulo 	  * Pointers to BSS entries in the order they were in the last scan
589f05cddf9SRui Paulo 	  * results.
590f05cddf9SRui Paulo 	  */
591f05cddf9SRui Paulo 	struct wpa_bss **last_scan_res;
592f05cddf9SRui Paulo 	unsigned int last_scan_res_used;
593f05cddf9SRui Paulo 	unsigned int last_scan_res_size;
5945b9c547cSRui Paulo 	struct os_reltime last_scan;
595f05cddf9SRui Paulo 
596325151a3SRui Paulo 	const struct wpa_driver_ops *driver;
59739beb93cSSam Leffler 	int interface_removed; /* whether the network interface has been
59839beb93cSSam Leffler 				* removed */
59939beb93cSSam Leffler 	struct wpa_sm *wpa;
60039beb93cSSam Leffler 	struct eapol_sm *eapol;
60139beb93cSSam Leffler 
60239beb93cSSam Leffler 	struct ctrl_iface_priv *ctrl_iface;
60339beb93cSSam Leffler 
604e28a4053SRui Paulo 	enum wpa_states wpa_state;
6055b9c547cSRui Paulo 	struct wpa_radio_work *scan_work;
6063157ba21SRui Paulo 	int scanning;
607f05cddf9SRui Paulo 	int sched_scanning;
608780fb4a2SCy Schubert 	unsigned int sched_scan_stop_req:1;
60939beb93cSSam Leffler 	int new_connection;
61039beb93cSSam Leffler 
61139beb93cSSam Leffler 	int eapol_received; /* number of EAPOL packets received after the
61239beb93cSSam Leffler 			     * previous association event */
61339beb93cSSam Leffler 
61439beb93cSSam Leffler 	struct scard_data *scard;
615f05cddf9SRui Paulo 	char imsi[20];
616f05cddf9SRui Paulo 	int mnc_len;
61739beb93cSSam Leffler 
61839beb93cSSam Leffler 	unsigned char last_eapol_src[ETH_ALEN];
61939beb93cSSam Leffler 
6205b9c547cSRui Paulo 	unsigned int keys_cleared; /* bitfield of key indexes that the driver is
6215b9c547cSRui Paulo 				    * known not to be configured with a key */
62239beb93cSSam Leffler 
62339beb93cSSam Leffler 	struct wpa_blacklist *blacklist;
62439beb93cSSam Leffler 
625f05cddf9SRui Paulo 	/**
626f05cddf9SRui Paulo 	 * extra_blacklist_count - Sum of blacklist counts after last connection
627f05cddf9SRui Paulo 	 *
628f05cddf9SRui Paulo 	 * This variable is used to maintain a count of temporary blacklisting
629f05cddf9SRui Paulo 	 * failures (maximum number for any BSS) over blacklist clear
630f05cddf9SRui Paulo 	 * operations. This is needed for figuring out whether there has been
631f05cddf9SRui Paulo 	 * failures prior to the last blacklist clear operation which happens
632f05cddf9SRui Paulo 	 * whenever no other not-blacklisted BSS candidates are available. This
633f05cddf9SRui Paulo 	 * gets cleared whenever a connection has been established successfully.
634f05cddf9SRui Paulo 	 */
635f05cddf9SRui Paulo 	int extra_blacklist_count;
63639beb93cSSam Leffler 
637f05cddf9SRui Paulo 	/**
638f05cddf9SRui Paulo 	 * scan_req - Type of the scan request
639f05cddf9SRui Paulo 	 */
640f05cddf9SRui Paulo 	enum scan_req_type {
641f05cddf9SRui Paulo 		/**
642f05cddf9SRui Paulo 		 * NORMAL_SCAN_REQ - Normal scan request
643f05cddf9SRui Paulo 		 *
644f05cddf9SRui Paulo 		 * This is used for scans initiated by wpa_supplicant to find an
645f05cddf9SRui Paulo 		 * AP for a connection.
646f05cddf9SRui Paulo 		 */
647f05cddf9SRui Paulo 		NORMAL_SCAN_REQ,
648f05cddf9SRui Paulo 
649f05cddf9SRui Paulo 		/**
650f05cddf9SRui Paulo 		 * INITIAL_SCAN_REQ - Initial scan request
651f05cddf9SRui Paulo 		 *
652f05cddf9SRui Paulo 		 * This is used for the first scan on an interface to force at
653f05cddf9SRui Paulo 		 * least one scan to be run even if the configuration does not
654f05cddf9SRui Paulo 		 * include any enabled networks.
655f05cddf9SRui Paulo 		 */
656f05cddf9SRui Paulo 		INITIAL_SCAN_REQ,
657f05cddf9SRui Paulo 
658f05cddf9SRui Paulo 		/**
659f05cddf9SRui Paulo 		 * MANUAL_SCAN_REQ - Manual scan request
660f05cddf9SRui Paulo 		 *
661f05cddf9SRui Paulo 		 * This is used for scans where the user request a scan or
662f05cddf9SRui Paulo 		 * a specific wpa_supplicant operation (e.g., WPS) requires scan
663f05cddf9SRui Paulo 		 * to be run.
664f05cddf9SRui Paulo 		 */
665f05cddf9SRui Paulo 		MANUAL_SCAN_REQ
6665b9c547cSRui Paulo 	} scan_req, last_scan_req;
6675b9c547cSRui Paulo 	enum wpa_states scan_prev_wpa_state;
6685b9c547cSRui Paulo 	struct os_reltime scan_trigger_time, scan_start_time;
669325151a3SRui Paulo 	/* Minimum freshness requirement for connection purposes */
670325151a3SRui Paulo 	struct os_reltime scan_min_time;
671f05cddf9SRui Paulo 	int scan_runs; /* number of scan runs since WPS was started */
672f05cddf9SRui Paulo 	int *next_scan_freqs;
673*85732ac8SCy Schubert 	int *select_network_scan_freqs;
6745b9c547cSRui Paulo 	int *manual_scan_freqs;
6755b9c547cSRui Paulo 	int *manual_sched_scan_freqs;
6765b9c547cSRui Paulo 	unsigned int manual_scan_passive:1;
6775b9c547cSRui Paulo 	unsigned int manual_scan_use_id:1;
6785b9c547cSRui Paulo 	unsigned int manual_scan_only_new:1;
6795b9c547cSRui Paulo 	unsigned int own_scan_requested:1;
6805b9c547cSRui Paulo 	unsigned int own_scan_running:1;
6815b9c547cSRui Paulo 	unsigned int clear_driver_scan_cache:1;
6825b9c547cSRui Paulo 	unsigned int manual_scan_id;
683f05cddf9SRui Paulo 	int scan_interval; /* time in sec between scans to find suitable AP */
684f05cddf9SRui Paulo 	int normal_scans; /* normal scans run before sched_scan */
685f05cddf9SRui Paulo 	int scan_for_connection; /* whether the scan request was triggered for
686f05cddf9SRui Paulo 				  * finding a connection */
687*85732ac8SCy Schubert 	/*
688*85732ac8SCy Schubert 	 * A unique cookie representing the vendor scan request. This cookie is
689*85732ac8SCy Schubert 	 * returned from the driver interface. 0 indicates that there is no
690*85732ac8SCy Schubert 	 * pending vendor scan request.
691*85732ac8SCy Schubert 	 */
692*85732ac8SCy Schubert 	u64 curr_scan_cookie;
6935b9c547cSRui Paulo #define MAX_SCAN_ID 16
6945b9c547cSRui Paulo 	int scan_id[MAX_SCAN_ID];
6955b9c547cSRui Paulo 	unsigned int scan_id_count;
696780fb4a2SCy Schubert 	u8 next_scan_bssid[ETH_ALEN];
697f05cddf9SRui Paulo 
698325151a3SRui Paulo 	struct wpa_ssid_value *ssids_from_scan_req;
699325151a3SRui Paulo 	unsigned int num_ssids_from_scan_req;
700325151a3SRui Paulo 
7015b9c547cSRui Paulo 	u64 drv_flags;
702f05cddf9SRui Paulo 	unsigned int drv_enc;
7035b9c547cSRui Paulo 	unsigned int drv_smps_modes;
7045b9c547cSRui Paulo 	unsigned int drv_rrm_flags;
705f05cddf9SRui Paulo 
706f05cddf9SRui Paulo 	/*
707f05cddf9SRui Paulo 	 * A bitmap of supported protocols for probe response offload. See
708f05cddf9SRui Paulo 	 * struct wpa_driver_capa in driver.h
709f05cddf9SRui Paulo 	 */
710f05cddf9SRui Paulo 	unsigned int probe_resp_offloads;
711f05cddf9SRui Paulo 
7125b9c547cSRui Paulo 	/* extended capabilities supported by the driver */
7135b9c547cSRui Paulo 	const u8 *extended_capa, *extended_capa_mask;
7145b9c547cSRui Paulo 	unsigned int extended_capa_len;
7155b9c547cSRui Paulo 
716e28a4053SRui Paulo 	int max_scan_ssids;
717f05cddf9SRui Paulo 	int max_sched_scan_ssids;
718780fb4a2SCy Schubert 	unsigned int max_sched_scan_plans;
719780fb4a2SCy Schubert 	unsigned int max_sched_scan_plan_interval;
720780fb4a2SCy Schubert 	unsigned int max_sched_scan_plan_iterations;
721f05cddf9SRui Paulo 	int sched_scan_supported;
722f05cddf9SRui Paulo 	unsigned int max_match_sets;
723e28a4053SRui Paulo 	unsigned int max_remain_on_chan;
724f05cddf9SRui Paulo 	unsigned int max_stations;
72539beb93cSSam Leffler 
72639beb93cSSam Leffler 	int pending_mic_error_report;
72739beb93cSSam Leffler 	int pending_mic_error_pairwise;
72839beb93cSSam Leffler 	int mic_errors_seen; /* Michael MIC errors with the current PTK */
72939beb93cSSam Leffler 
73039beb93cSSam Leffler 	struct wps_context *wps;
73139beb93cSSam Leffler 	int wps_success; /* WPS success event received */
732e28a4053SRui Paulo 	struct wps_er *wps_er;
7335b9c547cSRui Paulo 	unsigned int wps_run;
734325151a3SRui Paulo 	struct os_reltime wps_pin_start_time;
73539beb93cSSam Leffler 	int blacklist_cleared;
7363157ba21SRui Paulo 
7373157ba21SRui Paulo 	struct wpabuf *pending_eapol_rx;
7385b9c547cSRui Paulo 	struct os_reltime pending_eapol_rx_time;
7393157ba21SRui Paulo 	u8 pending_eapol_rx_src[ETH_ALEN];
740f05cddf9SRui Paulo 	unsigned int last_eapol_matches_bssid:1;
7415b9c547cSRui Paulo 	unsigned int eap_expected_failure:1;
7425b9c547cSRui Paulo 	unsigned int reattach:1; /* reassociation to the same BSS requested */
7435b9c547cSRui Paulo 	unsigned int mac_addr_changed:1;
744325151a3SRui Paulo 	unsigned int added_vif:1;
745a2063804SGordon Tetlow 	unsigned int wnmsleep_used:1;
746*85732ac8SCy Schubert 	unsigned int owe_transition_select:1;
747*85732ac8SCy Schubert 	unsigned int owe_transition_search:1;
7485b9c547cSRui Paulo 
7495b9c547cSRui Paulo 	struct os_reltime last_mac_addr_change;
7505b9c547cSRui Paulo 	int last_mac_addr_style;
751e28a4053SRui Paulo 
752e28a4053SRui Paulo 	struct ibss_rsn *ibss_rsn;
753e28a4053SRui Paulo 
754f05cddf9SRui Paulo 	int set_sta_uapsd;
755f05cddf9SRui Paulo 	int sta_uapsd;
756f05cddf9SRui Paulo 	int set_ap_uapsd;
757f05cddf9SRui Paulo 	int ap_uapsd;
758*85732ac8SCy Schubert 	int auth_alg;
759*85732ac8SCy Schubert 	u16 last_owe_group;
760f05cddf9SRui Paulo 
761e28a4053SRui Paulo #ifdef CONFIG_SME
762e28a4053SRui Paulo 	struct {
763325151a3SRui Paulo 		u8 ssid[SSID_MAX_LEN];
764e28a4053SRui Paulo 		size_t ssid_len;
765e28a4053SRui Paulo 		int freq;
766*85732ac8SCy Schubert 		u8 assoc_req_ie[1500];
767e28a4053SRui Paulo 		size_t assoc_req_ie_len;
768e28a4053SRui Paulo 		int mfp;
769e28a4053SRui Paulo 		int ft_used;
770e28a4053SRui Paulo 		u8 mobility_domain[2];
771e28a4053SRui Paulo 		u8 *ft_ies;
772e28a4053SRui Paulo 		size_t ft_ies_len;
773e28a4053SRui Paulo 		u8 prev_bssid[ETH_ALEN];
774e28a4053SRui Paulo 		int prev_bssid_set;
775e28a4053SRui Paulo 		int auth_alg;
776f05cddf9SRui Paulo 		int proto;
777f05cddf9SRui Paulo 
778f05cddf9SRui Paulo 		int sa_query_count; /* number of pending SA Query requests;
779f05cddf9SRui Paulo 				     * 0 = no SA Query in progress */
780f05cddf9SRui Paulo 		int sa_query_timed_out;
781f05cddf9SRui Paulo 		u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN *
782f05cddf9SRui Paulo 					* sa_query_count octets of pending
783f05cddf9SRui Paulo 					* SA Query transaction identifiers */
7845b9c547cSRui Paulo 		struct os_reltime sa_query_start;
7855b9c547cSRui Paulo 		struct os_reltime last_unprot_disconnect;
7865b9c547cSRui Paulo 		enum { HT_SEC_CHAN_UNKNOWN,
7875b9c547cSRui Paulo 		       HT_SEC_CHAN_ABOVE,
7885b9c547cSRui Paulo 		       HT_SEC_CHAN_BELOW } ht_sec_chan;
789f05cddf9SRui Paulo 		u8 sched_obss_scan;
790f05cddf9SRui Paulo 		u16 obss_scan_int;
791f05cddf9SRui Paulo 		u16 bss_max_idle_period;
7925b9c547cSRui Paulo #ifdef CONFIG_SAE
7935b9c547cSRui Paulo 		struct sae_data sae;
7945b9c547cSRui Paulo 		struct wpabuf *sae_token;
7955b9c547cSRui Paulo 		int sae_group_index;
7965b9c547cSRui Paulo 		unsigned int sae_pmksa_caching:1;
797*85732ac8SCy Schubert 		u16 seq_num;
798*85732ac8SCy Schubert 		struct external_auth ext_auth;
7995b9c547cSRui Paulo #endif /* CONFIG_SAE */
800e28a4053SRui Paulo 	} sme;
801e28a4053SRui Paulo #endif /* CONFIG_SME */
802e28a4053SRui Paulo 
803e28a4053SRui Paulo #ifdef CONFIG_AP
804e28a4053SRui Paulo 	struct hostapd_iface *ap_iface;
805e28a4053SRui Paulo 	void (*ap_configured_cb)(void *ctx, void *data);
806e28a4053SRui Paulo 	void *ap_configured_cb_ctx;
807e28a4053SRui Paulo 	void *ap_configured_cb_data;
808e28a4053SRui Paulo #endif /* CONFIG_AP */
809e28a4053SRui Paulo 
8105b9c547cSRui Paulo 	struct hostapd_iface *ifmsh;
8115b9c547cSRui Paulo #ifdef CONFIG_MESH
8125b9c547cSRui Paulo 	struct mesh_rsn *mesh_rsn;
8135b9c547cSRui Paulo 	int mesh_if_idx;
8145b9c547cSRui Paulo 	unsigned int mesh_if_created:1;
8155b9c547cSRui Paulo 	unsigned int mesh_ht_enabled:1;
816780fb4a2SCy Schubert 	unsigned int mesh_vht_enabled:1;
817*85732ac8SCy Schubert #ifdef CONFIG_PMKSA_CACHE_EXTERNAL
818*85732ac8SCy Schubert 	/* struct external_pmksa_cache::list */
819*85732ac8SCy Schubert 	struct dl_list mesh_external_pmksa_cache;
820*85732ac8SCy Schubert #endif /* CONFIG_PMKSA_CACHE_EXTERNAL */
8215b9c547cSRui Paulo #endif /* CONFIG_MESH */
8225b9c547cSRui Paulo 
823f05cddf9SRui Paulo 	unsigned int off_channel_freq;
824f05cddf9SRui Paulo 	struct wpabuf *pending_action_tx;
825f05cddf9SRui Paulo 	u8 pending_action_src[ETH_ALEN];
826f05cddf9SRui Paulo 	u8 pending_action_dst[ETH_ALEN];
827f05cddf9SRui Paulo 	u8 pending_action_bssid[ETH_ALEN];
828f05cddf9SRui Paulo 	unsigned int pending_action_freq;
829f05cddf9SRui Paulo 	int pending_action_no_cck;
830f05cddf9SRui Paulo 	int pending_action_without_roc;
8315b9c547cSRui Paulo 	unsigned int pending_action_tx_done:1;
832f05cddf9SRui Paulo 	void (*pending_action_tx_status_cb)(struct wpa_supplicant *wpa_s,
833f05cddf9SRui Paulo 					    unsigned int freq, const u8 *dst,
834f05cddf9SRui Paulo 					    const u8 *src, const u8 *bssid,
835f05cddf9SRui Paulo 					    const u8 *data, size_t data_len,
836f05cddf9SRui Paulo 					    enum offchannel_send_action_result
837f05cddf9SRui Paulo 					    result);
838f05cddf9SRui Paulo 	unsigned int roc_waiting_drv_freq;
839f05cddf9SRui Paulo 	int action_tx_wait_time;
840*85732ac8SCy Schubert 	int action_tx_wait_time_used;
841f05cddf9SRui Paulo 
8425b9c547cSRui Paulo 	int p2p_mgmt;
8435b9c547cSRui Paulo 
844f05cddf9SRui Paulo #ifdef CONFIG_P2P
845f05cddf9SRui Paulo 	struct p2p_go_neg_results *go_params;
846f05cddf9SRui Paulo 	int create_p2p_iface;
847f05cddf9SRui Paulo 	u8 pending_interface_addr[ETH_ALEN];
848f05cddf9SRui Paulo 	char pending_interface_name[100];
849f05cddf9SRui Paulo 	int pending_interface_type;
850f05cddf9SRui Paulo 	int p2p_group_idx;
851f05cddf9SRui Paulo 	unsigned int pending_listen_freq;
852f05cddf9SRui Paulo 	unsigned int pending_listen_duration;
853f05cddf9SRui Paulo 	enum {
854f05cddf9SRui Paulo 		NOT_P2P_GROUP_INTERFACE,
855f05cddf9SRui Paulo 		P2P_GROUP_INTERFACE_PENDING,
856f05cddf9SRui Paulo 		P2P_GROUP_INTERFACE_GO,
857f05cddf9SRui Paulo 		P2P_GROUP_INTERFACE_CLIENT
858f05cddf9SRui Paulo 	} p2p_group_interface;
859f05cddf9SRui Paulo 	struct p2p_group *p2p_group;
860f05cddf9SRui Paulo 	int p2p_long_listen; /* remaining time in long Listen state in ms */
861f05cddf9SRui Paulo 	char p2p_pin[10];
862f05cddf9SRui Paulo 	int p2p_wps_method;
863f05cddf9SRui Paulo 	u8 p2p_auth_invite[ETH_ALEN];
864f05cddf9SRui Paulo 	int p2p_sd_over_ctrl_iface;
865f05cddf9SRui Paulo 	int p2p_in_provisioning;
8665b9c547cSRui Paulo 	int p2p_in_invitation;
8675b9c547cSRui Paulo 	int p2p_invite_go_freq;
868f05cddf9SRui Paulo 	int pending_invite_ssid_id;
869f05cddf9SRui Paulo 	int show_group_started;
870f05cddf9SRui Paulo 	u8 go_dev_addr[ETH_ALEN];
871f05cddf9SRui Paulo 	int pending_pd_before_join;
872f05cddf9SRui Paulo 	u8 pending_join_iface_addr[ETH_ALEN];
873f05cddf9SRui Paulo 	u8 pending_join_dev_addr[ETH_ALEN];
874f05cddf9SRui Paulo 	int pending_join_wps_method;
875325151a3SRui Paulo 	u8 p2p_join_ssid[SSID_MAX_LEN];
8765b9c547cSRui Paulo 	size_t p2p_join_ssid_len;
877f05cddf9SRui Paulo 	int p2p_join_scan_count;
878f05cddf9SRui Paulo 	int auto_pd_scan_retry;
879f05cddf9SRui Paulo 	int force_long_sd;
880f05cddf9SRui Paulo 	u16 pending_pd_config_methods;
881f05cddf9SRui Paulo 	enum {
8825b9c547cSRui Paulo 		NORMAL_PD, AUTO_PD_GO_NEG, AUTO_PD_JOIN, AUTO_PD_ASP
883f05cddf9SRui Paulo 	} pending_pd_use;
884f05cddf9SRui Paulo 
885f05cddf9SRui Paulo 	/*
886f05cddf9SRui Paulo 	 * Whether cross connection is disallowed by the AP to which this
887f05cddf9SRui Paulo 	 * interface is associated (only valid if there is an association).
888f05cddf9SRui Paulo 	 */
889f05cddf9SRui Paulo 	int cross_connect_disallowed;
890f05cddf9SRui Paulo 
891f05cddf9SRui Paulo 	/*
892f05cddf9SRui Paulo 	 * Whether this P2P group is configured to use cross connection (only
893f05cddf9SRui Paulo 	 * valid if this is P2P GO interface). The actual cross connect packet
894f05cddf9SRui Paulo 	 * forwarding may not be configured depending on the uplink status.
895f05cddf9SRui Paulo 	 */
896f05cddf9SRui Paulo 	int cross_connect_enabled;
897f05cddf9SRui Paulo 
898f05cddf9SRui Paulo 	/* Whether cross connection forwarding is in use at the moment. */
899f05cddf9SRui Paulo 	int cross_connect_in_use;
900f05cddf9SRui Paulo 
901f05cddf9SRui Paulo 	/*
902f05cddf9SRui Paulo 	 * Uplink interface name for cross connection
903f05cddf9SRui Paulo 	 */
904f05cddf9SRui Paulo 	char cross_connect_uplink[100];
905f05cddf9SRui Paulo 
906f05cddf9SRui Paulo 	unsigned int p2p_auto_join:1;
907f05cddf9SRui Paulo 	unsigned int p2p_auto_pd:1;
908*85732ac8SCy Schubert 	unsigned int p2p_go_do_acs:1;
909f05cddf9SRui Paulo 	unsigned int p2p_persistent_group:1;
910f05cddf9SRui Paulo 	unsigned int p2p_fallback_to_go_neg:1;
911f05cddf9SRui Paulo 	unsigned int p2p_pd_before_go_neg:1;
912f05cddf9SRui Paulo 	unsigned int p2p_go_ht40:1;
9135b9c547cSRui Paulo 	unsigned int p2p_go_vht:1;
914f05cddf9SRui Paulo 	unsigned int user_initiated_pd:1;
9155b9c547cSRui Paulo 	unsigned int p2p_go_group_formation_completed:1;
9165b9c547cSRui Paulo 	unsigned int group_formation_reported:1;
9175b9c547cSRui Paulo 	unsigned int waiting_presence_resp;
9185b9c547cSRui Paulo 	int p2p_first_connection_timeout;
9195b9c547cSRui Paulo 	unsigned int p2p_nfc_tag_enabled:1;
9205b9c547cSRui Paulo 	unsigned int p2p_peer_oob_pk_hash_known:1;
9215b9c547cSRui Paulo 	unsigned int p2p_disable_ip_addr_req:1;
922325151a3SRui Paulo 	unsigned int p2ps_method_config_any:1;
923325151a3SRui Paulo 	unsigned int p2p_cli_probe:1;
924*85732ac8SCy Schubert 	enum hostapd_hw_mode p2p_go_acs_band;
925f05cddf9SRui Paulo 	int p2p_persistent_go_freq;
926f05cddf9SRui Paulo 	int p2p_persistent_id;
927f05cddf9SRui Paulo 	int p2p_go_intent;
928f05cddf9SRui Paulo 	int p2p_connect_freq;
9295b9c547cSRui Paulo 	struct os_reltime p2p_auto_started;
9305b9c547cSRui Paulo 	struct wpa_ssid *p2p_last_4way_hs_fail;
9315b9c547cSRui Paulo 	struct wpa_radio_work *p2p_scan_work;
9325b9c547cSRui Paulo 	struct wpa_radio_work *p2p_listen_work;
9335b9c547cSRui Paulo 	struct wpa_radio_work *p2p_send_action_work;
9345b9c547cSRui Paulo 
9355b9c547cSRui Paulo 	u16 p2p_oob_dev_pw_id; /* OOB Device Password Id for group formation */
9365b9c547cSRui Paulo 	struct wpabuf *p2p_oob_dev_pw; /* OOB Device Password for group
9375b9c547cSRui Paulo 					* formation */
9385b9c547cSRui Paulo 	u8 p2p_peer_oob_pubkey_hash[WPS_OOB_PUBKEY_HASH_LEN];
9395b9c547cSRui Paulo 	u8 p2p_ip_addr_info[3 * 4];
9405b9c547cSRui Paulo 
9415b9c547cSRui Paulo 	/* group common frequencies */
9425b9c547cSRui Paulo 	int *p2p_group_common_freqs;
9435b9c547cSRui Paulo 	unsigned int p2p_group_common_freqs_num;
9445b9c547cSRui Paulo 	u8 p2ps_join_addr[ETH_ALEN];
945780fb4a2SCy Schubert 
946780fb4a2SCy Schubert 	unsigned int p2p_go_max_oper_chwidth;
947780fb4a2SCy Schubert 	unsigned int p2p_go_vht_center_freq2;
948780fb4a2SCy Schubert 	int p2p_lo_started;
949f05cddf9SRui Paulo #endif /* CONFIG_P2P */
950f05cddf9SRui Paulo 
951e28a4053SRui Paulo 	struct wpa_ssid *bgscan_ssid;
952e28a4053SRui Paulo 	const struct bgscan_ops *bgscan;
953e28a4053SRui Paulo 	void *bgscan_priv;
954e28a4053SRui Paulo 
955f05cddf9SRui Paulo 	const struct autoscan_ops *autoscan;
956f05cddf9SRui Paulo 	struct wpa_driver_scan_params *autoscan_params;
957f05cddf9SRui Paulo 	void *autoscan_priv;
958f05cddf9SRui Paulo 
959f05cddf9SRui Paulo 	struct wpa_ssid *connect_without_scan;
960f05cddf9SRui Paulo 
961f05cddf9SRui Paulo 	struct wps_ap_info *wps_ap;
962f05cddf9SRui Paulo 	size_t num_wps_ap;
963f05cddf9SRui Paulo 	int wps_ap_iter;
964e28a4053SRui Paulo 
965e28a4053SRui Paulo 	int after_wps;
966f05cddf9SRui Paulo 	int known_wps_freq;
967e28a4053SRui Paulo 	unsigned int wps_freq;
968f05cddf9SRui Paulo 	int wps_fragment_size;
969f05cddf9SRui Paulo 	int auto_reconnect_disabled;
970f05cddf9SRui Paulo 
971f05cddf9SRui Paulo 	 /* Channel preferences for AP/P2P GO use */
972f05cddf9SRui Paulo 	int best_24_freq;
973f05cddf9SRui Paulo 	int best_5_freq;
974f05cddf9SRui Paulo 	int best_overall_freq;
975f05cddf9SRui Paulo 
976f05cddf9SRui Paulo 	struct gas_query *gas;
977*85732ac8SCy Schubert 	struct gas_server *gas_server;
978f05cddf9SRui Paulo 
979f05cddf9SRui Paulo #ifdef CONFIG_INTERWORKING
980f05cddf9SRui Paulo 	unsigned int fetch_anqp_in_progress:1;
981f05cddf9SRui Paulo 	unsigned int network_select:1;
982f05cddf9SRui Paulo 	unsigned int auto_select:1;
983f05cddf9SRui Paulo 	unsigned int auto_network_select:1;
9845b9c547cSRui Paulo 	unsigned int interworking_fast_assoc_tried:1;
985f05cddf9SRui Paulo 	unsigned int fetch_all_anqp:1;
9865b9c547cSRui Paulo 	unsigned int fetch_osu_info:1;
9875b9c547cSRui Paulo 	unsigned int fetch_osu_waiting_scan:1;
9885b9c547cSRui Paulo 	unsigned int fetch_osu_icon_in_progress:1;
9895b9c547cSRui Paulo 	struct wpa_bss *interworking_gas_bss;
9905b9c547cSRui Paulo 	unsigned int osu_icon_id;
991780fb4a2SCy Schubert 	struct dl_list icon_head; /* struct icon_entry */
9925b9c547cSRui Paulo 	struct osu_provider *osu_prov;
9935b9c547cSRui Paulo 	size_t osu_prov_count;
9945b9c547cSRui Paulo 	struct os_reltime osu_icon_fetch_start;
9955b9c547cSRui Paulo 	unsigned int num_osu_scans;
9965b9c547cSRui Paulo 	unsigned int num_prov_found;
997f05cddf9SRui Paulo #endif /* CONFIG_INTERWORKING */
998f05cddf9SRui Paulo 	unsigned int drv_capa_known;
999f05cddf9SRui Paulo 
1000f05cddf9SRui Paulo 	struct {
1001f05cddf9SRui Paulo 		struct hostapd_hw_modes *modes;
1002f05cddf9SRui Paulo 		u16 num_modes;
1003f05cddf9SRui Paulo 		u16 flags;
1004f05cddf9SRui Paulo 	} hw;
10055b9c547cSRui Paulo 	enum local_hw_capab {
10065b9c547cSRui Paulo 		CAPAB_NO_HT_VHT,
10075b9c547cSRui Paulo 		CAPAB_HT,
10085b9c547cSRui Paulo 		CAPAB_HT40,
10095b9c547cSRui Paulo 		CAPAB_VHT,
10105b9c547cSRui Paulo 	} hw_capab;
10115b9c547cSRui Paulo #ifdef CONFIG_MACSEC
10125b9c547cSRui Paulo 	struct ieee802_1x_kay *kay;
10135b9c547cSRui Paulo #endif /* CONFIG_MACSEC */
1014f05cddf9SRui Paulo 
1015f05cddf9SRui Paulo 	int pno;
10165b9c547cSRui Paulo 	int pno_sched_pending;
1017f05cddf9SRui Paulo 
1018f05cddf9SRui Paulo 	/* WLAN_REASON_* reason codes. Negative if locally generated. */
1019f05cddf9SRui Paulo 	int disconnect_reason;
1020f05cddf9SRui Paulo 
1021780fb4a2SCy Schubert 	/* WLAN_STATUS_* status codes from (Re)Association Response frame. */
1022780fb4a2SCy Schubert 	u16 assoc_status_code;
1023780fb4a2SCy Schubert 
1024f05cddf9SRui Paulo 	struct ext_password_data *ext_pw;
1025f05cddf9SRui Paulo 
10265b9c547cSRui Paulo 	struct wpabuf *last_gas_resp, *prev_gas_resp;
10275b9c547cSRui Paulo 	u8 last_gas_addr[ETH_ALEN], prev_gas_addr[ETH_ALEN];
10285b9c547cSRui Paulo 	u8 last_gas_dialog_token, prev_gas_dialog_token;
1029f05cddf9SRui Paulo 
1030f05cddf9SRui Paulo 	unsigned int no_keep_alive:1;
10315b9c547cSRui Paulo 	unsigned int ext_mgmt_frame_handling:1;
10325b9c547cSRui Paulo 	unsigned int ext_eapol_frame_io:1;
10335b9c547cSRui Paulo 	unsigned int wmm_ac_supported:1;
10345b9c547cSRui Paulo 	unsigned int ext_work_in_progress:1;
10355b9c547cSRui Paulo 	unsigned int own_disconnect_req:1;
1036*85732ac8SCy Schubert 	unsigned int ignore_post_flush_scan_res:1;
10375b9c547cSRui Paulo 
10385b9c547cSRui Paulo #define MAC_ADDR_RAND_SCAN       BIT(0)
10395b9c547cSRui Paulo #define MAC_ADDR_RAND_SCHED_SCAN BIT(1)
10405b9c547cSRui Paulo #define MAC_ADDR_RAND_PNO        BIT(2)
10415b9c547cSRui Paulo #define MAC_ADDR_RAND_ALL        (MAC_ADDR_RAND_SCAN | \
10425b9c547cSRui Paulo 				  MAC_ADDR_RAND_SCHED_SCAN | \
10435b9c547cSRui Paulo 				  MAC_ADDR_RAND_PNO)
10445b9c547cSRui Paulo 	unsigned int mac_addr_rand_supported;
10455b9c547cSRui Paulo 	unsigned int mac_addr_rand_enable;
10465b9c547cSRui Paulo 
10475b9c547cSRui Paulo 	/* MAC Address followed by mask (2 * ETH_ALEN) */
10485b9c547cSRui Paulo 	u8 *mac_addr_scan;
10495b9c547cSRui Paulo 	u8 *mac_addr_sched_scan;
10505b9c547cSRui Paulo 	u8 *mac_addr_pno;
10515b9c547cSRui Paulo 
10525b9c547cSRui Paulo #ifdef CONFIG_WNM
10535b9c547cSRui Paulo 	u8 wnm_dialog_token;
10545b9c547cSRui Paulo 	u8 wnm_reply;
10555b9c547cSRui Paulo 	u8 wnm_num_neighbor_report;
10565b9c547cSRui Paulo 	u8 wnm_mode;
10575b9c547cSRui Paulo 	u16 wnm_dissoc_timer;
10585b9c547cSRui Paulo 	u8 wnm_bss_termination_duration[12];
10595b9c547cSRui Paulo 	struct neighbor_report *wnm_neighbor_report_elements;
10605b9c547cSRui Paulo 	struct os_reltime wnm_cand_valid_until;
10615b9c547cSRui Paulo 	u8 wnm_cand_from_bss[ETH_ALEN];
1062*85732ac8SCy Schubert 	struct wpabuf *coloc_intf_elems;
1063*85732ac8SCy Schubert 	u8 coloc_intf_dialog_token;
1064*85732ac8SCy Schubert 	u8 coloc_intf_auto_report;
1065*85732ac8SCy Schubert 	u8 coloc_intf_timeout;
1066*85732ac8SCy Schubert #ifdef CONFIG_MBO
1067*85732ac8SCy Schubert 	unsigned int wnm_mbo_trans_reason_present:1;
1068*85732ac8SCy Schubert 	u8 wnm_mbo_transition_reason;
1069*85732ac8SCy Schubert #endif /* CONFIG_MBO */
10705b9c547cSRui Paulo #endif /* CONFIG_WNM */
10715b9c547cSRui Paulo 
10725b9c547cSRui Paulo #ifdef CONFIG_TESTING_GET_GTK
10735b9c547cSRui Paulo 	u8 last_gtk[32];
10745b9c547cSRui Paulo 	size_t last_gtk_len;
10755b9c547cSRui Paulo #endif /* CONFIG_TESTING_GET_GTK */
10765b9c547cSRui Paulo 
10775b9c547cSRui Paulo 	unsigned int num_multichan_concurrent;
10785b9c547cSRui Paulo 	struct wpa_radio_work *connect_work;
10795b9c547cSRui Paulo 
10805b9c547cSRui Paulo 	unsigned int ext_work_id;
10815b9c547cSRui Paulo 
10825b9c547cSRui Paulo 	struct wpabuf *vendor_elem[NUM_VENDOR_ELEM_FRAMES];
10835b9c547cSRui Paulo 
10845b9c547cSRui Paulo #ifdef CONFIG_TESTING_OPTIONS
10855b9c547cSRui Paulo 	struct l2_packet_data *l2_test;
10865b9c547cSRui Paulo 	unsigned int extra_roc_dur;
10875b9c547cSRui Paulo 	enum wpa_supplicant_test_failure test_failure;
1088*85732ac8SCy Schubert 	char *get_pref_freq_list_override;
1089780fb4a2SCy Schubert 	unsigned int reject_btm_req_reason;
1090780fb4a2SCy Schubert 	unsigned int p2p_go_csa_on_inv:1;
1091780fb4a2SCy Schubert 	unsigned int ignore_auth_resp:1;
1092780fb4a2SCy Schubert 	unsigned int ignore_assoc_disallow:1;
1093*85732ac8SCy Schubert 	unsigned int testing_resend_assoc:1;
1094*85732ac8SCy Schubert 	struct wpabuf *sae_commit_override;
1095*85732ac8SCy Schubert 	enum wpa_alg last_tk_alg;
1096*85732ac8SCy Schubert 	u8 last_tk_addr[ETH_ALEN];
1097*85732ac8SCy Schubert 	int last_tk_key_idx;
1098*85732ac8SCy Schubert 	u8 last_tk[WPA_TK_MAX_LEN];
1099*85732ac8SCy Schubert 	size_t last_tk_len;
1100*85732ac8SCy Schubert 	struct wpabuf *last_assoc_req_wpa_ie;
11015b9c547cSRui Paulo #endif /* CONFIG_TESTING_OPTIONS */
11025b9c547cSRui Paulo 
11035b9c547cSRui Paulo 	struct wmm_ac_assoc_data *wmm_ac_assoc_info;
11045b9c547cSRui Paulo 	struct wmm_tspec_element *tspecs[WMM_AC_NUM][TS_DIR_IDX_COUNT];
11055b9c547cSRui Paulo 	struct wmm_ac_addts_request *addts_request;
11065b9c547cSRui Paulo 	u8 wmm_ac_last_dialog_token;
11075b9c547cSRui Paulo 	struct wmm_tspec_element *last_tspecs;
11085b9c547cSRui Paulo 	u8 last_tspecs_count;
11095b9c547cSRui Paulo 
11105b9c547cSRui Paulo 	struct rrm_data rrm;
1111*85732ac8SCy Schubert 	struct beacon_rep_data beacon_rep_data;
1112325151a3SRui Paulo 
1113325151a3SRui Paulo #ifdef CONFIG_FST
1114325151a3SRui Paulo 	struct fst_iface *fst;
1115325151a3SRui Paulo 	const struct wpabuf *fst_ies;
1116325151a3SRui Paulo 	struct wpabuf *received_mb_ies;
1117325151a3SRui Paulo #endif /* CONFIG_FST */
1118780fb4a2SCy Schubert 
1119780fb4a2SCy Schubert #ifdef CONFIG_MBO
1120780fb4a2SCy Schubert 	/* Multiband operation non-preferred channel */
1121780fb4a2SCy Schubert 	struct wpa_mbo_non_pref_channel {
1122780fb4a2SCy Schubert 		enum mbo_non_pref_chan_reason reason;
1123780fb4a2SCy Schubert 		u8 oper_class;
1124780fb4a2SCy Schubert 		u8 chan;
1125780fb4a2SCy Schubert 		u8 preference;
1126780fb4a2SCy Schubert 	} *non_pref_chan;
1127780fb4a2SCy Schubert 	size_t non_pref_chan_num;
1128780fb4a2SCy Schubert 	u8 mbo_wnm_token;
1129*85732ac8SCy Schubert 	/**
1130*85732ac8SCy Schubert 	 * enable_oce - Enable OCE if it is enabled by user and device also
1131*85732ac8SCy Schubert 	 *		supports OCE.
1132*85732ac8SCy Schubert 	 * User can enable OCE with wpa_config's 'oce' parameter as follows -
1133*85732ac8SCy Schubert 	 *  - Set BIT(0) to enable OCE in non-AP STA mode.
1134*85732ac8SCy Schubert 	 *  - Set BIT(1) to enable OCE in STA-CFON mode.
1135*85732ac8SCy Schubert 	 */
1136*85732ac8SCy Schubert 	u8 enable_oce;
1137780fb4a2SCy Schubert #endif /* CONFIG_MBO */
1138780fb4a2SCy Schubert 
1139780fb4a2SCy Schubert 	/*
1140780fb4a2SCy Schubert 	 * This should be under CONFIG_MBO, but it is left out to allow using
1141780fb4a2SCy Schubert 	 * the bss_temp_disallowed list for other purposes as well.
1142780fb4a2SCy Schubert 	 */
1143780fb4a2SCy Schubert 	struct dl_list bss_tmp_disallowed;
1144780fb4a2SCy Schubert 
1145780fb4a2SCy Schubert 	/*
1146780fb4a2SCy Schubert 	 * Content of a measurement report element with type 8 (LCI),
1147780fb4a2SCy Schubert 	 * own location.
1148780fb4a2SCy Schubert 	 */
1149780fb4a2SCy Schubert 	struct wpabuf *lci;
1150780fb4a2SCy Schubert 	struct os_reltime lci_time;
1151*85732ac8SCy Schubert 
1152*85732ac8SCy Schubert 	struct os_reltime beacon_rep_scan;
1153*85732ac8SCy Schubert 
1154*85732ac8SCy Schubert 	/* FILS HLP requests (struct fils_hlp_req) */
1155*85732ac8SCy Schubert 	struct dl_list fils_hlp_req;
1156*85732ac8SCy Schubert 
1157*85732ac8SCy Schubert 	struct sched_scan_relative_params {
1158*85732ac8SCy Schubert 		/**
1159*85732ac8SCy Schubert 		 * relative_rssi_set - Enable relatively preferred BSS reporting
1160*85732ac8SCy Schubert 		 *
1161*85732ac8SCy Schubert 		 * 0 = Disable reporting relatively preferred BSSs
1162*85732ac8SCy Schubert 		 * 1 = Enable reporting relatively preferred BSSs
1163*85732ac8SCy Schubert 		 */
1164*85732ac8SCy Schubert 		int relative_rssi_set;
1165*85732ac8SCy Schubert 
1166*85732ac8SCy Schubert 		/**
1167*85732ac8SCy Schubert 		 * relative_rssi - Relative RSSI for reporting better BSSs
1168*85732ac8SCy Schubert 		 *
1169*85732ac8SCy Schubert 		 * Amount of RSSI by which a BSS should be better than the
1170*85732ac8SCy Schubert 		 * current connected BSS so that the new BSS can be reported
1171*85732ac8SCy Schubert 		 * to user space. This applies to sched_scan operations.
1172*85732ac8SCy Schubert 		 */
1173*85732ac8SCy Schubert 		int relative_rssi;
1174*85732ac8SCy Schubert 
1175*85732ac8SCy Schubert 		/**
1176*85732ac8SCy Schubert 		 * relative_adjust_band - Band in which RSSI is to be adjusted
1177*85732ac8SCy Schubert 		 */
1178*85732ac8SCy Schubert 		enum set_band relative_adjust_band;
1179*85732ac8SCy Schubert 
1180*85732ac8SCy Schubert 		/**
1181*85732ac8SCy Schubert 		 * relative_adjust_rssi - RSSI adjustment
1182*85732ac8SCy Schubert 		 *
1183*85732ac8SCy Schubert 		 * An amount of relative_adjust_rssi should be added to the
1184*85732ac8SCy Schubert 		 * BSSs that belong to the relative_adjust_band while comparing
1185*85732ac8SCy Schubert 		 * with other bands for BSS reporting.
1186*85732ac8SCy Schubert 		 */
1187*85732ac8SCy Schubert 		int relative_adjust_rssi;
1188*85732ac8SCy Schubert 	} srp;
1189*85732ac8SCy Schubert 
1190*85732ac8SCy Schubert 	/* RIC elements for FT protocol */
1191*85732ac8SCy Schubert 	struct wpabuf *ric_ies;
1192*85732ac8SCy Schubert 
1193*85732ac8SCy Schubert 	int last_auth_timeout_sec;
1194*85732ac8SCy Schubert 
1195*85732ac8SCy Schubert #ifdef CONFIG_DPP
1196*85732ac8SCy Schubert 	struct dl_list dpp_bootstrap; /* struct dpp_bootstrap_info */
1197*85732ac8SCy Schubert 	struct dl_list dpp_configurator; /* struct dpp_configurator */
1198*85732ac8SCy Schubert 	int dpp_init_done;
1199*85732ac8SCy Schubert 	struct dpp_authentication *dpp_auth;
1200*85732ac8SCy Schubert 	struct wpa_radio_work *dpp_listen_work;
1201*85732ac8SCy Schubert 	unsigned int dpp_pending_listen_freq;
1202*85732ac8SCy Schubert 	unsigned int dpp_listen_freq;
1203*85732ac8SCy Schubert 	u8 dpp_allowed_roles;
1204*85732ac8SCy Schubert 	int dpp_qr_mutual;
1205*85732ac8SCy Schubert 	int dpp_netrole_ap;
1206*85732ac8SCy Schubert 	int dpp_auth_ok_on_ack;
1207*85732ac8SCy Schubert 	int dpp_in_response_listen;
1208*85732ac8SCy Schubert 	int dpp_gas_client;
1209*85732ac8SCy Schubert 	int dpp_gas_dialog_token;
1210*85732ac8SCy Schubert 	u8 dpp_intro_bssid[ETH_ALEN];
1211*85732ac8SCy Schubert 	void *dpp_intro_network;
1212*85732ac8SCy Schubert 	struct dpp_pkex *dpp_pkex;
1213*85732ac8SCy Schubert 	struct dpp_bootstrap_info *dpp_pkex_bi;
1214*85732ac8SCy Schubert 	char *dpp_pkex_code;
1215*85732ac8SCy Schubert 	char *dpp_pkex_identifier;
1216*85732ac8SCy Schubert 	char *dpp_pkex_auth_cmd;
1217*85732ac8SCy Schubert 	char *dpp_configurator_params;
1218*85732ac8SCy Schubert 	struct os_reltime dpp_last_init;
1219*85732ac8SCy Schubert 	struct os_reltime dpp_init_iter_start;
1220*85732ac8SCy Schubert 	unsigned int dpp_init_max_tries;
1221*85732ac8SCy Schubert 	unsigned int dpp_init_retry_time;
1222*85732ac8SCy Schubert 	unsigned int dpp_resp_wait_time;
1223*85732ac8SCy Schubert 	unsigned int dpp_resp_max_tries;
1224*85732ac8SCy Schubert 	unsigned int dpp_resp_retry_time;
1225*85732ac8SCy Schubert #ifdef CONFIG_TESTING_OPTIONS
1226*85732ac8SCy Schubert 	char *dpp_config_obj_override;
1227*85732ac8SCy Schubert 	char *dpp_discovery_override;
1228*85732ac8SCy Schubert 	char *dpp_groups_override;
1229*85732ac8SCy Schubert 	unsigned int dpp_ignore_netaccesskey_mismatch:1;
1230*85732ac8SCy Schubert #endif /* CONFIG_TESTING_OPTIONS */
1231*85732ac8SCy Schubert #endif /* CONFIG_DPP */
1232*85732ac8SCy Schubert 
1233*85732ac8SCy Schubert #ifdef CONFIG_FILS
1234*85732ac8SCy Schubert 	unsigned int disable_fils:1;
1235*85732ac8SCy Schubert #endif /* CONFIG_FILS */
1236*85732ac8SCy Schubert 	unsigned int ieee80211ac:1;
123739beb93cSSam Leffler };
123839beb93cSSam Leffler 
123939beb93cSSam Leffler 
124039beb93cSSam Leffler /* wpa_supplicant.c */
1241f05cddf9SRui Paulo void wpa_supplicant_apply_ht_overrides(
1242f05cddf9SRui Paulo 	struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
1243f05cddf9SRui Paulo 	struct wpa_driver_associate_params *params);
12445b9c547cSRui Paulo void wpa_supplicant_apply_vht_overrides(
12455b9c547cSRui Paulo 	struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
12465b9c547cSRui Paulo 	struct wpa_driver_associate_params *params);
1247f05cddf9SRui Paulo 
1248e28a4053SRui Paulo int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
12495b9c547cSRui Paulo int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s,
12505b9c547cSRui Paulo 				    struct wpa_ssid *ssid);
1251e28a4053SRui Paulo 
125239beb93cSSam Leffler int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s);
125339beb93cSSam Leffler 
1254e28a4053SRui Paulo const char * wpa_supplicant_state_txt(enum wpa_states state);
1255f05cddf9SRui Paulo int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s);
125639beb93cSSam Leffler int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s);
125739beb93cSSam Leffler int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
1258e28a4053SRui Paulo 			      struct wpa_bss *bss, struct wpa_ssid *ssid,
125939beb93cSSam Leffler 			      u8 *wpa_ie, size_t *wpa_ie_len);
126039beb93cSSam Leffler void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
1261e28a4053SRui Paulo 			      struct wpa_bss *bss,
126239beb93cSSam Leffler 			      struct wpa_ssid *ssid);
126339beb93cSSam Leffler void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s,
126439beb93cSSam Leffler 				       struct wpa_ssid *ssid);
126539beb93cSSam Leffler void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s);
126639beb93cSSam Leffler void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr);
126739beb93cSSam Leffler void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
126839beb93cSSam Leffler 				     int sec, int usec);
1269*85732ac8SCy Schubert void wpas_auth_timeout_restart(struct wpa_supplicant *wpa_s, int sec_diff);
1270f05cddf9SRui Paulo void wpa_supplicant_reinit_autoscan(struct wpa_supplicant *wpa_s);
1271e28a4053SRui Paulo void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
1272e28a4053SRui Paulo 			      enum wpa_states state);
127339beb93cSSam Leffler struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s);
1274f05cddf9SRui Paulo const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s);
127539beb93cSSam Leffler void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
127639beb93cSSam Leffler void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
127739beb93cSSam Leffler 				   int reason_code);
127839beb93cSSam Leffler 
1279780fb4a2SCy Schubert struct wpa_ssid * wpa_supplicant_add_network(struct wpa_supplicant *wpa_s);
1280780fb4a2SCy Schubert int wpa_supplicant_remove_network(struct wpa_supplicant *wpa_s, int id);
1281e28a4053SRui Paulo void wpa_supplicant_enable_network(struct wpa_supplicant *wpa_s,
1282e28a4053SRui Paulo 				   struct wpa_ssid *ssid);
1283e28a4053SRui Paulo void wpa_supplicant_disable_network(struct wpa_supplicant *wpa_s,
1284e28a4053SRui Paulo 				    struct wpa_ssid *ssid);
1285e28a4053SRui Paulo void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s,
1286e28a4053SRui Paulo 				   struct wpa_ssid *ssid);
12875b9c547cSRui Paulo int wpas_set_pkcs11_engine_and_module_path(struct wpa_supplicant *wpa_s,
12885b9c547cSRui Paulo 					   const char *pkcs11_engine_path,
12895b9c547cSRui Paulo 					   const char *pkcs11_module_path);
1290e28a4053SRui Paulo int wpa_supplicant_set_ap_scan(struct wpa_supplicant *wpa_s,
1291e28a4053SRui Paulo 			       int ap_scan);
1292f05cddf9SRui Paulo int wpa_supplicant_set_bss_expiration_age(struct wpa_supplicant *wpa_s,
1293f05cddf9SRui Paulo 					  unsigned int expire_age);
1294f05cddf9SRui Paulo int wpa_supplicant_set_bss_expiration_count(struct wpa_supplicant *wpa_s,
1295f05cddf9SRui Paulo 					    unsigned int expire_count);
1296f05cddf9SRui Paulo int wpa_supplicant_set_scan_interval(struct wpa_supplicant *wpa_s,
1297f05cddf9SRui Paulo 				     int scan_interval);
1298e28a4053SRui Paulo int wpa_supplicant_set_debug_params(struct wpa_global *global,
1299e28a4053SRui Paulo 				    int debug_level, int debug_timestamp,
1300e28a4053SRui Paulo 				    int debug_show_keys);
1301f05cddf9SRui Paulo void free_hw_features(struct wpa_supplicant *wpa_s);
1302e28a4053SRui Paulo 
130339beb93cSSam Leffler void wpa_show_license(void);
130439beb93cSSam Leffler 
1305780fb4a2SCy Schubert struct wpa_interface * wpa_supplicant_match_iface(struct wpa_global *global,
1306780fb4a2SCy Schubert 						  const char *ifname);
130739beb93cSSam Leffler struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
13085b9c547cSRui Paulo 						 struct wpa_interface *iface,
13095b9c547cSRui Paulo 						 struct wpa_supplicant *parent);
131039beb93cSSam Leffler int wpa_supplicant_remove_iface(struct wpa_global *global,
1311f05cddf9SRui Paulo 				struct wpa_supplicant *wpa_s,
1312f05cddf9SRui Paulo 				int terminate);
131339beb93cSSam Leffler struct wpa_supplicant * wpa_supplicant_get_iface(struct wpa_global *global,
131439beb93cSSam Leffler 						 const char *ifname);
131539beb93cSSam Leffler struct wpa_global * wpa_supplicant_init(struct wpa_params *params);
131639beb93cSSam Leffler int wpa_supplicant_run(struct wpa_global *global);
131739beb93cSSam Leffler void wpa_supplicant_deinit(struct wpa_global *global);
131839beb93cSSam Leffler 
131939beb93cSSam Leffler int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
132039beb93cSSam Leffler 			      struct wpa_ssid *ssid);
1321e28a4053SRui Paulo void wpa_supplicant_terminate_proc(struct wpa_global *global);
1322e28a4053SRui Paulo void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
1323e28a4053SRui Paulo 			     const u8 *buf, size_t len);
1324f05cddf9SRui Paulo void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s);
1325f05cddf9SRui Paulo void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s);
1326f05cddf9SRui Paulo void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid);
1327*85732ac8SCy Schubert void fils_connection_failure(struct wpa_supplicant *wpa_s);
1328f05cddf9SRui Paulo int wpas_driver_bss_selection(struct wpa_supplicant *wpa_s);
1329f05cddf9SRui Paulo int wpas_is_p2p_prioritized(struct wpa_supplicant *wpa_s);
13305b9c547cSRui Paulo void wpas_auth_failed(struct wpa_supplicant *wpa_s, char *reason);
1331f05cddf9SRui Paulo void wpas_clear_temp_disabled(struct wpa_supplicant *wpa_s,
1332f05cddf9SRui Paulo 			      struct wpa_ssid *ssid, int clear_failures);
1333f05cddf9SRui Paulo int disallowed_bssid(struct wpa_supplicant *wpa_s, const u8 *bssid);
1334f05cddf9SRui Paulo int disallowed_ssid(struct wpa_supplicant *wpa_s, const u8 *ssid,
1335f05cddf9SRui Paulo 		    size_t ssid_len);
1336f05cddf9SRui Paulo void wpas_request_connection(struct wpa_supplicant *wpa_s);
1337780fb4a2SCy Schubert void wpas_request_disconnection(struct wpa_supplicant *wpa_s);
13385b9c547cSRui Paulo int wpas_build_ext_capab(struct wpa_supplicant *wpa_s, u8 *buf, size_t buflen);
13395b9c547cSRui Paulo int wpas_update_random_addr(struct wpa_supplicant *wpa_s, int style);
13405b9c547cSRui Paulo int wpas_update_random_addr_disassoc(struct wpa_supplicant *wpa_s);
13415b9c547cSRui Paulo void add_freq(int *freqs, int *num_freqs, int freq);
13425b9c547cSRui Paulo 
13435b9c547cSRui Paulo void wpas_rrm_reset(struct wpa_supplicant *wpa_s);
13445b9c547cSRui Paulo void wpas_rrm_process_neighbor_rep(struct wpa_supplicant *wpa_s,
13455b9c547cSRui Paulo 				   const u8 *report, size_t report_len);
13465b9c547cSRui Paulo int wpas_rrm_send_neighbor_rep_request(struct wpa_supplicant *wpa_s,
1347780fb4a2SCy Schubert 				       const struct wpa_ssid_value *ssid,
1348780fb4a2SCy Schubert 				       int lci, int civic,
13495b9c547cSRui Paulo 				       void (*cb)(void *ctx,
13505b9c547cSRui Paulo 						  struct wpabuf *neighbor_rep),
13515b9c547cSRui Paulo 				       void *cb_ctx);
1352780fb4a2SCy Schubert void wpas_rrm_handle_radio_measurement_request(struct wpa_supplicant *wpa_s,
1353*85732ac8SCy Schubert 					       const u8 *src, const u8 *dst,
1354780fb4a2SCy Schubert 					       const u8 *frame, size_t len);
13555b9c547cSRui Paulo void wpas_rrm_handle_link_measurement_request(struct wpa_supplicant *wpa_s,
13565b9c547cSRui Paulo 					      const u8 *src,
13575b9c547cSRui Paulo 					      const u8 *frame, size_t len,
13585b9c547cSRui Paulo 					      int rssi);
1359*85732ac8SCy Schubert void wpas_rrm_refuse_request(struct wpa_supplicant *wpa_s);
1360*85732ac8SCy Schubert int wpas_beacon_rep_scan_process(struct wpa_supplicant *wpa_s,
1361*85732ac8SCy Schubert 				 struct wpa_scan_results *scan_res,
1362*85732ac8SCy Schubert 				 struct scan_info *info);
1363*85732ac8SCy Schubert void wpas_clear_beacon_rep_data(struct wpa_supplicant *wpa_s);
1364*85732ac8SCy Schubert void wpas_flush_fils_hlp_req(struct wpa_supplicant *wpa_s);
1365f05cddf9SRui Paulo 
1366780fb4a2SCy Schubert 
1367780fb4a2SCy Schubert /* MBO functions */
1368*85732ac8SCy Schubert int wpas_mbo_ie(struct wpa_supplicant *wpa_s, u8 *buf, size_t len,
1369*85732ac8SCy Schubert 		int add_oce_capa);
1370*85732ac8SCy Schubert const u8 * mbo_attr_from_mbo_ie(const u8 *mbo_ie, enum mbo_attr_id attr);
1371780fb4a2SCy Schubert const u8 * wpas_mbo_get_bss_attr(struct wpa_bss *bss, enum mbo_attr_id attr);
1372780fb4a2SCy Schubert int wpas_mbo_update_non_pref_chan(struct wpa_supplicant *wpa_s,
1373780fb4a2SCy Schubert 				  const char *non_pref_chan);
1374780fb4a2SCy Schubert void wpas_mbo_scan_ie(struct wpa_supplicant *wpa_s, struct wpabuf *ie);
1375780fb4a2SCy Schubert void wpas_mbo_ie_trans_req(struct wpa_supplicant *wpa_s, const u8 *ie,
1376780fb4a2SCy Schubert 			   size_t len);
1377780fb4a2SCy Schubert size_t wpas_mbo_ie_bss_trans_reject(struct wpa_supplicant *wpa_s, u8 *pos,
1378780fb4a2SCy Schubert 				    size_t len,
1379780fb4a2SCy Schubert 				    enum mbo_transition_reject_reason reason);
1380780fb4a2SCy Schubert void wpas_mbo_update_cell_capa(struct wpa_supplicant *wpa_s, u8 mbo_cell_capa);
1381780fb4a2SCy Schubert struct wpabuf * mbo_build_anqp_buf(struct wpa_supplicant *wpa_s,
1382*85732ac8SCy Schubert 				   struct wpa_bss *bss, u32 mbo_subtypes);
1383*85732ac8SCy Schubert void mbo_parse_rx_anqp_resp(struct wpa_supplicant *wpa_s,
1384*85732ac8SCy Schubert 			    struct wpa_bss *bss, const u8 *sa,
1385*85732ac8SCy Schubert 			    const u8 *data, size_t slen);
1386*85732ac8SCy Schubert 
1387*85732ac8SCy Schubert /* op_classes.c */
1388*85732ac8SCy Schubert enum chan_allowed {
1389*85732ac8SCy Schubert 	NOT_ALLOWED, NO_IR, ALLOWED
1390*85732ac8SCy Schubert };
1391*85732ac8SCy Schubert 
1392*85732ac8SCy Schubert enum chan_allowed verify_channel(struct hostapd_hw_modes *mode, u8 channel,
1393*85732ac8SCy Schubert 				 u8 bw);
1394*85732ac8SCy Schubert size_t wpas_supp_op_class_ie(struct wpa_supplicant *wpa_s, int freq, u8 *pos,
1395*85732ac8SCy Schubert 			      size_t len);
1396780fb4a2SCy Schubert 
1397f05cddf9SRui Paulo /**
1398f05cddf9SRui Paulo  * wpa_supplicant_ctrl_iface_ctrl_rsp_handle - Handle a control response
1399f05cddf9SRui Paulo  * @wpa_s: Pointer to wpa_supplicant data
1400f05cddf9SRui Paulo  * @ssid: Pointer to the network block the reply is for
1401f05cddf9SRui Paulo  * @field: field the response is a reply for
1402f05cddf9SRui Paulo  * @value: value (ie, password, etc) for @field
1403f05cddf9SRui Paulo  * Returns: 0 on success, non-zero on error
1404f05cddf9SRui Paulo  *
1405f05cddf9SRui Paulo  * Helper function to handle replies to control interface requests.
1406f05cddf9SRui Paulo  */
1407f05cddf9SRui Paulo int wpa_supplicant_ctrl_iface_ctrl_rsp_handle(struct wpa_supplicant *wpa_s,
1408f05cddf9SRui Paulo 					      struct wpa_ssid *ssid,
1409f05cddf9SRui Paulo 					      const char *field,
1410f05cddf9SRui Paulo 					      const char *value);
141139beb93cSSam Leffler 
14125b9c547cSRui Paulo void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
14135b9c547cSRui Paulo 			  const struct wpa_ssid *ssid,
14145b9c547cSRui Paulo 			  struct hostapd_freq_params *freq);
14155b9c547cSRui Paulo 
141639beb93cSSam Leffler /* events.c */
141739beb93cSSam Leffler void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s);
1418f05cddf9SRui Paulo int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
1419e28a4053SRui Paulo 			   struct wpa_bss *selected,
1420e28a4053SRui Paulo 			   struct wpa_ssid *ssid);
1421f05cddf9SRui Paulo void wpa_supplicant_stop_countermeasures(void *eloop_ctx, void *sock_ctx);
1422f05cddf9SRui Paulo void wpa_supplicant_delayed_mic_error_report(void *eloop_ctx, void *sock_ctx);
1423f05cddf9SRui Paulo void wnm_bss_keep_alive_deinit(struct wpa_supplicant *wpa_s);
14245b9c547cSRui Paulo int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s);
14255b9c547cSRui Paulo struct wpa_bss * wpa_supplicant_pick_network(struct wpa_supplicant *wpa_s,
14265b9c547cSRui Paulo 					     struct wpa_ssid **selected_ssid);
1427*85732ac8SCy Schubert int wpas_temp_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
142839beb93cSSam Leffler 
1429e28a4053SRui Paulo /* eap_register.c */
1430e28a4053SRui Paulo int eap_register_methods(void);
143139beb93cSSam Leffler 
1432f05cddf9SRui Paulo /**
1433325151a3SRui Paulo  * Utility method to tell if a given network is for persistent group storage
1434f05cddf9SRui Paulo  * @ssid: Network object
1435f05cddf9SRui Paulo  * Returns: 1 if network is a persistent group, 0 otherwise
1436f05cddf9SRui Paulo  */
1437f05cddf9SRui Paulo static inline int network_is_persistent_group(struct wpa_ssid *ssid)
1438f05cddf9SRui Paulo {
1439325151a3SRui Paulo 	return ssid->disabled == 2 && ssid->p2p_persistent_group;
1440f05cddf9SRui Paulo }
1441f05cddf9SRui Paulo 
1442f05cddf9SRui Paulo int wpas_network_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
14435b9c547cSRui Paulo int wpas_get_ssid_pmf(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
1444f05cddf9SRui Paulo 
1445f05cddf9SRui Paulo int wpas_init_ext_pw(struct wpa_supplicant *wpa_s);
1446f05cddf9SRui Paulo 
14475b9c547cSRui Paulo void dump_freq_data(struct wpa_supplicant *wpa_s, const char *title,
14485b9c547cSRui Paulo 		    struct wpa_used_freq_data *freqs_data,
14495b9c547cSRui Paulo 		    unsigned int len);
14505b9c547cSRui Paulo 
14515b9c547cSRui Paulo int get_shared_radio_freqs_data(struct wpa_supplicant *wpa_s,
14525b9c547cSRui Paulo 				struct wpa_used_freq_data *freqs_data,
14535b9c547cSRui Paulo 				unsigned int len);
14545b9c547cSRui Paulo int get_shared_radio_freqs(struct wpa_supplicant *wpa_s,
14555b9c547cSRui Paulo 			   int *freq_array, unsigned int len);
14565b9c547cSRui Paulo 
1457325151a3SRui Paulo void wpas_network_reenabled(void *eloop_ctx, void *timeout_ctx);
1458325151a3SRui Paulo 
1459780fb4a2SCy Schubert void wpas_vendor_elem_update(struct wpa_supplicant *wpa_s);
1460780fb4a2SCy Schubert struct wpa_supplicant * wpas_vendor_elem(struct wpa_supplicant *wpa_s,
1461780fb4a2SCy Schubert 					 enum wpa_vendor_elem_frame frame);
1462780fb4a2SCy Schubert int wpas_vendor_elem_remove(struct wpa_supplicant *wpa_s, int frame,
1463780fb4a2SCy Schubert 			    const u8 *elem, size_t len);
1464780fb4a2SCy Schubert 
1465325151a3SRui Paulo #ifdef CONFIG_FST
1466325151a3SRui Paulo 
1467325151a3SRui Paulo struct fst_wpa_obj;
1468325151a3SRui Paulo 
1469325151a3SRui Paulo void fst_wpa_supplicant_fill_iface_obj(struct wpa_supplicant *wpa_s,
1470325151a3SRui Paulo 				       struct fst_wpa_obj *iface_obj);
1471325151a3SRui Paulo 
1472325151a3SRui Paulo #endif /* CONFIG_FST */
1473325151a3SRui Paulo 
1474780fb4a2SCy Schubert int wpas_sched_scan_plans_set(struct wpa_supplicant *wpa_s, const char *cmd);
1475780fb4a2SCy Schubert 
1476780fb4a2SCy Schubert struct hostapd_hw_modes * get_mode(struct hostapd_hw_modes *modes,
1477780fb4a2SCy Schubert 				   u16 num_modes, enum hostapd_hw_mode mode);
1478780fb4a2SCy Schubert 
1479780fb4a2SCy Schubert void wpa_bss_tmp_disallow(struct wpa_supplicant *wpa_s, const u8 *bssid,
1480780fb4a2SCy Schubert 			  unsigned int sec);
1481780fb4a2SCy Schubert int wpa_is_bss_tmp_disallowed(struct wpa_supplicant *wpa_s, const u8 *bssid);
1482780fb4a2SCy Schubert 
1483780fb4a2SCy Schubert struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
1484780fb4a2SCy Schubert 				     int i, struct wpa_bss *bss,
1485780fb4a2SCy Schubert 				     struct wpa_ssid *group,
1486*85732ac8SCy Schubert 				     int only_first_ssid, int debug_print);
1487*85732ac8SCy Schubert 
1488*85732ac8SCy Schubert int wpas_ctrl_iface_get_pref_freq_list_override(struct wpa_supplicant *wpa_s,
1489*85732ac8SCy Schubert 						enum wpa_driver_if_type if_type,
1490*85732ac8SCy Schubert 						unsigned int *num,
1491*85732ac8SCy Schubert 						unsigned int *freq_list);
1492*85732ac8SCy Schubert 
1493*85732ac8SCy Schubert int wpa_is_fils_supported(struct wpa_supplicant *wpa_s);
1494*85732ac8SCy Schubert int wpa_is_fils_sk_pfs_supported(struct wpa_supplicant *wpa_s);
1495780fb4a2SCy Schubert 
149639beb93cSSam Leffler #endif /* WPA_SUPPLICANT_I_H */
1497