Coverage Report

Created: 2025-10-10 06:31

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