• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * wpa_supplicant - Internal definitions
3  * Copyright (c) 2003-2014, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef WPA_SUPPLICANT_I_H
10 #define WPA_SUPPLICANT_I_H
11 
12 #include "utils/bitfield.h"
13 #include "utils/list.h"
14 #include "common/defs.h"
15 #include "common/sae.h"
16 #include "common/wpa_ctrl.h"
17 #include "common/dpp.h"
18 #include "crypto/sha384.h"
19 #include "eapol_supp/eapol_supp_sm.h"
20 #include "wps/wps_defs.h"
21 #include "config_ssid.h"
22 #include "wmm_ac.h"
23 #include <netinet/in.h>
24 #include <netinet/in6.h>
25 
26 extern const char *const wpa_supplicant_version;
27 extern const char *const wpa_supplicant_license;
28 #ifndef CONFIG_NO_STDOUT_DEBUG
29 extern const char *const wpa_supplicant_full_license1;
30 extern const char *const wpa_supplicant_full_license2;
31 extern const char *const wpa_supplicant_full_license3;
32 extern const char *const wpa_supplicant_full_license4;
33 extern const char *const wpa_supplicant_full_license5;
34 #endif /* CONFIG_NO_STDOUT_DEBUG */
35 
36 struct wpa_sm;
37 struct wpa_supplicant;
38 struct ibss_rsn;
39 struct scan_info;
40 struct wpa_bss;
41 struct wpa_scan_results;
42 struct hostapd_hw_modes;
43 struct wpa_driver_associate_params;
44 struct wpa_cred;
45 
46 /*
47  * Forward declarations of private structures used within the ctrl_iface
48  * backends. Other parts of wpa_supplicant do not have access to data stored in
49  * these structures.
50  */
51 struct ctrl_iface_priv;
52 struct ctrl_iface_global_priv;
53 struct wpas_dbus_priv;
54 struct wpas_aidl_priv;
55 
56 /**
57  * struct wpa_interface - Parameters for wpa_supplicant_add_iface()
58  */
59 struct wpa_interface {
60 	/**
61 	 * confname - Configuration name (file or profile) name
62 	 *
63 	 * This can also be %NULL when a configuration file is not used. In
64 	 * that case, ctrl_interface must be set to allow the interface to be
65 	 * configured.
66 	 */
67 	const char *confname;
68 
69 	/**
70 	 * confanother - Additional configuration name (file or profile) name
71 	 *
72 	 * This can also be %NULL when the additional configuration file is not
73 	 * used.
74 	 */
75 	const char *confanother;
76 
77 	/**
78 	 * ctrl_interface - Control interface parameter
79 	 *
80 	 * If a configuration file is not used, this variable can be used to
81 	 * set the ctrl_interface parameter that would have otherwise been read
82 	 * from the configuration file. If both confname and ctrl_interface are
83 	 * set, ctrl_interface is used to override the value from configuration
84 	 * file.
85 	 */
86 	const char *ctrl_interface;
87 
88 	/**
89 	 * driver - Driver interface name, or %NULL to use the default driver
90 	 */
91 	const char *driver;
92 
93 	/**
94 	 * driver_param - Driver interface parameters
95 	 *
96 	 * If a configuration file is not used, this variable can be used to
97 	 * set the driver_param parameters that would have otherwise been read
98 	 * from the configuration file. If both confname and driver_param are
99 	 * set, driver_param is used to override the value from configuration
100 	 * file.
101 	 */
102 	const char *driver_param;
103 
104 	/**
105 	 * ifname - Interface name
106 	 */
107 	const char *ifname;
108 
109 	/**
110 	 * bridge_ifname - Optional bridge interface name
111 	 *
112 	 * If the driver interface (ifname) is included in a Linux bridge
113 	 * device, the bridge interface may need to be used for receiving EAPOL
114 	 * frames. This can be enabled by setting this variable to enable
115 	 * receiving of EAPOL frames from an additional interface.
116 	 */
117 	const char *bridge_ifname;
118 
119 	/**
120 	 * p2p_mgmt - Interface used for P2P management (P2P Device operations)
121 	 *
122 	 * Indicates whether wpas_p2p_init() must be called for this interface.
123 	 * This is used only when the driver supports a dedicated P2P Device
124 	 * interface that is not a network interface.
125 	 */
126 	int p2p_mgmt;
127 
128 #ifdef CONFIG_MATCH_IFACE
129 	/**
130 	 * matched - Interface was matched rather than specified
131 	 *
132 	 */
133 	enum {
134 		WPA_IFACE_NOT_MATCHED,
135 		WPA_IFACE_MATCHED_NULL,
136 		WPA_IFACE_MATCHED
137 	} matched;
138 #endif /* CONFIG_MATCH_IFACE */
139 };
140 
141 /**
142  * struct wpa_params - Parameters for wpa_supplicant_init()
143  */
144 struct wpa_params {
145 	/**
146 	 * daemonize - Run %wpa_supplicant in the background
147 	 */
148 	int daemonize;
149 
150 	/**
151 	 * wait_for_monitor - Wait for a monitor program before starting
152 	 */
153 	int wait_for_monitor;
154 
155 	/**
156 	 * pid_file - Path to a PID (process ID) file
157 	 *
158 	 * If this and daemonize are set, process ID of the background process
159 	 * will be written to the specified file.
160 	 */
161 	char *pid_file;
162 
163 	/**
164 	 * wpa_debug_level - Debugging verbosity level (e.g., MSG_INFO)
165 	 */
166 	int wpa_debug_level;
167 
168 	/**
169 	 * wpa_debug_show_keys - Whether keying material is included in debug
170 	 *
171 	 * This parameter can be used to allow keying material to be included
172 	 * in debug messages. This is a security risk and this option should
173 	 * not be enabled in normal configuration. If needed during
174 	 * development or while troubleshooting, this option can provide more
175 	 * details for figuring out what is happening.
176 	 */
177 	int wpa_debug_show_keys;
178 
179 	/**
180 	 * wpa_debug_timestamp - Whether to include timestamp in debug messages
181 	 */
182 	int wpa_debug_timestamp;
183 
184 	/**
185 	 * ctrl_interface - Global ctrl_iface path/parameter
186 	 */
187 	char *ctrl_interface;
188 
189 	/**
190 	 * ctrl_interface_group - Global ctrl_iface group
191 	 */
192 	char *ctrl_interface_group;
193 
194 	/**
195 	 * dbus_ctrl_interface - Enable the DBus control interface
196 	 */
197 	int dbus_ctrl_interface;
198 
199 	/**
200 	 * wpa_debug_file_path - Path of debug file or %NULL to use stdout
201 	 */
202 	const char *wpa_debug_file_path;
203 
204 	/**
205 	 * wpa_debug_syslog - Enable log output through syslog
206 	 */
207 	int wpa_debug_syslog;
208 
209 	/**
210 	 * wpa_debug_tracing - Enable log output through Linux tracing
211 	 */
212 	int wpa_debug_tracing;
213 
214 	/**
215 	 * override_driver - Optional driver parameter override
216 	 *
217 	 * This parameter can be used to override the driver parameter in
218 	 * dynamic interface addition to force a specific driver wrapper to be
219 	 * used instead.
220 	 */
221 	char *override_driver;
222 
223 	/**
224 	 * override_ctrl_interface - Optional ctrl_interface override
225 	 *
226 	 * This parameter can be used to override the ctrl_interface parameter
227 	 * in dynamic interface addition to force a control interface to be
228 	 * created.
229 	 */
230 	char *override_ctrl_interface;
231 
232 	/**
233 	 * entropy_file - Optional entropy file
234 	 *
235 	 * This parameter can be used to configure wpa_supplicant to maintain
236 	 * its internal entropy store over restarts.
237 	 */
238 	char *entropy_file;
239 
240 #ifdef CONFIG_P2P
241 	/**
242 	 * conf_p2p_dev - Configuration file used to hold the
243 	 * P2P Device configuration parameters.
244 	 *
245 	 * This can also be %NULL. In such a case, if a P2P Device dedicated
246 	 * interfaces is created, the main configuration file will be used.
247 	 */
248 	char *conf_p2p_dev;
249 #endif /* CONFIG_P2P */
250 
251 #ifdef CONFIG_MATCH_IFACE
252 	/**
253 	 * match_ifaces - Interface descriptions to match
254 	 */
255 	struct wpa_interface *match_ifaces;
256 
257 	/**
258 	 * match_iface_count - Number of defined matching interfaces
259 	 */
260 	int match_iface_count;
261 #endif /* CONFIG_MATCH_IFACE */
262 };
263 
264 struct p2p_srv_bonjour {
265 	struct dl_list list;
266 	struct wpabuf *query;
267 	struct wpabuf *resp;
268 };
269 
270 struct p2p_srv_upnp {
271 	struct dl_list list;
272 	u8 version;
273 	char *service;
274 };
275 
276 /**
277  * struct wpa_global - Internal, global data for all %wpa_supplicant interfaces
278  *
279  * This structure is initialized by calling wpa_supplicant_init() when starting
280  * %wpa_supplicant.
281  */
282 struct wpa_global {
283 	struct wpa_supplicant *ifaces;
284 	struct wpa_params params;
285 	struct ctrl_iface_global_priv *ctrl_iface;
286 	struct wpas_dbus_priv *dbus;
287 	struct wpas_aidl_priv *aidl;
288 	void **drv_priv;
289 	size_t drv_count;
290 	struct os_time suspend_time;
291 	struct p2p_data *p2p;
292 	struct wpa_supplicant *p2p_init_wpa_s;
293 	struct wpa_supplicant *p2p_group_formation;
294 	struct wpa_supplicant *p2p_invite_group;
295 	u8 p2p_dev_addr[ETH_ALEN];
296 	struct os_reltime p2p_go_wait_client;
297 	struct dl_list p2p_srv_bonjour; /* struct p2p_srv_bonjour */
298 	struct dl_list p2p_srv_upnp; /* struct p2p_srv_upnp */
299 	int p2p_disabled;
300 	int cross_connection;
301 	int p2p_long_listen; /* remaining time in long Listen state in ms */
302 	struct wpa_freq_range_list p2p_disallow_freq;
303 	struct wpa_freq_range_list p2p_go_avoid_freq;
304 	enum wpa_conc_pref {
305 		WPA_CONC_PREF_NOT_SET,
306 		WPA_CONC_PREF_STA,
307 		WPA_CONC_PREF_P2P
308 	} conc_pref;
309 	unsigned int p2p_per_sta_psk:1;
310 	unsigned int p2p_fail_on_wps_complete:1;
311 	unsigned int p2p_24ghz_social_channels:1;
312 	unsigned int pending_p2ps_group:1;
313 	unsigned int pending_group_iface_for_p2ps:1;
314 	unsigned int p2p_go_found_external_scan:1;
315 	unsigned int pending_p2ps_group_freq;
316 
317 #ifdef CONFIG_WIFI_DISPLAY
318 	int wifi_display;
319 #define MAX_WFD_SUBELEMS 12
320 	struct wpabuf *wfd_subelem[MAX_WFD_SUBELEMS];
321 #endif /* CONFIG_WIFI_DISPLAY */
322 
323 	struct psk_list_entry *add_psk; /* From group formation */
324 };
325 
326 
327 /**
328  * struct wpa_radio - Internal data for per-radio information
329  *
330  * This structure is used to share data about configured interfaces
331  * (struct wpa_supplicant) that share the same physical radio, e.g., to allow
332  * better coordination of offchannel operations.
333  */
334 struct wpa_radio {
335 	char name[16]; /* from driver_ops get_radio_name() or empty if not
336 			* available */
337 	/** NULL if no external scan running. */
338 	struct wpa_supplicant *external_scan_req_interface;
339 	unsigned int num_active_works;
340 	struct dl_list ifaces; /* struct wpa_supplicant::radio_list entries */
341 	struct dl_list work; /* struct wpa_radio_work::list entries */
342 };
343 
344 /**
345  * Checks whether an external scan is running on a given radio.
346  * @radio: Pointer to radio struct
347  * Returns: true if an external scan is running, false otherwise.
348  */
external_scan_running(struct wpa_radio * radio)349 static inline bool external_scan_running(struct wpa_radio *radio)
350 {
351 	return radio && radio->external_scan_req_interface;
352 }
353 
354 #define MAX_ACTIVE_WORKS 2
355 
356 
357 /**
358  * struct wpa_radio_work - Radio work item
359  */
360 struct wpa_radio_work {
361 	struct dl_list list;
362 	unsigned int freq; /* known frequency (MHz) or 0 for multiple/unknown */
363 	const char *type;
364 	struct wpa_supplicant *wpa_s;
365 	void (*cb)(struct wpa_radio_work *work, int deinit);
366 	void *ctx;
367 	unsigned int started:1;
368 	struct os_reltime time;
369 	unsigned int bands;
370 };
371 
372 int radio_add_work(struct wpa_supplicant *wpa_s, unsigned int freq,
373 		   const char *type, int next,
374 		   void (*cb)(struct wpa_radio_work *work, int deinit),
375 		   void *ctx);
376 void radio_work_done(struct wpa_radio_work *work);
377 void radio_remove_works(struct wpa_supplicant *wpa_s,
378 			const char *type, int remove_all);
379 void radio_remove_pending_work(struct wpa_supplicant *wpa_s, void *ctx);
380 void radio_work_check_next(struct wpa_supplicant *wpa_s);
381 struct wpa_radio_work *
382 radio_work_pending(struct wpa_supplicant *wpa_s, const char *type);
383 
384 struct wpa_connect_work {
385 	unsigned int sme:1;
386 	unsigned int bss_removed:1;
387 	struct wpa_bss *bss;
388 	struct wpa_ssid *ssid;
389 };
390 
391 int wpas_valid_bss_ssid(struct wpa_supplicant *wpa_s, struct wpa_bss *test_bss,
392 			struct wpa_ssid *test_ssid);
393 void wpas_connect_work_free(struct wpa_connect_work *cwork);
394 void wpas_connect_work_done(struct wpa_supplicant *wpa_s);
395 
396 struct wpa_external_work {
397 	unsigned int id;
398 	char type[100];
399 	unsigned int timeout;
400 };
401 
402 enum wpa_radio_work_band wpas_freq_to_band(int freq);
403 unsigned int wpas_get_bands(struct wpa_supplicant *wpa_s, const int *freqs);
404 
405 /**
406  * offchannel_send_action_result - Result of offchannel send Action frame
407  */
408 enum offchannel_send_action_result {
409 	OFFCHANNEL_SEND_ACTION_SUCCESS /**< Frame was send and acknowledged */,
410 	OFFCHANNEL_SEND_ACTION_NO_ACK /**< Frame was sent, but not acknowledged
411 				       */,
412 	OFFCHANNEL_SEND_ACTION_FAILED /**< Frame was not sent due to a failure
413 				       */
414 };
415 
416 struct wps_ap_info {
417 	u8 bssid[ETH_ALEN];
418 	enum wps_ap_info_type {
419 		WPS_AP_NOT_SEL_REG,
420 		WPS_AP_SEL_REG,
421 		WPS_AP_SEL_REG_OUR
422 	} type;
423 	unsigned int tries;
424 	struct os_reltime last_attempt;
425 	unsigned int pbc_active;
426 	u8 uuid[WPS_UUID_LEN];
427 };
428 
429 #define WPA_FREQ_USED_BY_INFRA_STATION BIT(0)
430 #define WPA_FREQ_USED_BY_P2P_CLIENT BIT(1)
431 
432 struct wpa_used_freq_data {
433 	int freq;
434 	unsigned int flags;
435 };
436 
437 #define RRM_NEIGHBOR_REPORT_TIMEOUT 1 /* 1 second for AP to send a report */
438 
439 /*
440  * struct rrm_data - Data used for managing RRM features
441  */
442 struct rrm_data {
443 	/* rrm_used - indication regarding the current connection */
444 	unsigned int rrm_used:1;
445 
446 	/*
447 	 * notify_neighbor_rep - Callback for notifying report requester
448 	 */
449 	void (*notify_neighbor_rep)(void *ctx, struct wpabuf *neighbor_rep);
450 
451 	/*
452 	 * neighbor_rep_cb_ctx - Callback context
453 	 * Received in the callback registration, and sent to the callback
454 	 * function as a parameter.
455 	 */
456 	void *neighbor_rep_cb_ctx;
457 
458 	/* next_neighbor_rep_token - Next request's dialog token */
459 	u8 next_neighbor_rep_token;
460 
461 	/* token - Dialog token of the current radio measurement */
462 	u8 token;
463 
464 	/* destination address of the current radio measurement request */
465 	u8 dst_addr[ETH_ALEN];
466 };
467 
468 enum wpa_supplicant_test_failure {
469 	WPAS_TEST_FAILURE_NONE,
470 	WPAS_TEST_FAILURE_SCAN_TRIGGER,
471 };
472 
473 struct icon_entry {
474 	struct dl_list list;
475 	u8 bssid[ETH_ALEN];
476 	u8 dialog_token;
477 	char *file_name;
478 	u8 *image;
479 	size_t image_len;
480 };
481 
482 struct wpa_bss_tmp_disallowed {
483 	struct dl_list list;
484 	u8 bssid[ETH_ALEN];
485 	int rssi_threshold;
486 };
487 
488 struct beacon_rep_data {
489 	u8 token;
490 	u8 last_indication;
491 	struct wpa_driver_scan_params scan_params;
492 	u8 ssid[SSID_MAX_LEN];
493 	size_t ssid_len;
494 	u8 bssid[ETH_ALEN];
495 	enum beacon_report_detail report_detail;
496 	struct bitfield *eids;
497 };
498 
499 
500 struct external_pmksa_cache {
501 	struct dl_list list;
502 	void *pmksa_cache;
503 };
504 
505 struct fils_hlp_req {
506 	struct dl_list list;
507 	u8 dst[ETH_ALEN];
508 	struct wpabuf *pkt;
509 };
510 
511 struct driver_signal_override {
512 	struct dl_list list;
513 	u8 bssid[ETH_ALEN];
514 	int si_current_signal;
515 	int si_avg_signal;
516 	int si_avg_beacon_signal;
517 	int si_current_noise;
518 	int scan_level;
519 };
520 
521 struct robust_av_data {
522 	u8 dialog_token;
523 	enum scs_request_type request_type;
524 	u8 up_bitmap;
525 	u8 up_limit;
526 	u32 stream_timeout;
527 	u8 frame_classifier[48];
528 	size_t frame_classifier_len;
529 	bool valid_config;
530 };
531 
532 struct dscp_policy_status {
533 	u8 id;
534 	u8 status;
535 };
536 
537 struct dscp_resp_data {
538 	bool more;
539 	bool reset;
540 	bool solicited;
541 	struct dscp_policy_status *policy;
542 	int num_policies;
543 };
544 
545 #ifdef CONFIG_PASN
546 
547 struct pasn_fils {
548 	u8 nonce[FILS_NONCE_LEN];
549 	u8 anonce[FILS_NONCE_LEN];
550 	u8 session[FILS_SESSION_LEN];
551 	u8 erp_pmkid[PMKID_LEN];
552 	bool completed;
553 };
554 
555 struct wpas_pasn {
556 	int akmp;
557 	int cipher;
558 	u16 group;
559 	int freq;
560 	size_t kdk_len;
561 
562 	u8 trans_seq;
563 	u8 status;
564 
565 	u8 bssid[ETH_ALEN];
566 	size_t pmk_len;
567 	u8 pmk[PMK_LEN_MAX];
568 	bool using_pmksa;
569 
570 	u8 hash[SHA384_MAC_LEN];
571 
572 	struct wpabuf *beacon_rsne_rsnxe;
573 	struct wpa_ptk ptk;
574 	struct crypto_ecdh *ecdh;
575 
576 	struct wpabuf *comeback;
577 	u16 comeback_after;
578 
579 #ifdef CONFIG_SAE
580 	struct sae_data sae;
581 #endif /* CONFIG_SAE */
582 
583 	struct wpa_ssid *ssid;
584 
585 #ifdef CONFIG_FILS
586 	struct pasn_fils fils;
587 #endif /* CONFIG_FILS */
588 
589 #ifdef CONFIG_IEEE80211R
590 	u8 pmk_r1[PMK_LEN_MAX];
591 	size_t pmk_r1_len;
592 	u8 pmk_r1_name[WPA_PMK_NAME_LEN];
593 #endif /* CONFIG_IEEE80211R */
594 };
595 #endif /* CONFIG_PASN */
596 
597 
598 enum ip_version {
599 	IPV4 = 4,
600 	IPV6 = 6,
601 };
602 
603 
604 struct ipv4_params {
605 	struct in_addr src_ip;
606 	struct in_addr dst_ip;
607 	u16 src_port;
608 	u16 dst_port;
609 	u8 dscp;
610 	u8 protocol;
611 	u8 param_mask;
612 };
613 
614 
615 struct ipv6_params {
616 	struct in6_addr src_ip;
617 	struct in6_addr dst_ip;
618 	u16 src_port;
619 	u16 dst_port;
620 	u8 dscp;
621 	u8 next_header;
622 	u8 flow_label[3];
623 	u8 param_mask;
624 };
625 
626 
627 struct type4_params {
628 	u8 classifier_mask;
629 	enum ip_version ip_version;
630 	union {
631 		struct ipv4_params v4;
632 		struct ipv6_params v6;
633 	} ip_params;
634 };
635 
636 
637 struct type10_params {
638 	u8 prot_instance;
639 	u8 prot_number;
640 	u8 *filter_value;
641 	u8 *filter_mask;
642 	size_t filter_len;
643 };
644 
645 
646 struct tclas_element {
647 	u8 user_priority;
648 	u8 classifier_type;
649 	union {
650 		struct type4_params type4_param;
651 		struct type10_params type10_param;
652 	} frame_classifier;
653 };
654 
655 
656 struct scs_desc_elem {
657 	u8 scs_id;
658 	enum scs_request_type request_type;
659 	u8 intra_access_priority;
660 	bool scs_up_avail;
661 	struct tclas_element *tclas_elems;
662 	unsigned int num_tclas_elem;
663 	u8 tclas_processing;
664 };
665 
666 
667 struct scs_robust_av_data {
668 	struct scs_desc_elem *scs_desc_elems;
669 	unsigned int num_scs_desc;
670 };
671 
672 
673 enum scs_response_status {
674 	SCS_DESC_SENT = 0,
675 	SCS_DESC_SUCCESS = 1,
676 };
677 
678 
679 struct active_scs_elem {
680 	struct dl_list list;
681 	u8 scs_id;
682 	enum scs_response_status status;
683 };
684 
685 struct dscp_policy_data {
686 	u8 policy_id;
687 	u8 req_type;
688 	u8 dscp;
689 	bool dscp_info;
690 	const u8 *frame_classifier;
691 	u8 frame_classifier_len;
692 	struct type4_params type4_param;
693 	const u8 *domain_name;
694 	u8 domain_name_len;
695 	u16 start_port;
696 	u16 end_port;
697 	bool port_range_info;
698 };
699 
700 
701 /**
702  * struct wpa_supplicant - Internal data for wpa_supplicant interface
703  *
704  * This structure contains the internal data for core wpa_supplicant code. This
705  * should be only used directly from the core code. However, a pointer to this
706  * data is used from other files as an arbitrary context pointer in calls to
707  * core functions.
708  */
709 struct wpa_supplicant {
710 	struct wpa_global *global;
711 	struct wpa_radio *radio; /* shared radio context */
712 	struct dl_list radio_list; /* list head: struct wpa_radio::ifaces */
713 	struct wpa_supplicant *parent;
714 	struct wpa_supplicant *p2pdev;
715 	struct wpa_supplicant *next;
716 	struct l2_packet_data *l2;
717 	struct l2_packet_data *l2_br;
718 	struct os_reltime roam_start;
719 	struct os_reltime roam_time;
720 	struct os_reltime session_start;
721 	struct os_reltime session_length;
722 	unsigned char own_addr[ETH_ALEN];
723 	unsigned char perm_addr[ETH_ALEN];
724 	char ifname[100];
725 #ifdef CONFIG_MATCH_IFACE
726 	int matched;
727 #endif /* CONFIG_MATCH_IFACE */
728 #ifdef CONFIG_CTRL_IFACE_DBUS_NEW
729 	char *dbus_new_path;
730 	char *dbus_groupobj_path;
731 #ifdef CONFIG_AP
732 	char *preq_notify_peer;
733 #endif /* CONFIG_AP */
734 #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
735 #ifdef CONFIG_CTRL_IFACE_AIDL
736 	const void *aidl_object_key;
737 #endif /* CONFIG_CTRL_IFACE_AIDL */
738 	char bridge_ifname[16];
739 
740 	char *confname;
741 	char *confanother;
742 
743 	struct wpa_config *conf;
744 	int countermeasures;
745 	struct os_reltime last_michael_mic_error;
746 	u8 bssid[ETH_ALEN];
747 	u8 pending_bssid[ETH_ALEN]; /* If wpa_state == WPA_ASSOCIATING, this
748 				     * field contains the target BSSID. */
749 	int reassociate; /* reassociation requested */
750 	bool roam_in_progress; /* roam in progress */
751 	unsigned int reassoc_same_bss:1; /* reassociating to the same BSS */
752 	unsigned int reassoc_same_ess:1; /* reassociating to the same ESS */
753 	int disconnected; /* all connections disabled; i.e., do no reassociate
754 			   * before this has been cleared */
755 	struct wpa_ssid *current_ssid;
756 	struct wpa_ssid *last_ssid;
757 	struct wpa_bss *current_bss;
758 	int ap_ies_from_associnfo;
759 	unsigned int assoc_freq;
760 	u8 *last_con_fail_realm;
761 	size_t last_con_fail_realm_len;
762 
763 	/* Selected configuration (based on Beacon/ProbeResp WPA IE) */
764 	int pairwise_cipher;
765 	int deny_ptk0_rekey;
766 	int group_cipher;
767 	int key_mgmt;
768 	int wpa_proto;
769 	int mgmt_group_cipher;
770 
771 	void *drv_priv; /* private data used by driver_ops */
772 	void *global_drv_priv;
773 
774 	u8 *bssid_filter;
775 	size_t bssid_filter_count;
776 
777 	u8 *disallow_aps_bssid;
778 	size_t disallow_aps_bssid_count;
779 	struct wpa_ssid_value *disallow_aps_ssid;
780 	size_t disallow_aps_ssid_count;
781 
782 	u32 setband_mask;
783 
784 	/* Preferred network for the next connection attempt */
785 	struct wpa_ssid *next_ssid;
786 
787 	/* previous scan was wildcard when interleaving between
788 	 * wildcard scans and specific SSID scan when max_ssids=1 */
789 	int prev_scan_wildcard;
790 	struct wpa_ssid *prev_scan_ssid; /* previously scanned SSID;
791 					  * NULL = not yet initialized (start
792 					  * with wildcard SSID)
793 					  * WILDCARD_SSID_SCAN = wildcard
794 					  * SSID was used in the previous scan
795 					  */
796 #define WILDCARD_SSID_SCAN ((struct wpa_ssid *) 1)
797 
798 	struct wpa_ssid *prev_sched_ssid; /* last SSID used in sched scan */
799 	int sched_scan_timeout;
800 	int first_sched_scan;
801 	int sched_scan_timed_out;
802 	struct sched_scan_plan *sched_scan_plans;
803 	size_t sched_scan_plans_num;
804 
805 	void (*scan_res_handler)(struct wpa_supplicant *wpa_s,
806 				 struct wpa_scan_results *scan_res);
807 	void (*scan_res_fail_handler)(struct wpa_supplicant *wpa_s);
808 	struct dl_list bss; /* struct wpa_bss::list */
809 	struct dl_list bss_id; /* struct wpa_bss::list_id */
810 	size_t num_bss;
811 	unsigned int bss_update_idx;
812 	unsigned int bss_next_id;
813 
814 	 /*
815 	  * Pointers to BSS entries in the order they were in the last scan
816 	  * results.
817 	  */
818 	struct wpa_bss **last_scan_res;
819 	size_t last_scan_res_used;
820 	size_t last_scan_res_size;
821 	struct os_reltime last_scan;
822 
823 	const struct wpa_driver_ops *driver;
824 	int interface_removed; /* whether the network interface has been
825 				* removed */
826 	struct wpa_sm *wpa;
827 	struct ptksa_cache *ptksa;
828 
829 	struct eapol_sm *eapol;
830 
831 	struct ctrl_iface_priv *ctrl_iface;
832 
833 	enum wpa_states wpa_state;
834 	struct wpa_radio_work *scan_work;
835 	int scanning;
836 	int sched_scanning;
837 	unsigned int sched_scan_stop_req:1;
838 	int new_connection;
839 
840 	int eapol_received; /* number of EAPOL packets received after the
841 			     * previous association event */
842 
843 	u8 rsnxe[20];
844 	size_t rsnxe_len;
845 
846 	struct scard_data *scard;
847 	char imsi[20];
848 	int mnc_len;
849 
850 	unsigned char last_eapol_src[ETH_ALEN];
851 
852 	unsigned int keys_cleared; /* bitfield of key indexes that the driver is
853 				    * known not to be configured with a key */
854 
855 	struct wpa_bssid_ignore *bssid_ignore;
856 
857 	/* Number of connection failures since last successful connection */
858 	unsigned int consecutive_conn_failures;
859 
860 	/**
861 	 * scan_req - Type of the scan request
862 	 */
863 	enum scan_req_type {
864 		/**
865 		 * NORMAL_SCAN_REQ - Normal scan request
866 		 *
867 		 * This is used for scans initiated by wpa_supplicant to find an
868 		 * AP for a connection.
869 		 */
870 		NORMAL_SCAN_REQ,
871 
872 		/**
873 		 * INITIAL_SCAN_REQ - Initial scan request
874 		 *
875 		 * This is used for the first scan on an interface to force at
876 		 * least one scan to be run even if the configuration does not
877 		 * include any enabled networks.
878 		 */
879 		INITIAL_SCAN_REQ,
880 
881 		/**
882 		 * MANUAL_SCAN_REQ - Manual scan request
883 		 *
884 		 * This is used for scans where the user request a scan or
885 		 * a specific wpa_supplicant operation (e.g., WPS) requires scan
886 		 * to be run.
887 		 */
888 		MANUAL_SCAN_REQ
889 	} scan_req, last_scan_req;
890 	enum wpa_states scan_prev_wpa_state;
891 	struct os_reltime scan_trigger_time, scan_start_time;
892 	/* Minimum freshness requirement for connection purposes */
893 	struct os_reltime scan_min_time;
894 	int scan_runs; /* number of scan runs since WPS was started */
895 	int *next_scan_freqs;
896 	int *select_network_scan_freqs;
897 	int *manual_scan_freqs;
898 	int *manual_sched_scan_freqs;
899 	unsigned int manual_scan_passive:1;
900 	unsigned int manual_scan_use_id:1;
901 	unsigned int manual_scan_only_new:1;
902 	unsigned int own_scan_requested:1;
903 	unsigned int own_scan_running:1;
904 	unsigned int clear_driver_scan_cache:1;
905 	unsigned int manual_scan_id;
906 	int scan_interval; /* time in sec between scans to find suitable AP */
907 	int normal_scans; /* normal scans run before sched_scan */
908 	int scan_for_connection; /* whether the scan request was triggered for
909 				  * finding a connection */
910 	/*
911 	 * A unique cookie representing the vendor scan request. This cookie is
912 	 * returned from the driver interface. 0 indicates that there is no
913 	 * pending vendor scan request.
914 	 */
915 	u64 curr_scan_cookie;
916 #define MAX_SCAN_ID 16
917 	int scan_id[MAX_SCAN_ID];
918 	unsigned int scan_id_count;
919 	u8 next_scan_bssid[ETH_ALEN];
920 	unsigned int next_scan_bssid_wildcard_ssid:1;
921 
922 	struct wpa_ssid_value *ssids_from_scan_req;
923 	unsigned int num_ssids_from_scan_req;
924 	int *last_scan_freqs;
925 	unsigned int num_last_scan_freqs;
926 	unsigned int suitable_network;
927 	unsigned int no_suitable_network;
928 
929 	u64 drv_flags;
930 	u64 drv_flags2;
931 	unsigned int drv_enc;
932 	unsigned int drv_rrm_flags;
933 	unsigned int drv_max_acl_mac_addrs;
934 
935 	/*
936 	 * A bitmap of supported protocols for probe response offload. See
937 	 * struct wpa_driver_capa in driver.h
938 	 */
939 	unsigned int probe_resp_offloads;
940 
941 	/* extended capabilities supported by the driver */
942 	const u8 *extended_capa, *extended_capa_mask;
943 	unsigned int extended_capa_len;
944 
945 	int max_scan_ssids;
946 	int max_sched_scan_ssids;
947 	unsigned int max_sched_scan_plans;
948 	unsigned int max_sched_scan_plan_interval;
949 	unsigned int max_sched_scan_plan_iterations;
950 	int sched_scan_supported;
951 	unsigned int max_match_sets;
952 	unsigned int max_remain_on_chan;
953 	unsigned int max_stations;
954 
955 	int pending_mic_error_report;
956 	int pending_mic_error_pairwise;
957 	int mic_errors_seen; /* Michael MIC errors with the current PTK */
958 
959 	struct wps_context *wps;
960 	int wps_success; /* WPS success event received */
961 	struct wps_er *wps_er;
962 	unsigned int wps_run;
963 	struct os_reltime wps_pin_start_time;
964 	bool bssid_ignore_cleared;
965 
966 	struct wpabuf *pending_eapol_rx;
967 	struct os_reltime pending_eapol_rx_time;
968 	u8 pending_eapol_rx_src[ETH_ALEN];
969 	unsigned int last_eapol_matches_bssid:1;
970 	unsigned int eapol_failed:1;
971 	unsigned int eap_expected_failure:1;
972 	unsigned int reattach:1; /* reassociation to the same BSS requested */
973 	unsigned int mac_addr_changed:1;
974 	unsigned int added_vif:1;
975 	unsigned int wnmsleep_used:1;
976 	unsigned int owe_transition_select:1;
977 	unsigned int owe_transition_search:1;
978 	unsigned int connection_set:1;
979 	unsigned int connection_ht:1;
980 	unsigned int connection_vht:1;
981 	unsigned int connection_he:1;
982 	unsigned int connection_eht:1;
983 	unsigned int connection_max_nss_rx:4;
984 	unsigned int connection_max_nss_tx:4;
985 	unsigned int connection_channel_bandwidth:5;
986 	unsigned int disable_mbo_oce:1;
987 	unsigned int connection_11b_only:1;
988 
989 	struct os_reltime last_mac_addr_change;
990 	int last_mac_addr_style;
991 
992 	struct ibss_rsn *ibss_rsn;
993 
994 	int set_sta_uapsd;
995 	int sta_uapsd;
996 	int set_ap_uapsd;
997 	int ap_uapsd;
998 	int auth_alg;
999 	u16 last_owe_group;
1000 
1001 #ifdef CONFIG_SME
1002 	struct {
1003 		u8 ssid[SSID_MAX_LEN];
1004 		size_t ssid_len;
1005 		int freq;
1006 		u8 assoc_req_ie[1500];
1007 		size_t assoc_req_ie_len;
1008 		int mfp;
1009 		int ft_used;
1010 		u8 mobility_domain[2];
1011 		u8 *ft_ies;
1012 		size_t ft_ies_len;
1013 		u8 prev_bssid[ETH_ALEN];
1014 		int prev_bssid_set;
1015 		int auth_alg;
1016 		int proto;
1017 
1018 		int sa_query_count; /* number of pending SA Query requests;
1019 				     * 0 = no SA Query in progress */
1020 		int sa_query_timed_out;
1021 		u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN *
1022 					* sa_query_count octets of pending
1023 					* SA Query transaction identifiers */
1024 		struct os_reltime sa_query_start;
1025 		struct os_reltime last_unprot_disconnect;
1026 		enum { HT_SEC_CHAN_UNKNOWN,
1027 		       HT_SEC_CHAN_ABOVE,
1028 		       HT_SEC_CHAN_BELOW } ht_sec_chan;
1029 		u8 sched_obss_scan;
1030 		u16 obss_scan_int;
1031 		u16 bss_max_idle_period;
1032 #ifdef CONFIG_SAE
1033 		struct sae_data sae;
1034 		struct wpabuf *sae_token;
1035 		int sae_group_index;
1036 		unsigned int sae_pmksa_caching:1;
1037 		u16 seq_num;
1038 		u8 ext_auth_bssid[ETH_ALEN];
1039 		u8 ext_auth_ssid[SSID_MAX_LEN];
1040 		size_t ext_auth_ssid_len;
1041 		int *sae_rejected_groups;
1042 #endif /* CONFIG_SAE */
1043 	} sme;
1044 #endif /* CONFIG_SME */
1045 
1046 #ifdef CONFIG_AP
1047 	struct hostapd_iface *ap_iface;
1048 	void (*ap_configured_cb)(void *ctx, void *data);
1049 	void *ap_configured_cb_ctx;
1050 	void *ap_configured_cb_data;
1051 #endif /* CONFIG_AP */
1052 
1053 	struct hostapd_iface *ifmsh;
1054 #ifdef CONFIG_MESH
1055 	struct mesh_rsn *mesh_rsn;
1056 	int mesh_if_idx;
1057 	unsigned int mesh_if_created:1;
1058 	unsigned int mesh_ht_enabled:1;
1059 	unsigned int mesh_vht_enabled:1;
1060 	unsigned int mesh_he_enabled:1;
1061 	struct wpa_driver_mesh_join_params *mesh_params;
1062 #ifdef CONFIG_PMKSA_CACHE_EXTERNAL
1063 	/* struct external_pmksa_cache::list */
1064 	struct dl_list mesh_external_pmksa_cache;
1065 #endif /* CONFIG_PMKSA_CACHE_EXTERNAL */
1066 #endif /* CONFIG_MESH */
1067 
1068 	unsigned int off_channel_freq;
1069 	struct wpabuf *pending_action_tx;
1070 	u8 pending_action_src[ETH_ALEN];
1071 	u8 pending_action_dst[ETH_ALEN];
1072 	u8 pending_action_bssid[ETH_ALEN];
1073 	unsigned int pending_action_freq;
1074 	int pending_action_no_cck;
1075 	int pending_action_without_roc;
1076 	unsigned int pending_action_tx_done:1;
1077 	void (*pending_action_tx_status_cb)(struct wpa_supplicant *wpa_s,
1078 					    unsigned int freq, const u8 *dst,
1079 					    const u8 *src, const u8 *bssid,
1080 					    const u8 *data, size_t data_len,
1081 					    enum offchannel_send_action_result
1082 					    result);
1083 	unsigned int roc_waiting_drv_freq;
1084 	int action_tx_wait_time;
1085 	int action_tx_wait_time_used;
1086 
1087 	int p2p_mgmt;
1088 
1089 #ifdef CONFIG_P2P
1090 	struct p2p_go_neg_results *go_params;
1091 	int create_p2p_iface;
1092 	u8 pending_interface_addr[ETH_ALEN];
1093 	char pending_interface_name[100];
1094 	int pending_interface_type;
1095 	int p2p_group_idx;
1096 	unsigned int pending_listen_freq;
1097 	unsigned int pending_listen_duration;
1098 	enum {
1099 		NOT_P2P_GROUP_INTERFACE,
1100 		P2P_GROUP_INTERFACE_PENDING,
1101 		P2P_GROUP_INTERFACE_GO,
1102 		P2P_GROUP_INTERFACE_CLIENT
1103 	} p2p_group_interface;
1104 	struct p2p_group *p2p_group;
1105 	char p2p_pin[10];
1106 	int p2p_wps_method;
1107 	u8 p2p_auth_invite[ETH_ALEN];
1108 	int p2p_sd_over_ctrl_iface;
1109 	int p2p_in_provisioning;
1110 	int p2p_in_invitation;
1111 	int p2p_invite_go_freq;
1112 	int pending_invite_ssid_id;
1113 	int show_group_started;
1114 	u8 go_dev_addr[ETH_ALEN];
1115 	int pending_pd_before_join;
1116 	u8 pending_join_iface_addr[ETH_ALEN];
1117 	u8 pending_join_dev_addr[ETH_ALEN];
1118 	int pending_join_wps_method;
1119 	u8 p2p_join_ssid[SSID_MAX_LEN];
1120 	size_t p2p_join_ssid_len;
1121 	int p2p_join_scan_count;
1122 	int auto_pd_scan_retry;
1123 	int force_long_sd;
1124 	u16 pending_pd_config_methods;
1125 	enum {
1126 		NORMAL_PD, AUTO_PD_GO_NEG, AUTO_PD_JOIN, AUTO_PD_ASP
1127 	} pending_pd_use;
1128 
1129 	/*
1130 	 * Whether cross connection is disallowed by the AP to which this
1131 	 * interface is associated (only valid if there is an association).
1132 	 */
1133 	int cross_connect_disallowed;
1134 
1135 	/*
1136 	 * Whether this P2P group is configured to use cross connection (only
1137 	 * valid if this is P2P GO interface). The actual cross connect packet
1138 	 * forwarding may not be configured depending on the uplink status.
1139 	 */
1140 	int cross_connect_enabled;
1141 
1142 	/* Whether cross connection forwarding is in use at the moment. */
1143 	int cross_connect_in_use;
1144 
1145 	/*
1146 	 * Uplink interface name for cross connection
1147 	 */
1148 	char cross_connect_uplink[100];
1149 
1150 	unsigned int p2p_auto_join:1;
1151 	unsigned int p2p_auto_pd:1;
1152 	unsigned int p2p_go_do_acs:1;
1153 	unsigned int p2p_persistent_group:1;
1154 	unsigned int p2p_fallback_to_go_neg:1;
1155 	unsigned int p2p_pd_before_go_neg:1;
1156 	unsigned int p2p_go_ht40:1;
1157 	unsigned int p2p_go_vht:1;
1158 	unsigned int p2p_go_edmg:1;
1159 	unsigned int p2p_go_he:1;
1160 	unsigned int user_initiated_pd:1;
1161 	unsigned int p2p_go_group_formation_completed:1;
1162 	unsigned int group_formation_reported:1;
1163 	unsigned int waiting_presence_resp;
1164 	int p2p_first_connection_timeout;
1165 	unsigned int p2p_nfc_tag_enabled:1;
1166 	unsigned int p2p_peer_oob_pk_hash_known:1;
1167 	unsigned int p2p_disable_ip_addr_req:1;
1168 	unsigned int p2ps_method_config_any:1;
1169 	unsigned int p2p_cli_probe:1;
1170 	unsigned int p2p_go_allow_dfs:1;
1171 	enum hostapd_hw_mode p2p_go_acs_band;
1172 	int p2p_persistent_go_freq;
1173 	int p2p_persistent_id;
1174 	int p2p_go_intent;
1175 	int p2p_connect_freq;
1176 	struct os_reltime p2p_auto_started;
1177 	struct wpa_ssid *p2p_last_4way_hs_fail;
1178 	struct wpa_radio_work *p2p_scan_work;
1179 	struct wpa_radio_work *p2p_listen_work;
1180 	struct wpa_radio_work *p2p_send_action_work;
1181 
1182 	u16 p2p_oob_dev_pw_id; /* OOB Device Password Id for group formation */
1183 	struct wpabuf *p2p_oob_dev_pw; /* OOB Device Password for group
1184 					* formation */
1185 	u8 p2p_peer_oob_pubkey_hash[WPS_OOB_PUBKEY_HASH_LEN];
1186 	u8 p2p_ip_addr_info[3 * 4];
1187 
1188 	/* group common frequencies */
1189 	int *p2p_group_common_freqs;
1190 	unsigned int p2p_group_common_freqs_num;
1191 	u8 p2ps_join_addr[ETH_ALEN];
1192 
1193 	unsigned int p2p_go_max_oper_chwidth;
1194 	unsigned int p2p_go_vht_center_freq2;
1195 	int p2p_lo_started;
1196 #endif /* CONFIG_P2P */
1197 
1198 	struct wpa_ssid *bgscan_ssid;
1199 	const struct bgscan_ops *bgscan;
1200 	void *bgscan_priv;
1201 
1202 	const struct autoscan_ops *autoscan;
1203 	struct wpa_driver_scan_params *autoscan_params;
1204 	void *autoscan_priv;
1205 
1206 	struct wpa_ssid *connect_without_scan;
1207 
1208 	struct wps_ap_info *wps_ap;
1209 	size_t num_wps_ap;
1210 	int wps_ap_iter;
1211 
1212 	int after_wps;
1213 	int known_wps_freq;
1214 	unsigned int wps_freq;
1215 	int wps_fragment_size;
1216 	int auto_reconnect_disabled;
1217 
1218 	 /* Channel preferences for AP/P2P GO use */
1219 	int best_24_freq;
1220 	int best_5_freq;
1221 	int best_overall_freq;
1222 
1223 	struct gas_query *gas;
1224 	struct gas_server *gas_server;
1225 
1226 #ifdef CONFIG_INTERWORKING
1227 	unsigned int fetch_anqp_in_progress:1;
1228 	unsigned int network_select:1;
1229 	unsigned int auto_select:1;
1230 	unsigned int auto_network_select:1;
1231 	unsigned int interworking_fast_assoc_tried:1;
1232 	unsigned int fetch_all_anqp:1;
1233 	unsigned int fetch_osu_info:1;
1234 	unsigned int fetch_osu_waiting_scan:1;
1235 	unsigned int fetch_osu_icon_in_progress:1;
1236 	struct wpa_bss *interworking_gas_bss;
1237 	unsigned int osu_icon_id;
1238 	struct dl_list icon_head; /* struct icon_entry */
1239 	struct osu_provider *osu_prov;
1240 	size_t osu_prov_count;
1241 	struct os_reltime osu_icon_fetch_start;
1242 	unsigned int num_osu_scans;
1243 	unsigned int num_prov_found;
1244 #endif /* CONFIG_INTERWORKING */
1245 	unsigned int drv_capa_known;
1246 
1247 	struct {
1248 		struct hostapd_hw_modes *modes;
1249 		u16 num_modes;
1250 		u16 flags;
1251 	} hw;
1252 	enum local_hw_capab {
1253 		CAPAB_NO_HT_VHT,
1254 		CAPAB_HT,
1255 		CAPAB_HT40,
1256 		CAPAB_VHT,
1257 	} hw_capab;
1258 #ifdef CONFIG_MACSEC
1259 	struct ieee802_1x_kay *kay;
1260 #endif /* CONFIG_MACSEC */
1261 
1262 	int pno;
1263 	int pno_sched_pending;
1264 
1265 	/* WLAN_REASON_* reason codes. Negative if locally generated. */
1266 	int disconnect_reason;
1267 
1268 	/* WLAN_STATUS_* status codes from last received Authentication frame
1269 	 * from the AP. */
1270 	u16 auth_status_code;
1271 
1272 	/* WLAN_STATUS_* status codes from (Re)Association Response frame. */
1273 	u16 assoc_status_code;
1274 
1275 	struct ext_password_data *ext_pw;
1276 
1277 	struct wpabuf *last_gas_resp, *prev_gas_resp;
1278 	u8 last_gas_addr[ETH_ALEN], prev_gas_addr[ETH_ALEN];
1279 	u8 last_gas_dialog_token, prev_gas_dialog_token;
1280 
1281 	unsigned int no_keep_alive:1;
1282 	unsigned int ext_mgmt_frame_handling:1;
1283 	unsigned int ext_eapol_frame_io:1;
1284 	unsigned int wmm_ac_supported:1;
1285 	unsigned int ext_work_in_progress:1;
1286 	unsigned int own_disconnect_req:1;
1287 	unsigned int own_reconnect_req:1;
1288 	unsigned int ignore_post_flush_scan_res:1;
1289 
1290 #define MAC_ADDR_RAND_SCAN       BIT(0)
1291 #define MAC_ADDR_RAND_SCHED_SCAN BIT(1)
1292 #define MAC_ADDR_RAND_PNO        BIT(2)
1293 #define MAC_ADDR_RAND_ALL        (MAC_ADDR_RAND_SCAN | \
1294 				  MAC_ADDR_RAND_SCHED_SCAN | \
1295 				  MAC_ADDR_RAND_PNO)
1296 	unsigned int mac_addr_rand_supported;
1297 	unsigned int mac_addr_rand_enable;
1298 
1299 	/* MAC Address followed by mask (2 * ETH_ALEN) */
1300 	u8 *mac_addr_scan;
1301 	u8 *mac_addr_sched_scan;
1302 	u8 *mac_addr_pno;
1303 
1304 #ifdef CONFIG_WNM
1305 	u8 wnm_dialog_token;
1306 	u8 wnm_reply;
1307 	u8 wnm_num_neighbor_report;
1308 	u8 wnm_mode;
1309 	u16 wnm_dissoc_timer;
1310 	u8 wnm_bss_termination_duration[12];
1311 	struct neighbor_report *wnm_neighbor_report_elements;
1312 	struct os_reltime wnm_cand_valid_until;
1313 	u8 wnm_cand_from_bss[ETH_ALEN];
1314 	enum bss_trans_mgmt_status_code bss_tm_status;
1315 	bool bss_trans_mgmt_in_progress;
1316 	struct wpabuf *coloc_intf_elems;
1317 	u8 coloc_intf_dialog_token;
1318 	u8 coloc_intf_auto_report;
1319 	u8 coloc_intf_timeout;
1320 #ifdef CONFIG_MBO
1321 	unsigned int wnm_mbo_trans_reason_present:1;
1322 	unsigned int wnm_mbo_cell_pref_present:1;
1323 	unsigned int wnm_mbo_assoc_retry_delay_present:1;
1324 	u8 wnm_mbo_transition_reason;
1325 	u8 wnm_mbo_cell_preference;
1326 	u16 wnm_mbo_assoc_retry_delay_sec;
1327 #endif /* CONFIG_MBO */
1328 #endif /* CONFIG_WNM */
1329 
1330 #ifdef CONFIG_TESTING_GET_GTK
1331 	u8 last_gtk[32];
1332 	size_t last_gtk_len;
1333 #endif /* CONFIG_TESTING_GET_GTK */
1334 
1335 	unsigned int num_multichan_concurrent;
1336 	struct wpa_radio_work *connect_work;
1337 
1338 	unsigned int ext_work_id;
1339 
1340 	struct wpabuf *vendor_elem[NUM_VENDOR_ELEM_FRAMES];
1341 
1342 #ifdef CONFIG_TESTING_OPTIONS
1343 	struct l2_packet_data *l2_test;
1344 	unsigned int extra_roc_dur;
1345 	enum wpa_supplicant_test_failure test_failure;
1346 	char *get_pref_freq_list_override;
1347 	unsigned int reject_btm_req_reason;
1348 	unsigned int p2p_go_csa_on_inv:1;
1349 	unsigned int ignore_auth_resp:1;
1350 	unsigned int ignore_assoc_disallow:1;
1351 	unsigned int disable_sa_query:1;
1352 	unsigned int testing_resend_assoc:1;
1353 	unsigned int ignore_sae_h2e_only:1;
1354 	int ft_rsnxe_used;
1355 	struct wpabuf *sae_commit_override;
1356 	enum wpa_alg last_tk_alg;
1357 	u8 last_tk_addr[ETH_ALEN];
1358 	int last_tk_key_idx;
1359 	u8 last_tk[WPA_TK_MAX_LEN];
1360 	size_t last_tk_len;
1361 	struct wpabuf *last_assoc_req_wpa_ie;
1362 	int *extra_sae_rejected_groups;
1363 	struct wpabuf *rsne_override_eapol;
1364 	struct wpabuf *rsnxe_override_assoc;
1365 	struct wpabuf *rsnxe_override_eapol;
1366 	struct dl_list drv_signal_override;
1367 	unsigned int oci_freq_override_eapol;
1368 	unsigned int oci_freq_override_saquery_req;
1369 	unsigned int oci_freq_override_saquery_resp;
1370 	unsigned int oci_freq_override_eapol_g2;
1371 	unsigned int oci_freq_override_ft_assoc;
1372 	unsigned int oci_freq_override_fils_assoc;
1373 	unsigned int oci_freq_override_wnm_sleep;
1374 	int force_hunting_and_pecking_pwe;
1375 	unsigned int disable_eapol_g2_tx;
1376 #endif /* CONFIG_TESTING_OPTIONS */
1377 
1378 	struct wmm_ac_assoc_data *wmm_ac_assoc_info;
1379 	struct wmm_tspec_element *tspecs[WMM_AC_NUM][TS_DIR_IDX_COUNT];
1380 	struct wmm_ac_addts_request *addts_request;
1381 	u8 wmm_ac_last_dialog_token;
1382 	struct wmm_tspec_element *last_tspecs;
1383 	u8 last_tspecs_count;
1384 
1385 	struct rrm_data rrm;
1386 	struct beacon_rep_data beacon_rep_data;
1387 
1388 #ifdef CONFIG_FST
1389 	struct fst_iface *fst;
1390 	const struct wpabuf *fst_ies;
1391 	struct wpabuf *received_mb_ies;
1392 #endif /* CONFIG_FST */
1393 
1394 #ifdef CONFIG_MBO
1395 	/* Multiband operation non-preferred channel */
1396 	struct wpa_mbo_non_pref_channel {
1397 		enum mbo_non_pref_chan_reason reason;
1398 		u8 oper_class;
1399 		u8 chan;
1400 		u8 preference;
1401 	} *non_pref_chan;
1402 	size_t non_pref_chan_num;
1403 	u8 mbo_wnm_token;
1404 	/**
1405 	 * enable_oce - Enable OCE if it is enabled by user and device also
1406 	 *		supports OCE.
1407 	 * User can enable OCE with wpa_config's 'oce' parameter as follows -
1408 	 *  - Set BIT(0) to enable OCE in non-AP STA mode.
1409 	 *  - Set BIT(1) to enable OCE in STA-CFON mode.
1410 	 */
1411 	u8 enable_oce;
1412 #endif /* CONFIG_MBO */
1413 
1414 	/*
1415 	 * This should be under CONFIG_MBO, but it is left out to allow using
1416 	 * the bss_temp_disallowed list for other purposes as well.
1417 	 */
1418 	struct dl_list bss_tmp_disallowed;
1419 
1420 	/*
1421 	 * Content of a measurement report element with type 8 (LCI),
1422 	 * own location.
1423 	 */
1424 	struct wpabuf *lci;
1425 	struct os_reltime lci_time;
1426 
1427 	struct os_reltime beacon_rep_scan;
1428 
1429 	/* FILS HLP requests (struct fils_hlp_req) */
1430 	struct dl_list fils_hlp_req;
1431 
1432 	struct sched_scan_relative_params {
1433 		/**
1434 		 * relative_rssi_set - Enable relatively preferred BSS reporting
1435 		 *
1436 		 * 0 = Disable reporting relatively preferred BSSs
1437 		 * 1 = Enable reporting relatively preferred BSSs
1438 		 */
1439 		int relative_rssi_set;
1440 
1441 		/**
1442 		 * relative_rssi - Relative RSSI for reporting better BSSs
1443 		 *
1444 		 * Amount of RSSI by which a BSS should be better than the
1445 		 * current connected BSS so that the new BSS can be reported
1446 		 * to user space. This applies to sched_scan operations.
1447 		 */
1448 		int relative_rssi;
1449 
1450 		/**
1451 		 * relative_adjust_band - Band in which RSSI is to be adjusted
1452 		 */
1453 		enum set_band relative_adjust_band;
1454 
1455 		/**
1456 		 * relative_adjust_rssi - RSSI adjustment
1457 		 *
1458 		 * An amount of relative_adjust_rssi should be added to the
1459 		 * BSSs that belong to the relative_adjust_band while comparing
1460 		 * with other bands for BSS reporting.
1461 		 */
1462 		int relative_adjust_rssi;
1463 	} srp;
1464 
1465 	/* RIC elements for FT protocol */
1466 	struct wpabuf *ric_ies;
1467 
1468 	int last_auth_timeout_sec;
1469 
1470 #ifdef CONFIG_DPP
1471 	struct dpp_global *dpp;
1472 	struct dpp_authentication *dpp_auth;
1473 	struct wpa_radio_work *dpp_listen_work;
1474 	unsigned int dpp_pending_listen_freq;
1475 	unsigned int dpp_listen_freq;
1476 	struct os_reltime dpp_listen_end;
1477 	u8 dpp_allowed_roles;
1478 	int dpp_qr_mutual;
1479 	int dpp_netrole;
1480 	int dpp_auth_ok_on_ack;
1481 	int dpp_in_response_listen;
1482 	int dpp_gas_client;
1483 	int dpp_gas_server;
1484 	int dpp_gas_dialog_token;
1485 	u8 dpp_intro_bssid[ETH_ALEN];
1486 	void *dpp_intro_network;
1487 	struct dpp_pkex *dpp_pkex;
1488 	struct dpp_bootstrap_info *dpp_pkex_bi;
1489 	char *dpp_pkex_code;
1490 	char *dpp_pkex_identifier;
1491 	enum dpp_pkex_ver dpp_pkex_ver;
1492 	char *dpp_pkex_auth_cmd;
1493 	char *dpp_configurator_params;
1494 	struct os_reltime dpp_last_init;
1495 	struct os_reltime dpp_init_iter_start;
1496 	unsigned int dpp_init_max_tries;
1497 	unsigned int dpp_init_retry_time;
1498 	unsigned int dpp_resp_wait_time;
1499 	unsigned int dpp_resp_max_tries;
1500 	unsigned int dpp_resp_retry_time;
1501 	u8 dpp_last_ssid[SSID_MAX_LEN];
1502 	size_t dpp_last_ssid_len;
1503 	bool dpp_conf_backup_received;
1504 	bool dpp_pkex_wait_auth_req;
1505 #ifdef CONFIG_DPP2
1506 	struct dpp_pfs *dpp_pfs;
1507 	int dpp_pfs_fallback;
1508 	struct wpabuf *dpp_presence_announcement;
1509 	struct dpp_bootstrap_info *dpp_chirp_bi;
1510 	int dpp_chirp_freq;
1511 	int *dpp_chirp_freqs;
1512 	int dpp_chirp_iter;
1513 	int dpp_chirp_round;
1514 	int dpp_chirp_scan_done;
1515 	int dpp_chirp_listen;
1516 	struct wpa_ssid *dpp_reconfig_ssid;
1517 	int dpp_reconfig_ssid_id;
1518 	struct dpp_reconfig_id *dpp_reconfig_id;
1519 #endif /* CONFIG_DPP2 */
1520 #ifdef CONFIG_TESTING_OPTIONS
1521 	char *dpp_config_obj_override;
1522 	char *dpp_discovery_override;
1523 	char *dpp_groups_override;
1524 	unsigned int dpp_ignore_netaccesskey_mismatch:1;
1525 #endif /* CONFIG_TESTING_OPTIONS */
1526 #endif /* CONFIG_DPP */
1527 
1528 #ifdef CONFIG_FILS
1529 	unsigned int disable_fils:1;
1530 #endif /* CONFIG_FILS */
1531 	unsigned int ieee80211ac:1;
1532 	unsigned int enabled_4addr_mode:1;
1533 	unsigned int multi_bss_support:1;
1534 	unsigned int drv_authorized_port:1;
1535 	unsigned int multi_ap_ie:1;
1536 	unsigned int multi_ap_backhaul:1;
1537 	unsigned int multi_ap_fronthaul:1;
1538 	struct robust_av_data robust_av;
1539 	bool mscs_setup_done;
1540 
1541 #ifdef CONFIG_PASN
1542 	struct wpas_pasn pasn;
1543 	struct wpa_radio_work *pasn_auth_work;
1544 #endif /* CONFIG_PASN */
1545 	struct scs_robust_av_data scs_robust_av_req;
1546 	u8 scs_dialog_token;
1547 #ifdef CONFIG_TESTING_OPTIONS
1548 	unsigned int disable_scs_support:1;
1549 	unsigned int disable_mscs_support:1;
1550 #endif /* CONFIG_TESTING_OPTIONS */
1551 	struct dl_list active_scs_ids;
1552 	bool ongoing_scs_req;
1553 	u8 dscp_req_dialog_token;
1554 	u8 dscp_query_dialog_token;
1555 	unsigned int enable_dscp_policy_capa:1;
1556 	unsigned int connection_dscp:1;
1557 	unsigned int wait_for_dscp_req:1;
1558 };
1559 
1560 
1561 /* wpa_supplicant.c */
1562 void wpa_supplicant_apply_ht_overrides(
1563 	struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
1564 	struct wpa_driver_associate_params *params);
1565 void wpa_supplicant_apply_vht_overrides(
1566 	struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
1567 	struct wpa_driver_associate_params *params);
1568 void wpa_supplicant_apply_he_overrides(
1569 	struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
1570 	struct wpa_driver_associate_params *params);
1571 
1572 int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
1573 int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s,
1574 				    struct wpa_ssid *ssid);
1575 
1576 int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s);
1577 
1578 const char * wpa_supplicant_state_txt(enum wpa_states state);
1579 int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s);
1580 int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s);
1581 int wpa_supplicant_update_bridge_ifname(struct wpa_supplicant *wpa_s,
1582 					const char *bridge_ifname);
1583 void wpas_set_mgmt_group_cipher(struct wpa_supplicant *wpa_s,
1584 				struct wpa_ssid *ssid, struct wpa_ie_data *ie);
1585 int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
1586 			      struct wpa_bss *bss, struct wpa_ssid *ssid,
1587 			      u8 *wpa_ie, size_t *wpa_ie_len);
1588 int wpas_restore_permanent_mac_addr(struct wpa_supplicant *wpa_s);
1589 void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
1590 			      struct wpa_bss *bss,
1591 			      struct wpa_ssid *ssid);
1592 void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s,
1593 				       struct wpa_ssid *ssid);
1594 void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s);
1595 void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr);
1596 void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
1597 				     int sec, int usec);
1598 void wpas_auth_timeout_restart(struct wpa_supplicant *wpa_s, int sec_diff);
1599 void wpa_supplicant_reinit_autoscan(struct wpa_supplicant *wpa_s);
1600 void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
1601 			      enum wpa_states state);
1602 struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s);
1603 const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s);
1604 void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
1605 void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
1606 				   u16 reason_code);
1607 void wpa_supplicant_reconnect(struct wpa_supplicant *wpa_s);
1608 
1609 struct wpa_ssid * wpa_supplicant_add_network(struct wpa_supplicant *wpa_s);
1610 int wpa_supplicant_remove_network(struct wpa_supplicant *wpa_s, int id);
1611 int wpa_supplicant_remove_all_networks(struct wpa_supplicant *wpa_s);
1612 void wpa_supplicant_enable_network(struct wpa_supplicant *wpa_s,
1613 				   struct wpa_ssid *ssid);
1614 void wpa_supplicant_disable_network(struct wpa_supplicant *wpa_s,
1615 				    struct wpa_ssid *ssid);
1616 void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s,
1617 				   struct wpa_ssid *ssid);
1618 int wpas_remove_cred(struct wpa_supplicant *wpa_s, struct wpa_cred *cred);
1619 int wpas_remove_all_creds(struct wpa_supplicant *wpa_s);
1620 int wpas_set_pkcs11_engine_and_module_path(struct wpa_supplicant *wpa_s,
1621 					   const char *pkcs11_engine_path,
1622 					   const char *pkcs11_module_path);
1623 int wpa_supplicant_set_ap_scan(struct wpa_supplicant *wpa_s,
1624 			       int ap_scan);
1625 int wpa_supplicant_set_bss_expiration_age(struct wpa_supplicant *wpa_s,
1626 					  unsigned int expire_age);
1627 int wpa_supplicant_set_bss_expiration_count(struct wpa_supplicant *wpa_s,
1628 					    unsigned int expire_count);
1629 int wpa_supplicant_set_scan_interval(struct wpa_supplicant *wpa_s,
1630 				     int scan_interval);
1631 int wpa_supplicant_set_debug_params(struct wpa_global *global,
1632 				    int debug_level, int debug_timestamp,
1633 				    int debug_show_keys);
1634 void free_hw_features(struct wpa_supplicant *wpa_s);
1635 
1636 void wpa_show_license(void);
1637 
1638 struct wpa_interface * wpa_supplicant_match_iface(struct wpa_global *global,
1639 						  const char *ifname);
1640 struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
1641 						 struct wpa_interface *iface,
1642 						 struct wpa_supplicant *parent);
1643 int wpa_supplicant_remove_iface(struct wpa_global *global,
1644 				struct wpa_supplicant *wpa_s,
1645 				int terminate);
1646 struct wpa_supplicant * wpa_supplicant_get_iface(struct wpa_global *global,
1647 						 const char *ifname);
1648 struct wpa_global * wpa_supplicant_init(struct wpa_params *params);
1649 int wpa_supplicant_run(struct wpa_global *global);
1650 void wpa_supplicant_deinit(struct wpa_global *global);
1651 
1652 int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
1653 			      struct wpa_ssid *ssid);
1654 void wpa_supplicant_terminate_proc(struct wpa_global *global);
1655 void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
1656 			     const u8 *buf, size_t len);
1657 void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s);
1658 void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s);
1659 void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid);
1660 void fils_connection_failure(struct wpa_supplicant *wpa_s);
1661 void fils_pmksa_cache_flush(struct wpa_supplicant *wpa_s);
1662 int wpas_driver_bss_selection(struct wpa_supplicant *wpa_s);
1663 int wpas_is_p2p_prioritized(struct wpa_supplicant *wpa_s);
1664 void wpas_auth_failed(struct wpa_supplicant *wpa_s, char *reason);
1665 void wpas_clear_temp_disabled(struct wpa_supplicant *wpa_s,
1666 			      struct wpa_ssid *ssid, int clear_failures);
1667 int disallowed_bssid(struct wpa_supplicant *wpa_s, const u8 *bssid);
1668 int disallowed_ssid(struct wpa_supplicant *wpa_s, const u8 *ssid,
1669 		    size_t ssid_len);
1670 void wpas_request_connection(struct wpa_supplicant *wpa_s);
1671 void wpas_request_disconnection(struct wpa_supplicant *wpa_s);
1672 int wpas_build_ext_capab(struct wpa_supplicant *wpa_s, u8 *buf, size_t buflen);
1673 int wpas_update_random_addr(struct wpa_supplicant *wpa_s, int style);
1674 int wpas_update_random_addr_disassoc(struct wpa_supplicant *wpa_s);
1675 void add_freq(int *freqs, int *num_freqs, int freq);
1676 
1677 int wpas_get_op_chan_phy(int freq, const u8 *ies, size_t ies_len,
1678 			 u8 *op_class, u8 *chan, u8 *phy_type);
1679 
1680 int wpas_twt_send_setup(struct wpa_supplicant *wpa_s, u8 dtok, int exponent,
1681 			int mantissa, u8 min_twt, int setup_cmd, u64 twt,
1682 			bool requestor, bool trigger, bool implicit,
1683 			bool flow_type, u8 flow_id, bool protection,
1684 			u8 twt_channel, u8 control);
1685 int wpas_twt_send_teardown(struct wpa_supplicant *wpa_s, u8 flags);
1686 
1687 void wpas_rrm_reset(struct wpa_supplicant *wpa_s);
1688 void wpas_rrm_process_neighbor_rep(struct wpa_supplicant *wpa_s,
1689 				   const u8 *report, size_t report_len);
1690 int wpas_rrm_send_neighbor_rep_request(struct wpa_supplicant *wpa_s,
1691 				       const struct wpa_ssid_value *ssid,
1692 				       int lci, int civic,
1693 				       void (*cb)(void *ctx,
1694 						  struct wpabuf *neighbor_rep),
1695 				       void *cb_ctx);
1696 void wpas_rrm_handle_radio_measurement_request(struct wpa_supplicant *wpa_s,
1697 					       const u8 *src, const u8 *dst,
1698 					       const u8 *frame, size_t len);
1699 void wpas_rrm_handle_link_measurement_request(struct wpa_supplicant *wpa_s,
1700 					      const u8 *src,
1701 					      const u8 *frame, size_t len,
1702 					      int rssi);
1703 void wpas_rrm_refuse_request(struct wpa_supplicant *wpa_s);
1704 int wpas_beacon_rep_scan_process(struct wpa_supplicant *wpa_s,
1705 				 struct wpa_scan_results *scan_res,
1706 				 struct scan_info *info);
1707 void wpas_clear_beacon_rep_data(struct wpa_supplicant *wpa_s);
1708 void wpas_flush_fils_hlp_req(struct wpa_supplicant *wpa_s);
1709 void wpas_clear_disabled_interface(void *eloop_ctx, void *timeout_ctx);
1710 void wpa_supplicant_reset_bgscan(struct wpa_supplicant *wpa_s);
1711 
1712 
1713 /* MBO functions */
1714 int wpas_mbo_ie(struct wpa_supplicant *wpa_s, u8 *buf, size_t len,
1715 		int add_oce_capa);
1716 const u8 * mbo_attr_from_mbo_ie(const u8 *mbo_ie, enum mbo_attr_id attr);
1717 const u8 * wpas_mbo_check_assoc_disallow(struct wpa_bss *bss);
1718 void wpas_mbo_check_pmf(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
1719 			struct wpa_ssid *ssid);
1720 const u8 * mbo_get_attr_from_ies(const u8 *ies, size_t ies_len,
1721 				 enum mbo_attr_id attr);
1722 int wpas_mbo_update_non_pref_chan(struct wpa_supplicant *wpa_s,
1723 				  const char *non_pref_chan);
1724 void wpas_mbo_scan_ie(struct wpa_supplicant *wpa_s, struct wpabuf *ie);
1725 void wpas_mbo_ie_trans_req(struct wpa_supplicant *wpa_s, const u8 *ie,
1726 			   size_t len);
1727 size_t wpas_mbo_ie_bss_trans_reject(struct wpa_supplicant *wpa_s, u8 *pos,
1728 				    size_t len,
1729 				    enum mbo_transition_reject_reason reason);
1730 void wpas_mbo_update_cell_capa(struct wpa_supplicant *wpa_s, u8 mbo_cell_capa);
1731 struct wpabuf * mbo_build_anqp_buf(struct wpa_supplicant *wpa_s,
1732 				   struct wpa_bss *bss, u32 mbo_subtypes);
1733 void mbo_parse_rx_anqp_resp(struct wpa_supplicant *wpa_s,
1734 			    struct wpa_bss *bss, const u8 *sa,
1735 			    const u8 *data, size_t slen);
1736 void wpas_update_mbo_connect_params(struct wpa_supplicant *wpa_s);
1737 
1738 /* op_classes.c */
1739 enum chan_allowed {
1740 	NOT_ALLOWED, NO_IR, RADAR, ALLOWED
1741 };
1742 
1743 enum chan_allowed verify_channel(struct hostapd_hw_modes *mode, u8 op_class,
1744 				 u8 channel, u8 bw);
1745 size_t wpas_supp_op_class_ie(struct wpa_supplicant *wpa_s,
1746 			     struct wpa_ssid *ssid,
1747 			     struct wpa_bss *bss, u8 *pos, size_t len);
1748 int * wpas_supp_op_classes(struct wpa_supplicant *wpa_s);
1749 
1750 int wpas_enable_mac_addr_randomization(struct wpa_supplicant *wpa_s,
1751 				       unsigned int type, const u8 *addr,
1752 				       const u8 *mask);
1753 int wpas_disable_mac_addr_randomization(struct wpa_supplicant *wpa_s,
1754 					unsigned int type);
1755 
1756 /**
1757  * wpa_supplicant_ctrl_iface_ctrl_rsp_handle - Handle a control response
1758  * @wpa_s: Pointer to wpa_supplicant data
1759  * @ssid: Pointer to the network block the reply is for
1760  * @field: field the response is a reply for
1761  * @value: value (ie, password, etc) for @field
1762  * Returns: 0 on success, non-zero on error
1763  *
1764  * Helper function to handle replies to control interface requests.
1765  */
1766 int wpa_supplicant_ctrl_iface_ctrl_rsp_handle(struct wpa_supplicant *wpa_s,
1767 					      struct wpa_ssid *ssid,
1768 					      const char *field,
1769 					      const char *value);
1770 /**
1771  * wpa_supplicant_ctrl_rsp_handle - Handle a control response
1772  * @wpa_s: Pointer to wpa_supplicant data
1773  * @ssid: Pointer to the network block the reply is for
1774  * @field: field the response is a reply for
1775  * @value: value (ie, password, etc) for @field
1776  * Returns: 0 on success, non-zero on error
1777  *
1778  * Helper function to handle replies to control interface requests.
1779  */
1780 int wpa_supplicant_ctrl_rsp_handle(struct wpa_supplicant *wpa_s,
1781 				   struct wpa_ssid *ssid,
1782 				   enum wpa_ctrl_req_type rtype,
1783 				   const char *value, int len);
1784 
1785 void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
1786 			  const struct wpa_ssid *ssid,
1787 			  struct hostapd_freq_params *freq);
1788 
1789 /* events.c */
1790 void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s);
1791 int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
1792 			   struct wpa_bss *selected,
1793 			   struct wpa_ssid *ssid);
1794 void wpa_supplicant_stop_countermeasures(void *eloop_ctx, void *sock_ctx);
1795 void wpa_supplicant_delayed_mic_error_report(void *eloop_ctx, void *sock_ctx);
1796 void wnm_bss_keep_alive_deinit(struct wpa_supplicant *wpa_s);
1797 int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s);
1798 struct wpa_bss * wpa_supplicant_pick_network(struct wpa_supplicant *wpa_s,
1799 					     struct wpa_ssid **selected_ssid);
1800 int wpas_temp_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
1801 void wpa_supplicant_update_channel_list(struct wpa_supplicant *wpa_s,
1802 					struct channel_list_changed *info);
1803 int wpa_supplicant_need_to_roam_within_ess(struct wpa_supplicant *wpa_s,
1804 					   struct wpa_bss *current_bss,
1805 					   struct wpa_bss *seleceted);
1806 
1807 /* eap_register.c */
1808 int eap_register_methods(void);
1809 
1810 /**
1811  * Utility method to tell if a given network is for persistent group storage
1812  * @ssid: Network object
1813  * Returns: 1 if network is a persistent group, 0 otherwise
1814  */
network_is_persistent_group(struct wpa_ssid * ssid)1815 static inline int network_is_persistent_group(struct wpa_ssid *ssid)
1816 {
1817 	return ssid->disabled == 2 && ssid->p2p_persistent_group;
1818 }
1819 
wpas_mode_to_ieee80211_mode(enum wpas_mode mode)1820 static inline int wpas_mode_to_ieee80211_mode(enum wpas_mode mode)
1821 {
1822 	switch (mode) {
1823 	default:
1824 	case WPAS_MODE_INFRA:
1825 		return IEEE80211_MODE_INFRA;
1826 	case WPAS_MODE_IBSS:
1827 		return IEEE80211_MODE_IBSS;
1828 	case WPAS_MODE_AP:
1829 	case WPAS_MODE_P2P_GO:
1830 	case WPAS_MODE_P2P_GROUP_FORMATION:
1831 		return IEEE80211_MODE_AP;
1832 	case WPAS_MODE_MESH:
1833 		return IEEE80211_MODE_MESH;
1834 	}
1835 }
1836 
1837 
1838 int wpas_network_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
1839 int wpas_get_ssid_pmf(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
1840 int pmf_in_use(struct wpa_supplicant *wpa_s, const u8 *addr);
1841 
1842 int wpas_init_ext_pw(struct wpa_supplicant *wpa_s);
1843 
1844 void dump_freq_data(struct wpa_supplicant *wpa_s, const char *title,
1845 		    struct wpa_used_freq_data *freqs_data,
1846 		    unsigned int len);
1847 
1848 int get_shared_radio_freqs_data(struct wpa_supplicant *wpa_s,
1849 				struct wpa_used_freq_data *freqs_data,
1850 				unsigned int len);
1851 int get_shared_radio_freqs(struct wpa_supplicant *wpa_s,
1852 			   int *freq_array, unsigned int len);
1853 
1854 void wpas_network_reenabled(void *eloop_ctx, void *timeout_ctx);
1855 
1856 void wpas_vendor_elem_update(struct wpa_supplicant *wpa_s);
1857 struct wpa_supplicant * wpas_vendor_elem(struct wpa_supplicant *wpa_s,
1858 					 enum wpa_vendor_elem_frame frame);
1859 int wpas_vendor_elem_remove(struct wpa_supplicant *wpa_s, int frame,
1860 			    const u8 *elem, size_t len);
1861 
1862 #ifdef CONFIG_FST
1863 
1864 struct fst_wpa_obj;
1865 
1866 void fst_wpa_supplicant_fill_iface_obj(struct wpa_supplicant *wpa_s,
1867 				       struct fst_wpa_obj *iface_obj);
1868 
1869 #endif /* CONFIG_FST */
1870 
1871 int wpas_sched_scan_plans_set(struct wpa_supplicant *wpa_s, const char *cmd);
1872 
1873 struct hostapd_hw_modes * get_mode(struct hostapd_hw_modes *modes,
1874 				   u16 num_modes, enum hostapd_hw_mode mode,
1875 				   bool is_6ghz);
1876 struct hostapd_hw_modes * get_mode_with_freq(struct hostapd_hw_modes *modes,
1877 					     u16 num_modes, int freq);
1878 
1879 void wpa_bss_tmp_disallow(struct wpa_supplicant *wpa_s, const u8 *bssid,
1880 			  unsigned int sec, int rssi_threshold);
1881 int wpa_is_bss_tmp_disallowed(struct wpa_supplicant *wpa_s,
1882 			      struct wpa_bss *bss);
1883 void free_bss_tmp_disallowed(struct wpa_supplicant *wpa_s);
1884 
1885 struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
1886 				     int i, struct wpa_bss *bss,
1887 				     struct wpa_ssid *group,
1888 				     int only_first_ssid, int debug_print);
1889 
1890 int wpas_ctrl_iface_get_pref_freq_list_override(struct wpa_supplicant *wpa_s,
1891 						enum wpa_driver_if_type if_type,
1892 						unsigned int *num,
1893 						unsigned int *freq_list);
1894 
1895 int wpa_is_fils_supported(struct wpa_supplicant *wpa_s);
1896 int wpa_is_fils_sk_pfs_supported(struct wpa_supplicant *wpa_s);
1897 
1898 void wpas_clear_driver_signal_override(struct wpa_supplicant *wpa_s);
1899 
1900 int wpas_send_mscs_req(struct wpa_supplicant *wpa_s);
1901 void wpas_populate_mscs_descriptor_ie(struct robust_av_data *robust_av,
1902 				      struct wpabuf *buf);
1903 void wpas_handle_robust_av_recv_action(struct wpa_supplicant *wpa_s,
1904 				       const u8 *src, const u8 *buf,
1905 				       size_t len);
1906 void wpas_handle_assoc_resp_mscs(struct wpa_supplicant *wpa_s, const u8 *bssid,
1907 				 const u8 *ies, size_t ies_len);
1908 int wpas_send_scs_req(struct wpa_supplicant *wpa_s);
1909 void free_up_tclas_elem(struct scs_desc_elem *elem);
1910 void free_up_scs_desc(struct scs_robust_av_data *data);
1911 void wpas_handle_robust_av_scs_recv_action(struct wpa_supplicant *wpa_s,
1912 					   const u8 *src, const u8 *buf,
1913 					   size_t len);
1914 void wpas_scs_deinit(struct wpa_supplicant *wpa_s);
1915 void wpas_handle_qos_mgmt_recv_action(struct wpa_supplicant *wpa_s,
1916 				      const u8 *src,
1917 				      const u8 *buf, size_t len);
1918 void wpas_dscp_deinit(struct wpa_supplicant *wpa_s);
1919 int wpas_send_dscp_response(struct wpa_supplicant *wpa_s,
1920 			    struct dscp_resp_data *resp_data);
1921 void wpas_handle_assoc_resp_qos_mgmt(struct wpa_supplicant *wpa_s,
1922 				     const u8 *ies, size_t ies_len);
1923 int wpas_send_dscp_query(struct wpa_supplicant *wpa_s, const char *domain_name,
1924 			 size_t domain_name_length);
1925 
1926 int wpas_pasn_auth_start(struct wpa_supplicant *wpa_s,
1927 			 const u8 *bssid, int akmp, int cipher,
1928 			 u16 group, int network_id,
1929 			 const u8 *comeback, size_t comeback_len);
1930 void wpas_pasn_auth_stop(struct wpa_supplicant *wpa_s);
1931 int wpas_pasn_auth_tx_status(struct wpa_supplicant *wpa_s,
1932 			     const u8 *data, size_t data_len, u8 acked);
1933 int wpas_pasn_auth_rx(struct wpa_supplicant *wpa_s,
1934 		      const struct ieee80211_mgmt *mgmt, size_t len);
1935 int disabled_freq(struct wpa_supplicant *wpa_s, int freq);
1936 
1937 int wpas_pasn_deauthenticate(struct wpa_supplicant *wpa_s, const u8 *bssid);
1938 
1939 #endif /* WPA_SUPPLICANT_I_H */
1940