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