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