Coverage Report

Created: 2026-11-30 06:09

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