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