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; 4139beb93cSSam Leffler 4239beb93cSSam Leffler /* 4339beb93cSSam Leffler * Forward declarations of private structures used within the ctrl_iface 4439beb93cSSam Leffler * backends. Other parts of wpa_supplicant do not have access to data stored in 4539beb93cSSam Leffler * these structures. 4639beb93cSSam Leffler */ 4739beb93cSSam Leffler struct ctrl_iface_priv; 4839beb93cSSam Leffler struct ctrl_iface_global_priv; 49e28a4053SRui Paulo struct wpas_dbus_priv; 50780fb4a2SCy Schubert struct wpas_binder_priv; 5139beb93cSSam Leffler 5239beb93cSSam Leffler /** 5339beb93cSSam Leffler * struct wpa_interface - Parameters for wpa_supplicant_add_iface() 5439beb93cSSam Leffler */ 5539beb93cSSam Leffler struct wpa_interface { 5639beb93cSSam Leffler /** 5739beb93cSSam Leffler * confname - Configuration name (file or profile) name 5839beb93cSSam Leffler * 5939beb93cSSam Leffler * This can also be %NULL when a configuration file is not used. In 6039beb93cSSam Leffler * that case, ctrl_interface must be set to allow the interface to be 6139beb93cSSam Leffler * configured. 6239beb93cSSam Leffler */ 6339beb93cSSam Leffler const char *confname; 6439beb93cSSam Leffler 6539beb93cSSam Leffler /** 665b9c547cSRui Paulo * confanother - Additional configuration name (file or profile) name 675b9c547cSRui Paulo * 685b9c547cSRui Paulo * This can also be %NULL when the additional configuration file is not 695b9c547cSRui Paulo * used. 705b9c547cSRui Paulo */ 715b9c547cSRui Paulo const char *confanother; 725b9c547cSRui Paulo 735b9c547cSRui Paulo /** 7439beb93cSSam Leffler * ctrl_interface - Control interface parameter 7539beb93cSSam Leffler * 7639beb93cSSam Leffler * If a configuration file is not used, this variable can be used to 7739beb93cSSam Leffler * set the ctrl_interface parameter that would have otherwise been read 7839beb93cSSam Leffler * from the configuration file. If both confname and ctrl_interface are 7939beb93cSSam Leffler * set, ctrl_interface is used to override the value from configuration 8039beb93cSSam Leffler * file. 8139beb93cSSam Leffler */ 8239beb93cSSam Leffler const char *ctrl_interface; 8339beb93cSSam Leffler 8439beb93cSSam Leffler /** 8539beb93cSSam Leffler * driver - Driver interface name, or %NULL to use the default driver 8639beb93cSSam Leffler */ 8739beb93cSSam Leffler const char *driver; 8839beb93cSSam Leffler 8939beb93cSSam Leffler /** 9039beb93cSSam Leffler * driver_param - Driver interface parameters 9139beb93cSSam Leffler * 9239beb93cSSam Leffler * If a configuration file is not used, this variable can be used to 9339beb93cSSam Leffler * set the driver_param parameters that would have otherwise been read 9439beb93cSSam Leffler * from the configuration file. If both confname and driver_param are 9539beb93cSSam Leffler * set, driver_param is used to override the value from configuration 9639beb93cSSam Leffler * file. 9739beb93cSSam Leffler */ 9839beb93cSSam Leffler const char *driver_param; 9939beb93cSSam Leffler 10039beb93cSSam Leffler /** 10139beb93cSSam Leffler * ifname - Interface name 10239beb93cSSam Leffler */ 10339beb93cSSam Leffler const char *ifname; 10439beb93cSSam Leffler 10539beb93cSSam Leffler /** 10639beb93cSSam Leffler * bridge_ifname - Optional bridge interface name 10739beb93cSSam Leffler * 10839beb93cSSam Leffler * If the driver interface (ifname) is included in a Linux bridge 10939beb93cSSam Leffler * device, the bridge interface may need to be used for receiving EAPOL 11039beb93cSSam Leffler * frames. This can be enabled by setting this variable to enable 11139beb93cSSam Leffler * receiving of EAPOL frames from an additional interface. 11239beb93cSSam Leffler */ 11339beb93cSSam Leffler const char *bridge_ifname; 1145b9c547cSRui Paulo 1155b9c547cSRui Paulo /** 1165b9c547cSRui Paulo * p2p_mgmt - Interface used for P2P management (P2P Device operations) 1175b9c547cSRui Paulo * 1185b9c547cSRui Paulo * Indicates whether wpas_p2p_init() must be called for this interface. 1195b9c547cSRui Paulo * This is used only when the driver supports a dedicated P2P Device 1205b9c547cSRui Paulo * interface that is not a network interface. 1215b9c547cSRui Paulo */ 1225b9c547cSRui Paulo int p2p_mgmt; 123c1d255d3SCy Schubert 124c1d255d3SCy Schubert #ifdef CONFIG_MATCH_IFACE 125c1d255d3SCy Schubert /** 126c1d255d3SCy Schubert * matched - Interface was matched rather than specified 127c1d255d3SCy Schubert * 128c1d255d3SCy Schubert */ 129c1d255d3SCy Schubert enum { 130c1d255d3SCy Schubert WPA_IFACE_NOT_MATCHED, 131c1d255d3SCy Schubert WPA_IFACE_MATCHED_NULL, 132c1d255d3SCy Schubert WPA_IFACE_MATCHED 133c1d255d3SCy Schubert } matched; 134c1d255d3SCy Schubert #endif /* CONFIG_MATCH_IFACE */ 13539beb93cSSam Leffler }; 13639beb93cSSam Leffler 13739beb93cSSam Leffler /** 13839beb93cSSam Leffler * struct wpa_params - Parameters for wpa_supplicant_init() 13939beb93cSSam Leffler */ 14039beb93cSSam Leffler struct wpa_params { 14139beb93cSSam Leffler /** 14239beb93cSSam Leffler * daemonize - Run %wpa_supplicant in the background 14339beb93cSSam Leffler */ 14439beb93cSSam Leffler int daemonize; 14539beb93cSSam Leffler 14639beb93cSSam Leffler /** 14739beb93cSSam Leffler * wait_for_monitor - Wait for a monitor program before starting 14839beb93cSSam Leffler */ 14939beb93cSSam Leffler int wait_for_monitor; 15039beb93cSSam Leffler 15139beb93cSSam Leffler /** 15239beb93cSSam Leffler * pid_file - Path to a PID (process ID) file 15339beb93cSSam Leffler * 15439beb93cSSam Leffler * If this and daemonize are set, process ID of the background process 15539beb93cSSam Leffler * will be written to the specified file. 15639beb93cSSam Leffler */ 15739beb93cSSam Leffler char *pid_file; 15839beb93cSSam Leffler 15939beb93cSSam Leffler /** 16039beb93cSSam Leffler * wpa_debug_level - Debugging verbosity level (e.g., MSG_INFO) 16139beb93cSSam Leffler */ 16239beb93cSSam Leffler int wpa_debug_level; 16339beb93cSSam Leffler 16439beb93cSSam Leffler /** 16539beb93cSSam Leffler * wpa_debug_show_keys - Whether keying material is included in debug 16639beb93cSSam Leffler * 16739beb93cSSam Leffler * This parameter can be used to allow keying material to be included 16839beb93cSSam Leffler * in debug messages. This is a security risk and this option should 16939beb93cSSam Leffler * not be enabled in normal configuration. If needed during 17039beb93cSSam Leffler * development or while troubleshooting, this option can provide more 17139beb93cSSam Leffler * details for figuring out what is happening. 17239beb93cSSam Leffler */ 17339beb93cSSam Leffler int wpa_debug_show_keys; 17439beb93cSSam Leffler 17539beb93cSSam Leffler /** 17639beb93cSSam Leffler * wpa_debug_timestamp - Whether to include timestamp in debug messages 17739beb93cSSam Leffler */ 17839beb93cSSam Leffler int wpa_debug_timestamp; 17939beb93cSSam Leffler 18039beb93cSSam Leffler /** 18139beb93cSSam Leffler * ctrl_interface - Global ctrl_iface path/parameter 18239beb93cSSam Leffler */ 18339beb93cSSam Leffler char *ctrl_interface; 18439beb93cSSam Leffler 18539beb93cSSam Leffler /** 1865b9c547cSRui Paulo * ctrl_interface_group - Global ctrl_iface group 1875b9c547cSRui Paulo */ 1885b9c547cSRui Paulo char *ctrl_interface_group; 1895b9c547cSRui Paulo 1905b9c547cSRui Paulo /** 19139beb93cSSam Leffler * dbus_ctrl_interface - Enable the DBus control interface 19239beb93cSSam Leffler */ 19339beb93cSSam Leffler int dbus_ctrl_interface; 19439beb93cSSam Leffler 19539beb93cSSam Leffler /** 19639beb93cSSam Leffler * wpa_debug_file_path - Path of debug file or %NULL to use stdout 19739beb93cSSam Leffler */ 19839beb93cSSam Leffler const char *wpa_debug_file_path; 1992aef0ff7SSam Leffler 2002aef0ff7SSam Leffler /** 2012aef0ff7SSam Leffler * wpa_debug_syslog - Enable log output through syslog 2022aef0ff7SSam Leffler */ 203e28a4053SRui Paulo int wpa_debug_syslog; 204e28a4053SRui Paulo 205e28a4053SRui Paulo /** 206f05cddf9SRui Paulo * wpa_debug_tracing - Enable log output through Linux tracing 207f05cddf9SRui Paulo */ 208f05cddf9SRui Paulo int wpa_debug_tracing; 209f05cddf9SRui Paulo 210f05cddf9SRui Paulo /** 211e28a4053SRui Paulo * override_driver - Optional driver parameter override 212e28a4053SRui Paulo * 213e28a4053SRui Paulo * This parameter can be used to override the driver parameter in 214e28a4053SRui Paulo * dynamic interface addition to force a specific driver wrapper to be 215e28a4053SRui Paulo * used instead. 216e28a4053SRui Paulo */ 217e28a4053SRui Paulo char *override_driver; 218e28a4053SRui Paulo 219e28a4053SRui Paulo /** 220e28a4053SRui Paulo * override_ctrl_interface - Optional ctrl_interface override 221e28a4053SRui Paulo * 222e28a4053SRui Paulo * This parameter can be used to override the ctrl_interface parameter 223e28a4053SRui Paulo * in dynamic interface addition to force a control interface to be 224e28a4053SRui Paulo * created. 225e28a4053SRui Paulo */ 226e28a4053SRui Paulo char *override_ctrl_interface; 227f05cddf9SRui Paulo 228f05cddf9SRui Paulo /** 229f05cddf9SRui Paulo * entropy_file - Optional entropy file 230f05cddf9SRui Paulo * 231f05cddf9SRui Paulo * This parameter can be used to configure wpa_supplicant to maintain 232f05cddf9SRui Paulo * its internal entropy store over restarts. 233f05cddf9SRui Paulo */ 234f05cddf9SRui Paulo char *entropy_file; 235325151a3SRui Paulo 236325151a3SRui Paulo #ifdef CONFIG_P2P 237325151a3SRui Paulo /** 238325151a3SRui Paulo * conf_p2p_dev - Configuration file used to hold the 239325151a3SRui Paulo * P2P Device configuration parameters. 240325151a3SRui Paulo * 241325151a3SRui Paulo * This can also be %NULL. In such a case, if a P2P Device dedicated 242325151a3SRui Paulo * interfaces is created, the main configuration file will be used. 243325151a3SRui Paulo */ 244325151a3SRui Paulo char *conf_p2p_dev; 245325151a3SRui Paulo #endif /* CONFIG_P2P */ 246325151a3SRui Paulo 247780fb4a2SCy Schubert #ifdef CONFIG_MATCH_IFACE 248780fb4a2SCy Schubert /** 249780fb4a2SCy Schubert * match_ifaces - Interface descriptions to match 250780fb4a2SCy Schubert */ 251780fb4a2SCy Schubert struct wpa_interface *match_ifaces; 252780fb4a2SCy Schubert 253780fb4a2SCy Schubert /** 254780fb4a2SCy Schubert * match_iface_count - Number of defined matching interfaces 255780fb4a2SCy Schubert */ 256780fb4a2SCy Schubert int match_iface_count; 257780fb4a2SCy Schubert #endif /* CONFIG_MATCH_IFACE */ 25839beb93cSSam Leffler }; 25939beb93cSSam Leffler 260f05cddf9SRui Paulo struct p2p_srv_bonjour { 261f05cddf9SRui Paulo struct dl_list list; 262f05cddf9SRui Paulo struct wpabuf *query; 263f05cddf9SRui Paulo struct wpabuf *resp; 264f05cddf9SRui Paulo }; 265f05cddf9SRui Paulo 266f05cddf9SRui Paulo struct p2p_srv_upnp { 267f05cddf9SRui Paulo struct dl_list list; 268f05cddf9SRui Paulo u8 version; 269f05cddf9SRui Paulo char *service; 270f05cddf9SRui Paulo }; 271f05cddf9SRui Paulo 27239beb93cSSam Leffler /** 27339beb93cSSam Leffler * struct wpa_global - Internal, global data for all %wpa_supplicant interfaces 27439beb93cSSam Leffler * 27539beb93cSSam Leffler * This structure is initialized by calling wpa_supplicant_init() when starting 27639beb93cSSam Leffler * %wpa_supplicant. 27739beb93cSSam Leffler */ 27839beb93cSSam Leffler struct wpa_global { 27939beb93cSSam Leffler struct wpa_supplicant *ifaces; 28039beb93cSSam Leffler struct wpa_params params; 28139beb93cSSam Leffler struct ctrl_iface_global_priv *ctrl_iface; 282e28a4053SRui Paulo struct wpas_dbus_priv *dbus; 283780fb4a2SCy Schubert struct wpas_binder_priv *binder; 28439beb93cSSam Leffler void **drv_priv; 28539beb93cSSam Leffler size_t drv_count; 286e28a4053SRui Paulo struct os_time suspend_time; 287f05cddf9SRui Paulo struct p2p_data *p2p; 288f05cddf9SRui Paulo struct wpa_supplicant *p2p_init_wpa_s; 289f05cddf9SRui Paulo struct wpa_supplicant *p2p_group_formation; 2905b9c547cSRui Paulo struct wpa_supplicant *p2p_invite_group; 291f05cddf9SRui Paulo u8 p2p_dev_addr[ETH_ALEN]; 2925b9c547cSRui Paulo struct os_reltime p2p_go_wait_client; 293f05cddf9SRui Paulo struct dl_list p2p_srv_bonjour; /* struct p2p_srv_bonjour */ 294f05cddf9SRui Paulo struct dl_list p2p_srv_upnp; /* struct p2p_srv_upnp */ 295f05cddf9SRui Paulo int p2p_disabled; 296f05cddf9SRui Paulo int cross_connection; 297c1d255d3SCy Schubert int p2p_long_listen; /* remaining time in long Listen state in ms */ 2985b9c547cSRui Paulo struct wpa_freq_range_list p2p_disallow_freq; 2995b9c547cSRui Paulo struct wpa_freq_range_list p2p_go_avoid_freq; 300f05cddf9SRui Paulo enum wpa_conc_pref { 301f05cddf9SRui Paulo WPA_CONC_PREF_NOT_SET, 302f05cddf9SRui Paulo WPA_CONC_PREF_STA, 303f05cddf9SRui Paulo WPA_CONC_PREF_P2P 304f05cddf9SRui Paulo } conc_pref; 3055b9c547cSRui Paulo unsigned int p2p_per_sta_psk:1; 3065b9c547cSRui Paulo unsigned int p2p_fail_on_wps_complete:1; 3075b9c547cSRui Paulo unsigned int p2p_24ghz_social_channels:1; 3085b9c547cSRui Paulo unsigned int pending_p2ps_group:1; 3095b9c547cSRui Paulo unsigned int pending_group_iface_for_p2ps:1; 310780fb4a2SCy Schubert unsigned int pending_p2ps_group_freq; 311f05cddf9SRui Paulo 312f05cddf9SRui Paulo #ifdef CONFIG_WIFI_DISPLAY 313f05cddf9SRui Paulo int wifi_display; 31485732ac8SCy Schubert #define MAX_WFD_SUBELEMS 12 315f05cddf9SRui Paulo struct wpabuf *wfd_subelem[MAX_WFD_SUBELEMS]; 316f05cddf9SRui Paulo #endif /* CONFIG_WIFI_DISPLAY */ 3175b9c547cSRui Paulo 3185b9c547cSRui Paulo struct psk_list_entry *add_psk; /* From group formation */ 31939beb93cSSam Leffler }; 32039beb93cSSam Leffler 32139beb93cSSam Leffler 322f05cddf9SRui Paulo /** 3235b9c547cSRui Paulo * struct wpa_radio - Internal data for per-radio information 3245b9c547cSRui Paulo * 3255b9c547cSRui Paulo * This structure is used to share data about configured interfaces 3265b9c547cSRui Paulo * (struct wpa_supplicant) that share the same physical radio, e.g., to allow 3275b9c547cSRui Paulo * better coordination of offchannel operations. 3285b9c547cSRui Paulo */ 3295b9c547cSRui Paulo struct wpa_radio { 3305b9c547cSRui Paulo char name[16]; /* from driver_ops get_radio_name() or empty if not 3315b9c547cSRui Paulo * available */ 332c1d255d3SCy Schubert /** NULL if no external scan running. */ 333c1d255d3SCy Schubert struct wpa_supplicant *external_scan_req_interface; 334780fb4a2SCy Schubert unsigned int num_active_works; 3355b9c547cSRui Paulo struct dl_list ifaces; /* struct wpa_supplicant::radio_list entries */ 3365b9c547cSRui Paulo struct dl_list work; /* struct wpa_radio_work::list entries */ 3375b9c547cSRui Paulo }; 3385b9c547cSRui Paulo 339c1d255d3SCy Schubert /** 340c1d255d3SCy Schubert * Checks whether an external scan is running on a given radio. 341c1d255d3SCy Schubert * @radio: Pointer to radio struct 342c1d255d3SCy Schubert * Returns: true if an external scan is running, false otherwise. 343c1d255d3SCy Schubert */ 344c1d255d3SCy Schubert static inline bool external_scan_running(struct wpa_radio *radio) 345c1d255d3SCy Schubert { 346c1d255d3SCy Schubert return radio && radio->external_scan_req_interface; 347c1d255d3SCy Schubert } 348c1d255d3SCy Schubert 349780fb4a2SCy Schubert #define MAX_ACTIVE_WORKS 2 350780fb4a2SCy Schubert 351780fb4a2SCy Schubert 3525b9c547cSRui Paulo /** 3535b9c547cSRui Paulo * struct wpa_radio_work - Radio work item 3545b9c547cSRui Paulo */ 3555b9c547cSRui Paulo struct wpa_radio_work { 3565b9c547cSRui Paulo struct dl_list list; 3575b9c547cSRui Paulo unsigned int freq; /* known frequency (MHz) or 0 for multiple/unknown */ 3585b9c547cSRui Paulo const char *type; 3595b9c547cSRui Paulo struct wpa_supplicant *wpa_s; 3605b9c547cSRui Paulo void (*cb)(struct wpa_radio_work *work, int deinit); 3615b9c547cSRui Paulo void *ctx; 3625b9c547cSRui Paulo unsigned int started:1; 3635b9c547cSRui Paulo struct os_reltime time; 364780fb4a2SCy Schubert unsigned int bands; 3655b9c547cSRui Paulo }; 3665b9c547cSRui Paulo 3675b9c547cSRui Paulo int radio_add_work(struct wpa_supplicant *wpa_s, unsigned int freq, 3685b9c547cSRui Paulo const char *type, int next, 3695b9c547cSRui Paulo void (*cb)(struct wpa_radio_work *work, int deinit), 3705b9c547cSRui Paulo void *ctx); 3715b9c547cSRui Paulo void radio_work_done(struct wpa_radio_work *work); 3725b9c547cSRui Paulo void radio_remove_works(struct wpa_supplicant *wpa_s, 3735b9c547cSRui Paulo const char *type, int remove_all); 37485732ac8SCy Schubert void radio_remove_pending_work(struct wpa_supplicant *wpa_s, void *ctx); 3755b9c547cSRui Paulo void radio_work_check_next(struct wpa_supplicant *wpa_s); 3765b9c547cSRui Paulo struct wpa_radio_work * 3775b9c547cSRui Paulo radio_work_pending(struct wpa_supplicant *wpa_s, const char *type); 3785b9c547cSRui Paulo 3795b9c547cSRui Paulo struct wpa_connect_work { 3805b9c547cSRui Paulo unsigned int sme:1; 3815b9c547cSRui Paulo unsigned int bss_removed:1; 3825b9c547cSRui Paulo struct wpa_bss *bss; 3835b9c547cSRui Paulo struct wpa_ssid *ssid; 3845b9c547cSRui Paulo }; 3855b9c547cSRui Paulo 3865b9c547cSRui Paulo int wpas_valid_bss_ssid(struct wpa_supplicant *wpa_s, struct wpa_bss *test_bss, 3875b9c547cSRui Paulo struct wpa_ssid *test_ssid); 3885b9c547cSRui Paulo void wpas_connect_work_free(struct wpa_connect_work *cwork); 3895b9c547cSRui Paulo void wpas_connect_work_done(struct wpa_supplicant *wpa_s); 3905b9c547cSRui Paulo 3915b9c547cSRui Paulo struct wpa_external_work { 3925b9c547cSRui Paulo unsigned int id; 3935b9c547cSRui Paulo char type[100]; 3945b9c547cSRui Paulo unsigned int timeout; 3955b9c547cSRui Paulo }; 3965b9c547cSRui Paulo 397780fb4a2SCy Schubert enum wpa_radio_work_band wpas_freq_to_band(int freq); 398780fb4a2SCy Schubert unsigned int wpas_get_bands(struct wpa_supplicant *wpa_s, const int *freqs); 399780fb4a2SCy Schubert 4005b9c547cSRui Paulo /** 401f05cddf9SRui Paulo * offchannel_send_action_result - Result of offchannel send Action frame 402f05cddf9SRui Paulo */ 403f05cddf9SRui Paulo enum offchannel_send_action_result { 404f05cddf9SRui Paulo OFFCHANNEL_SEND_ACTION_SUCCESS /**< Frame was send and acknowledged */, 405f05cddf9SRui Paulo OFFCHANNEL_SEND_ACTION_NO_ACK /**< Frame was sent, but not acknowledged 406f05cddf9SRui Paulo */, 407f05cddf9SRui Paulo OFFCHANNEL_SEND_ACTION_FAILED /**< Frame was not sent due to a failure 408f05cddf9SRui Paulo */ 409f05cddf9SRui Paulo }; 410f05cddf9SRui Paulo 411f05cddf9SRui Paulo struct wps_ap_info { 412f05cddf9SRui Paulo u8 bssid[ETH_ALEN]; 413f05cddf9SRui Paulo enum wps_ap_info_type { 414f05cddf9SRui Paulo WPS_AP_NOT_SEL_REG, 415f05cddf9SRui Paulo WPS_AP_SEL_REG, 416f05cddf9SRui Paulo WPS_AP_SEL_REG_OUR 417f05cddf9SRui Paulo } type; 418f05cddf9SRui Paulo unsigned int tries; 4195b9c547cSRui Paulo struct os_reltime last_attempt; 420325151a3SRui Paulo unsigned int pbc_active; 421325151a3SRui Paulo u8 uuid[WPS_UUID_LEN]; 422f05cddf9SRui Paulo }; 423f05cddf9SRui Paulo 4245b9c547cSRui Paulo #define WPA_FREQ_USED_BY_INFRA_STATION BIT(0) 4255b9c547cSRui Paulo #define WPA_FREQ_USED_BY_P2P_CLIENT BIT(1) 4265b9c547cSRui Paulo 4275b9c547cSRui Paulo struct wpa_used_freq_data { 4285b9c547cSRui Paulo int freq; 4295b9c547cSRui Paulo unsigned int flags; 4305b9c547cSRui Paulo }; 4315b9c547cSRui Paulo 4325b9c547cSRui Paulo #define RRM_NEIGHBOR_REPORT_TIMEOUT 1 /* 1 second for AP to send a report */ 4335b9c547cSRui Paulo 4345b9c547cSRui Paulo /* 4355b9c547cSRui Paulo * struct rrm_data - Data used for managing RRM features 4365b9c547cSRui Paulo */ 4375b9c547cSRui Paulo struct rrm_data { 4385b9c547cSRui Paulo /* rrm_used - indication regarding the current connection */ 4395b9c547cSRui Paulo unsigned int rrm_used:1; 4405b9c547cSRui Paulo 4415b9c547cSRui Paulo /* 4425b9c547cSRui Paulo * notify_neighbor_rep - Callback for notifying report requester 4435b9c547cSRui Paulo */ 4445b9c547cSRui Paulo void (*notify_neighbor_rep)(void *ctx, struct wpabuf *neighbor_rep); 4455b9c547cSRui Paulo 4465b9c547cSRui Paulo /* 4475b9c547cSRui Paulo * neighbor_rep_cb_ctx - Callback context 4485b9c547cSRui Paulo * Received in the callback registration, and sent to the callback 4495b9c547cSRui Paulo * function as a parameter. 4505b9c547cSRui Paulo */ 4515b9c547cSRui Paulo void *neighbor_rep_cb_ctx; 4525b9c547cSRui Paulo 4535b9c547cSRui Paulo /* next_neighbor_rep_token - Next request's dialog token */ 4545b9c547cSRui Paulo u8 next_neighbor_rep_token; 45585732ac8SCy Schubert 45685732ac8SCy Schubert /* token - Dialog token of the current radio measurement */ 45785732ac8SCy Schubert u8 token; 45885732ac8SCy Schubert 45985732ac8SCy Schubert /* destination address of the current radio measurement request */ 46085732ac8SCy Schubert u8 dst_addr[ETH_ALEN]; 4615b9c547cSRui Paulo }; 4625b9c547cSRui Paulo 4635b9c547cSRui Paulo enum wpa_supplicant_test_failure { 4645b9c547cSRui Paulo WPAS_TEST_FAILURE_NONE, 4655b9c547cSRui Paulo WPAS_TEST_FAILURE_SCAN_TRIGGER, 4665b9c547cSRui Paulo }; 4675b9c547cSRui Paulo 468780fb4a2SCy Schubert struct icon_entry { 469780fb4a2SCy Schubert struct dl_list list; 470780fb4a2SCy Schubert u8 bssid[ETH_ALEN]; 471780fb4a2SCy Schubert u8 dialog_token; 472780fb4a2SCy Schubert char *file_name; 473780fb4a2SCy Schubert u8 *image; 474780fb4a2SCy Schubert size_t image_len; 475780fb4a2SCy Schubert }; 476780fb4a2SCy Schubert 477780fb4a2SCy Schubert struct wpa_bss_tmp_disallowed { 478780fb4a2SCy Schubert struct dl_list list; 479780fb4a2SCy Schubert u8 bssid[ETH_ALEN]; 4804bc52338SCy Schubert int rssi_threshold; 48185732ac8SCy Schubert }; 48285732ac8SCy Schubert 48385732ac8SCy Schubert struct beacon_rep_data { 48485732ac8SCy Schubert u8 token; 4854bc52338SCy Schubert u8 last_indication; 48685732ac8SCy Schubert struct wpa_driver_scan_params scan_params; 48785732ac8SCy Schubert u8 ssid[SSID_MAX_LEN]; 48885732ac8SCy Schubert size_t ssid_len; 48985732ac8SCy Schubert u8 bssid[ETH_ALEN]; 49085732ac8SCy Schubert enum beacon_report_detail report_detail; 49185732ac8SCy Schubert struct bitfield *eids; 49285732ac8SCy Schubert }; 49385732ac8SCy Schubert 49485732ac8SCy Schubert 49585732ac8SCy Schubert struct external_pmksa_cache { 49685732ac8SCy Schubert struct dl_list list; 49785732ac8SCy Schubert void *pmksa_cache; 49885732ac8SCy Schubert }; 49985732ac8SCy Schubert 50085732ac8SCy Schubert struct fils_hlp_req { 50185732ac8SCy Schubert struct dl_list list; 50285732ac8SCy Schubert u8 dst[ETH_ALEN]; 50385732ac8SCy Schubert struct wpabuf *pkt; 504780fb4a2SCy Schubert }; 505780fb4a2SCy Schubert 506c1d255d3SCy Schubert struct driver_signal_override { 507c1d255d3SCy Schubert struct dl_list list; 508c1d255d3SCy Schubert u8 bssid[ETH_ALEN]; 509c1d255d3SCy Schubert int si_current_signal; 510c1d255d3SCy Schubert int si_avg_signal; 511c1d255d3SCy Schubert int si_avg_beacon_signal; 512c1d255d3SCy Schubert int si_current_noise; 513c1d255d3SCy Schubert int scan_level; 514c1d255d3SCy Schubert }; 515c1d255d3SCy Schubert 516c1d255d3SCy Schubert struct robust_av_data { 517c1d255d3SCy Schubert u8 dialog_token; 518c1d255d3SCy Schubert enum scs_request_type request_type; 519c1d255d3SCy Schubert u8 up_bitmap; 520c1d255d3SCy Schubert u8 up_limit; 521c1d255d3SCy Schubert u32 stream_timeout; 522c1d255d3SCy Schubert u8 frame_classifier[48]; 523c1d255d3SCy Schubert size_t frame_classifier_len; 524c1d255d3SCy Schubert bool valid_config; 525c1d255d3SCy Schubert }; 526c1d255d3SCy Schubert 527*4b72b91aSCy Schubert struct dscp_policy_status { 528*4b72b91aSCy Schubert u8 id; 529*4b72b91aSCy Schubert u8 status; 530*4b72b91aSCy Schubert }; 531*4b72b91aSCy Schubert 532*4b72b91aSCy Schubert struct dscp_resp_data { 533*4b72b91aSCy Schubert bool more; 534*4b72b91aSCy Schubert bool reset; 535*4b72b91aSCy Schubert bool solicited; 536*4b72b91aSCy Schubert struct dscp_policy_status *policy; 537*4b72b91aSCy Schubert int num_policies; 538*4b72b91aSCy Schubert }; 539*4b72b91aSCy Schubert 540c1d255d3SCy Schubert #ifdef CONFIG_PASN 541c1d255d3SCy Schubert 542c1d255d3SCy Schubert struct pasn_fils { 543c1d255d3SCy Schubert u8 nonce[FILS_NONCE_LEN]; 544c1d255d3SCy Schubert u8 anonce[FILS_NONCE_LEN]; 545c1d255d3SCy Schubert u8 session[FILS_SESSION_LEN]; 546c1d255d3SCy Schubert u8 erp_pmkid[PMKID_LEN]; 547c1d255d3SCy Schubert bool completed; 548c1d255d3SCy Schubert }; 549c1d255d3SCy Schubert 550c1d255d3SCy Schubert struct wpas_pasn { 551c1d255d3SCy Schubert int akmp; 552c1d255d3SCy Schubert int cipher; 553c1d255d3SCy Schubert u16 group; 554c1d255d3SCy Schubert int freq; 555c1d255d3SCy Schubert size_t kdk_len; 556c1d255d3SCy Schubert 557c1d255d3SCy Schubert u8 trans_seq; 558c1d255d3SCy Schubert u8 status; 559c1d255d3SCy Schubert 560c1d255d3SCy Schubert u8 bssid[ETH_ALEN]; 561c1d255d3SCy Schubert size_t pmk_len; 562c1d255d3SCy Schubert u8 pmk[PMK_LEN_MAX]; 563c1d255d3SCy Schubert bool using_pmksa; 564c1d255d3SCy Schubert 565c1d255d3SCy Schubert u8 hash[SHA384_MAC_LEN]; 566c1d255d3SCy Schubert 567c1d255d3SCy Schubert struct wpabuf *beacon_rsne_rsnxe; 568c1d255d3SCy Schubert struct wpa_ptk ptk; 569c1d255d3SCy Schubert struct crypto_ecdh *ecdh; 570c1d255d3SCy Schubert 571c1d255d3SCy Schubert struct wpabuf *comeback; 572c1d255d3SCy Schubert u16 comeback_after; 573c1d255d3SCy Schubert 574c1d255d3SCy Schubert #ifdef CONFIG_SAE 575c1d255d3SCy Schubert struct sae_data sae; 576c1d255d3SCy Schubert #endif /* CONFIG_SAE */ 577c1d255d3SCy Schubert 578c1d255d3SCy Schubert struct wpa_ssid *ssid; 579c1d255d3SCy Schubert 580c1d255d3SCy Schubert #ifdef CONFIG_FILS 581c1d255d3SCy Schubert struct pasn_fils fils; 582c1d255d3SCy Schubert #endif /* CONFIG_FILS */ 583c1d255d3SCy Schubert 584c1d255d3SCy Schubert #ifdef CONFIG_IEEE80211R 585c1d255d3SCy Schubert u8 pmk_r1[PMK_LEN_MAX]; 586c1d255d3SCy Schubert size_t pmk_r1_len; 587c1d255d3SCy Schubert u8 pmk_r1_name[WPA_PMK_NAME_LEN]; 588c1d255d3SCy Schubert #endif /* CONFIG_IEEE80211R */ 589c1d255d3SCy Schubert }; 590c1d255d3SCy Schubert #endif /* CONFIG_PASN */ 591c1d255d3SCy Schubert 592*4b72b91aSCy Schubert 593*4b72b91aSCy Schubert enum ip_version { 594*4b72b91aSCy Schubert IPV4 = 4, 595*4b72b91aSCy Schubert IPV6 = 6, 596*4b72b91aSCy Schubert }; 597*4b72b91aSCy Schubert 598*4b72b91aSCy Schubert 599*4b72b91aSCy Schubert struct ipv4_params { 600*4b72b91aSCy Schubert struct in_addr src_ip; 601*4b72b91aSCy Schubert struct in_addr dst_ip; 602*4b72b91aSCy Schubert u16 src_port; 603*4b72b91aSCy Schubert u16 dst_port; 604*4b72b91aSCy Schubert u8 dscp; 605*4b72b91aSCy Schubert u8 protocol; 606*4b72b91aSCy Schubert u8 param_mask; 607*4b72b91aSCy Schubert }; 608*4b72b91aSCy Schubert 609*4b72b91aSCy Schubert 610*4b72b91aSCy Schubert struct ipv6_params { 611*4b72b91aSCy Schubert struct in6_addr src_ip; 612*4b72b91aSCy Schubert struct in6_addr dst_ip; 613*4b72b91aSCy Schubert u16 src_port; 614*4b72b91aSCy Schubert u16 dst_port; 615*4b72b91aSCy Schubert u8 dscp; 616*4b72b91aSCy Schubert u8 next_header; 617*4b72b91aSCy Schubert u8 flow_label[3]; 618*4b72b91aSCy Schubert u8 param_mask; 619*4b72b91aSCy Schubert }; 620*4b72b91aSCy Schubert 621*4b72b91aSCy Schubert 622*4b72b91aSCy Schubert struct type4_params { 623*4b72b91aSCy Schubert u8 classifier_mask; 624*4b72b91aSCy Schubert enum ip_version ip_version; 625*4b72b91aSCy Schubert union { 626*4b72b91aSCy Schubert struct ipv4_params v4; 627*4b72b91aSCy Schubert struct ipv6_params v6; 628*4b72b91aSCy Schubert } ip_params; 629*4b72b91aSCy Schubert }; 630*4b72b91aSCy Schubert 631*4b72b91aSCy Schubert 632*4b72b91aSCy Schubert struct type10_params { 633*4b72b91aSCy Schubert u8 prot_instance; 634*4b72b91aSCy Schubert u8 prot_number; 635*4b72b91aSCy Schubert u8 *filter_value; 636*4b72b91aSCy Schubert u8 *filter_mask; 637*4b72b91aSCy Schubert size_t filter_len; 638*4b72b91aSCy Schubert }; 639*4b72b91aSCy Schubert 640*4b72b91aSCy Schubert 641*4b72b91aSCy Schubert struct tclas_element { 642*4b72b91aSCy Schubert u8 user_priority; 643*4b72b91aSCy Schubert u8 classifier_type; 644*4b72b91aSCy Schubert union { 645*4b72b91aSCy Schubert struct type4_params type4_param; 646*4b72b91aSCy Schubert struct type10_params type10_param; 647*4b72b91aSCy Schubert } frame_classifier; 648*4b72b91aSCy Schubert }; 649*4b72b91aSCy Schubert 650*4b72b91aSCy Schubert 651*4b72b91aSCy Schubert struct scs_desc_elem { 652*4b72b91aSCy Schubert u8 scs_id; 653*4b72b91aSCy Schubert enum scs_request_type request_type; 654*4b72b91aSCy Schubert u8 intra_access_priority; 655*4b72b91aSCy Schubert bool scs_up_avail; 656*4b72b91aSCy Schubert struct tclas_element *tclas_elems; 657*4b72b91aSCy Schubert unsigned int num_tclas_elem; 658*4b72b91aSCy Schubert u8 tclas_processing; 659*4b72b91aSCy Schubert }; 660*4b72b91aSCy Schubert 661*4b72b91aSCy Schubert 662*4b72b91aSCy Schubert struct scs_robust_av_data { 663*4b72b91aSCy Schubert struct scs_desc_elem *scs_desc_elems; 664*4b72b91aSCy Schubert unsigned int num_scs_desc; 665*4b72b91aSCy Schubert }; 666*4b72b91aSCy Schubert 667*4b72b91aSCy Schubert 668*4b72b91aSCy Schubert enum scs_response_status { 669*4b72b91aSCy Schubert SCS_DESC_SENT = 0, 670*4b72b91aSCy Schubert SCS_DESC_SUCCESS = 1, 671*4b72b91aSCy Schubert }; 672*4b72b91aSCy Schubert 673*4b72b91aSCy Schubert 674*4b72b91aSCy Schubert struct active_scs_elem { 675*4b72b91aSCy Schubert struct dl_list list; 676*4b72b91aSCy Schubert u8 scs_id; 677*4b72b91aSCy Schubert enum scs_response_status status; 678*4b72b91aSCy Schubert }; 679*4b72b91aSCy Schubert 680*4b72b91aSCy Schubert 68139beb93cSSam Leffler /** 68239beb93cSSam Leffler * struct wpa_supplicant - Internal data for wpa_supplicant interface 68339beb93cSSam Leffler * 68439beb93cSSam Leffler * This structure contains the internal data for core wpa_supplicant code. This 68539beb93cSSam Leffler * should be only used directly from the core code. However, a pointer to this 68639beb93cSSam Leffler * data is used from other files as an arbitrary context pointer in calls to 68739beb93cSSam Leffler * core functions. 68839beb93cSSam Leffler */ 68939beb93cSSam Leffler struct wpa_supplicant { 69039beb93cSSam Leffler struct wpa_global *global; 6915b9c547cSRui Paulo struct wpa_radio *radio; /* shared radio context */ 6925b9c547cSRui Paulo struct dl_list radio_list; /* list head: struct wpa_radio::ifaces */ 693f05cddf9SRui Paulo struct wpa_supplicant *parent; 694780fb4a2SCy Schubert struct wpa_supplicant *p2pdev; 69539beb93cSSam Leffler struct wpa_supplicant *next; 69639beb93cSSam Leffler struct l2_packet_data *l2; 69739beb93cSSam Leffler struct l2_packet_data *l2_br; 6984bc52338SCy Schubert struct os_reltime roam_start; 6994bc52338SCy Schubert struct os_reltime roam_time; 7004bc52338SCy Schubert struct os_reltime session_start; 7014bc52338SCy Schubert struct os_reltime session_length; 70239beb93cSSam Leffler unsigned char own_addr[ETH_ALEN]; 7035b9c547cSRui Paulo unsigned char perm_addr[ETH_ALEN]; 70439beb93cSSam Leffler char ifname[100]; 705780fb4a2SCy Schubert #ifdef CONFIG_MATCH_IFACE 706780fb4a2SCy Schubert int matched; 707780fb4a2SCy Schubert #endif /* CONFIG_MATCH_IFACE */ 708e28a4053SRui Paulo #ifdef CONFIG_CTRL_IFACE_DBUS_NEW 709e28a4053SRui Paulo char *dbus_new_path; 710f05cddf9SRui Paulo char *dbus_groupobj_path; 711f05cddf9SRui Paulo #ifdef CONFIG_AP 712f05cddf9SRui Paulo char *preq_notify_peer; 713f05cddf9SRui Paulo #endif /* CONFIG_AP */ 714e28a4053SRui Paulo #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ 715780fb4a2SCy Schubert #ifdef CONFIG_CTRL_IFACE_BINDER 716780fb4a2SCy Schubert const void *binder_object_key; 717780fb4a2SCy Schubert #endif /* CONFIG_CTRL_IFACE_BINDER */ 71839beb93cSSam Leffler char bridge_ifname[16]; 71939beb93cSSam Leffler 72039beb93cSSam Leffler char *confname; 7215b9c547cSRui Paulo char *confanother; 7225b9c547cSRui Paulo 72339beb93cSSam Leffler struct wpa_config *conf; 72439beb93cSSam Leffler int countermeasures; 7255b9c547cSRui Paulo struct os_reltime last_michael_mic_error; 72639beb93cSSam Leffler u8 bssid[ETH_ALEN]; 72739beb93cSSam Leffler u8 pending_bssid[ETH_ALEN]; /* If wpa_state == WPA_ASSOCIATING, this 728f05cddf9SRui Paulo * field contains the target BSSID. */ 72939beb93cSSam Leffler int reassociate; /* reassociation requested */ 730c1d255d3SCy Schubert bool roam_in_progress; /* roam in progress */ 731780fb4a2SCy Schubert unsigned int reassoc_same_bss:1; /* reassociating to the same BSS */ 732780fb4a2SCy Schubert unsigned int reassoc_same_ess:1; /* reassociating to the same ESS */ 73339beb93cSSam Leffler int disconnected; /* all connections disabled; i.e., do no reassociate 73439beb93cSSam Leffler * before this has been cleared */ 73539beb93cSSam Leffler struct wpa_ssid *current_ssid; 7365b9c547cSRui Paulo struct wpa_ssid *last_ssid; 737e28a4053SRui Paulo struct wpa_bss *current_bss; 73839beb93cSSam Leffler int ap_ies_from_associnfo; 739e28a4053SRui Paulo unsigned int assoc_freq; 74085732ac8SCy Schubert u8 *last_con_fail_realm; 74185732ac8SCy Schubert size_t last_con_fail_realm_len; 74239beb93cSSam Leffler 74339beb93cSSam Leffler /* Selected configuration (based on Beacon/ProbeResp WPA IE) */ 74439beb93cSSam Leffler int pairwise_cipher; 745c1d255d3SCy Schubert int deny_ptk0_rekey; 74639beb93cSSam Leffler int group_cipher; 74739beb93cSSam Leffler int key_mgmt; 748f05cddf9SRui Paulo int wpa_proto; 74939beb93cSSam Leffler int mgmt_group_cipher; 75039beb93cSSam Leffler 75139beb93cSSam Leffler void *drv_priv; /* private data used by driver_ops */ 7523157ba21SRui Paulo void *global_drv_priv; 75339beb93cSSam Leffler 754f05cddf9SRui Paulo u8 *bssid_filter; 755f05cddf9SRui Paulo size_t bssid_filter_count; 756f05cddf9SRui Paulo 757f05cddf9SRui Paulo u8 *disallow_aps_bssid; 758f05cddf9SRui Paulo size_t disallow_aps_bssid_count; 759f05cddf9SRui Paulo struct wpa_ssid_value *disallow_aps_ssid; 760f05cddf9SRui Paulo size_t disallow_aps_ssid_count; 761f05cddf9SRui Paulo 762c1d255d3SCy Schubert u32 setband_mask; 7635b9c547cSRui Paulo 7645b9c547cSRui Paulo /* Preferred network for the next connection attempt */ 7655b9c547cSRui Paulo struct wpa_ssid *next_ssid; 7665b9c547cSRui Paulo 767f05cddf9SRui Paulo /* previous scan was wildcard when interleaving between 768f05cddf9SRui Paulo * wildcard scans and specific SSID scan when max_ssids=1 */ 769f05cddf9SRui Paulo int prev_scan_wildcard; 77039beb93cSSam Leffler struct wpa_ssid *prev_scan_ssid; /* previously scanned SSID; 77139beb93cSSam Leffler * NULL = not yet initialized (start 772e28a4053SRui Paulo * with wildcard SSID) 773e28a4053SRui Paulo * WILDCARD_SSID_SCAN = wildcard 77439beb93cSSam Leffler * SSID was used in the previous scan 77539beb93cSSam Leffler */ 776e28a4053SRui Paulo #define WILDCARD_SSID_SCAN ((struct wpa_ssid *) 1) 77739beb93cSSam Leffler 778f05cddf9SRui Paulo struct wpa_ssid *prev_sched_ssid; /* last SSID used in sched scan */ 779f05cddf9SRui Paulo int sched_scan_timeout; 780f05cddf9SRui Paulo int first_sched_scan; 781f05cddf9SRui Paulo int sched_scan_timed_out; 782780fb4a2SCy Schubert struct sched_scan_plan *sched_scan_plans; 783780fb4a2SCy Schubert size_t sched_scan_plans_num; 784f05cddf9SRui Paulo 785e28a4053SRui Paulo void (*scan_res_handler)(struct wpa_supplicant *wpa_s, 786e28a4053SRui Paulo struct wpa_scan_results *scan_res); 787c1d255d3SCy Schubert void (*scan_res_fail_handler)(struct wpa_supplicant *wpa_s); 788e28a4053SRui Paulo struct dl_list bss; /* struct wpa_bss::list */ 789e28a4053SRui Paulo struct dl_list bss_id; /* struct wpa_bss::list_id */ 790e28a4053SRui Paulo size_t num_bss; 791e28a4053SRui Paulo unsigned int bss_update_idx; 792e28a4053SRui Paulo unsigned int bss_next_id; 79339beb93cSSam Leffler 794f05cddf9SRui Paulo /* 795f05cddf9SRui Paulo * Pointers to BSS entries in the order they were in the last scan 796f05cddf9SRui Paulo * results. 797f05cddf9SRui Paulo */ 798f05cddf9SRui Paulo struct wpa_bss **last_scan_res; 799c1d255d3SCy Schubert size_t last_scan_res_used; 800c1d255d3SCy Schubert size_t last_scan_res_size; 8015b9c547cSRui Paulo struct os_reltime last_scan; 802f05cddf9SRui Paulo 803325151a3SRui Paulo const struct wpa_driver_ops *driver; 80439beb93cSSam Leffler int interface_removed; /* whether the network interface has been 80539beb93cSSam Leffler * removed */ 80639beb93cSSam Leffler struct wpa_sm *wpa; 807c1d255d3SCy Schubert struct ptksa_cache *ptksa; 808c1d255d3SCy Schubert 80939beb93cSSam Leffler struct eapol_sm *eapol; 81039beb93cSSam Leffler 81139beb93cSSam Leffler struct ctrl_iface_priv *ctrl_iface; 81239beb93cSSam Leffler 813e28a4053SRui Paulo enum wpa_states wpa_state; 8145b9c547cSRui Paulo struct wpa_radio_work *scan_work; 8153157ba21SRui Paulo int scanning; 816f05cddf9SRui Paulo int sched_scanning; 817780fb4a2SCy Schubert unsigned int sched_scan_stop_req:1; 81839beb93cSSam Leffler int new_connection; 81939beb93cSSam Leffler 82039beb93cSSam Leffler int eapol_received; /* number of EAPOL packets received after the 82139beb93cSSam Leffler * previous association event */ 82239beb93cSSam Leffler 823c1d255d3SCy Schubert u8 rsnxe[20]; 824c1d255d3SCy Schubert size_t rsnxe_len; 825c1d255d3SCy Schubert 82639beb93cSSam Leffler struct scard_data *scard; 827f05cddf9SRui Paulo char imsi[20]; 828f05cddf9SRui Paulo int mnc_len; 82939beb93cSSam Leffler 83039beb93cSSam Leffler unsigned char last_eapol_src[ETH_ALEN]; 83139beb93cSSam Leffler 8325b9c547cSRui Paulo unsigned int keys_cleared; /* bitfield of key indexes that the driver is 8335b9c547cSRui Paulo * known not to be configured with a key */ 83439beb93cSSam Leffler 835c1d255d3SCy Schubert struct wpa_bssid_ignore *bssid_ignore; 83639beb93cSSam Leffler 837c1d255d3SCy Schubert /* Number of connection failures since last successful connection */ 838c1d255d3SCy Schubert unsigned int consecutive_conn_failures; 83939beb93cSSam Leffler 840f05cddf9SRui Paulo /** 841f05cddf9SRui Paulo * scan_req - Type of the scan request 842f05cddf9SRui Paulo */ 843f05cddf9SRui Paulo enum scan_req_type { 844f05cddf9SRui Paulo /** 845f05cddf9SRui Paulo * NORMAL_SCAN_REQ - Normal scan request 846f05cddf9SRui Paulo * 847f05cddf9SRui Paulo * This is used for scans initiated by wpa_supplicant to find an 848f05cddf9SRui Paulo * AP for a connection. 849f05cddf9SRui Paulo */ 850f05cddf9SRui Paulo NORMAL_SCAN_REQ, 851f05cddf9SRui Paulo 852f05cddf9SRui Paulo /** 853f05cddf9SRui Paulo * INITIAL_SCAN_REQ - Initial scan request 854f05cddf9SRui Paulo * 855f05cddf9SRui Paulo * This is used for the first scan on an interface to force at 856f05cddf9SRui Paulo * least one scan to be run even if the configuration does not 857f05cddf9SRui Paulo * include any enabled networks. 858f05cddf9SRui Paulo */ 859f05cddf9SRui Paulo INITIAL_SCAN_REQ, 860f05cddf9SRui Paulo 861f05cddf9SRui Paulo /** 862f05cddf9SRui Paulo * MANUAL_SCAN_REQ - Manual scan request 863f05cddf9SRui Paulo * 864f05cddf9SRui Paulo * This is used for scans where the user request a scan or 865f05cddf9SRui Paulo * a specific wpa_supplicant operation (e.g., WPS) requires scan 866f05cddf9SRui Paulo * to be run. 867f05cddf9SRui Paulo */ 868f05cddf9SRui Paulo MANUAL_SCAN_REQ 8695b9c547cSRui Paulo } scan_req, last_scan_req; 8705b9c547cSRui Paulo enum wpa_states scan_prev_wpa_state; 8715b9c547cSRui Paulo struct os_reltime scan_trigger_time, scan_start_time; 872325151a3SRui Paulo /* Minimum freshness requirement for connection purposes */ 873325151a3SRui Paulo struct os_reltime scan_min_time; 874f05cddf9SRui Paulo int scan_runs; /* number of scan runs since WPS was started */ 875f05cddf9SRui Paulo int *next_scan_freqs; 87685732ac8SCy Schubert int *select_network_scan_freqs; 8775b9c547cSRui Paulo int *manual_scan_freqs; 8785b9c547cSRui Paulo int *manual_sched_scan_freqs; 8795b9c547cSRui Paulo unsigned int manual_scan_passive:1; 8805b9c547cSRui Paulo unsigned int manual_scan_use_id:1; 8815b9c547cSRui Paulo unsigned int manual_scan_only_new:1; 8825b9c547cSRui Paulo unsigned int own_scan_requested:1; 8835b9c547cSRui Paulo unsigned int own_scan_running:1; 8845b9c547cSRui Paulo unsigned int clear_driver_scan_cache:1; 8855b9c547cSRui Paulo unsigned int manual_scan_id; 886f05cddf9SRui Paulo int scan_interval; /* time in sec between scans to find suitable AP */ 887f05cddf9SRui Paulo int normal_scans; /* normal scans run before sched_scan */ 888f05cddf9SRui Paulo int scan_for_connection; /* whether the scan request was triggered for 889f05cddf9SRui Paulo * finding a connection */ 89085732ac8SCy Schubert /* 89185732ac8SCy Schubert * A unique cookie representing the vendor scan request. This cookie is 89285732ac8SCy Schubert * returned from the driver interface. 0 indicates that there is no 89385732ac8SCy Schubert * pending vendor scan request. 89485732ac8SCy Schubert */ 89585732ac8SCy Schubert u64 curr_scan_cookie; 8965b9c547cSRui Paulo #define MAX_SCAN_ID 16 8975b9c547cSRui Paulo int scan_id[MAX_SCAN_ID]; 8985b9c547cSRui Paulo unsigned int scan_id_count; 899780fb4a2SCy Schubert u8 next_scan_bssid[ETH_ALEN]; 900c1d255d3SCy Schubert unsigned int next_scan_bssid_wildcard_ssid:1; 901f05cddf9SRui Paulo 902325151a3SRui Paulo struct wpa_ssid_value *ssids_from_scan_req; 903325151a3SRui Paulo unsigned int num_ssids_from_scan_req; 904c1d255d3SCy Schubert int *last_scan_freqs; 905c1d255d3SCy Schubert unsigned int num_last_scan_freqs; 906c1d255d3SCy Schubert unsigned int suitable_network; 907c1d255d3SCy Schubert unsigned int no_suitable_network; 908325151a3SRui Paulo 9095b9c547cSRui Paulo u64 drv_flags; 910c1d255d3SCy Schubert u64 drv_flags2; 911f05cddf9SRui Paulo unsigned int drv_enc; 9125b9c547cSRui Paulo unsigned int drv_rrm_flags; 913f05cddf9SRui Paulo 914f05cddf9SRui Paulo /* 915f05cddf9SRui Paulo * A bitmap of supported protocols for probe response offload. See 916f05cddf9SRui Paulo * struct wpa_driver_capa in driver.h 917f05cddf9SRui Paulo */ 918f05cddf9SRui Paulo unsigned int probe_resp_offloads; 919f05cddf9SRui Paulo 9205b9c547cSRui Paulo /* extended capabilities supported by the driver */ 9215b9c547cSRui Paulo const u8 *extended_capa, *extended_capa_mask; 9225b9c547cSRui Paulo unsigned int extended_capa_len; 9235b9c547cSRui Paulo 924e28a4053SRui Paulo int max_scan_ssids; 925f05cddf9SRui Paulo int max_sched_scan_ssids; 926780fb4a2SCy Schubert unsigned int max_sched_scan_plans; 927780fb4a2SCy Schubert unsigned int max_sched_scan_plan_interval; 928780fb4a2SCy Schubert unsigned int max_sched_scan_plan_iterations; 929f05cddf9SRui Paulo int sched_scan_supported; 930f05cddf9SRui Paulo unsigned int max_match_sets; 931e28a4053SRui Paulo unsigned int max_remain_on_chan; 932f05cddf9SRui Paulo unsigned int max_stations; 93339beb93cSSam Leffler 93439beb93cSSam Leffler int pending_mic_error_report; 93539beb93cSSam Leffler int pending_mic_error_pairwise; 93639beb93cSSam Leffler int mic_errors_seen; /* Michael MIC errors with the current PTK */ 93739beb93cSSam Leffler 93839beb93cSSam Leffler struct wps_context *wps; 93939beb93cSSam Leffler int wps_success; /* WPS success event received */ 940e28a4053SRui Paulo struct wps_er *wps_er; 9415b9c547cSRui Paulo unsigned int wps_run; 942325151a3SRui Paulo struct os_reltime wps_pin_start_time; 943c1d255d3SCy Schubert bool bssid_ignore_cleared; 9443157ba21SRui Paulo 9453157ba21SRui Paulo struct wpabuf *pending_eapol_rx; 9465b9c547cSRui Paulo struct os_reltime pending_eapol_rx_time; 9473157ba21SRui Paulo u8 pending_eapol_rx_src[ETH_ALEN]; 948f05cddf9SRui Paulo unsigned int last_eapol_matches_bssid:1; 9495b9c547cSRui Paulo unsigned int eap_expected_failure:1; 9505b9c547cSRui Paulo unsigned int reattach:1; /* reassociation to the same BSS requested */ 9515b9c547cSRui Paulo unsigned int mac_addr_changed:1; 952325151a3SRui Paulo unsigned int added_vif:1; 953a2063804SGordon Tetlow unsigned int wnmsleep_used:1; 95485732ac8SCy Schubert unsigned int owe_transition_select:1; 95585732ac8SCy Schubert unsigned int owe_transition_search:1; 9564bc52338SCy Schubert unsigned int connection_set:1; 9574bc52338SCy Schubert unsigned int connection_ht:1; 9584bc52338SCy Schubert unsigned int connection_vht:1; 9594bc52338SCy Schubert unsigned int connection_he:1; 960c1d255d3SCy Schubert unsigned int disable_mbo_oce:1; 9615b9c547cSRui Paulo 9625b9c547cSRui Paulo struct os_reltime last_mac_addr_change; 9635b9c547cSRui Paulo int last_mac_addr_style; 964e28a4053SRui Paulo 965e28a4053SRui Paulo struct ibss_rsn *ibss_rsn; 966e28a4053SRui Paulo 967f05cddf9SRui Paulo int set_sta_uapsd; 968f05cddf9SRui Paulo int sta_uapsd; 969f05cddf9SRui Paulo int set_ap_uapsd; 970f05cddf9SRui Paulo int ap_uapsd; 97185732ac8SCy Schubert int auth_alg; 97285732ac8SCy Schubert u16 last_owe_group; 973f05cddf9SRui Paulo 974e28a4053SRui Paulo #ifdef CONFIG_SME 975e28a4053SRui Paulo struct { 976325151a3SRui Paulo u8 ssid[SSID_MAX_LEN]; 977e28a4053SRui Paulo size_t ssid_len; 978e28a4053SRui Paulo int freq; 97985732ac8SCy Schubert u8 assoc_req_ie[1500]; 980e28a4053SRui Paulo size_t assoc_req_ie_len; 981e28a4053SRui Paulo int mfp; 982e28a4053SRui Paulo int ft_used; 983e28a4053SRui Paulo u8 mobility_domain[2]; 984e28a4053SRui Paulo u8 *ft_ies; 985e28a4053SRui Paulo size_t ft_ies_len; 986e28a4053SRui Paulo u8 prev_bssid[ETH_ALEN]; 987e28a4053SRui Paulo int prev_bssid_set; 988e28a4053SRui Paulo int auth_alg; 989f05cddf9SRui Paulo int proto; 990f05cddf9SRui Paulo 991f05cddf9SRui Paulo int sa_query_count; /* number of pending SA Query requests; 992f05cddf9SRui Paulo * 0 = no SA Query in progress */ 993f05cddf9SRui Paulo int sa_query_timed_out; 994f05cddf9SRui Paulo u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN * 995f05cddf9SRui Paulo * sa_query_count octets of pending 996f05cddf9SRui Paulo * SA Query transaction identifiers */ 9975b9c547cSRui Paulo struct os_reltime sa_query_start; 9985b9c547cSRui Paulo struct os_reltime last_unprot_disconnect; 9995b9c547cSRui Paulo enum { HT_SEC_CHAN_UNKNOWN, 10005b9c547cSRui Paulo HT_SEC_CHAN_ABOVE, 10015b9c547cSRui Paulo HT_SEC_CHAN_BELOW } ht_sec_chan; 1002f05cddf9SRui Paulo u8 sched_obss_scan; 1003f05cddf9SRui Paulo u16 obss_scan_int; 1004f05cddf9SRui Paulo u16 bss_max_idle_period; 10055b9c547cSRui Paulo #ifdef CONFIG_SAE 10065b9c547cSRui Paulo struct sae_data sae; 10075b9c547cSRui Paulo struct wpabuf *sae_token; 10085b9c547cSRui Paulo int sae_group_index; 10095b9c547cSRui Paulo unsigned int sae_pmksa_caching:1; 101085732ac8SCy Schubert u16 seq_num; 1011206b73d0SCy Schubert u8 ext_auth_bssid[ETH_ALEN]; 1012206b73d0SCy Schubert u8 ext_auth_ssid[SSID_MAX_LEN]; 1013206b73d0SCy Schubert size_t ext_auth_ssid_len; 1014c1d255d3SCy Schubert int *sae_rejected_groups; 10155b9c547cSRui Paulo #endif /* CONFIG_SAE */ 1016e28a4053SRui Paulo } sme; 1017e28a4053SRui Paulo #endif /* CONFIG_SME */ 1018e28a4053SRui Paulo 1019e28a4053SRui Paulo #ifdef CONFIG_AP 1020e28a4053SRui Paulo struct hostapd_iface *ap_iface; 1021e28a4053SRui Paulo void (*ap_configured_cb)(void *ctx, void *data); 1022e28a4053SRui Paulo void *ap_configured_cb_ctx; 1023e28a4053SRui Paulo void *ap_configured_cb_data; 1024e28a4053SRui Paulo #endif /* CONFIG_AP */ 1025e28a4053SRui Paulo 10265b9c547cSRui Paulo struct hostapd_iface *ifmsh; 10275b9c547cSRui Paulo #ifdef CONFIG_MESH 10285b9c547cSRui Paulo struct mesh_rsn *mesh_rsn; 10295b9c547cSRui Paulo int mesh_if_idx; 10305b9c547cSRui Paulo unsigned int mesh_if_created:1; 10315b9c547cSRui Paulo unsigned int mesh_ht_enabled:1; 1032780fb4a2SCy Schubert unsigned int mesh_vht_enabled:1; 1033206b73d0SCy Schubert unsigned int mesh_he_enabled:1; 10344bc52338SCy Schubert struct wpa_driver_mesh_join_params *mesh_params; 103585732ac8SCy Schubert #ifdef CONFIG_PMKSA_CACHE_EXTERNAL 103685732ac8SCy Schubert /* struct external_pmksa_cache::list */ 103785732ac8SCy Schubert struct dl_list mesh_external_pmksa_cache; 103885732ac8SCy Schubert #endif /* CONFIG_PMKSA_CACHE_EXTERNAL */ 10395b9c547cSRui Paulo #endif /* CONFIG_MESH */ 10405b9c547cSRui Paulo 1041f05cddf9SRui Paulo unsigned int off_channel_freq; 1042f05cddf9SRui Paulo struct wpabuf *pending_action_tx; 1043f05cddf9SRui Paulo u8 pending_action_src[ETH_ALEN]; 1044f05cddf9SRui Paulo u8 pending_action_dst[ETH_ALEN]; 1045f05cddf9SRui Paulo u8 pending_action_bssid[ETH_ALEN]; 1046f05cddf9SRui Paulo unsigned int pending_action_freq; 1047f05cddf9SRui Paulo int pending_action_no_cck; 1048f05cddf9SRui Paulo int pending_action_without_roc; 10495b9c547cSRui Paulo unsigned int pending_action_tx_done:1; 1050f05cddf9SRui Paulo void (*pending_action_tx_status_cb)(struct wpa_supplicant *wpa_s, 1051f05cddf9SRui Paulo unsigned int freq, const u8 *dst, 1052f05cddf9SRui Paulo const u8 *src, const u8 *bssid, 1053f05cddf9SRui Paulo const u8 *data, size_t data_len, 1054f05cddf9SRui Paulo enum offchannel_send_action_result 1055f05cddf9SRui Paulo result); 1056f05cddf9SRui Paulo unsigned int roc_waiting_drv_freq; 1057f05cddf9SRui Paulo int action_tx_wait_time; 105885732ac8SCy Schubert int action_tx_wait_time_used; 1059f05cddf9SRui Paulo 10605b9c547cSRui Paulo int p2p_mgmt; 10615b9c547cSRui Paulo 1062f05cddf9SRui Paulo #ifdef CONFIG_P2P 1063f05cddf9SRui Paulo struct p2p_go_neg_results *go_params; 1064f05cddf9SRui Paulo int create_p2p_iface; 1065f05cddf9SRui Paulo u8 pending_interface_addr[ETH_ALEN]; 1066f05cddf9SRui Paulo char pending_interface_name[100]; 1067f05cddf9SRui Paulo int pending_interface_type; 1068f05cddf9SRui Paulo int p2p_group_idx; 1069f05cddf9SRui Paulo unsigned int pending_listen_freq; 1070f05cddf9SRui Paulo unsigned int pending_listen_duration; 1071f05cddf9SRui Paulo enum { 1072f05cddf9SRui Paulo NOT_P2P_GROUP_INTERFACE, 1073f05cddf9SRui Paulo P2P_GROUP_INTERFACE_PENDING, 1074f05cddf9SRui Paulo P2P_GROUP_INTERFACE_GO, 1075f05cddf9SRui Paulo P2P_GROUP_INTERFACE_CLIENT 1076f05cddf9SRui Paulo } p2p_group_interface; 1077f05cddf9SRui Paulo struct p2p_group *p2p_group; 1078f05cddf9SRui Paulo char p2p_pin[10]; 1079f05cddf9SRui Paulo int p2p_wps_method; 1080f05cddf9SRui Paulo u8 p2p_auth_invite[ETH_ALEN]; 1081f05cddf9SRui Paulo int p2p_sd_over_ctrl_iface; 1082f05cddf9SRui Paulo int p2p_in_provisioning; 10835b9c547cSRui Paulo int p2p_in_invitation; 10845b9c547cSRui Paulo int p2p_invite_go_freq; 1085f05cddf9SRui Paulo int pending_invite_ssid_id; 1086f05cddf9SRui Paulo int show_group_started; 1087f05cddf9SRui Paulo u8 go_dev_addr[ETH_ALEN]; 1088f05cddf9SRui Paulo int pending_pd_before_join; 1089f05cddf9SRui Paulo u8 pending_join_iface_addr[ETH_ALEN]; 1090f05cddf9SRui Paulo u8 pending_join_dev_addr[ETH_ALEN]; 1091f05cddf9SRui Paulo int pending_join_wps_method; 1092325151a3SRui Paulo u8 p2p_join_ssid[SSID_MAX_LEN]; 10935b9c547cSRui Paulo size_t p2p_join_ssid_len; 1094f05cddf9SRui Paulo int p2p_join_scan_count; 1095f05cddf9SRui Paulo int auto_pd_scan_retry; 1096f05cddf9SRui Paulo int force_long_sd; 1097f05cddf9SRui Paulo u16 pending_pd_config_methods; 1098f05cddf9SRui Paulo enum { 10995b9c547cSRui Paulo NORMAL_PD, AUTO_PD_GO_NEG, AUTO_PD_JOIN, AUTO_PD_ASP 1100f05cddf9SRui Paulo } pending_pd_use; 1101f05cddf9SRui Paulo 1102f05cddf9SRui Paulo /* 1103f05cddf9SRui Paulo * Whether cross connection is disallowed by the AP to which this 1104f05cddf9SRui Paulo * interface is associated (only valid if there is an association). 1105f05cddf9SRui Paulo */ 1106f05cddf9SRui Paulo int cross_connect_disallowed; 1107f05cddf9SRui Paulo 1108f05cddf9SRui Paulo /* 1109f05cddf9SRui Paulo * Whether this P2P group is configured to use cross connection (only 1110f05cddf9SRui Paulo * valid if this is P2P GO interface). The actual cross connect packet 1111f05cddf9SRui Paulo * forwarding may not be configured depending on the uplink status. 1112f05cddf9SRui Paulo */ 1113f05cddf9SRui Paulo int cross_connect_enabled; 1114f05cddf9SRui Paulo 1115f05cddf9SRui Paulo /* Whether cross connection forwarding is in use at the moment. */ 1116f05cddf9SRui Paulo int cross_connect_in_use; 1117f05cddf9SRui Paulo 1118f05cddf9SRui Paulo /* 1119f05cddf9SRui Paulo * Uplink interface name for cross connection 1120f05cddf9SRui Paulo */ 1121f05cddf9SRui Paulo char cross_connect_uplink[100]; 1122f05cddf9SRui Paulo 1123f05cddf9SRui Paulo unsigned int p2p_auto_join:1; 1124f05cddf9SRui Paulo unsigned int p2p_auto_pd:1; 112585732ac8SCy Schubert unsigned int p2p_go_do_acs:1; 1126f05cddf9SRui Paulo unsigned int p2p_persistent_group:1; 1127f05cddf9SRui Paulo unsigned int p2p_fallback_to_go_neg:1; 1128f05cddf9SRui Paulo unsigned int p2p_pd_before_go_neg:1; 1129f05cddf9SRui Paulo unsigned int p2p_go_ht40:1; 11305b9c547cSRui Paulo unsigned int p2p_go_vht:1; 1131c1d255d3SCy Schubert unsigned int p2p_go_edmg:1; 11324bc52338SCy Schubert unsigned int p2p_go_he:1; 1133f05cddf9SRui Paulo unsigned int user_initiated_pd:1; 11345b9c547cSRui Paulo unsigned int p2p_go_group_formation_completed:1; 11355b9c547cSRui Paulo unsigned int group_formation_reported:1; 11365b9c547cSRui Paulo unsigned int waiting_presence_resp; 11375b9c547cSRui Paulo int p2p_first_connection_timeout; 11385b9c547cSRui Paulo unsigned int p2p_nfc_tag_enabled:1; 11395b9c547cSRui Paulo unsigned int p2p_peer_oob_pk_hash_known:1; 11405b9c547cSRui Paulo unsigned int p2p_disable_ip_addr_req:1; 1141325151a3SRui Paulo unsigned int p2ps_method_config_any:1; 1142325151a3SRui Paulo unsigned int p2p_cli_probe:1; 1143*4b72b91aSCy Schubert unsigned int p2p_go_allow_dfs:1; 114485732ac8SCy Schubert enum hostapd_hw_mode p2p_go_acs_band; 1145f05cddf9SRui Paulo int p2p_persistent_go_freq; 1146f05cddf9SRui Paulo int p2p_persistent_id; 1147f05cddf9SRui Paulo int p2p_go_intent; 1148f05cddf9SRui Paulo int p2p_connect_freq; 11495b9c547cSRui Paulo struct os_reltime p2p_auto_started; 11505b9c547cSRui Paulo struct wpa_ssid *p2p_last_4way_hs_fail; 11515b9c547cSRui Paulo struct wpa_radio_work *p2p_scan_work; 11525b9c547cSRui Paulo struct wpa_radio_work *p2p_listen_work; 11535b9c547cSRui Paulo struct wpa_radio_work *p2p_send_action_work; 11545b9c547cSRui Paulo 11555b9c547cSRui Paulo u16 p2p_oob_dev_pw_id; /* OOB Device Password Id for group formation */ 11565b9c547cSRui Paulo struct wpabuf *p2p_oob_dev_pw; /* OOB Device Password for group 11575b9c547cSRui Paulo * formation */ 11585b9c547cSRui Paulo u8 p2p_peer_oob_pubkey_hash[WPS_OOB_PUBKEY_HASH_LEN]; 11595b9c547cSRui Paulo u8 p2p_ip_addr_info[3 * 4]; 11605b9c547cSRui Paulo 11615b9c547cSRui Paulo /* group common frequencies */ 11625b9c547cSRui Paulo int *p2p_group_common_freqs; 11635b9c547cSRui Paulo unsigned int p2p_group_common_freqs_num; 11645b9c547cSRui Paulo u8 p2ps_join_addr[ETH_ALEN]; 1165780fb4a2SCy Schubert 1166780fb4a2SCy Schubert unsigned int p2p_go_max_oper_chwidth; 1167780fb4a2SCy Schubert unsigned int p2p_go_vht_center_freq2; 1168780fb4a2SCy Schubert int p2p_lo_started; 1169f05cddf9SRui Paulo #endif /* CONFIG_P2P */ 1170f05cddf9SRui Paulo 1171e28a4053SRui Paulo struct wpa_ssid *bgscan_ssid; 1172e28a4053SRui Paulo const struct bgscan_ops *bgscan; 1173e28a4053SRui Paulo void *bgscan_priv; 1174e28a4053SRui Paulo 1175f05cddf9SRui Paulo const struct autoscan_ops *autoscan; 1176f05cddf9SRui Paulo struct wpa_driver_scan_params *autoscan_params; 1177f05cddf9SRui Paulo void *autoscan_priv; 1178f05cddf9SRui Paulo 1179f05cddf9SRui Paulo struct wpa_ssid *connect_without_scan; 1180f05cddf9SRui Paulo 1181f05cddf9SRui Paulo struct wps_ap_info *wps_ap; 1182f05cddf9SRui Paulo size_t num_wps_ap; 1183f05cddf9SRui Paulo int wps_ap_iter; 1184e28a4053SRui Paulo 1185e28a4053SRui Paulo int after_wps; 1186f05cddf9SRui Paulo int known_wps_freq; 1187e28a4053SRui Paulo unsigned int wps_freq; 1188f05cddf9SRui Paulo int wps_fragment_size; 1189f05cddf9SRui Paulo int auto_reconnect_disabled; 1190f05cddf9SRui Paulo 1191f05cddf9SRui Paulo /* Channel preferences for AP/P2P GO use */ 1192f05cddf9SRui Paulo int best_24_freq; 1193f05cddf9SRui Paulo int best_5_freq; 1194f05cddf9SRui Paulo int best_overall_freq; 1195f05cddf9SRui Paulo 1196f05cddf9SRui Paulo struct gas_query *gas; 119785732ac8SCy Schubert struct gas_server *gas_server; 1198f05cddf9SRui Paulo 1199f05cddf9SRui Paulo #ifdef CONFIG_INTERWORKING 1200f05cddf9SRui Paulo unsigned int fetch_anqp_in_progress:1; 1201f05cddf9SRui Paulo unsigned int network_select:1; 1202f05cddf9SRui Paulo unsigned int auto_select:1; 1203f05cddf9SRui Paulo unsigned int auto_network_select:1; 12045b9c547cSRui Paulo unsigned int interworking_fast_assoc_tried:1; 1205f05cddf9SRui Paulo unsigned int fetch_all_anqp:1; 12065b9c547cSRui Paulo unsigned int fetch_osu_info:1; 12075b9c547cSRui Paulo unsigned int fetch_osu_waiting_scan:1; 12085b9c547cSRui Paulo unsigned int fetch_osu_icon_in_progress:1; 12095b9c547cSRui Paulo struct wpa_bss *interworking_gas_bss; 12105b9c547cSRui Paulo unsigned int osu_icon_id; 1211780fb4a2SCy Schubert struct dl_list icon_head; /* struct icon_entry */ 12125b9c547cSRui Paulo struct osu_provider *osu_prov; 12135b9c547cSRui Paulo size_t osu_prov_count; 12145b9c547cSRui Paulo struct os_reltime osu_icon_fetch_start; 12155b9c547cSRui Paulo unsigned int num_osu_scans; 12165b9c547cSRui Paulo unsigned int num_prov_found; 1217f05cddf9SRui Paulo #endif /* CONFIG_INTERWORKING */ 1218f05cddf9SRui Paulo unsigned int drv_capa_known; 1219f05cddf9SRui Paulo 1220f05cddf9SRui Paulo struct { 1221f05cddf9SRui Paulo struct hostapd_hw_modes *modes; 1222f05cddf9SRui Paulo u16 num_modes; 1223f05cddf9SRui Paulo u16 flags; 1224f05cddf9SRui Paulo } hw; 12255b9c547cSRui Paulo enum local_hw_capab { 12265b9c547cSRui Paulo CAPAB_NO_HT_VHT, 12275b9c547cSRui Paulo CAPAB_HT, 12285b9c547cSRui Paulo CAPAB_HT40, 12295b9c547cSRui Paulo CAPAB_VHT, 12305b9c547cSRui Paulo } hw_capab; 12315b9c547cSRui Paulo #ifdef CONFIG_MACSEC 12325b9c547cSRui Paulo struct ieee802_1x_kay *kay; 12335b9c547cSRui Paulo #endif /* CONFIG_MACSEC */ 1234f05cddf9SRui Paulo 1235f05cddf9SRui Paulo int pno; 12365b9c547cSRui Paulo int pno_sched_pending; 1237f05cddf9SRui Paulo 1238f05cddf9SRui Paulo /* WLAN_REASON_* reason codes. Negative if locally generated. */ 1239f05cddf9SRui Paulo int disconnect_reason; 1240f05cddf9SRui Paulo 12414bc52338SCy Schubert /* WLAN_STATUS_* status codes from last received Authentication frame 12424bc52338SCy Schubert * from the AP. */ 12434bc52338SCy Schubert u16 auth_status_code; 12444bc52338SCy Schubert 1245780fb4a2SCy Schubert /* WLAN_STATUS_* status codes from (Re)Association Response frame. */ 1246780fb4a2SCy Schubert u16 assoc_status_code; 1247780fb4a2SCy Schubert 1248f05cddf9SRui Paulo struct ext_password_data *ext_pw; 1249f05cddf9SRui Paulo 12505b9c547cSRui Paulo struct wpabuf *last_gas_resp, *prev_gas_resp; 12515b9c547cSRui Paulo u8 last_gas_addr[ETH_ALEN], prev_gas_addr[ETH_ALEN]; 12525b9c547cSRui Paulo u8 last_gas_dialog_token, prev_gas_dialog_token; 1253f05cddf9SRui Paulo 1254f05cddf9SRui Paulo unsigned int no_keep_alive:1; 12555b9c547cSRui Paulo unsigned int ext_mgmt_frame_handling:1; 12565b9c547cSRui Paulo unsigned int ext_eapol_frame_io:1; 12575b9c547cSRui Paulo unsigned int wmm_ac_supported:1; 12585b9c547cSRui Paulo unsigned int ext_work_in_progress:1; 12595b9c547cSRui Paulo unsigned int own_disconnect_req:1; 1260c1d255d3SCy Schubert unsigned int own_reconnect_req:1; 126185732ac8SCy Schubert unsigned int ignore_post_flush_scan_res:1; 12625b9c547cSRui Paulo 12635b9c547cSRui Paulo #define MAC_ADDR_RAND_SCAN BIT(0) 12645b9c547cSRui Paulo #define MAC_ADDR_RAND_SCHED_SCAN BIT(1) 12655b9c547cSRui Paulo #define MAC_ADDR_RAND_PNO BIT(2) 12665b9c547cSRui Paulo #define MAC_ADDR_RAND_ALL (MAC_ADDR_RAND_SCAN | \ 12675b9c547cSRui Paulo MAC_ADDR_RAND_SCHED_SCAN | \ 12685b9c547cSRui Paulo MAC_ADDR_RAND_PNO) 12695b9c547cSRui Paulo unsigned int mac_addr_rand_supported; 12705b9c547cSRui Paulo unsigned int mac_addr_rand_enable; 12715b9c547cSRui Paulo 12725b9c547cSRui Paulo /* MAC Address followed by mask (2 * ETH_ALEN) */ 12735b9c547cSRui Paulo u8 *mac_addr_scan; 12745b9c547cSRui Paulo u8 *mac_addr_sched_scan; 12755b9c547cSRui Paulo u8 *mac_addr_pno; 12765b9c547cSRui Paulo 12775b9c547cSRui Paulo #ifdef CONFIG_WNM 12785b9c547cSRui Paulo u8 wnm_dialog_token; 12795b9c547cSRui Paulo u8 wnm_reply; 12805b9c547cSRui Paulo u8 wnm_num_neighbor_report; 12815b9c547cSRui Paulo u8 wnm_mode; 12825b9c547cSRui Paulo u16 wnm_dissoc_timer; 12835b9c547cSRui Paulo u8 wnm_bss_termination_duration[12]; 12845b9c547cSRui Paulo struct neighbor_report *wnm_neighbor_report_elements; 12855b9c547cSRui Paulo struct os_reltime wnm_cand_valid_until; 12865b9c547cSRui Paulo u8 wnm_cand_from_bss[ETH_ALEN]; 12874bc52338SCy Schubert enum bss_trans_mgmt_status_code bss_tm_status; 128885732ac8SCy Schubert struct wpabuf *coloc_intf_elems; 128985732ac8SCy Schubert u8 coloc_intf_dialog_token; 129085732ac8SCy Schubert u8 coloc_intf_auto_report; 129185732ac8SCy Schubert u8 coloc_intf_timeout; 129285732ac8SCy Schubert #ifdef CONFIG_MBO 129385732ac8SCy Schubert unsigned int wnm_mbo_trans_reason_present:1; 129485732ac8SCy Schubert u8 wnm_mbo_transition_reason; 129585732ac8SCy Schubert #endif /* CONFIG_MBO */ 12965b9c547cSRui Paulo #endif /* CONFIG_WNM */ 12975b9c547cSRui Paulo 12985b9c547cSRui Paulo #ifdef CONFIG_TESTING_GET_GTK 12995b9c547cSRui Paulo u8 last_gtk[32]; 13005b9c547cSRui Paulo size_t last_gtk_len; 13015b9c547cSRui Paulo #endif /* CONFIG_TESTING_GET_GTK */ 13025b9c547cSRui Paulo 13035b9c547cSRui Paulo unsigned int num_multichan_concurrent; 13045b9c547cSRui Paulo struct wpa_radio_work *connect_work; 13055b9c547cSRui Paulo 13065b9c547cSRui Paulo unsigned int ext_work_id; 13075b9c547cSRui Paulo 13085b9c547cSRui Paulo struct wpabuf *vendor_elem[NUM_VENDOR_ELEM_FRAMES]; 13095b9c547cSRui Paulo 13105b9c547cSRui Paulo #ifdef CONFIG_TESTING_OPTIONS 13115b9c547cSRui Paulo struct l2_packet_data *l2_test; 13125b9c547cSRui Paulo unsigned int extra_roc_dur; 13135b9c547cSRui Paulo enum wpa_supplicant_test_failure test_failure; 131485732ac8SCy Schubert char *get_pref_freq_list_override; 1315780fb4a2SCy Schubert unsigned int reject_btm_req_reason; 1316780fb4a2SCy Schubert unsigned int p2p_go_csa_on_inv:1; 1317780fb4a2SCy Schubert unsigned int ignore_auth_resp:1; 1318780fb4a2SCy Schubert unsigned int ignore_assoc_disallow:1; 1319c1d255d3SCy Schubert unsigned int disable_sa_query:1; 132085732ac8SCy Schubert unsigned int testing_resend_assoc:1; 1321c1d255d3SCy Schubert unsigned int ignore_sae_h2e_only:1; 1322c1d255d3SCy Schubert int ft_rsnxe_used; 132385732ac8SCy Schubert struct wpabuf *sae_commit_override; 132485732ac8SCy Schubert enum wpa_alg last_tk_alg; 132585732ac8SCy Schubert u8 last_tk_addr[ETH_ALEN]; 132685732ac8SCy Schubert int last_tk_key_idx; 132785732ac8SCy Schubert u8 last_tk[WPA_TK_MAX_LEN]; 132885732ac8SCy Schubert size_t last_tk_len; 132985732ac8SCy Schubert struct wpabuf *last_assoc_req_wpa_ie; 1330c1d255d3SCy Schubert int *extra_sae_rejected_groups; 1331c1d255d3SCy Schubert struct wpabuf *rsne_override_eapol; 1332c1d255d3SCy Schubert struct wpabuf *rsnxe_override_assoc; 1333c1d255d3SCy Schubert struct wpabuf *rsnxe_override_eapol; 1334c1d255d3SCy Schubert struct dl_list drv_signal_override; 1335c1d255d3SCy Schubert unsigned int oci_freq_override_eapol; 1336c1d255d3SCy Schubert unsigned int oci_freq_override_saquery_req; 1337c1d255d3SCy Schubert unsigned int oci_freq_override_saquery_resp; 1338c1d255d3SCy Schubert unsigned int oci_freq_override_eapol_g2; 1339c1d255d3SCy Schubert unsigned int oci_freq_override_ft_assoc; 1340c1d255d3SCy Schubert unsigned int oci_freq_override_fils_assoc; 1341c1d255d3SCy Schubert unsigned int oci_freq_override_wnm_sleep; 13425b9c547cSRui Paulo #endif /* CONFIG_TESTING_OPTIONS */ 13435b9c547cSRui Paulo 13445b9c547cSRui Paulo struct wmm_ac_assoc_data *wmm_ac_assoc_info; 13455b9c547cSRui Paulo struct wmm_tspec_element *tspecs[WMM_AC_NUM][TS_DIR_IDX_COUNT]; 13465b9c547cSRui Paulo struct wmm_ac_addts_request *addts_request; 13475b9c547cSRui Paulo u8 wmm_ac_last_dialog_token; 13485b9c547cSRui Paulo struct wmm_tspec_element *last_tspecs; 13495b9c547cSRui Paulo u8 last_tspecs_count; 13505b9c547cSRui Paulo 13515b9c547cSRui Paulo struct rrm_data rrm; 135285732ac8SCy Schubert struct beacon_rep_data beacon_rep_data; 1353325151a3SRui Paulo 1354325151a3SRui Paulo #ifdef CONFIG_FST 1355325151a3SRui Paulo struct fst_iface *fst; 1356325151a3SRui Paulo const struct wpabuf *fst_ies; 1357325151a3SRui Paulo struct wpabuf *received_mb_ies; 1358325151a3SRui Paulo #endif /* CONFIG_FST */ 1359780fb4a2SCy Schubert 1360780fb4a2SCy Schubert #ifdef CONFIG_MBO 1361780fb4a2SCy Schubert /* Multiband operation non-preferred channel */ 1362780fb4a2SCy Schubert struct wpa_mbo_non_pref_channel { 1363780fb4a2SCy Schubert enum mbo_non_pref_chan_reason reason; 1364780fb4a2SCy Schubert u8 oper_class; 1365780fb4a2SCy Schubert u8 chan; 1366780fb4a2SCy Schubert u8 preference; 1367780fb4a2SCy Schubert } *non_pref_chan; 1368780fb4a2SCy Schubert size_t non_pref_chan_num; 1369780fb4a2SCy Schubert u8 mbo_wnm_token; 137085732ac8SCy Schubert /** 137185732ac8SCy Schubert * enable_oce - Enable OCE if it is enabled by user and device also 137285732ac8SCy Schubert * supports OCE. 137385732ac8SCy Schubert * User can enable OCE with wpa_config's 'oce' parameter as follows - 137485732ac8SCy Schubert * - Set BIT(0) to enable OCE in non-AP STA mode. 137585732ac8SCy Schubert * - Set BIT(1) to enable OCE in STA-CFON mode. 137685732ac8SCy Schubert */ 137785732ac8SCy Schubert u8 enable_oce; 1378780fb4a2SCy Schubert #endif /* CONFIG_MBO */ 1379780fb4a2SCy Schubert 1380780fb4a2SCy Schubert /* 1381780fb4a2SCy Schubert * This should be under CONFIG_MBO, but it is left out to allow using 1382780fb4a2SCy Schubert * the bss_temp_disallowed list for other purposes as well. 1383780fb4a2SCy Schubert */ 1384780fb4a2SCy Schubert struct dl_list bss_tmp_disallowed; 1385780fb4a2SCy Schubert 1386780fb4a2SCy Schubert /* 1387780fb4a2SCy Schubert * Content of a measurement report element with type 8 (LCI), 1388780fb4a2SCy Schubert * own location. 1389780fb4a2SCy Schubert */ 1390780fb4a2SCy Schubert struct wpabuf *lci; 1391780fb4a2SCy Schubert struct os_reltime lci_time; 139285732ac8SCy Schubert 139385732ac8SCy Schubert struct os_reltime beacon_rep_scan; 139485732ac8SCy Schubert 139585732ac8SCy Schubert /* FILS HLP requests (struct fils_hlp_req) */ 139685732ac8SCy Schubert struct dl_list fils_hlp_req; 139785732ac8SCy Schubert 139885732ac8SCy Schubert struct sched_scan_relative_params { 139985732ac8SCy Schubert /** 140085732ac8SCy Schubert * relative_rssi_set - Enable relatively preferred BSS reporting 140185732ac8SCy Schubert * 140285732ac8SCy Schubert * 0 = Disable reporting relatively preferred BSSs 140385732ac8SCy Schubert * 1 = Enable reporting relatively preferred BSSs 140485732ac8SCy Schubert */ 140585732ac8SCy Schubert int relative_rssi_set; 140685732ac8SCy Schubert 140785732ac8SCy Schubert /** 140885732ac8SCy Schubert * relative_rssi - Relative RSSI for reporting better BSSs 140985732ac8SCy Schubert * 141085732ac8SCy Schubert * Amount of RSSI by which a BSS should be better than the 141185732ac8SCy Schubert * current connected BSS so that the new BSS can be reported 141285732ac8SCy Schubert * to user space. This applies to sched_scan operations. 141385732ac8SCy Schubert */ 141485732ac8SCy Schubert int relative_rssi; 141585732ac8SCy Schubert 141685732ac8SCy Schubert /** 141785732ac8SCy Schubert * relative_adjust_band - Band in which RSSI is to be adjusted 141885732ac8SCy Schubert */ 141985732ac8SCy Schubert enum set_band relative_adjust_band; 142085732ac8SCy Schubert 142185732ac8SCy Schubert /** 142285732ac8SCy Schubert * relative_adjust_rssi - RSSI adjustment 142385732ac8SCy Schubert * 142485732ac8SCy Schubert * An amount of relative_adjust_rssi should be added to the 142585732ac8SCy Schubert * BSSs that belong to the relative_adjust_band while comparing 142685732ac8SCy Schubert * with other bands for BSS reporting. 142785732ac8SCy Schubert */ 142885732ac8SCy Schubert int relative_adjust_rssi; 142985732ac8SCy Schubert } srp; 143085732ac8SCy Schubert 143185732ac8SCy Schubert /* RIC elements for FT protocol */ 143285732ac8SCy Schubert struct wpabuf *ric_ies; 143385732ac8SCy Schubert 143485732ac8SCy Schubert int last_auth_timeout_sec; 143585732ac8SCy Schubert 143685732ac8SCy Schubert #ifdef CONFIG_DPP 14374bc52338SCy Schubert struct dpp_global *dpp; 143885732ac8SCy Schubert struct dpp_authentication *dpp_auth; 143985732ac8SCy Schubert struct wpa_radio_work *dpp_listen_work; 144085732ac8SCy Schubert unsigned int dpp_pending_listen_freq; 144185732ac8SCy Schubert unsigned int dpp_listen_freq; 1442c1d255d3SCy Schubert struct os_reltime dpp_listen_end; 144385732ac8SCy Schubert u8 dpp_allowed_roles; 144485732ac8SCy Schubert int dpp_qr_mutual; 1445c1d255d3SCy Schubert int dpp_netrole; 144685732ac8SCy Schubert int dpp_auth_ok_on_ack; 144785732ac8SCy Schubert int dpp_in_response_listen; 144885732ac8SCy Schubert int dpp_gas_client; 144985732ac8SCy Schubert int dpp_gas_dialog_token; 145085732ac8SCy Schubert u8 dpp_intro_bssid[ETH_ALEN]; 145185732ac8SCy Schubert void *dpp_intro_network; 145285732ac8SCy Schubert struct dpp_pkex *dpp_pkex; 145385732ac8SCy Schubert struct dpp_bootstrap_info *dpp_pkex_bi; 145485732ac8SCy Schubert char *dpp_pkex_code; 145585732ac8SCy Schubert char *dpp_pkex_identifier; 145685732ac8SCy Schubert char *dpp_pkex_auth_cmd; 145785732ac8SCy Schubert char *dpp_configurator_params; 145885732ac8SCy Schubert struct os_reltime dpp_last_init; 145985732ac8SCy Schubert struct os_reltime dpp_init_iter_start; 146085732ac8SCy Schubert unsigned int dpp_init_max_tries; 146185732ac8SCy Schubert unsigned int dpp_init_retry_time; 146285732ac8SCy Schubert unsigned int dpp_resp_wait_time; 146385732ac8SCy Schubert unsigned int dpp_resp_max_tries; 146485732ac8SCy Schubert unsigned int dpp_resp_retry_time; 1465c1d255d3SCy Schubert u8 dpp_last_ssid[SSID_MAX_LEN]; 1466c1d255d3SCy Schubert size_t dpp_last_ssid_len; 1467c1d255d3SCy Schubert bool dpp_conf_backup_received; 14684bc52338SCy Schubert #ifdef CONFIG_DPP2 14694bc52338SCy Schubert struct dpp_pfs *dpp_pfs; 1470c1d255d3SCy Schubert int dpp_pfs_fallback; 1471c1d255d3SCy Schubert struct wpabuf *dpp_presence_announcement; 1472c1d255d3SCy Schubert struct dpp_bootstrap_info *dpp_chirp_bi; 1473c1d255d3SCy Schubert int dpp_chirp_freq; 1474c1d255d3SCy Schubert int *dpp_chirp_freqs; 1475c1d255d3SCy Schubert int dpp_chirp_iter; 1476c1d255d3SCy Schubert int dpp_chirp_round; 1477c1d255d3SCy Schubert int dpp_chirp_scan_done; 1478c1d255d3SCy Schubert int dpp_chirp_listen; 1479c1d255d3SCy Schubert struct wpa_ssid *dpp_reconfig_ssid; 1480c1d255d3SCy Schubert int dpp_reconfig_ssid_id; 1481c1d255d3SCy Schubert struct dpp_reconfig_id *dpp_reconfig_id; 14824bc52338SCy Schubert #endif /* CONFIG_DPP2 */ 148385732ac8SCy Schubert #ifdef CONFIG_TESTING_OPTIONS 148485732ac8SCy Schubert char *dpp_config_obj_override; 148585732ac8SCy Schubert char *dpp_discovery_override; 148685732ac8SCy Schubert char *dpp_groups_override; 148785732ac8SCy Schubert unsigned int dpp_ignore_netaccesskey_mismatch:1; 148885732ac8SCy Schubert #endif /* CONFIG_TESTING_OPTIONS */ 148985732ac8SCy Schubert #endif /* CONFIG_DPP */ 149085732ac8SCy Schubert 149185732ac8SCy Schubert #ifdef CONFIG_FILS 149285732ac8SCy Schubert unsigned int disable_fils:1; 149385732ac8SCy Schubert #endif /* CONFIG_FILS */ 149485732ac8SCy Schubert unsigned int ieee80211ac:1; 14954bc52338SCy Schubert unsigned int enabled_4addr_mode:1; 14964bc52338SCy Schubert unsigned int multi_bss_support:1; 1497c1d255d3SCy Schubert unsigned int drv_authorized_port:1; 1498c1d255d3SCy Schubert unsigned int multi_ap_ie:1; 1499c1d255d3SCy Schubert unsigned int multi_ap_backhaul:1; 1500c1d255d3SCy Schubert unsigned int multi_ap_fronthaul:1; 1501c1d255d3SCy Schubert struct robust_av_data robust_av; 1502c1d255d3SCy Schubert bool mscs_setup_done; 1503c1d255d3SCy Schubert 1504c1d255d3SCy Schubert #ifdef CONFIG_PASN 1505c1d255d3SCy Schubert struct wpas_pasn pasn; 1506c1d255d3SCy Schubert struct wpa_radio_work *pasn_auth_work; 1507c1d255d3SCy Schubert #endif /* CONFIG_PASN */ 1508*4b72b91aSCy Schubert struct scs_robust_av_data scs_robust_av_req; 1509*4b72b91aSCy Schubert u8 scs_dialog_token; 1510*4b72b91aSCy Schubert #ifdef CONFIG_TESTING_OPTIONS 1511*4b72b91aSCy Schubert unsigned int disable_scs_support:1; 1512*4b72b91aSCy Schubert unsigned int disable_mscs_support:1; 1513*4b72b91aSCy Schubert #endif /* CONFIG_TESTING_OPTIONS */ 1514*4b72b91aSCy Schubert struct dl_list active_scs_ids; 1515*4b72b91aSCy Schubert bool ongoing_scs_req; 1516*4b72b91aSCy Schubert u8 dscp_req_dialog_token; 1517*4b72b91aSCy Schubert u8 dscp_query_dialog_token; 1518*4b72b91aSCy Schubert unsigned int enable_dscp_policy_capa:1; 1519*4b72b91aSCy Schubert unsigned int connection_dscp:1; 1520*4b72b91aSCy Schubert unsigned int wait_for_dscp_req:1; 152139beb93cSSam Leffler }; 152239beb93cSSam Leffler 152339beb93cSSam Leffler 152439beb93cSSam Leffler /* wpa_supplicant.c */ 1525f05cddf9SRui Paulo void wpa_supplicant_apply_ht_overrides( 1526f05cddf9SRui Paulo struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, 1527f05cddf9SRui Paulo struct wpa_driver_associate_params *params); 15285b9c547cSRui Paulo void wpa_supplicant_apply_vht_overrides( 15295b9c547cSRui Paulo struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, 15305b9c547cSRui Paulo struct wpa_driver_associate_params *params); 1531c1d255d3SCy Schubert void wpa_supplicant_apply_he_overrides( 1532c1d255d3SCy Schubert struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, 1533c1d255d3SCy Schubert struct wpa_driver_associate_params *params); 1534f05cddf9SRui Paulo 1535e28a4053SRui Paulo int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid); 15365b9c547cSRui Paulo int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s, 15375b9c547cSRui Paulo struct wpa_ssid *ssid); 1538e28a4053SRui Paulo 153939beb93cSSam Leffler int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s); 154039beb93cSSam Leffler 1541e28a4053SRui Paulo const char * wpa_supplicant_state_txt(enum wpa_states state); 1542f05cddf9SRui Paulo int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s); 154339beb93cSSam Leffler int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s); 1544c1d255d3SCy Schubert int wpa_supplicant_update_bridge_ifname(struct wpa_supplicant *wpa_s, 1545c1d255d3SCy Schubert const char *bridge_ifname); 1546*4b72b91aSCy Schubert void wpas_set_mgmt_group_cipher(struct wpa_supplicant *wpa_s, 1547*4b72b91aSCy Schubert struct wpa_ssid *ssid, struct wpa_ie_data *ie); 154839beb93cSSam Leffler int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s, 1549e28a4053SRui Paulo struct wpa_bss *bss, struct wpa_ssid *ssid, 155039beb93cSSam Leffler u8 *wpa_ie, size_t *wpa_ie_len); 1551c1d255d3SCy Schubert int wpas_restore_permanent_mac_addr(struct wpa_supplicant *wpa_s); 155239beb93cSSam Leffler void wpa_supplicant_associate(struct wpa_supplicant *wpa_s, 1553e28a4053SRui Paulo struct wpa_bss *bss, 155439beb93cSSam Leffler struct wpa_ssid *ssid); 155539beb93cSSam Leffler void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s, 155639beb93cSSam Leffler struct wpa_ssid *ssid); 155739beb93cSSam Leffler void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s); 155839beb93cSSam Leffler void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr); 155939beb93cSSam Leffler void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s, 156039beb93cSSam Leffler int sec, int usec); 156185732ac8SCy Schubert void wpas_auth_timeout_restart(struct wpa_supplicant *wpa_s, int sec_diff); 1562f05cddf9SRui Paulo void wpa_supplicant_reinit_autoscan(struct wpa_supplicant *wpa_s); 1563e28a4053SRui Paulo void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, 1564e28a4053SRui Paulo enum wpa_states state); 156539beb93cSSam Leffler struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s); 1566f05cddf9SRui Paulo const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s); 156739beb93cSSam Leffler void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s); 156839beb93cSSam Leffler void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s, 1569206b73d0SCy Schubert u16 reason_code); 1570c1d255d3SCy Schubert void wpa_supplicant_reconnect(struct wpa_supplicant *wpa_s); 157139beb93cSSam Leffler 1572780fb4a2SCy Schubert struct wpa_ssid * wpa_supplicant_add_network(struct wpa_supplicant *wpa_s); 1573780fb4a2SCy Schubert int wpa_supplicant_remove_network(struct wpa_supplicant *wpa_s, int id); 1574c1d255d3SCy Schubert int wpa_supplicant_remove_all_networks(struct wpa_supplicant *wpa_s); 1575e28a4053SRui Paulo void wpa_supplicant_enable_network(struct wpa_supplicant *wpa_s, 1576e28a4053SRui Paulo struct wpa_ssid *ssid); 1577e28a4053SRui Paulo void wpa_supplicant_disable_network(struct wpa_supplicant *wpa_s, 1578e28a4053SRui Paulo struct wpa_ssid *ssid); 1579e28a4053SRui Paulo void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s, 1580e28a4053SRui Paulo struct wpa_ssid *ssid); 15815b9c547cSRui Paulo int wpas_set_pkcs11_engine_and_module_path(struct wpa_supplicant *wpa_s, 15825b9c547cSRui Paulo const char *pkcs11_engine_path, 15835b9c547cSRui Paulo const char *pkcs11_module_path); 1584e28a4053SRui Paulo int wpa_supplicant_set_ap_scan(struct wpa_supplicant *wpa_s, 1585e28a4053SRui Paulo int ap_scan); 1586f05cddf9SRui Paulo int wpa_supplicant_set_bss_expiration_age(struct wpa_supplicant *wpa_s, 1587f05cddf9SRui Paulo unsigned int expire_age); 1588f05cddf9SRui Paulo int wpa_supplicant_set_bss_expiration_count(struct wpa_supplicant *wpa_s, 1589f05cddf9SRui Paulo unsigned int expire_count); 1590f05cddf9SRui Paulo int wpa_supplicant_set_scan_interval(struct wpa_supplicant *wpa_s, 1591f05cddf9SRui Paulo int scan_interval); 1592e28a4053SRui Paulo int wpa_supplicant_set_debug_params(struct wpa_global *global, 1593e28a4053SRui Paulo int debug_level, int debug_timestamp, 1594e28a4053SRui Paulo int debug_show_keys); 1595f05cddf9SRui Paulo void free_hw_features(struct wpa_supplicant *wpa_s); 1596e28a4053SRui Paulo 159739beb93cSSam Leffler void wpa_show_license(void); 159839beb93cSSam Leffler 1599780fb4a2SCy Schubert struct wpa_interface * wpa_supplicant_match_iface(struct wpa_global *global, 1600780fb4a2SCy Schubert const char *ifname); 160139beb93cSSam Leffler struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global, 16025b9c547cSRui Paulo struct wpa_interface *iface, 16035b9c547cSRui Paulo struct wpa_supplicant *parent); 160439beb93cSSam Leffler int wpa_supplicant_remove_iface(struct wpa_global *global, 1605f05cddf9SRui Paulo struct wpa_supplicant *wpa_s, 1606f05cddf9SRui Paulo int terminate); 160739beb93cSSam Leffler struct wpa_supplicant * wpa_supplicant_get_iface(struct wpa_global *global, 160839beb93cSSam Leffler const char *ifname); 160939beb93cSSam Leffler struct wpa_global * wpa_supplicant_init(struct wpa_params *params); 161039beb93cSSam Leffler int wpa_supplicant_run(struct wpa_global *global); 161139beb93cSSam Leffler void wpa_supplicant_deinit(struct wpa_global *global); 161239beb93cSSam Leffler 161339beb93cSSam Leffler int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s, 161439beb93cSSam Leffler struct wpa_ssid *ssid); 1615e28a4053SRui Paulo void wpa_supplicant_terminate_proc(struct wpa_global *global); 1616e28a4053SRui Paulo void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr, 1617e28a4053SRui Paulo const u8 *buf, size_t len); 1618f05cddf9SRui Paulo void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s); 1619f05cddf9SRui Paulo void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s); 1620f05cddf9SRui Paulo void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid); 162185732ac8SCy Schubert void fils_connection_failure(struct wpa_supplicant *wpa_s); 1622c1d255d3SCy Schubert void fils_pmksa_cache_flush(struct wpa_supplicant *wpa_s); 1623f05cddf9SRui Paulo int wpas_driver_bss_selection(struct wpa_supplicant *wpa_s); 1624f05cddf9SRui Paulo int wpas_is_p2p_prioritized(struct wpa_supplicant *wpa_s); 16255b9c547cSRui Paulo void wpas_auth_failed(struct wpa_supplicant *wpa_s, char *reason); 1626f05cddf9SRui Paulo void wpas_clear_temp_disabled(struct wpa_supplicant *wpa_s, 1627f05cddf9SRui Paulo struct wpa_ssid *ssid, int clear_failures); 1628f05cddf9SRui Paulo int disallowed_bssid(struct wpa_supplicant *wpa_s, const u8 *bssid); 1629f05cddf9SRui Paulo int disallowed_ssid(struct wpa_supplicant *wpa_s, const u8 *ssid, 1630f05cddf9SRui Paulo size_t ssid_len); 1631f05cddf9SRui Paulo void wpas_request_connection(struct wpa_supplicant *wpa_s); 1632780fb4a2SCy Schubert void wpas_request_disconnection(struct wpa_supplicant *wpa_s); 16335b9c547cSRui Paulo int wpas_build_ext_capab(struct wpa_supplicant *wpa_s, u8 *buf, size_t buflen); 16345b9c547cSRui Paulo int wpas_update_random_addr(struct wpa_supplicant *wpa_s, int style); 16355b9c547cSRui Paulo int wpas_update_random_addr_disassoc(struct wpa_supplicant *wpa_s); 16365b9c547cSRui Paulo void add_freq(int *freqs, int *num_freqs, int freq); 16375b9c547cSRui Paulo 1638c1d255d3SCy Schubert int wpas_get_op_chan_phy(int freq, const u8 *ies, size_t ies_len, 1639c1d255d3SCy Schubert u8 *op_class, u8 *chan, u8 *phy_type); 1640c1d255d3SCy Schubert 1641c1d255d3SCy Schubert int wpas_twt_send_setup(struct wpa_supplicant *wpa_s, u8 dtok, int exponent, 1642c1d255d3SCy Schubert int mantissa, u8 min_twt, int setup_cmd, u64 twt, 1643c1d255d3SCy Schubert bool requestor, bool trigger, bool implicit, 1644c1d255d3SCy Schubert bool flow_type, u8 flow_id, bool protection, 1645c1d255d3SCy Schubert u8 twt_channel, u8 control); 1646c1d255d3SCy Schubert int wpas_twt_send_teardown(struct wpa_supplicant *wpa_s, u8 flags); 1647c1d255d3SCy Schubert 16485b9c547cSRui Paulo void wpas_rrm_reset(struct wpa_supplicant *wpa_s); 16495b9c547cSRui Paulo void wpas_rrm_process_neighbor_rep(struct wpa_supplicant *wpa_s, 16505b9c547cSRui Paulo const u8 *report, size_t report_len); 16515b9c547cSRui Paulo int wpas_rrm_send_neighbor_rep_request(struct wpa_supplicant *wpa_s, 1652780fb4a2SCy Schubert const struct wpa_ssid_value *ssid, 1653780fb4a2SCy Schubert int lci, int civic, 16545b9c547cSRui Paulo void (*cb)(void *ctx, 16555b9c547cSRui Paulo struct wpabuf *neighbor_rep), 16565b9c547cSRui Paulo void *cb_ctx); 1657780fb4a2SCy Schubert void wpas_rrm_handle_radio_measurement_request(struct wpa_supplicant *wpa_s, 165885732ac8SCy Schubert const u8 *src, const u8 *dst, 1659780fb4a2SCy Schubert const u8 *frame, size_t len); 16605b9c547cSRui Paulo void wpas_rrm_handle_link_measurement_request(struct wpa_supplicant *wpa_s, 16615b9c547cSRui Paulo const u8 *src, 16625b9c547cSRui Paulo const u8 *frame, size_t len, 16635b9c547cSRui Paulo int rssi); 166485732ac8SCy Schubert void wpas_rrm_refuse_request(struct wpa_supplicant *wpa_s); 166585732ac8SCy Schubert int wpas_beacon_rep_scan_process(struct wpa_supplicant *wpa_s, 166685732ac8SCy Schubert struct wpa_scan_results *scan_res, 166785732ac8SCy Schubert struct scan_info *info); 166885732ac8SCy Schubert void wpas_clear_beacon_rep_data(struct wpa_supplicant *wpa_s); 166985732ac8SCy Schubert void wpas_flush_fils_hlp_req(struct wpa_supplicant *wpa_s); 1670c1d255d3SCy Schubert void wpas_clear_disabled_interface(void *eloop_ctx, void *timeout_ctx); 1671c1d255d3SCy Schubert void wpa_supplicant_reset_bgscan(struct wpa_supplicant *wpa_s); 1672f05cddf9SRui Paulo 1673780fb4a2SCy Schubert 1674780fb4a2SCy Schubert /* MBO functions */ 167585732ac8SCy Schubert int wpas_mbo_ie(struct wpa_supplicant *wpa_s, u8 *buf, size_t len, 167685732ac8SCy Schubert int add_oce_capa); 167785732ac8SCy Schubert const u8 * mbo_attr_from_mbo_ie(const u8 *mbo_ie, enum mbo_attr_id attr); 1678780fb4a2SCy Schubert const u8 * wpas_mbo_get_bss_attr(struct wpa_bss *bss, enum mbo_attr_id attr); 1679c1d255d3SCy Schubert void wpas_mbo_check_pmf(struct wpa_supplicant *wpa_s, struct wpa_bss *bss, 1680c1d255d3SCy Schubert struct wpa_ssid *ssid); 16814bc52338SCy Schubert const u8 * mbo_get_attr_from_ies(const u8 *ies, size_t ies_len, 16824bc52338SCy Schubert enum mbo_attr_id attr); 1683780fb4a2SCy Schubert int wpas_mbo_update_non_pref_chan(struct wpa_supplicant *wpa_s, 1684780fb4a2SCy Schubert const char *non_pref_chan); 1685780fb4a2SCy Schubert void wpas_mbo_scan_ie(struct wpa_supplicant *wpa_s, struct wpabuf *ie); 1686780fb4a2SCy Schubert void wpas_mbo_ie_trans_req(struct wpa_supplicant *wpa_s, const u8 *ie, 1687780fb4a2SCy Schubert size_t len); 1688780fb4a2SCy Schubert size_t wpas_mbo_ie_bss_trans_reject(struct wpa_supplicant *wpa_s, u8 *pos, 1689780fb4a2SCy Schubert size_t len, 1690780fb4a2SCy Schubert enum mbo_transition_reject_reason reason); 1691780fb4a2SCy Schubert void wpas_mbo_update_cell_capa(struct wpa_supplicant *wpa_s, u8 mbo_cell_capa); 1692780fb4a2SCy Schubert struct wpabuf * mbo_build_anqp_buf(struct wpa_supplicant *wpa_s, 169385732ac8SCy Schubert struct wpa_bss *bss, u32 mbo_subtypes); 169485732ac8SCy Schubert void mbo_parse_rx_anqp_resp(struct wpa_supplicant *wpa_s, 169585732ac8SCy Schubert struct wpa_bss *bss, const u8 *sa, 169685732ac8SCy Schubert const u8 *data, size_t slen); 16974bc52338SCy Schubert void wpas_update_mbo_connect_params(struct wpa_supplicant *wpa_s); 169885732ac8SCy Schubert 169985732ac8SCy Schubert /* op_classes.c */ 170085732ac8SCy Schubert enum chan_allowed { 1701*4b72b91aSCy Schubert NOT_ALLOWED, NO_IR, RADAR, ALLOWED 170285732ac8SCy Schubert }; 170385732ac8SCy Schubert 1704c1d255d3SCy Schubert enum chan_allowed verify_channel(struct hostapd_hw_modes *mode, u8 op_class, 1705c1d255d3SCy Schubert u8 channel, u8 bw); 17064bc52338SCy Schubert size_t wpas_supp_op_class_ie(struct wpa_supplicant *wpa_s, 17074bc52338SCy Schubert struct wpa_ssid *ssid, 1708c1d255d3SCy Schubert struct wpa_bss *bss, u8 *pos, size_t len); 1709c1d255d3SCy Schubert int * wpas_supp_op_classes(struct wpa_supplicant *wpa_s); 1710780fb4a2SCy Schubert 1711206b73d0SCy Schubert int wpas_enable_mac_addr_randomization(struct wpa_supplicant *wpa_s, 1712206b73d0SCy Schubert unsigned int type, const u8 *addr, 1713206b73d0SCy Schubert const u8 *mask); 1714206b73d0SCy Schubert int wpas_disable_mac_addr_randomization(struct wpa_supplicant *wpa_s, 1715206b73d0SCy Schubert unsigned int type); 1716206b73d0SCy Schubert 1717f05cddf9SRui Paulo /** 1718f05cddf9SRui Paulo * wpa_supplicant_ctrl_iface_ctrl_rsp_handle - Handle a control response 1719f05cddf9SRui Paulo * @wpa_s: Pointer to wpa_supplicant data 1720f05cddf9SRui Paulo * @ssid: Pointer to the network block the reply is for 1721f05cddf9SRui Paulo * @field: field the response is a reply for 1722f05cddf9SRui Paulo * @value: value (ie, password, etc) for @field 1723f05cddf9SRui Paulo * Returns: 0 on success, non-zero on error 1724f05cddf9SRui Paulo * 1725f05cddf9SRui Paulo * Helper function to handle replies to control interface requests. 1726f05cddf9SRui Paulo */ 1727f05cddf9SRui Paulo int wpa_supplicant_ctrl_iface_ctrl_rsp_handle(struct wpa_supplicant *wpa_s, 1728f05cddf9SRui Paulo struct wpa_ssid *ssid, 1729f05cddf9SRui Paulo const char *field, 1730f05cddf9SRui Paulo const char *value); 173139beb93cSSam Leffler 17325b9c547cSRui Paulo void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, 17335b9c547cSRui Paulo const struct wpa_ssid *ssid, 17345b9c547cSRui Paulo struct hostapd_freq_params *freq); 17355b9c547cSRui Paulo 173639beb93cSSam Leffler /* events.c */ 173739beb93cSSam Leffler void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s); 1738f05cddf9SRui Paulo int wpa_supplicant_connect(struct wpa_supplicant *wpa_s, 1739e28a4053SRui Paulo struct wpa_bss *selected, 1740e28a4053SRui Paulo struct wpa_ssid *ssid); 1741f05cddf9SRui Paulo void wpa_supplicant_stop_countermeasures(void *eloop_ctx, void *sock_ctx); 1742f05cddf9SRui Paulo void wpa_supplicant_delayed_mic_error_report(void *eloop_ctx, void *sock_ctx); 1743f05cddf9SRui Paulo void wnm_bss_keep_alive_deinit(struct wpa_supplicant *wpa_s); 17445b9c547cSRui Paulo int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s); 17455b9c547cSRui Paulo struct wpa_bss * wpa_supplicant_pick_network(struct wpa_supplicant *wpa_s, 17465b9c547cSRui Paulo struct wpa_ssid **selected_ssid); 174785732ac8SCy Schubert int wpas_temp_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid); 17484bc52338SCy Schubert void wpa_supplicant_update_channel_list(struct wpa_supplicant *wpa_s, 17494bc52338SCy Schubert struct channel_list_changed *info); 1750c1d255d3SCy Schubert int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s, 1751c1d255d3SCy Schubert struct wpa_bss *current_bss, 1752c1d255d3SCy Schubert struct wpa_bss *seleceted); 175339beb93cSSam Leffler 1754e28a4053SRui Paulo /* eap_register.c */ 1755e28a4053SRui Paulo int eap_register_methods(void); 175639beb93cSSam Leffler 1757f05cddf9SRui Paulo /** 1758325151a3SRui Paulo * Utility method to tell if a given network is for persistent group storage 1759f05cddf9SRui Paulo * @ssid: Network object 1760f05cddf9SRui Paulo * Returns: 1 if network is a persistent group, 0 otherwise 1761f05cddf9SRui Paulo */ 1762f05cddf9SRui Paulo static inline int network_is_persistent_group(struct wpa_ssid *ssid) 1763f05cddf9SRui Paulo { 1764325151a3SRui Paulo return ssid->disabled == 2 && ssid->p2p_persistent_group; 1765f05cddf9SRui Paulo } 1766f05cddf9SRui Paulo 1767206b73d0SCy Schubert 1768206b73d0SCy Schubert static inline int wpas_mode_to_ieee80211_mode(enum wpas_mode mode) 1769206b73d0SCy Schubert { 1770206b73d0SCy Schubert switch (mode) { 1771206b73d0SCy Schubert default: 1772206b73d0SCy Schubert case WPAS_MODE_INFRA: 1773206b73d0SCy Schubert return IEEE80211_MODE_INFRA; 1774206b73d0SCy Schubert case WPAS_MODE_IBSS: 1775206b73d0SCy Schubert return IEEE80211_MODE_IBSS; 1776206b73d0SCy Schubert case WPAS_MODE_AP: 1777206b73d0SCy Schubert case WPAS_MODE_P2P_GO: 1778206b73d0SCy Schubert case WPAS_MODE_P2P_GROUP_FORMATION: 1779206b73d0SCy Schubert return IEEE80211_MODE_AP; 1780206b73d0SCy Schubert case WPAS_MODE_MESH: 1781206b73d0SCy Schubert return IEEE80211_MODE_MESH; 1782206b73d0SCy Schubert } 1783206b73d0SCy Schubert } 1784206b73d0SCy Schubert 1785206b73d0SCy Schubert 1786f05cddf9SRui Paulo int wpas_network_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid); 17875b9c547cSRui Paulo int wpas_get_ssid_pmf(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid); 1788*4b72b91aSCy Schubert int pmf_in_use(struct wpa_supplicant *wpa_s, const u8 *addr); 1789f05cddf9SRui Paulo 1790f05cddf9SRui Paulo int wpas_init_ext_pw(struct wpa_supplicant *wpa_s); 1791f05cddf9SRui Paulo 17925b9c547cSRui Paulo void dump_freq_data(struct wpa_supplicant *wpa_s, const char *title, 17935b9c547cSRui Paulo struct wpa_used_freq_data *freqs_data, 17945b9c547cSRui Paulo unsigned int len); 17955b9c547cSRui Paulo 17965b9c547cSRui Paulo int get_shared_radio_freqs_data(struct wpa_supplicant *wpa_s, 17975b9c547cSRui Paulo struct wpa_used_freq_data *freqs_data, 17985b9c547cSRui Paulo unsigned int len); 17995b9c547cSRui Paulo int get_shared_radio_freqs(struct wpa_supplicant *wpa_s, 18005b9c547cSRui Paulo int *freq_array, unsigned int len); 18015b9c547cSRui Paulo 1802325151a3SRui Paulo void wpas_network_reenabled(void *eloop_ctx, void *timeout_ctx); 1803325151a3SRui Paulo 1804780fb4a2SCy Schubert void wpas_vendor_elem_update(struct wpa_supplicant *wpa_s); 1805780fb4a2SCy Schubert struct wpa_supplicant * wpas_vendor_elem(struct wpa_supplicant *wpa_s, 1806780fb4a2SCy Schubert enum wpa_vendor_elem_frame frame); 1807780fb4a2SCy Schubert int wpas_vendor_elem_remove(struct wpa_supplicant *wpa_s, int frame, 1808780fb4a2SCy Schubert const u8 *elem, size_t len); 1809780fb4a2SCy Schubert 1810325151a3SRui Paulo #ifdef CONFIG_FST 1811325151a3SRui Paulo 1812325151a3SRui Paulo struct fst_wpa_obj; 1813325151a3SRui Paulo 1814325151a3SRui Paulo void fst_wpa_supplicant_fill_iface_obj(struct wpa_supplicant *wpa_s, 1815325151a3SRui Paulo struct fst_wpa_obj *iface_obj); 1816325151a3SRui Paulo 1817325151a3SRui Paulo #endif /* CONFIG_FST */ 1818325151a3SRui Paulo 1819780fb4a2SCy Schubert int wpas_sched_scan_plans_set(struct wpa_supplicant *wpa_s, const char *cmd); 1820780fb4a2SCy Schubert 1821780fb4a2SCy Schubert struct hostapd_hw_modes * get_mode(struct hostapd_hw_modes *modes, 1822c1d255d3SCy Schubert u16 num_modes, enum hostapd_hw_mode mode, 1823c1d255d3SCy Schubert bool is_6ghz); 1824c1d255d3SCy Schubert struct hostapd_hw_modes * get_mode_with_freq(struct hostapd_hw_modes *modes, 1825c1d255d3SCy Schubert u16 num_modes, int freq); 1826780fb4a2SCy Schubert 1827780fb4a2SCy Schubert void wpa_bss_tmp_disallow(struct wpa_supplicant *wpa_s, const u8 *bssid, 18284bc52338SCy Schubert unsigned int sec, int rssi_threshold); 18294bc52338SCy Schubert int wpa_is_bss_tmp_disallowed(struct wpa_supplicant *wpa_s, 18304bc52338SCy Schubert struct wpa_bss *bss); 18314bc52338SCy Schubert void free_bss_tmp_disallowed(struct wpa_supplicant *wpa_s); 1832780fb4a2SCy Schubert 1833780fb4a2SCy Schubert struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s, 1834780fb4a2SCy Schubert int i, struct wpa_bss *bss, 1835780fb4a2SCy Schubert struct wpa_ssid *group, 183685732ac8SCy Schubert int only_first_ssid, int debug_print); 183785732ac8SCy Schubert 183885732ac8SCy Schubert int wpas_ctrl_iface_get_pref_freq_list_override(struct wpa_supplicant *wpa_s, 183985732ac8SCy Schubert enum wpa_driver_if_type if_type, 184085732ac8SCy Schubert unsigned int *num, 184185732ac8SCy Schubert unsigned int *freq_list); 184285732ac8SCy Schubert 184385732ac8SCy Schubert int wpa_is_fils_supported(struct wpa_supplicant *wpa_s); 184485732ac8SCy Schubert int wpa_is_fils_sk_pfs_supported(struct wpa_supplicant *wpa_s); 1845780fb4a2SCy Schubert 1846c1d255d3SCy Schubert void wpas_clear_driver_signal_override(struct wpa_supplicant *wpa_s); 1847c1d255d3SCy Schubert 1848c1d255d3SCy Schubert int wpas_send_mscs_req(struct wpa_supplicant *wpa_s); 1849c1d255d3SCy Schubert void wpas_populate_mscs_descriptor_ie(struct robust_av_data *robust_av, 1850c1d255d3SCy Schubert struct wpabuf *buf); 1851c1d255d3SCy Schubert void wpas_handle_robust_av_recv_action(struct wpa_supplicant *wpa_s, 1852c1d255d3SCy Schubert const u8 *src, const u8 *buf, 1853c1d255d3SCy Schubert size_t len); 1854c1d255d3SCy Schubert void wpas_handle_assoc_resp_mscs(struct wpa_supplicant *wpa_s, const u8 *bssid, 1855c1d255d3SCy Schubert const u8 *ies, size_t ies_len); 1856*4b72b91aSCy Schubert int wpas_send_scs_req(struct wpa_supplicant *wpa_s); 1857*4b72b91aSCy Schubert void free_up_tclas_elem(struct scs_desc_elem *elem); 1858*4b72b91aSCy Schubert void free_up_scs_desc(struct scs_robust_av_data *data); 1859*4b72b91aSCy Schubert void wpas_handle_robust_av_scs_recv_action(struct wpa_supplicant *wpa_s, 1860*4b72b91aSCy Schubert const u8 *src, const u8 *buf, 1861*4b72b91aSCy Schubert size_t len); 1862*4b72b91aSCy Schubert void wpas_scs_deinit(struct wpa_supplicant *wpa_s); 1863*4b72b91aSCy Schubert void wpas_handle_qos_mgmt_recv_action(struct wpa_supplicant *wpa_s, 1864*4b72b91aSCy Schubert const u8 *src, 1865*4b72b91aSCy Schubert const u8 *buf, size_t len); 1866*4b72b91aSCy Schubert void wpas_dscp_deinit(struct wpa_supplicant *wpa_s); 1867*4b72b91aSCy Schubert int wpas_send_dscp_response(struct wpa_supplicant *wpa_s, 1868*4b72b91aSCy Schubert struct dscp_resp_data *resp_data); 1869*4b72b91aSCy Schubert void wpas_handle_assoc_resp_qos_mgmt(struct wpa_supplicant *wpa_s, 1870*4b72b91aSCy Schubert const u8 *ies, size_t ies_len); 1871*4b72b91aSCy Schubert int wpas_send_dscp_query(struct wpa_supplicant *wpa_s, const char *domain_name, 1872*4b72b91aSCy Schubert size_t domain_name_length); 1873c1d255d3SCy Schubert 1874c1d255d3SCy Schubert int wpas_pasn_auth_start(struct wpa_supplicant *wpa_s, 1875c1d255d3SCy Schubert const u8 *bssid, int akmp, int cipher, 1876c1d255d3SCy Schubert u16 group, int network_id, 1877c1d255d3SCy Schubert const u8 *comeback, size_t comeback_len); 1878c1d255d3SCy Schubert void wpas_pasn_auth_stop(struct wpa_supplicant *wpa_s); 1879c1d255d3SCy Schubert int wpas_pasn_auth_tx_status(struct wpa_supplicant *wpa_s, 1880c1d255d3SCy Schubert const u8 *data, size_t data_len, u8 acked); 1881c1d255d3SCy Schubert int wpas_pasn_auth_rx(struct wpa_supplicant *wpa_s, 1882c1d255d3SCy Schubert const struct ieee80211_mgmt *mgmt, size_t len); 1883c1d255d3SCy Schubert 1884c1d255d3SCy Schubert int wpas_pasn_deauthenticate(struct wpa_supplicant *wpa_s, const u8 *bssid); 1885c1d255d3SCy Schubert 188639beb93cSSam Leffler #endif /* WPA_SUPPLICANT_I_H */ 1887