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 12e28a4053SRui Paulo #include "utils/list.h" 13e28a4053SRui Paulo #include "common/defs.h" 145b9c547cSRui Paulo #include "common/sae.h" 155b9c547cSRui Paulo #include "common/wpa_ctrl.h" 165b9c547cSRui Paulo #include "wps/wps_defs.h" 17f05cddf9SRui Paulo #include "config_ssid.h" 185b9c547cSRui Paulo #include "wmm_ac.h" 1939beb93cSSam Leffler 20325151a3SRui Paulo extern const char *const wpa_supplicant_version; 21325151a3SRui Paulo extern const char *const wpa_supplicant_license; 2239beb93cSSam Leffler #ifndef CONFIG_NO_STDOUT_DEBUG 23325151a3SRui Paulo extern const char *const wpa_supplicant_full_license1; 24325151a3SRui Paulo extern const char *const wpa_supplicant_full_license2; 25325151a3SRui Paulo extern const char *const wpa_supplicant_full_license3; 26325151a3SRui Paulo extern const char *const wpa_supplicant_full_license4; 27325151a3SRui Paulo extern const char *const wpa_supplicant_full_license5; 2839beb93cSSam Leffler #endif /* CONFIG_NO_STDOUT_DEBUG */ 2939beb93cSSam Leffler 3039beb93cSSam Leffler struct wpa_sm; 3139beb93cSSam Leffler struct wpa_supplicant; 32e28a4053SRui Paulo struct ibss_rsn; 33e28a4053SRui Paulo struct scan_info; 34e28a4053SRui Paulo struct wpa_bss; 35e28a4053SRui Paulo struct wpa_scan_results; 36f05cddf9SRui Paulo struct hostapd_hw_modes; 37f05cddf9SRui Paulo struct wpa_driver_associate_params; 3839beb93cSSam Leffler 3939beb93cSSam Leffler /* 4039beb93cSSam Leffler * Forward declarations of private structures used within the ctrl_iface 4139beb93cSSam Leffler * backends. Other parts of wpa_supplicant do not have access to data stored in 4239beb93cSSam Leffler * these structures. 4339beb93cSSam Leffler */ 4439beb93cSSam Leffler struct ctrl_iface_priv; 4539beb93cSSam Leffler struct ctrl_iface_global_priv; 46e28a4053SRui Paulo struct wpas_dbus_priv; 47*780fb4a2SCy Schubert struct wpas_binder_priv; 4839beb93cSSam Leffler 4939beb93cSSam Leffler /** 5039beb93cSSam Leffler * struct wpa_interface - Parameters for wpa_supplicant_add_iface() 5139beb93cSSam Leffler */ 5239beb93cSSam Leffler struct wpa_interface { 5339beb93cSSam Leffler /** 5439beb93cSSam Leffler * confname - Configuration name (file or profile) name 5539beb93cSSam Leffler * 5639beb93cSSam Leffler * This can also be %NULL when a configuration file is not used. In 5739beb93cSSam Leffler * that case, ctrl_interface must be set to allow the interface to be 5839beb93cSSam Leffler * configured. 5939beb93cSSam Leffler */ 6039beb93cSSam Leffler const char *confname; 6139beb93cSSam Leffler 6239beb93cSSam Leffler /** 635b9c547cSRui Paulo * confanother - Additional configuration name (file or profile) name 645b9c547cSRui Paulo * 655b9c547cSRui Paulo * This can also be %NULL when the additional configuration file is not 665b9c547cSRui Paulo * used. 675b9c547cSRui Paulo */ 685b9c547cSRui Paulo const char *confanother; 695b9c547cSRui Paulo 705b9c547cSRui Paulo /** 7139beb93cSSam Leffler * ctrl_interface - Control interface parameter 7239beb93cSSam Leffler * 7339beb93cSSam Leffler * If a configuration file is not used, this variable can be used to 7439beb93cSSam Leffler * set the ctrl_interface parameter that would have otherwise been read 7539beb93cSSam Leffler * from the configuration file. If both confname and ctrl_interface are 7639beb93cSSam Leffler * set, ctrl_interface is used to override the value from configuration 7739beb93cSSam Leffler * file. 7839beb93cSSam Leffler */ 7939beb93cSSam Leffler const char *ctrl_interface; 8039beb93cSSam Leffler 8139beb93cSSam Leffler /** 8239beb93cSSam Leffler * driver - Driver interface name, or %NULL to use the default driver 8339beb93cSSam Leffler */ 8439beb93cSSam Leffler const char *driver; 8539beb93cSSam Leffler 8639beb93cSSam Leffler /** 8739beb93cSSam Leffler * driver_param - Driver interface parameters 8839beb93cSSam Leffler * 8939beb93cSSam Leffler * If a configuration file is not used, this variable can be used to 9039beb93cSSam Leffler * set the driver_param parameters that would have otherwise been read 9139beb93cSSam Leffler * from the configuration file. If both confname and driver_param are 9239beb93cSSam Leffler * set, driver_param is used to override the value from configuration 9339beb93cSSam Leffler * file. 9439beb93cSSam Leffler */ 9539beb93cSSam Leffler const char *driver_param; 9639beb93cSSam Leffler 9739beb93cSSam Leffler /** 9839beb93cSSam Leffler * ifname - Interface name 9939beb93cSSam Leffler */ 10039beb93cSSam Leffler const char *ifname; 10139beb93cSSam Leffler 10239beb93cSSam Leffler /** 10339beb93cSSam Leffler * bridge_ifname - Optional bridge interface name 10439beb93cSSam Leffler * 10539beb93cSSam Leffler * If the driver interface (ifname) is included in a Linux bridge 10639beb93cSSam Leffler * device, the bridge interface may need to be used for receiving EAPOL 10739beb93cSSam Leffler * frames. This can be enabled by setting this variable to enable 10839beb93cSSam Leffler * receiving of EAPOL frames from an additional interface. 10939beb93cSSam Leffler */ 11039beb93cSSam Leffler const char *bridge_ifname; 1115b9c547cSRui Paulo 1125b9c547cSRui Paulo /** 1135b9c547cSRui Paulo * p2p_mgmt - Interface used for P2P management (P2P Device operations) 1145b9c547cSRui Paulo * 1155b9c547cSRui Paulo * Indicates whether wpas_p2p_init() must be called for this interface. 1165b9c547cSRui Paulo * This is used only when the driver supports a dedicated P2P Device 1175b9c547cSRui Paulo * interface that is not a network interface. 1185b9c547cSRui Paulo */ 1195b9c547cSRui Paulo int p2p_mgmt; 12039beb93cSSam Leffler }; 12139beb93cSSam Leffler 12239beb93cSSam Leffler /** 12339beb93cSSam Leffler * struct wpa_params - Parameters for wpa_supplicant_init() 12439beb93cSSam Leffler */ 12539beb93cSSam Leffler struct wpa_params { 12639beb93cSSam Leffler /** 12739beb93cSSam Leffler * daemonize - Run %wpa_supplicant in the background 12839beb93cSSam Leffler */ 12939beb93cSSam Leffler int daemonize; 13039beb93cSSam Leffler 13139beb93cSSam Leffler /** 13239beb93cSSam Leffler * wait_for_monitor - Wait for a monitor program before starting 13339beb93cSSam Leffler */ 13439beb93cSSam Leffler int wait_for_monitor; 13539beb93cSSam Leffler 13639beb93cSSam Leffler /** 13739beb93cSSam Leffler * pid_file - Path to a PID (process ID) file 13839beb93cSSam Leffler * 13939beb93cSSam Leffler * If this and daemonize are set, process ID of the background process 14039beb93cSSam Leffler * will be written to the specified file. 14139beb93cSSam Leffler */ 14239beb93cSSam Leffler char *pid_file; 14339beb93cSSam Leffler 14439beb93cSSam Leffler /** 14539beb93cSSam Leffler * wpa_debug_level - Debugging verbosity level (e.g., MSG_INFO) 14639beb93cSSam Leffler */ 14739beb93cSSam Leffler int wpa_debug_level; 14839beb93cSSam Leffler 14939beb93cSSam Leffler /** 15039beb93cSSam Leffler * wpa_debug_show_keys - Whether keying material is included in debug 15139beb93cSSam Leffler * 15239beb93cSSam Leffler * This parameter can be used to allow keying material to be included 15339beb93cSSam Leffler * in debug messages. This is a security risk and this option should 15439beb93cSSam Leffler * not be enabled in normal configuration. If needed during 15539beb93cSSam Leffler * development or while troubleshooting, this option can provide more 15639beb93cSSam Leffler * details for figuring out what is happening. 15739beb93cSSam Leffler */ 15839beb93cSSam Leffler int wpa_debug_show_keys; 15939beb93cSSam Leffler 16039beb93cSSam Leffler /** 16139beb93cSSam Leffler * wpa_debug_timestamp - Whether to include timestamp in debug messages 16239beb93cSSam Leffler */ 16339beb93cSSam Leffler int wpa_debug_timestamp; 16439beb93cSSam Leffler 16539beb93cSSam Leffler /** 16639beb93cSSam Leffler * ctrl_interface - Global ctrl_iface path/parameter 16739beb93cSSam Leffler */ 16839beb93cSSam Leffler char *ctrl_interface; 16939beb93cSSam Leffler 17039beb93cSSam Leffler /** 1715b9c547cSRui Paulo * ctrl_interface_group - Global ctrl_iface group 1725b9c547cSRui Paulo */ 1735b9c547cSRui Paulo char *ctrl_interface_group; 1745b9c547cSRui Paulo 1755b9c547cSRui Paulo /** 17639beb93cSSam Leffler * dbus_ctrl_interface - Enable the DBus control interface 17739beb93cSSam Leffler */ 17839beb93cSSam Leffler int dbus_ctrl_interface; 17939beb93cSSam Leffler 18039beb93cSSam Leffler /** 18139beb93cSSam Leffler * wpa_debug_file_path - Path of debug file or %NULL to use stdout 18239beb93cSSam Leffler */ 18339beb93cSSam Leffler const char *wpa_debug_file_path; 1842aef0ff7SSam Leffler 1852aef0ff7SSam Leffler /** 1862aef0ff7SSam Leffler * wpa_debug_syslog - Enable log output through syslog 1872aef0ff7SSam Leffler */ 188e28a4053SRui Paulo int wpa_debug_syslog; 189e28a4053SRui Paulo 190e28a4053SRui Paulo /** 191f05cddf9SRui Paulo * wpa_debug_tracing - Enable log output through Linux tracing 192f05cddf9SRui Paulo */ 193f05cddf9SRui Paulo int wpa_debug_tracing; 194f05cddf9SRui Paulo 195f05cddf9SRui Paulo /** 196e28a4053SRui Paulo * override_driver - Optional driver parameter override 197e28a4053SRui Paulo * 198e28a4053SRui Paulo * This parameter can be used to override the driver parameter in 199e28a4053SRui Paulo * dynamic interface addition to force a specific driver wrapper to be 200e28a4053SRui Paulo * used instead. 201e28a4053SRui Paulo */ 202e28a4053SRui Paulo char *override_driver; 203e28a4053SRui Paulo 204e28a4053SRui Paulo /** 205e28a4053SRui Paulo * override_ctrl_interface - Optional ctrl_interface override 206e28a4053SRui Paulo * 207e28a4053SRui Paulo * This parameter can be used to override the ctrl_interface parameter 208e28a4053SRui Paulo * in dynamic interface addition to force a control interface to be 209e28a4053SRui Paulo * created. 210e28a4053SRui Paulo */ 211e28a4053SRui Paulo char *override_ctrl_interface; 212f05cddf9SRui Paulo 213f05cddf9SRui Paulo /** 214f05cddf9SRui Paulo * entropy_file - Optional entropy file 215f05cddf9SRui Paulo * 216f05cddf9SRui Paulo * This parameter can be used to configure wpa_supplicant to maintain 217f05cddf9SRui Paulo * its internal entropy store over restarts. 218f05cddf9SRui Paulo */ 219f05cddf9SRui Paulo char *entropy_file; 220325151a3SRui Paulo 221325151a3SRui Paulo #ifdef CONFIG_P2P 222325151a3SRui Paulo /** 223325151a3SRui Paulo * conf_p2p_dev - Configuration file used to hold the 224325151a3SRui Paulo * P2P Device configuration parameters. 225325151a3SRui Paulo * 226325151a3SRui Paulo * This can also be %NULL. In such a case, if a P2P Device dedicated 227325151a3SRui Paulo * interfaces is created, the main configuration file will be used. 228325151a3SRui Paulo */ 229325151a3SRui Paulo char *conf_p2p_dev; 230325151a3SRui Paulo #endif /* CONFIG_P2P */ 231325151a3SRui Paulo 232*780fb4a2SCy Schubert #ifdef CONFIG_MATCH_IFACE 233*780fb4a2SCy Schubert /** 234*780fb4a2SCy Schubert * match_ifaces - Interface descriptions to match 235*780fb4a2SCy Schubert */ 236*780fb4a2SCy Schubert struct wpa_interface *match_ifaces; 237*780fb4a2SCy Schubert 238*780fb4a2SCy Schubert /** 239*780fb4a2SCy Schubert * match_iface_count - Number of defined matching interfaces 240*780fb4a2SCy Schubert */ 241*780fb4a2SCy Schubert int match_iface_count; 242*780fb4a2SCy Schubert #endif /* CONFIG_MATCH_IFACE */ 24339beb93cSSam Leffler }; 24439beb93cSSam Leffler 245f05cddf9SRui Paulo struct p2p_srv_bonjour { 246f05cddf9SRui Paulo struct dl_list list; 247f05cddf9SRui Paulo struct wpabuf *query; 248f05cddf9SRui Paulo struct wpabuf *resp; 249f05cddf9SRui Paulo }; 250f05cddf9SRui Paulo 251f05cddf9SRui Paulo struct p2p_srv_upnp { 252f05cddf9SRui Paulo struct dl_list list; 253f05cddf9SRui Paulo u8 version; 254f05cddf9SRui Paulo char *service; 255f05cddf9SRui Paulo }; 256f05cddf9SRui Paulo 25739beb93cSSam Leffler /** 25839beb93cSSam Leffler * struct wpa_global - Internal, global data for all %wpa_supplicant interfaces 25939beb93cSSam Leffler * 26039beb93cSSam Leffler * This structure is initialized by calling wpa_supplicant_init() when starting 26139beb93cSSam Leffler * %wpa_supplicant. 26239beb93cSSam Leffler */ 26339beb93cSSam Leffler struct wpa_global { 26439beb93cSSam Leffler struct wpa_supplicant *ifaces; 26539beb93cSSam Leffler struct wpa_params params; 26639beb93cSSam Leffler struct ctrl_iface_global_priv *ctrl_iface; 267e28a4053SRui Paulo struct wpas_dbus_priv *dbus; 268*780fb4a2SCy Schubert struct wpas_binder_priv *binder; 26939beb93cSSam Leffler void **drv_priv; 27039beb93cSSam Leffler size_t drv_count; 271e28a4053SRui Paulo struct os_time suspend_time; 272f05cddf9SRui Paulo struct p2p_data *p2p; 273f05cddf9SRui Paulo struct wpa_supplicant *p2p_init_wpa_s; 274f05cddf9SRui Paulo struct wpa_supplicant *p2p_group_formation; 2755b9c547cSRui Paulo struct wpa_supplicant *p2p_invite_group; 276f05cddf9SRui Paulo u8 p2p_dev_addr[ETH_ALEN]; 2775b9c547cSRui Paulo struct os_reltime p2p_go_wait_client; 278f05cddf9SRui Paulo struct dl_list p2p_srv_bonjour; /* struct p2p_srv_bonjour */ 279f05cddf9SRui Paulo struct dl_list p2p_srv_upnp; /* struct p2p_srv_upnp */ 280f05cddf9SRui Paulo int p2p_disabled; 281f05cddf9SRui Paulo int cross_connection; 2825b9c547cSRui Paulo struct wpa_freq_range_list p2p_disallow_freq; 2835b9c547cSRui Paulo struct wpa_freq_range_list p2p_go_avoid_freq; 284f05cddf9SRui Paulo enum wpa_conc_pref { 285f05cddf9SRui Paulo WPA_CONC_PREF_NOT_SET, 286f05cddf9SRui Paulo WPA_CONC_PREF_STA, 287f05cddf9SRui Paulo WPA_CONC_PREF_P2P 288f05cddf9SRui Paulo } conc_pref; 2895b9c547cSRui Paulo unsigned int p2p_per_sta_psk:1; 2905b9c547cSRui Paulo unsigned int p2p_fail_on_wps_complete:1; 2915b9c547cSRui Paulo unsigned int p2p_24ghz_social_channels:1; 2925b9c547cSRui Paulo unsigned int pending_p2ps_group:1; 2935b9c547cSRui Paulo unsigned int pending_group_iface_for_p2ps:1; 294*780fb4a2SCy Schubert unsigned int pending_p2ps_group_freq; 295f05cddf9SRui Paulo 296f05cddf9SRui Paulo #ifdef CONFIG_WIFI_DISPLAY 297f05cddf9SRui Paulo int wifi_display; 298f05cddf9SRui Paulo #define MAX_WFD_SUBELEMS 10 299f05cddf9SRui Paulo struct wpabuf *wfd_subelem[MAX_WFD_SUBELEMS]; 300f05cddf9SRui Paulo #endif /* CONFIG_WIFI_DISPLAY */ 3015b9c547cSRui Paulo 3025b9c547cSRui Paulo struct psk_list_entry *add_psk; /* From group formation */ 30339beb93cSSam Leffler }; 30439beb93cSSam Leffler 30539beb93cSSam Leffler 306f05cddf9SRui Paulo /** 3075b9c547cSRui Paulo * struct wpa_radio - Internal data for per-radio information 3085b9c547cSRui Paulo * 3095b9c547cSRui Paulo * This structure is used to share data about configured interfaces 3105b9c547cSRui Paulo * (struct wpa_supplicant) that share the same physical radio, e.g., to allow 3115b9c547cSRui Paulo * better coordination of offchannel operations. 3125b9c547cSRui Paulo */ 3135b9c547cSRui Paulo struct wpa_radio { 3145b9c547cSRui Paulo char name[16]; /* from driver_ops get_radio_name() or empty if not 3155b9c547cSRui Paulo * available */ 3165b9c547cSRui Paulo unsigned int external_scan_running:1; 317*780fb4a2SCy Schubert unsigned int num_active_works; 3185b9c547cSRui Paulo struct dl_list ifaces; /* struct wpa_supplicant::radio_list entries */ 3195b9c547cSRui Paulo struct dl_list work; /* struct wpa_radio_work::list entries */ 3205b9c547cSRui Paulo }; 3215b9c547cSRui Paulo 322*780fb4a2SCy Schubert #define MAX_ACTIVE_WORKS 2 323*780fb4a2SCy Schubert 324*780fb4a2SCy Schubert 3255b9c547cSRui Paulo /** 3265b9c547cSRui Paulo * struct wpa_radio_work - Radio work item 3275b9c547cSRui Paulo */ 3285b9c547cSRui Paulo struct wpa_radio_work { 3295b9c547cSRui Paulo struct dl_list list; 3305b9c547cSRui Paulo unsigned int freq; /* known frequency (MHz) or 0 for multiple/unknown */ 3315b9c547cSRui Paulo const char *type; 3325b9c547cSRui Paulo struct wpa_supplicant *wpa_s; 3335b9c547cSRui Paulo void (*cb)(struct wpa_radio_work *work, int deinit); 3345b9c547cSRui Paulo void *ctx; 3355b9c547cSRui Paulo unsigned int started:1; 3365b9c547cSRui Paulo struct os_reltime time; 337*780fb4a2SCy Schubert unsigned int bands; 3385b9c547cSRui Paulo }; 3395b9c547cSRui Paulo 3405b9c547cSRui Paulo int radio_add_work(struct wpa_supplicant *wpa_s, unsigned int freq, 3415b9c547cSRui Paulo const char *type, int next, 3425b9c547cSRui Paulo void (*cb)(struct wpa_radio_work *work, int deinit), 3435b9c547cSRui Paulo void *ctx); 3445b9c547cSRui Paulo void radio_work_done(struct wpa_radio_work *work); 3455b9c547cSRui Paulo void radio_remove_works(struct wpa_supplicant *wpa_s, 3465b9c547cSRui Paulo const char *type, int remove_all); 3475b9c547cSRui Paulo void radio_work_check_next(struct wpa_supplicant *wpa_s); 3485b9c547cSRui Paulo struct wpa_radio_work * 3495b9c547cSRui Paulo radio_work_pending(struct wpa_supplicant *wpa_s, const char *type); 3505b9c547cSRui Paulo 3515b9c547cSRui Paulo struct wpa_connect_work { 3525b9c547cSRui Paulo unsigned int sme:1; 3535b9c547cSRui Paulo unsigned int bss_removed:1; 3545b9c547cSRui Paulo struct wpa_bss *bss; 3555b9c547cSRui Paulo struct wpa_ssid *ssid; 3565b9c547cSRui Paulo }; 3575b9c547cSRui Paulo 3585b9c547cSRui Paulo int wpas_valid_bss_ssid(struct wpa_supplicant *wpa_s, struct wpa_bss *test_bss, 3595b9c547cSRui Paulo struct wpa_ssid *test_ssid); 3605b9c547cSRui Paulo void wpas_connect_work_free(struct wpa_connect_work *cwork); 3615b9c547cSRui Paulo void wpas_connect_work_done(struct wpa_supplicant *wpa_s); 3625b9c547cSRui Paulo 3635b9c547cSRui Paulo struct wpa_external_work { 3645b9c547cSRui Paulo unsigned int id; 3655b9c547cSRui Paulo char type[100]; 3665b9c547cSRui Paulo unsigned int timeout; 3675b9c547cSRui Paulo }; 3685b9c547cSRui Paulo 369*780fb4a2SCy Schubert enum wpa_radio_work_band wpas_freq_to_band(int freq); 370*780fb4a2SCy Schubert unsigned int wpas_get_bands(struct wpa_supplicant *wpa_s, const int *freqs); 371*780fb4a2SCy Schubert 3725b9c547cSRui Paulo /** 373f05cddf9SRui Paulo * offchannel_send_action_result - Result of offchannel send Action frame 374f05cddf9SRui Paulo */ 375f05cddf9SRui Paulo enum offchannel_send_action_result { 376f05cddf9SRui Paulo OFFCHANNEL_SEND_ACTION_SUCCESS /**< Frame was send and acknowledged */, 377f05cddf9SRui Paulo OFFCHANNEL_SEND_ACTION_NO_ACK /**< Frame was sent, but not acknowledged 378f05cddf9SRui Paulo */, 379f05cddf9SRui Paulo OFFCHANNEL_SEND_ACTION_FAILED /**< Frame was not sent due to a failure 380f05cddf9SRui Paulo */ 381f05cddf9SRui Paulo }; 382f05cddf9SRui Paulo 383f05cddf9SRui Paulo struct wps_ap_info { 384f05cddf9SRui Paulo u8 bssid[ETH_ALEN]; 385f05cddf9SRui Paulo enum wps_ap_info_type { 386f05cddf9SRui Paulo WPS_AP_NOT_SEL_REG, 387f05cddf9SRui Paulo WPS_AP_SEL_REG, 388f05cddf9SRui Paulo WPS_AP_SEL_REG_OUR 389f05cddf9SRui Paulo } type; 390f05cddf9SRui Paulo unsigned int tries; 3915b9c547cSRui Paulo struct os_reltime last_attempt; 392325151a3SRui Paulo unsigned int pbc_active; 393325151a3SRui Paulo u8 uuid[WPS_UUID_LEN]; 394f05cddf9SRui Paulo }; 395f05cddf9SRui Paulo 3965b9c547cSRui Paulo #define WPA_FREQ_USED_BY_INFRA_STATION BIT(0) 3975b9c547cSRui Paulo #define WPA_FREQ_USED_BY_P2P_CLIENT BIT(1) 3985b9c547cSRui Paulo 3995b9c547cSRui Paulo struct wpa_used_freq_data { 4005b9c547cSRui Paulo int freq; 4015b9c547cSRui Paulo unsigned int flags; 4025b9c547cSRui Paulo }; 4035b9c547cSRui Paulo 4045b9c547cSRui Paulo #define RRM_NEIGHBOR_REPORT_TIMEOUT 1 /* 1 second for AP to send a report */ 4055b9c547cSRui Paulo 4065b9c547cSRui Paulo /* 4075b9c547cSRui Paulo * struct rrm_data - Data used for managing RRM features 4085b9c547cSRui Paulo */ 4095b9c547cSRui Paulo struct rrm_data { 4105b9c547cSRui Paulo /* rrm_used - indication regarding the current connection */ 4115b9c547cSRui Paulo unsigned int rrm_used:1; 4125b9c547cSRui Paulo 4135b9c547cSRui Paulo /* 4145b9c547cSRui Paulo * notify_neighbor_rep - Callback for notifying report requester 4155b9c547cSRui Paulo */ 4165b9c547cSRui Paulo void (*notify_neighbor_rep)(void *ctx, struct wpabuf *neighbor_rep); 4175b9c547cSRui Paulo 4185b9c547cSRui Paulo /* 4195b9c547cSRui Paulo * neighbor_rep_cb_ctx - Callback context 4205b9c547cSRui Paulo * Received in the callback registration, and sent to the callback 4215b9c547cSRui Paulo * function as a parameter. 4225b9c547cSRui Paulo */ 4235b9c547cSRui Paulo void *neighbor_rep_cb_ctx; 4245b9c547cSRui Paulo 4255b9c547cSRui Paulo /* next_neighbor_rep_token - Next request's dialog token */ 4265b9c547cSRui Paulo u8 next_neighbor_rep_token; 4275b9c547cSRui Paulo }; 4285b9c547cSRui Paulo 4295b9c547cSRui Paulo enum wpa_supplicant_test_failure { 4305b9c547cSRui Paulo WPAS_TEST_FAILURE_NONE, 4315b9c547cSRui Paulo WPAS_TEST_FAILURE_SCAN_TRIGGER, 4325b9c547cSRui Paulo }; 4335b9c547cSRui Paulo 434*780fb4a2SCy Schubert struct icon_entry { 435*780fb4a2SCy Schubert struct dl_list list; 436*780fb4a2SCy Schubert u8 bssid[ETH_ALEN]; 437*780fb4a2SCy Schubert u8 dialog_token; 438*780fb4a2SCy Schubert char *file_name; 439*780fb4a2SCy Schubert u8 *image; 440*780fb4a2SCy Schubert size_t image_len; 441*780fb4a2SCy Schubert }; 442*780fb4a2SCy Schubert 443*780fb4a2SCy Schubert struct wpa_bss_tmp_disallowed { 444*780fb4a2SCy Schubert struct dl_list list; 445*780fb4a2SCy Schubert u8 bssid[ETH_ALEN]; 446*780fb4a2SCy Schubert struct os_reltime disallowed_until; 447*780fb4a2SCy Schubert }; 448*780fb4a2SCy Schubert 44939beb93cSSam Leffler /** 45039beb93cSSam Leffler * struct wpa_supplicant - Internal data for wpa_supplicant interface 45139beb93cSSam Leffler * 45239beb93cSSam Leffler * This structure contains the internal data for core wpa_supplicant code. This 45339beb93cSSam Leffler * should be only used directly from the core code. However, a pointer to this 45439beb93cSSam Leffler * data is used from other files as an arbitrary context pointer in calls to 45539beb93cSSam Leffler * core functions. 45639beb93cSSam Leffler */ 45739beb93cSSam Leffler struct wpa_supplicant { 45839beb93cSSam Leffler struct wpa_global *global; 4595b9c547cSRui Paulo struct wpa_radio *radio; /* shared radio context */ 4605b9c547cSRui Paulo struct dl_list radio_list; /* list head: struct wpa_radio::ifaces */ 461f05cddf9SRui Paulo struct wpa_supplicant *parent; 462*780fb4a2SCy Schubert struct wpa_supplicant *p2pdev; 46339beb93cSSam Leffler struct wpa_supplicant *next; 46439beb93cSSam Leffler struct l2_packet_data *l2; 46539beb93cSSam Leffler struct l2_packet_data *l2_br; 46639beb93cSSam Leffler unsigned char own_addr[ETH_ALEN]; 4675b9c547cSRui Paulo unsigned char perm_addr[ETH_ALEN]; 46839beb93cSSam Leffler char ifname[100]; 469*780fb4a2SCy Schubert #ifdef CONFIG_MATCH_IFACE 470*780fb4a2SCy Schubert int matched; 471*780fb4a2SCy Schubert #endif /* CONFIG_MATCH_IFACE */ 47239beb93cSSam Leffler #ifdef CONFIG_CTRL_IFACE_DBUS 47339beb93cSSam Leffler char *dbus_path; 47439beb93cSSam Leffler #endif /* CONFIG_CTRL_IFACE_DBUS */ 475e28a4053SRui Paulo #ifdef CONFIG_CTRL_IFACE_DBUS_NEW 476e28a4053SRui Paulo char *dbus_new_path; 477f05cddf9SRui Paulo char *dbus_groupobj_path; 478f05cddf9SRui Paulo #ifdef CONFIG_AP 479f05cddf9SRui Paulo char *preq_notify_peer; 480f05cddf9SRui Paulo #endif /* CONFIG_AP */ 481e28a4053SRui Paulo #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ 482*780fb4a2SCy Schubert #ifdef CONFIG_CTRL_IFACE_BINDER 483*780fb4a2SCy Schubert const void *binder_object_key; 484*780fb4a2SCy Schubert #endif /* CONFIG_CTRL_IFACE_BINDER */ 48539beb93cSSam Leffler char bridge_ifname[16]; 48639beb93cSSam Leffler 48739beb93cSSam Leffler char *confname; 4885b9c547cSRui Paulo char *confanother; 4895b9c547cSRui Paulo 49039beb93cSSam Leffler struct wpa_config *conf; 49139beb93cSSam Leffler int countermeasures; 4925b9c547cSRui Paulo struct os_reltime last_michael_mic_error; 49339beb93cSSam Leffler u8 bssid[ETH_ALEN]; 49439beb93cSSam Leffler u8 pending_bssid[ETH_ALEN]; /* If wpa_state == WPA_ASSOCIATING, this 495f05cddf9SRui Paulo * field contains the target BSSID. */ 49639beb93cSSam Leffler int reassociate; /* reassociation requested */ 497*780fb4a2SCy Schubert unsigned int reassoc_same_bss:1; /* reassociating to the same BSS */ 498*780fb4a2SCy Schubert unsigned int reassoc_same_ess:1; /* reassociating to the same ESS */ 49939beb93cSSam Leffler int disconnected; /* all connections disabled; i.e., do no reassociate 50039beb93cSSam Leffler * before this has been cleared */ 50139beb93cSSam Leffler struct wpa_ssid *current_ssid; 5025b9c547cSRui Paulo struct wpa_ssid *last_ssid; 503e28a4053SRui Paulo struct wpa_bss *current_bss; 50439beb93cSSam Leffler int ap_ies_from_associnfo; 505e28a4053SRui Paulo unsigned int assoc_freq; 50639beb93cSSam Leffler 50739beb93cSSam Leffler /* Selected configuration (based on Beacon/ProbeResp WPA IE) */ 50839beb93cSSam Leffler int pairwise_cipher; 50939beb93cSSam Leffler int group_cipher; 51039beb93cSSam Leffler int key_mgmt; 511f05cddf9SRui Paulo int wpa_proto; 51239beb93cSSam Leffler int mgmt_group_cipher; 51339beb93cSSam Leffler 51439beb93cSSam Leffler void *drv_priv; /* private data used by driver_ops */ 5153157ba21SRui Paulo void *global_drv_priv; 51639beb93cSSam Leffler 517f05cddf9SRui Paulo u8 *bssid_filter; 518f05cddf9SRui Paulo size_t bssid_filter_count; 519f05cddf9SRui Paulo 520f05cddf9SRui Paulo u8 *disallow_aps_bssid; 521f05cddf9SRui Paulo size_t disallow_aps_bssid_count; 522f05cddf9SRui Paulo struct wpa_ssid_value *disallow_aps_ssid; 523f05cddf9SRui Paulo size_t disallow_aps_ssid_count; 524f05cddf9SRui Paulo 525325151a3SRui Paulo enum set_band setband; 5265b9c547cSRui Paulo 5275b9c547cSRui Paulo /* Preferred network for the next connection attempt */ 5285b9c547cSRui Paulo struct wpa_ssid *next_ssid; 5295b9c547cSRui Paulo 530f05cddf9SRui Paulo /* previous scan was wildcard when interleaving between 531f05cddf9SRui Paulo * wildcard scans and specific SSID scan when max_ssids=1 */ 532f05cddf9SRui Paulo int prev_scan_wildcard; 53339beb93cSSam Leffler struct wpa_ssid *prev_scan_ssid; /* previously scanned SSID; 53439beb93cSSam Leffler * NULL = not yet initialized (start 535e28a4053SRui Paulo * with wildcard SSID) 536e28a4053SRui Paulo * WILDCARD_SSID_SCAN = wildcard 53739beb93cSSam Leffler * SSID was used in the previous scan 53839beb93cSSam Leffler */ 539e28a4053SRui Paulo #define WILDCARD_SSID_SCAN ((struct wpa_ssid *) 1) 54039beb93cSSam Leffler 541f05cddf9SRui Paulo struct wpa_ssid *prev_sched_ssid; /* last SSID used in sched scan */ 542f05cddf9SRui Paulo int sched_scan_timeout; 543f05cddf9SRui Paulo int first_sched_scan; 544f05cddf9SRui Paulo int sched_scan_timed_out; 545*780fb4a2SCy Schubert struct sched_scan_plan *sched_scan_plans; 546*780fb4a2SCy Schubert size_t sched_scan_plans_num; 547f05cddf9SRui Paulo 548e28a4053SRui Paulo void (*scan_res_handler)(struct wpa_supplicant *wpa_s, 549e28a4053SRui Paulo struct wpa_scan_results *scan_res); 550e28a4053SRui Paulo struct dl_list bss; /* struct wpa_bss::list */ 551e28a4053SRui Paulo struct dl_list bss_id; /* struct wpa_bss::list_id */ 552e28a4053SRui Paulo size_t num_bss; 553e28a4053SRui Paulo unsigned int bss_update_idx; 554e28a4053SRui Paulo unsigned int bss_next_id; 55539beb93cSSam Leffler 556f05cddf9SRui Paulo /* 557f05cddf9SRui Paulo * Pointers to BSS entries in the order they were in the last scan 558f05cddf9SRui Paulo * results. 559f05cddf9SRui Paulo */ 560f05cddf9SRui Paulo struct wpa_bss **last_scan_res; 561f05cddf9SRui Paulo unsigned int last_scan_res_used; 562f05cddf9SRui Paulo unsigned int last_scan_res_size; 5635b9c547cSRui Paulo struct os_reltime last_scan; 564f05cddf9SRui Paulo 565325151a3SRui Paulo const struct wpa_driver_ops *driver; 56639beb93cSSam Leffler int interface_removed; /* whether the network interface has been 56739beb93cSSam Leffler * removed */ 56839beb93cSSam Leffler struct wpa_sm *wpa; 56939beb93cSSam Leffler struct eapol_sm *eapol; 57039beb93cSSam Leffler 57139beb93cSSam Leffler struct ctrl_iface_priv *ctrl_iface; 57239beb93cSSam Leffler 573e28a4053SRui Paulo enum wpa_states wpa_state; 5745b9c547cSRui Paulo struct wpa_radio_work *scan_work; 5753157ba21SRui Paulo int scanning; 576f05cddf9SRui Paulo int sched_scanning; 577*780fb4a2SCy Schubert unsigned int sched_scan_stop_req:1; 57839beb93cSSam Leffler int new_connection; 57939beb93cSSam Leffler 58039beb93cSSam Leffler int eapol_received; /* number of EAPOL packets received after the 58139beb93cSSam Leffler * previous association event */ 58239beb93cSSam Leffler 58339beb93cSSam Leffler struct scard_data *scard; 584f05cddf9SRui Paulo char imsi[20]; 585f05cddf9SRui Paulo int mnc_len; 58639beb93cSSam Leffler 58739beb93cSSam Leffler unsigned char last_eapol_src[ETH_ALEN]; 58839beb93cSSam Leffler 5895b9c547cSRui Paulo unsigned int keys_cleared; /* bitfield of key indexes that the driver is 5905b9c547cSRui Paulo * known not to be configured with a key */ 59139beb93cSSam Leffler 59239beb93cSSam Leffler struct wpa_blacklist *blacklist; 59339beb93cSSam Leffler 594f05cddf9SRui Paulo /** 595f05cddf9SRui Paulo * extra_blacklist_count - Sum of blacklist counts after last connection 596f05cddf9SRui Paulo * 597f05cddf9SRui Paulo * This variable is used to maintain a count of temporary blacklisting 598f05cddf9SRui Paulo * failures (maximum number for any BSS) over blacklist clear 599f05cddf9SRui Paulo * operations. This is needed for figuring out whether there has been 600f05cddf9SRui Paulo * failures prior to the last blacklist clear operation which happens 601f05cddf9SRui Paulo * whenever no other not-blacklisted BSS candidates are available. This 602f05cddf9SRui Paulo * gets cleared whenever a connection has been established successfully. 603f05cddf9SRui Paulo */ 604f05cddf9SRui Paulo int extra_blacklist_count; 60539beb93cSSam Leffler 606f05cddf9SRui Paulo /** 607f05cddf9SRui Paulo * scan_req - Type of the scan request 608f05cddf9SRui Paulo */ 609f05cddf9SRui Paulo enum scan_req_type { 610f05cddf9SRui Paulo /** 611f05cddf9SRui Paulo * NORMAL_SCAN_REQ - Normal scan request 612f05cddf9SRui Paulo * 613f05cddf9SRui Paulo * This is used for scans initiated by wpa_supplicant to find an 614f05cddf9SRui Paulo * AP for a connection. 615f05cddf9SRui Paulo */ 616f05cddf9SRui Paulo NORMAL_SCAN_REQ, 617f05cddf9SRui Paulo 618f05cddf9SRui Paulo /** 619f05cddf9SRui Paulo * INITIAL_SCAN_REQ - Initial scan request 620f05cddf9SRui Paulo * 621f05cddf9SRui Paulo * This is used for the first scan on an interface to force at 622f05cddf9SRui Paulo * least one scan to be run even if the configuration does not 623f05cddf9SRui Paulo * include any enabled networks. 624f05cddf9SRui Paulo */ 625f05cddf9SRui Paulo INITIAL_SCAN_REQ, 626f05cddf9SRui Paulo 627f05cddf9SRui Paulo /** 628f05cddf9SRui Paulo * MANUAL_SCAN_REQ - Manual scan request 629f05cddf9SRui Paulo * 630f05cddf9SRui Paulo * This is used for scans where the user request a scan or 631f05cddf9SRui Paulo * a specific wpa_supplicant operation (e.g., WPS) requires scan 632f05cddf9SRui Paulo * to be run. 633f05cddf9SRui Paulo */ 634f05cddf9SRui Paulo MANUAL_SCAN_REQ 6355b9c547cSRui Paulo } scan_req, last_scan_req; 6365b9c547cSRui Paulo enum wpa_states scan_prev_wpa_state; 6375b9c547cSRui Paulo struct os_reltime scan_trigger_time, scan_start_time; 638325151a3SRui Paulo /* Minimum freshness requirement for connection purposes */ 639325151a3SRui Paulo struct os_reltime scan_min_time; 640f05cddf9SRui Paulo int scan_runs; /* number of scan runs since WPS was started */ 641f05cddf9SRui Paulo int *next_scan_freqs; 6425b9c547cSRui Paulo int *manual_scan_freqs; 6435b9c547cSRui Paulo int *manual_sched_scan_freqs; 6445b9c547cSRui Paulo unsigned int manual_scan_passive:1; 6455b9c547cSRui Paulo unsigned int manual_scan_use_id:1; 6465b9c547cSRui Paulo unsigned int manual_scan_only_new:1; 6475b9c547cSRui Paulo unsigned int own_scan_requested:1; 6485b9c547cSRui Paulo unsigned int own_scan_running:1; 6495b9c547cSRui Paulo unsigned int clear_driver_scan_cache:1; 6505b9c547cSRui Paulo unsigned int manual_scan_id; 651f05cddf9SRui Paulo int scan_interval; /* time in sec between scans to find suitable AP */ 652f05cddf9SRui Paulo int normal_scans; /* normal scans run before sched_scan */ 653f05cddf9SRui Paulo int scan_for_connection; /* whether the scan request was triggered for 654f05cddf9SRui Paulo * finding a connection */ 6555b9c547cSRui Paulo #define MAX_SCAN_ID 16 6565b9c547cSRui Paulo int scan_id[MAX_SCAN_ID]; 6575b9c547cSRui Paulo unsigned int scan_id_count; 658*780fb4a2SCy Schubert u8 next_scan_bssid[ETH_ALEN]; 659f05cddf9SRui Paulo 660325151a3SRui Paulo struct wpa_ssid_value *ssids_from_scan_req; 661325151a3SRui Paulo unsigned int num_ssids_from_scan_req; 662325151a3SRui Paulo 6635b9c547cSRui Paulo u64 drv_flags; 664f05cddf9SRui Paulo unsigned int drv_enc; 6655b9c547cSRui Paulo unsigned int drv_smps_modes; 6665b9c547cSRui Paulo unsigned int drv_rrm_flags; 667f05cddf9SRui Paulo 668f05cddf9SRui Paulo /* 669f05cddf9SRui Paulo * A bitmap of supported protocols for probe response offload. See 670f05cddf9SRui Paulo * struct wpa_driver_capa in driver.h 671f05cddf9SRui Paulo */ 672f05cddf9SRui Paulo unsigned int probe_resp_offloads; 673f05cddf9SRui Paulo 6745b9c547cSRui Paulo /* extended capabilities supported by the driver */ 6755b9c547cSRui Paulo const u8 *extended_capa, *extended_capa_mask; 6765b9c547cSRui Paulo unsigned int extended_capa_len; 6775b9c547cSRui Paulo 678e28a4053SRui Paulo int max_scan_ssids; 679f05cddf9SRui Paulo int max_sched_scan_ssids; 680*780fb4a2SCy Schubert unsigned int max_sched_scan_plans; 681*780fb4a2SCy Schubert unsigned int max_sched_scan_plan_interval; 682*780fb4a2SCy Schubert unsigned int max_sched_scan_plan_iterations; 683f05cddf9SRui Paulo int sched_scan_supported; 684f05cddf9SRui Paulo unsigned int max_match_sets; 685e28a4053SRui Paulo unsigned int max_remain_on_chan; 686f05cddf9SRui Paulo unsigned int max_stations; 68739beb93cSSam Leffler 68839beb93cSSam Leffler int pending_mic_error_report; 68939beb93cSSam Leffler int pending_mic_error_pairwise; 69039beb93cSSam Leffler int mic_errors_seen; /* Michael MIC errors with the current PTK */ 69139beb93cSSam Leffler 69239beb93cSSam Leffler struct wps_context *wps; 69339beb93cSSam Leffler int wps_success; /* WPS success event received */ 694e28a4053SRui Paulo struct wps_er *wps_er; 6955b9c547cSRui Paulo unsigned int wps_run; 696325151a3SRui Paulo struct os_reltime wps_pin_start_time; 69739beb93cSSam Leffler int blacklist_cleared; 6983157ba21SRui Paulo 6993157ba21SRui Paulo struct wpabuf *pending_eapol_rx; 7005b9c547cSRui Paulo struct os_reltime pending_eapol_rx_time; 7013157ba21SRui Paulo u8 pending_eapol_rx_src[ETH_ALEN]; 702f05cddf9SRui Paulo unsigned int last_eapol_matches_bssid:1; 7035b9c547cSRui Paulo unsigned int eap_expected_failure:1; 7045b9c547cSRui Paulo unsigned int reattach:1; /* reassociation to the same BSS requested */ 7055b9c547cSRui Paulo unsigned int mac_addr_changed:1; 706325151a3SRui Paulo unsigned int added_vif:1; 707a2063804SGordon Tetlow unsigned int wnmsleep_used:1; 7085b9c547cSRui Paulo 7095b9c547cSRui Paulo struct os_reltime last_mac_addr_change; 7105b9c547cSRui Paulo int last_mac_addr_style; 711e28a4053SRui Paulo 712e28a4053SRui Paulo struct ibss_rsn *ibss_rsn; 713e28a4053SRui Paulo 714f05cddf9SRui Paulo int set_sta_uapsd; 715f05cddf9SRui Paulo int sta_uapsd; 716f05cddf9SRui Paulo int set_ap_uapsd; 717f05cddf9SRui Paulo int ap_uapsd; 718f05cddf9SRui Paulo 719e28a4053SRui Paulo #ifdef CONFIG_SME 720e28a4053SRui Paulo struct { 721325151a3SRui Paulo u8 ssid[SSID_MAX_LEN]; 722e28a4053SRui Paulo size_t ssid_len; 723e28a4053SRui Paulo int freq; 724f05cddf9SRui Paulo u8 assoc_req_ie[200]; 725e28a4053SRui Paulo size_t assoc_req_ie_len; 726e28a4053SRui Paulo int mfp; 727e28a4053SRui Paulo int ft_used; 728e28a4053SRui Paulo u8 mobility_domain[2]; 729e28a4053SRui Paulo u8 *ft_ies; 730e28a4053SRui Paulo size_t ft_ies_len; 731e28a4053SRui Paulo u8 prev_bssid[ETH_ALEN]; 732e28a4053SRui Paulo int prev_bssid_set; 733e28a4053SRui Paulo int auth_alg; 734f05cddf9SRui Paulo int proto; 735f05cddf9SRui Paulo 736f05cddf9SRui Paulo int sa_query_count; /* number of pending SA Query requests; 737f05cddf9SRui Paulo * 0 = no SA Query in progress */ 738f05cddf9SRui Paulo int sa_query_timed_out; 739f05cddf9SRui Paulo u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN * 740f05cddf9SRui Paulo * sa_query_count octets of pending 741f05cddf9SRui Paulo * SA Query transaction identifiers */ 7425b9c547cSRui Paulo struct os_reltime sa_query_start; 7435b9c547cSRui Paulo struct os_reltime last_unprot_disconnect; 7445b9c547cSRui Paulo enum { HT_SEC_CHAN_UNKNOWN, 7455b9c547cSRui Paulo HT_SEC_CHAN_ABOVE, 7465b9c547cSRui Paulo HT_SEC_CHAN_BELOW } ht_sec_chan; 747f05cddf9SRui Paulo u8 sched_obss_scan; 748f05cddf9SRui Paulo u16 obss_scan_int; 749f05cddf9SRui Paulo u16 bss_max_idle_period; 7505b9c547cSRui Paulo #ifdef CONFIG_SAE 7515b9c547cSRui Paulo struct sae_data sae; 7525b9c547cSRui Paulo struct wpabuf *sae_token; 7535b9c547cSRui Paulo int sae_group_index; 7545b9c547cSRui Paulo unsigned int sae_pmksa_caching:1; 7555b9c547cSRui Paulo #endif /* CONFIG_SAE */ 756e28a4053SRui Paulo } sme; 757e28a4053SRui Paulo #endif /* CONFIG_SME */ 758e28a4053SRui Paulo 759e28a4053SRui Paulo #ifdef CONFIG_AP 760e28a4053SRui Paulo struct hostapd_iface *ap_iface; 761e28a4053SRui Paulo void (*ap_configured_cb)(void *ctx, void *data); 762e28a4053SRui Paulo void *ap_configured_cb_ctx; 763e28a4053SRui Paulo void *ap_configured_cb_data; 764e28a4053SRui Paulo #endif /* CONFIG_AP */ 765e28a4053SRui Paulo 7665b9c547cSRui Paulo struct hostapd_iface *ifmsh; 7675b9c547cSRui Paulo #ifdef CONFIG_MESH 7685b9c547cSRui Paulo struct mesh_rsn *mesh_rsn; 7695b9c547cSRui Paulo int mesh_if_idx; 7705b9c547cSRui Paulo unsigned int mesh_if_created:1; 7715b9c547cSRui Paulo unsigned int mesh_ht_enabled:1; 772*780fb4a2SCy Schubert unsigned int mesh_vht_enabled:1; 7735b9c547cSRui Paulo #endif /* CONFIG_MESH */ 7745b9c547cSRui Paulo 775f05cddf9SRui Paulo unsigned int off_channel_freq; 776f05cddf9SRui Paulo struct wpabuf *pending_action_tx; 777f05cddf9SRui Paulo u8 pending_action_src[ETH_ALEN]; 778f05cddf9SRui Paulo u8 pending_action_dst[ETH_ALEN]; 779f05cddf9SRui Paulo u8 pending_action_bssid[ETH_ALEN]; 780f05cddf9SRui Paulo unsigned int pending_action_freq; 781f05cddf9SRui Paulo int pending_action_no_cck; 782f05cddf9SRui Paulo int pending_action_without_roc; 7835b9c547cSRui Paulo unsigned int pending_action_tx_done:1; 784f05cddf9SRui Paulo void (*pending_action_tx_status_cb)(struct wpa_supplicant *wpa_s, 785f05cddf9SRui Paulo unsigned int freq, const u8 *dst, 786f05cddf9SRui Paulo const u8 *src, const u8 *bssid, 787f05cddf9SRui Paulo const u8 *data, size_t data_len, 788f05cddf9SRui Paulo enum offchannel_send_action_result 789f05cddf9SRui Paulo result); 790f05cddf9SRui Paulo unsigned int roc_waiting_drv_freq; 791f05cddf9SRui Paulo int action_tx_wait_time; 792f05cddf9SRui Paulo 7935b9c547cSRui Paulo int p2p_mgmt; 7945b9c547cSRui Paulo 795f05cddf9SRui Paulo #ifdef CONFIG_P2P 796f05cddf9SRui Paulo struct p2p_go_neg_results *go_params; 797f05cddf9SRui Paulo int create_p2p_iface; 798f05cddf9SRui Paulo u8 pending_interface_addr[ETH_ALEN]; 799f05cddf9SRui Paulo char pending_interface_name[100]; 800f05cddf9SRui Paulo int pending_interface_type; 801f05cddf9SRui Paulo int p2p_group_idx; 802f05cddf9SRui Paulo unsigned int pending_listen_freq; 803f05cddf9SRui Paulo unsigned int pending_listen_duration; 804f05cddf9SRui Paulo enum { 805f05cddf9SRui Paulo NOT_P2P_GROUP_INTERFACE, 806f05cddf9SRui Paulo P2P_GROUP_INTERFACE_PENDING, 807f05cddf9SRui Paulo P2P_GROUP_INTERFACE_GO, 808f05cddf9SRui Paulo P2P_GROUP_INTERFACE_CLIENT 809f05cddf9SRui Paulo } p2p_group_interface; 810f05cddf9SRui Paulo struct p2p_group *p2p_group; 811f05cddf9SRui Paulo int p2p_long_listen; /* remaining time in long Listen state in ms */ 812f05cddf9SRui Paulo char p2p_pin[10]; 813f05cddf9SRui Paulo int p2p_wps_method; 814f05cddf9SRui Paulo u8 p2p_auth_invite[ETH_ALEN]; 815f05cddf9SRui Paulo int p2p_sd_over_ctrl_iface; 816f05cddf9SRui Paulo int p2p_in_provisioning; 8175b9c547cSRui Paulo int p2p_in_invitation; 8185b9c547cSRui Paulo int p2p_invite_go_freq; 819f05cddf9SRui Paulo int pending_invite_ssid_id; 820f05cddf9SRui Paulo int show_group_started; 821f05cddf9SRui Paulo u8 go_dev_addr[ETH_ALEN]; 822f05cddf9SRui Paulo int pending_pd_before_join; 823f05cddf9SRui Paulo u8 pending_join_iface_addr[ETH_ALEN]; 824f05cddf9SRui Paulo u8 pending_join_dev_addr[ETH_ALEN]; 825f05cddf9SRui Paulo int pending_join_wps_method; 826325151a3SRui Paulo u8 p2p_join_ssid[SSID_MAX_LEN]; 8275b9c547cSRui Paulo size_t p2p_join_ssid_len; 828f05cddf9SRui Paulo int p2p_join_scan_count; 829f05cddf9SRui Paulo int auto_pd_scan_retry; 830f05cddf9SRui Paulo int force_long_sd; 831f05cddf9SRui Paulo u16 pending_pd_config_methods; 832f05cddf9SRui Paulo enum { 8335b9c547cSRui Paulo NORMAL_PD, AUTO_PD_GO_NEG, AUTO_PD_JOIN, AUTO_PD_ASP 834f05cddf9SRui Paulo } pending_pd_use; 835f05cddf9SRui Paulo 836f05cddf9SRui Paulo /* 837f05cddf9SRui Paulo * Whether cross connection is disallowed by the AP to which this 838f05cddf9SRui Paulo * interface is associated (only valid if there is an association). 839f05cddf9SRui Paulo */ 840f05cddf9SRui Paulo int cross_connect_disallowed; 841f05cddf9SRui Paulo 842f05cddf9SRui Paulo /* 843f05cddf9SRui Paulo * Whether this P2P group is configured to use cross connection (only 844f05cddf9SRui Paulo * valid if this is P2P GO interface). The actual cross connect packet 845f05cddf9SRui Paulo * forwarding may not be configured depending on the uplink status. 846f05cddf9SRui Paulo */ 847f05cddf9SRui Paulo int cross_connect_enabled; 848f05cddf9SRui Paulo 849f05cddf9SRui Paulo /* Whether cross connection forwarding is in use at the moment. */ 850f05cddf9SRui Paulo int cross_connect_in_use; 851f05cddf9SRui Paulo 852f05cddf9SRui Paulo /* 853f05cddf9SRui Paulo * Uplink interface name for cross connection 854f05cddf9SRui Paulo */ 855f05cddf9SRui Paulo char cross_connect_uplink[100]; 856f05cddf9SRui Paulo 857f05cddf9SRui Paulo unsigned int p2p_auto_join:1; 858f05cddf9SRui Paulo unsigned int p2p_auto_pd:1; 859f05cddf9SRui Paulo unsigned int p2p_persistent_group:1; 860f05cddf9SRui Paulo unsigned int p2p_fallback_to_go_neg:1; 861f05cddf9SRui Paulo unsigned int p2p_pd_before_go_neg:1; 862f05cddf9SRui Paulo unsigned int p2p_go_ht40:1; 8635b9c547cSRui Paulo unsigned int p2p_go_vht:1; 864f05cddf9SRui Paulo unsigned int user_initiated_pd:1; 8655b9c547cSRui Paulo unsigned int p2p_go_group_formation_completed:1; 8665b9c547cSRui Paulo unsigned int group_formation_reported:1; 8675b9c547cSRui Paulo unsigned int waiting_presence_resp; 8685b9c547cSRui Paulo int p2p_first_connection_timeout; 8695b9c547cSRui Paulo unsigned int p2p_nfc_tag_enabled:1; 8705b9c547cSRui Paulo unsigned int p2p_peer_oob_pk_hash_known:1; 8715b9c547cSRui Paulo unsigned int p2p_disable_ip_addr_req:1; 872325151a3SRui Paulo unsigned int p2ps_method_config_any:1; 873325151a3SRui Paulo unsigned int p2p_cli_probe:1; 874f05cddf9SRui Paulo int p2p_persistent_go_freq; 875f05cddf9SRui Paulo int p2p_persistent_id; 876f05cddf9SRui Paulo int p2p_go_intent; 877f05cddf9SRui Paulo int p2p_connect_freq; 8785b9c547cSRui Paulo struct os_reltime p2p_auto_started; 8795b9c547cSRui Paulo struct wpa_ssid *p2p_last_4way_hs_fail; 8805b9c547cSRui Paulo struct wpa_radio_work *p2p_scan_work; 8815b9c547cSRui Paulo struct wpa_radio_work *p2p_listen_work; 8825b9c547cSRui Paulo struct wpa_radio_work *p2p_send_action_work; 8835b9c547cSRui Paulo 8845b9c547cSRui Paulo u16 p2p_oob_dev_pw_id; /* OOB Device Password Id for group formation */ 8855b9c547cSRui Paulo struct wpabuf *p2p_oob_dev_pw; /* OOB Device Password for group 8865b9c547cSRui Paulo * formation */ 8875b9c547cSRui Paulo u8 p2p_peer_oob_pubkey_hash[WPS_OOB_PUBKEY_HASH_LEN]; 8885b9c547cSRui Paulo u8 p2p_ip_addr_info[3 * 4]; 8895b9c547cSRui Paulo 8905b9c547cSRui Paulo /* group common frequencies */ 8915b9c547cSRui Paulo int *p2p_group_common_freqs; 8925b9c547cSRui Paulo unsigned int p2p_group_common_freqs_num; 8935b9c547cSRui Paulo u8 p2ps_join_addr[ETH_ALEN]; 894*780fb4a2SCy Schubert 895*780fb4a2SCy Schubert unsigned int p2p_go_max_oper_chwidth; 896*780fb4a2SCy Schubert unsigned int p2p_go_vht_center_freq2; 897*780fb4a2SCy Schubert int p2p_lo_started; 898f05cddf9SRui Paulo #endif /* CONFIG_P2P */ 899f05cddf9SRui Paulo 900e28a4053SRui Paulo struct wpa_ssid *bgscan_ssid; 901e28a4053SRui Paulo const struct bgscan_ops *bgscan; 902e28a4053SRui Paulo void *bgscan_priv; 903e28a4053SRui Paulo 904f05cddf9SRui Paulo const struct autoscan_ops *autoscan; 905f05cddf9SRui Paulo struct wpa_driver_scan_params *autoscan_params; 906f05cddf9SRui Paulo void *autoscan_priv; 907f05cddf9SRui Paulo 908f05cddf9SRui Paulo struct wpa_ssid *connect_without_scan; 909f05cddf9SRui Paulo 910f05cddf9SRui Paulo struct wps_ap_info *wps_ap; 911f05cddf9SRui Paulo size_t num_wps_ap; 912f05cddf9SRui Paulo int wps_ap_iter; 913e28a4053SRui Paulo 914e28a4053SRui Paulo int after_wps; 915f05cddf9SRui Paulo int known_wps_freq; 916e28a4053SRui Paulo unsigned int wps_freq; 917f05cddf9SRui Paulo int wps_fragment_size; 918f05cddf9SRui Paulo int auto_reconnect_disabled; 919f05cddf9SRui Paulo 920f05cddf9SRui Paulo /* Channel preferences for AP/P2P GO use */ 921f05cddf9SRui Paulo int best_24_freq; 922f05cddf9SRui Paulo int best_5_freq; 923f05cddf9SRui Paulo int best_overall_freq; 924f05cddf9SRui Paulo 925f05cddf9SRui Paulo struct gas_query *gas; 926f05cddf9SRui Paulo 927f05cddf9SRui Paulo #ifdef CONFIG_INTERWORKING 928f05cddf9SRui Paulo unsigned int fetch_anqp_in_progress:1; 929f05cddf9SRui Paulo unsigned int network_select:1; 930f05cddf9SRui Paulo unsigned int auto_select:1; 931f05cddf9SRui Paulo unsigned int auto_network_select:1; 9325b9c547cSRui Paulo unsigned int interworking_fast_assoc_tried:1; 933f05cddf9SRui Paulo unsigned int fetch_all_anqp:1; 9345b9c547cSRui Paulo unsigned int fetch_osu_info:1; 9355b9c547cSRui Paulo unsigned int fetch_osu_waiting_scan:1; 9365b9c547cSRui Paulo unsigned int fetch_osu_icon_in_progress:1; 9375b9c547cSRui Paulo struct wpa_bss *interworking_gas_bss; 9385b9c547cSRui Paulo unsigned int osu_icon_id; 939*780fb4a2SCy Schubert struct dl_list icon_head; /* struct icon_entry */ 9405b9c547cSRui Paulo struct osu_provider *osu_prov; 9415b9c547cSRui Paulo size_t osu_prov_count; 9425b9c547cSRui Paulo struct os_reltime osu_icon_fetch_start; 9435b9c547cSRui Paulo unsigned int num_osu_scans; 9445b9c547cSRui Paulo unsigned int num_prov_found; 945f05cddf9SRui Paulo #endif /* CONFIG_INTERWORKING */ 946f05cddf9SRui Paulo unsigned int drv_capa_known; 947f05cddf9SRui Paulo 948f05cddf9SRui Paulo struct { 949f05cddf9SRui Paulo struct hostapd_hw_modes *modes; 950f05cddf9SRui Paulo u16 num_modes; 951f05cddf9SRui Paulo u16 flags; 952f05cddf9SRui Paulo } hw; 9535b9c547cSRui Paulo enum local_hw_capab { 9545b9c547cSRui Paulo CAPAB_NO_HT_VHT, 9555b9c547cSRui Paulo CAPAB_HT, 9565b9c547cSRui Paulo CAPAB_HT40, 9575b9c547cSRui Paulo CAPAB_VHT, 9585b9c547cSRui Paulo } hw_capab; 9595b9c547cSRui Paulo #ifdef CONFIG_MACSEC 9605b9c547cSRui Paulo struct ieee802_1x_kay *kay; 9615b9c547cSRui Paulo #endif /* CONFIG_MACSEC */ 962f05cddf9SRui Paulo 963f05cddf9SRui Paulo int pno; 9645b9c547cSRui Paulo int pno_sched_pending; 965f05cddf9SRui Paulo 966f05cddf9SRui Paulo /* WLAN_REASON_* reason codes. Negative if locally generated. */ 967f05cddf9SRui Paulo int disconnect_reason; 968f05cddf9SRui Paulo 969*780fb4a2SCy Schubert /* WLAN_STATUS_* status codes from (Re)Association Response frame. */ 970*780fb4a2SCy Schubert u16 assoc_status_code; 971*780fb4a2SCy Schubert 972f05cddf9SRui Paulo struct ext_password_data *ext_pw; 973f05cddf9SRui Paulo 9745b9c547cSRui Paulo struct wpabuf *last_gas_resp, *prev_gas_resp; 9755b9c547cSRui Paulo u8 last_gas_addr[ETH_ALEN], prev_gas_addr[ETH_ALEN]; 9765b9c547cSRui Paulo u8 last_gas_dialog_token, prev_gas_dialog_token; 977f05cddf9SRui Paulo 978f05cddf9SRui Paulo unsigned int no_keep_alive:1; 9795b9c547cSRui Paulo unsigned int ext_mgmt_frame_handling:1; 9805b9c547cSRui Paulo unsigned int ext_eapol_frame_io:1; 9815b9c547cSRui Paulo unsigned int wmm_ac_supported:1; 9825b9c547cSRui Paulo unsigned int ext_work_in_progress:1; 9835b9c547cSRui Paulo unsigned int own_disconnect_req:1; 9845b9c547cSRui Paulo 9855b9c547cSRui Paulo #define MAC_ADDR_RAND_SCAN BIT(0) 9865b9c547cSRui Paulo #define MAC_ADDR_RAND_SCHED_SCAN BIT(1) 9875b9c547cSRui Paulo #define MAC_ADDR_RAND_PNO BIT(2) 9885b9c547cSRui Paulo #define MAC_ADDR_RAND_ALL (MAC_ADDR_RAND_SCAN | \ 9895b9c547cSRui Paulo MAC_ADDR_RAND_SCHED_SCAN | \ 9905b9c547cSRui Paulo MAC_ADDR_RAND_PNO) 9915b9c547cSRui Paulo unsigned int mac_addr_rand_supported; 9925b9c547cSRui Paulo unsigned int mac_addr_rand_enable; 9935b9c547cSRui Paulo 9945b9c547cSRui Paulo /* MAC Address followed by mask (2 * ETH_ALEN) */ 9955b9c547cSRui Paulo u8 *mac_addr_scan; 9965b9c547cSRui Paulo u8 *mac_addr_sched_scan; 9975b9c547cSRui Paulo u8 *mac_addr_pno; 9985b9c547cSRui Paulo 9995b9c547cSRui Paulo #ifdef CONFIG_WNM 10005b9c547cSRui Paulo u8 wnm_dialog_token; 10015b9c547cSRui Paulo u8 wnm_reply; 10025b9c547cSRui Paulo u8 wnm_num_neighbor_report; 10035b9c547cSRui Paulo u8 wnm_mode; 10045b9c547cSRui Paulo u16 wnm_dissoc_timer; 10055b9c547cSRui Paulo u8 wnm_bss_termination_duration[12]; 10065b9c547cSRui Paulo struct neighbor_report *wnm_neighbor_report_elements; 10075b9c547cSRui Paulo struct os_reltime wnm_cand_valid_until; 10085b9c547cSRui Paulo u8 wnm_cand_from_bss[ETH_ALEN]; 10095b9c547cSRui Paulo #endif /* CONFIG_WNM */ 10105b9c547cSRui Paulo 10115b9c547cSRui Paulo #ifdef CONFIG_TESTING_GET_GTK 10125b9c547cSRui Paulo u8 last_gtk[32]; 10135b9c547cSRui Paulo size_t last_gtk_len; 10145b9c547cSRui Paulo #endif /* CONFIG_TESTING_GET_GTK */ 10155b9c547cSRui Paulo 10165b9c547cSRui Paulo unsigned int num_multichan_concurrent; 10175b9c547cSRui Paulo struct wpa_radio_work *connect_work; 10185b9c547cSRui Paulo 10195b9c547cSRui Paulo unsigned int ext_work_id; 10205b9c547cSRui Paulo 10215b9c547cSRui Paulo struct wpabuf *vendor_elem[NUM_VENDOR_ELEM_FRAMES]; 10225b9c547cSRui Paulo 10235b9c547cSRui Paulo #ifdef CONFIG_TESTING_OPTIONS 10245b9c547cSRui Paulo struct l2_packet_data *l2_test; 10255b9c547cSRui Paulo unsigned int extra_roc_dur; 10265b9c547cSRui Paulo enum wpa_supplicant_test_failure test_failure; 1027*780fb4a2SCy Schubert unsigned int reject_btm_req_reason; 1028*780fb4a2SCy Schubert unsigned int p2p_go_csa_on_inv:1; 1029*780fb4a2SCy Schubert unsigned int ignore_auth_resp:1; 1030*780fb4a2SCy Schubert unsigned int ignore_assoc_disallow:1; 10315b9c547cSRui Paulo #endif /* CONFIG_TESTING_OPTIONS */ 10325b9c547cSRui Paulo 10335b9c547cSRui Paulo struct wmm_ac_assoc_data *wmm_ac_assoc_info; 10345b9c547cSRui Paulo struct wmm_tspec_element *tspecs[WMM_AC_NUM][TS_DIR_IDX_COUNT]; 10355b9c547cSRui Paulo struct wmm_ac_addts_request *addts_request; 10365b9c547cSRui Paulo u8 wmm_ac_last_dialog_token; 10375b9c547cSRui Paulo struct wmm_tspec_element *last_tspecs; 10385b9c547cSRui Paulo u8 last_tspecs_count; 10395b9c547cSRui Paulo 10405b9c547cSRui Paulo struct rrm_data rrm; 1041325151a3SRui Paulo 1042325151a3SRui Paulo #ifdef CONFIG_FST 1043325151a3SRui Paulo struct fst_iface *fst; 1044325151a3SRui Paulo const struct wpabuf *fst_ies; 1045325151a3SRui Paulo struct wpabuf *received_mb_ies; 1046325151a3SRui Paulo #endif /* CONFIG_FST */ 1047*780fb4a2SCy Schubert 1048*780fb4a2SCy Schubert #ifdef CONFIG_MBO 1049*780fb4a2SCy Schubert /* Multiband operation non-preferred channel */ 1050*780fb4a2SCy Schubert struct wpa_mbo_non_pref_channel { 1051*780fb4a2SCy Schubert enum mbo_non_pref_chan_reason reason; 1052*780fb4a2SCy Schubert u8 oper_class; 1053*780fb4a2SCy Schubert u8 chan; 1054*780fb4a2SCy Schubert u8 preference; 1055*780fb4a2SCy Schubert } *non_pref_chan; 1056*780fb4a2SCy Schubert size_t non_pref_chan_num; 1057*780fb4a2SCy Schubert u8 mbo_wnm_token; 1058*780fb4a2SCy Schubert #endif /* CONFIG_MBO */ 1059*780fb4a2SCy Schubert 1060*780fb4a2SCy Schubert /* 1061*780fb4a2SCy Schubert * This should be under CONFIG_MBO, but it is left out to allow using 1062*780fb4a2SCy Schubert * the bss_temp_disallowed list for other purposes as well. 1063*780fb4a2SCy Schubert */ 1064*780fb4a2SCy Schubert struct dl_list bss_tmp_disallowed; 1065*780fb4a2SCy Schubert 1066*780fb4a2SCy Schubert /* 1067*780fb4a2SCy Schubert * Content of a measurement report element with type 8 (LCI), 1068*780fb4a2SCy Schubert * own location. 1069*780fb4a2SCy Schubert */ 1070*780fb4a2SCy Schubert struct wpabuf *lci; 1071*780fb4a2SCy Schubert struct os_reltime lci_time; 107239beb93cSSam Leffler }; 107339beb93cSSam Leffler 107439beb93cSSam Leffler 107539beb93cSSam Leffler /* wpa_supplicant.c */ 1076f05cddf9SRui Paulo void wpa_supplicant_apply_ht_overrides( 1077f05cddf9SRui Paulo struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, 1078f05cddf9SRui Paulo struct wpa_driver_associate_params *params); 10795b9c547cSRui Paulo void wpa_supplicant_apply_vht_overrides( 10805b9c547cSRui Paulo struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, 10815b9c547cSRui Paulo struct wpa_driver_associate_params *params); 1082f05cddf9SRui Paulo 1083e28a4053SRui Paulo int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid); 10845b9c547cSRui Paulo int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s, 10855b9c547cSRui Paulo struct wpa_ssid *ssid); 1086e28a4053SRui Paulo 108739beb93cSSam Leffler int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s); 108839beb93cSSam Leffler 1089e28a4053SRui Paulo const char * wpa_supplicant_state_txt(enum wpa_states state); 1090f05cddf9SRui Paulo int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s); 109139beb93cSSam Leffler int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s); 109239beb93cSSam Leffler int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s, 1093e28a4053SRui Paulo struct wpa_bss *bss, struct wpa_ssid *ssid, 109439beb93cSSam Leffler u8 *wpa_ie, size_t *wpa_ie_len); 109539beb93cSSam Leffler void wpa_supplicant_associate(struct wpa_supplicant *wpa_s, 1096e28a4053SRui Paulo struct wpa_bss *bss, 109739beb93cSSam Leffler struct wpa_ssid *ssid); 109839beb93cSSam Leffler void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s, 109939beb93cSSam Leffler struct wpa_ssid *ssid); 110039beb93cSSam Leffler void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s); 110139beb93cSSam Leffler void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr); 110239beb93cSSam Leffler void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s, 110339beb93cSSam Leffler int sec, int usec); 1104f05cddf9SRui Paulo void wpa_supplicant_reinit_autoscan(struct wpa_supplicant *wpa_s); 1105e28a4053SRui Paulo void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, 1106e28a4053SRui Paulo enum wpa_states state); 110739beb93cSSam Leffler struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s); 1108f05cddf9SRui Paulo const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s); 110939beb93cSSam Leffler void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s); 111039beb93cSSam Leffler void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s, 111139beb93cSSam Leffler int reason_code); 111239beb93cSSam Leffler 1113*780fb4a2SCy Schubert struct wpa_ssid * wpa_supplicant_add_network(struct wpa_supplicant *wpa_s); 1114*780fb4a2SCy Schubert int wpa_supplicant_remove_network(struct wpa_supplicant *wpa_s, int id); 1115e28a4053SRui Paulo void wpa_supplicant_enable_network(struct wpa_supplicant *wpa_s, 1116e28a4053SRui Paulo struct wpa_ssid *ssid); 1117e28a4053SRui Paulo void wpa_supplicant_disable_network(struct wpa_supplicant *wpa_s, 1118e28a4053SRui Paulo struct wpa_ssid *ssid); 1119e28a4053SRui Paulo void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s, 1120e28a4053SRui Paulo struct wpa_ssid *ssid); 11215b9c547cSRui Paulo int wpas_set_pkcs11_engine_and_module_path(struct wpa_supplicant *wpa_s, 11225b9c547cSRui Paulo const char *pkcs11_engine_path, 11235b9c547cSRui Paulo const char *pkcs11_module_path); 1124e28a4053SRui Paulo int wpa_supplicant_set_ap_scan(struct wpa_supplicant *wpa_s, 1125e28a4053SRui Paulo int ap_scan); 1126f05cddf9SRui Paulo int wpa_supplicant_set_bss_expiration_age(struct wpa_supplicant *wpa_s, 1127f05cddf9SRui Paulo unsigned int expire_age); 1128f05cddf9SRui Paulo int wpa_supplicant_set_bss_expiration_count(struct wpa_supplicant *wpa_s, 1129f05cddf9SRui Paulo unsigned int expire_count); 1130f05cddf9SRui Paulo int wpa_supplicant_set_scan_interval(struct wpa_supplicant *wpa_s, 1131f05cddf9SRui Paulo int scan_interval); 1132e28a4053SRui Paulo int wpa_supplicant_set_debug_params(struct wpa_global *global, 1133e28a4053SRui Paulo int debug_level, int debug_timestamp, 1134e28a4053SRui Paulo int debug_show_keys); 1135f05cddf9SRui Paulo void free_hw_features(struct wpa_supplicant *wpa_s); 1136e28a4053SRui Paulo 113739beb93cSSam Leffler void wpa_show_license(void); 113839beb93cSSam Leffler 1139*780fb4a2SCy Schubert struct wpa_interface * wpa_supplicant_match_iface(struct wpa_global *global, 1140*780fb4a2SCy Schubert const char *ifname); 114139beb93cSSam Leffler struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global, 11425b9c547cSRui Paulo struct wpa_interface *iface, 11435b9c547cSRui Paulo struct wpa_supplicant *parent); 114439beb93cSSam Leffler int wpa_supplicant_remove_iface(struct wpa_global *global, 1145f05cddf9SRui Paulo struct wpa_supplicant *wpa_s, 1146f05cddf9SRui Paulo int terminate); 114739beb93cSSam Leffler struct wpa_supplicant * wpa_supplicant_get_iface(struct wpa_global *global, 114839beb93cSSam Leffler const char *ifname); 114939beb93cSSam Leffler struct wpa_global * wpa_supplicant_init(struct wpa_params *params); 115039beb93cSSam Leffler int wpa_supplicant_run(struct wpa_global *global); 115139beb93cSSam Leffler void wpa_supplicant_deinit(struct wpa_global *global); 115239beb93cSSam Leffler 115339beb93cSSam Leffler int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s, 115439beb93cSSam Leffler struct wpa_ssid *ssid); 1155e28a4053SRui Paulo void wpa_supplicant_terminate_proc(struct wpa_global *global); 1156e28a4053SRui Paulo void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr, 1157e28a4053SRui Paulo const u8 *buf, size_t len); 1158f05cddf9SRui Paulo void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s); 1159f05cddf9SRui Paulo void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s); 1160f05cddf9SRui Paulo void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid); 1161f05cddf9SRui Paulo int wpas_driver_bss_selection(struct wpa_supplicant *wpa_s); 1162f05cddf9SRui Paulo int wpas_is_p2p_prioritized(struct wpa_supplicant *wpa_s); 11635b9c547cSRui Paulo void wpas_auth_failed(struct wpa_supplicant *wpa_s, char *reason); 1164f05cddf9SRui Paulo void wpas_clear_temp_disabled(struct wpa_supplicant *wpa_s, 1165f05cddf9SRui Paulo struct wpa_ssid *ssid, int clear_failures); 1166f05cddf9SRui Paulo int disallowed_bssid(struct wpa_supplicant *wpa_s, const u8 *bssid); 1167f05cddf9SRui Paulo int disallowed_ssid(struct wpa_supplicant *wpa_s, const u8 *ssid, 1168f05cddf9SRui Paulo size_t ssid_len); 1169f05cddf9SRui Paulo void wpas_request_connection(struct wpa_supplicant *wpa_s); 1170*780fb4a2SCy Schubert void wpas_request_disconnection(struct wpa_supplicant *wpa_s); 11715b9c547cSRui Paulo int wpas_build_ext_capab(struct wpa_supplicant *wpa_s, u8 *buf, size_t buflen); 11725b9c547cSRui Paulo int wpas_update_random_addr(struct wpa_supplicant *wpa_s, int style); 11735b9c547cSRui Paulo int wpas_update_random_addr_disassoc(struct wpa_supplicant *wpa_s); 11745b9c547cSRui Paulo void add_freq(int *freqs, int *num_freqs, int freq); 11755b9c547cSRui Paulo 11765b9c547cSRui Paulo void wpas_rrm_reset(struct wpa_supplicant *wpa_s); 11775b9c547cSRui Paulo void wpas_rrm_process_neighbor_rep(struct wpa_supplicant *wpa_s, 11785b9c547cSRui Paulo const u8 *report, size_t report_len); 11795b9c547cSRui Paulo int wpas_rrm_send_neighbor_rep_request(struct wpa_supplicant *wpa_s, 1180*780fb4a2SCy Schubert const struct wpa_ssid_value *ssid, 1181*780fb4a2SCy Schubert int lci, int civic, 11825b9c547cSRui Paulo void (*cb)(void *ctx, 11835b9c547cSRui Paulo struct wpabuf *neighbor_rep), 11845b9c547cSRui Paulo void *cb_ctx); 1185*780fb4a2SCy Schubert void wpas_rrm_handle_radio_measurement_request(struct wpa_supplicant *wpa_s, 1186*780fb4a2SCy Schubert const u8 *src, 1187*780fb4a2SCy Schubert const u8 *frame, size_t len); 11885b9c547cSRui Paulo void wpas_rrm_handle_link_measurement_request(struct wpa_supplicant *wpa_s, 11895b9c547cSRui Paulo const u8 *src, 11905b9c547cSRui Paulo const u8 *frame, size_t len, 11915b9c547cSRui Paulo int rssi); 1192f05cddf9SRui Paulo 1193*780fb4a2SCy Schubert 1194*780fb4a2SCy Schubert /* MBO functions */ 1195*780fb4a2SCy Schubert int wpas_mbo_ie(struct wpa_supplicant *wpa_s, u8 *buf, size_t len); 1196*780fb4a2SCy Schubert const u8 * wpas_mbo_get_bss_attr(struct wpa_bss *bss, enum mbo_attr_id attr); 1197*780fb4a2SCy Schubert int wpas_mbo_update_non_pref_chan(struct wpa_supplicant *wpa_s, 1198*780fb4a2SCy Schubert const char *non_pref_chan); 1199*780fb4a2SCy Schubert void wpas_mbo_scan_ie(struct wpa_supplicant *wpa_s, struct wpabuf *ie); 1200*780fb4a2SCy Schubert int wpas_mbo_supp_op_class_ie(struct wpa_supplicant *wpa_s, int freq, u8 *pos, 1201*780fb4a2SCy Schubert size_t len); 1202*780fb4a2SCy Schubert void wpas_mbo_ie_trans_req(struct wpa_supplicant *wpa_s, const u8 *ie, 1203*780fb4a2SCy Schubert size_t len); 1204*780fb4a2SCy Schubert size_t wpas_mbo_ie_bss_trans_reject(struct wpa_supplicant *wpa_s, u8 *pos, 1205*780fb4a2SCy Schubert size_t len, 1206*780fb4a2SCy Schubert enum mbo_transition_reject_reason reason); 1207*780fb4a2SCy Schubert void wpas_mbo_update_cell_capa(struct wpa_supplicant *wpa_s, u8 mbo_cell_capa); 1208*780fb4a2SCy Schubert struct wpabuf * mbo_build_anqp_buf(struct wpa_supplicant *wpa_s, 1209*780fb4a2SCy Schubert struct wpa_bss *bss); 1210*780fb4a2SCy Schubert 1211f05cddf9SRui Paulo /** 1212f05cddf9SRui Paulo * wpa_supplicant_ctrl_iface_ctrl_rsp_handle - Handle a control response 1213f05cddf9SRui Paulo * @wpa_s: Pointer to wpa_supplicant data 1214f05cddf9SRui Paulo * @ssid: Pointer to the network block the reply is for 1215f05cddf9SRui Paulo * @field: field the response is a reply for 1216f05cddf9SRui Paulo * @value: value (ie, password, etc) for @field 1217f05cddf9SRui Paulo * Returns: 0 on success, non-zero on error 1218f05cddf9SRui Paulo * 1219f05cddf9SRui Paulo * Helper function to handle replies to control interface requests. 1220f05cddf9SRui Paulo */ 1221f05cddf9SRui Paulo int wpa_supplicant_ctrl_iface_ctrl_rsp_handle(struct wpa_supplicant *wpa_s, 1222f05cddf9SRui Paulo struct wpa_ssid *ssid, 1223f05cddf9SRui Paulo const char *field, 1224f05cddf9SRui Paulo const char *value); 122539beb93cSSam Leffler 12265b9c547cSRui Paulo void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, 12275b9c547cSRui Paulo const struct wpa_ssid *ssid, 12285b9c547cSRui Paulo struct hostapd_freq_params *freq); 12295b9c547cSRui Paulo 123039beb93cSSam Leffler /* events.c */ 123139beb93cSSam Leffler void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s); 1232f05cddf9SRui Paulo int wpa_supplicant_connect(struct wpa_supplicant *wpa_s, 1233e28a4053SRui Paulo struct wpa_bss *selected, 1234e28a4053SRui Paulo struct wpa_ssid *ssid); 1235f05cddf9SRui Paulo void wpa_supplicant_stop_countermeasures(void *eloop_ctx, void *sock_ctx); 1236f05cddf9SRui Paulo void wpa_supplicant_delayed_mic_error_report(void *eloop_ctx, void *sock_ctx); 1237f05cddf9SRui Paulo void wnm_bss_keep_alive_deinit(struct wpa_supplicant *wpa_s); 12385b9c547cSRui Paulo int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s); 12395b9c547cSRui Paulo struct wpa_bss * wpa_supplicant_pick_network(struct wpa_supplicant *wpa_s, 12405b9c547cSRui Paulo struct wpa_ssid **selected_ssid); 124139beb93cSSam Leffler 1242e28a4053SRui Paulo /* eap_register.c */ 1243e28a4053SRui Paulo int eap_register_methods(void); 124439beb93cSSam Leffler 1245f05cddf9SRui Paulo /** 1246325151a3SRui Paulo * Utility method to tell if a given network is for persistent group storage 1247f05cddf9SRui Paulo * @ssid: Network object 1248f05cddf9SRui Paulo * Returns: 1 if network is a persistent group, 0 otherwise 1249f05cddf9SRui Paulo */ 1250f05cddf9SRui Paulo static inline int network_is_persistent_group(struct wpa_ssid *ssid) 1251f05cddf9SRui Paulo { 1252325151a3SRui Paulo return ssid->disabled == 2 && ssid->p2p_persistent_group; 1253f05cddf9SRui Paulo } 1254f05cddf9SRui Paulo 1255f05cddf9SRui Paulo int wpas_network_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid); 12565b9c547cSRui Paulo int wpas_get_ssid_pmf(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid); 1257f05cddf9SRui Paulo 1258f05cddf9SRui Paulo int wpas_init_ext_pw(struct wpa_supplicant *wpa_s); 1259f05cddf9SRui Paulo 12605b9c547cSRui Paulo void dump_freq_data(struct wpa_supplicant *wpa_s, const char *title, 12615b9c547cSRui Paulo struct wpa_used_freq_data *freqs_data, 12625b9c547cSRui Paulo unsigned int len); 12635b9c547cSRui Paulo 12645b9c547cSRui Paulo int get_shared_radio_freqs_data(struct wpa_supplicant *wpa_s, 12655b9c547cSRui Paulo struct wpa_used_freq_data *freqs_data, 12665b9c547cSRui Paulo unsigned int len); 12675b9c547cSRui Paulo int get_shared_radio_freqs(struct wpa_supplicant *wpa_s, 12685b9c547cSRui Paulo int *freq_array, unsigned int len); 12695b9c547cSRui Paulo 1270325151a3SRui Paulo void wpas_network_reenabled(void *eloop_ctx, void *timeout_ctx); 1271325151a3SRui Paulo 1272*780fb4a2SCy Schubert void wpas_vendor_elem_update(struct wpa_supplicant *wpa_s); 1273*780fb4a2SCy Schubert struct wpa_supplicant * wpas_vendor_elem(struct wpa_supplicant *wpa_s, 1274*780fb4a2SCy Schubert enum wpa_vendor_elem_frame frame); 1275*780fb4a2SCy Schubert int wpas_vendor_elem_remove(struct wpa_supplicant *wpa_s, int frame, 1276*780fb4a2SCy Schubert const u8 *elem, size_t len); 1277*780fb4a2SCy Schubert 1278325151a3SRui Paulo #ifdef CONFIG_FST 1279325151a3SRui Paulo 1280325151a3SRui Paulo struct fst_wpa_obj; 1281325151a3SRui Paulo 1282325151a3SRui Paulo void fst_wpa_supplicant_fill_iface_obj(struct wpa_supplicant *wpa_s, 1283325151a3SRui Paulo struct fst_wpa_obj *iface_obj); 1284325151a3SRui Paulo 1285325151a3SRui Paulo #endif /* CONFIG_FST */ 1286325151a3SRui Paulo 1287*780fb4a2SCy Schubert int wpas_sched_scan_plans_set(struct wpa_supplicant *wpa_s, const char *cmd); 1288*780fb4a2SCy Schubert 1289*780fb4a2SCy Schubert struct hostapd_hw_modes * get_mode(struct hostapd_hw_modes *modes, 1290*780fb4a2SCy Schubert u16 num_modes, enum hostapd_hw_mode mode); 1291*780fb4a2SCy Schubert 1292*780fb4a2SCy Schubert void wpa_bss_tmp_disallow(struct wpa_supplicant *wpa_s, const u8 *bssid, 1293*780fb4a2SCy Schubert unsigned int sec); 1294*780fb4a2SCy Schubert int wpa_is_bss_tmp_disallowed(struct wpa_supplicant *wpa_s, const u8 *bssid); 1295*780fb4a2SCy Schubert 1296*780fb4a2SCy Schubert struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s, 1297*780fb4a2SCy Schubert int i, struct wpa_bss *bss, 1298*780fb4a2SCy Schubert struct wpa_ssid *group, 1299*780fb4a2SCy Schubert int only_first_ssid); 1300*780fb4a2SCy Schubert 130139beb93cSSam Leffler #endif /* WPA_SUPPLICANT_I_H */ 1302