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