Coverage Report

Created: 2025-10-28 06:59

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