Interworking: Add ANQP query requests
[mech_eap.git] / wpa_supplicant / wpa_supplicant_i.h
1 /*
2  * wpa_supplicant - Internal definitions
3  * Copyright (c) 2003-2010, Jouni Malinen <j@w1.fi>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  *
9  * Alternatively, this software may be distributed under the terms of BSD
10  * license.
11  *
12  * See README and COPYING for more details.
13  */
14
15 #ifndef WPA_SUPPLICANT_I_H
16 #define WPA_SUPPLICANT_I_H
17
18 #include "utils/list.h"
19 #include "common/defs.h"
20 #include "config_ssid.h"
21
22 extern const char *wpa_supplicant_version;
23 extern const char *wpa_supplicant_license;
24 #ifndef CONFIG_NO_STDOUT_DEBUG
25 extern const char *wpa_supplicant_full_license1;
26 extern const char *wpa_supplicant_full_license2;
27 extern const char *wpa_supplicant_full_license3;
28 extern const char *wpa_supplicant_full_license4;
29 extern const char *wpa_supplicant_full_license5;
30 #endif /* CONFIG_NO_STDOUT_DEBUG */
31
32 struct wpa_sm;
33 struct wpa_supplicant;
34 struct ibss_rsn;
35 struct scan_info;
36 struct wpa_bss;
37 struct wpa_scan_results;
38 struct hostapd_hw_modes;
39
40 /*
41  * Forward declarations of private structures used within the ctrl_iface
42  * backends. Other parts of wpa_supplicant do not have access to data stored in
43  * these structures.
44  */
45 struct ctrl_iface_priv;
46 struct ctrl_iface_global_priv;
47 struct wpas_dbus_priv;
48
49 /**
50  * struct wpa_interface - Parameters for wpa_supplicant_add_iface()
51  */
52 struct wpa_interface {
53         /**
54          * confname - Configuration name (file or profile) name
55          *
56          * This can also be %NULL when a configuration file is not used. In
57          * that case, ctrl_interface must be set to allow the interface to be
58          * configured.
59          */
60         const char *confname;
61
62         /**
63          * ctrl_interface - Control interface parameter
64          *
65          * If a configuration file is not used, this variable can be used to
66          * set the ctrl_interface parameter that would have otherwise been read
67          * from the configuration file. If both confname and ctrl_interface are
68          * set, ctrl_interface is used to override the value from configuration
69          * file.
70          */
71         const char *ctrl_interface;
72
73         /**
74          * driver - Driver interface name, or %NULL to use the default driver
75          */
76         const char *driver;
77
78         /**
79          * driver_param - Driver interface parameters
80          *
81          * If a configuration file is not used, this variable can be used to
82          * set the driver_param parameters that would have otherwise been read
83          * from the configuration file. If both confname and driver_param are
84          * set, driver_param is used to override the value from configuration
85          * file.
86          */
87         const char *driver_param;
88
89         /**
90          * ifname - Interface name
91          */
92         const char *ifname;
93
94         /**
95          * bridge_ifname - Optional bridge interface name
96          *
97          * If the driver interface (ifname) is included in a Linux bridge
98          * device, the bridge interface may need to be used for receiving EAPOL
99          * frames. This can be enabled by setting this variable to enable
100          * receiving of EAPOL frames from an additional interface.
101          */
102         const char *bridge_ifname;
103 };
104
105 /**
106  * struct wpa_params - Parameters for wpa_supplicant_init()
107  */
108 struct wpa_params {
109         /**
110          * daemonize - Run %wpa_supplicant in the background
111          */
112         int daemonize;
113
114         /**
115          * wait_for_monitor - Wait for a monitor program before starting
116          */
117         int wait_for_monitor;
118
119         /**
120          * pid_file - Path to a PID (process ID) file
121          *
122          * If this and daemonize are set, process ID of the background process
123          * will be written to the specified file.
124          */
125         char *pid_file;
126
127         /**
128          * wpa_debug_level - Debugging verbosity level (e.g., MSG_INFO)
129          */
130         int wpa_debug_level;
131
132         /**
133          * wpa_debug_show_keys - Whether keying material is included in debug
134          *
135          * This parameter can be used to allow keying material to be included
136          * in debug messages. This is a security risk and this option should
137          * not be enabled in normal configuration. If needed during
138          * development or while troubleshooting, this option can provide more
139          * details for figuring out what is happening.
140          */
141         int wpa_debug_show_keys;
142
143         /**
144          * wpa_debug_timestamp - Whether to include timestamp in debug messages
145          */
146         int wpa_debug_timestamp;
147
148         /**
149          * ctrl_interface - Global ctrl_iface path/parameter
150          */
151         char *ctrl_interface;
152
153         /**
154          * dbus_ctrl_interface - Enable the DBus control interface
155          */
156         int dbus_ctrl_interface;
157
158         /**
159          * wpa_debug_file_path - Path of debug file or %NULL to use stdout
160          */
161         const char *wpa_debug_file_path;
162
163         /**
164          * wpa_debug_syslog - Enable log output through syslog
165          */
166         int wpa_debug_syslog;
167
168         /**
169          * override_driver - Optional driver parameter override
170          *
171          * This parameter can be used to override the driver parameter in
172          * dynamic interface addition to force a specific driver wrapper to be
173          * used instead.
174          */
175         char *override_driver;
176
177         /**
178          * override_ctrl_interface - Optional ctrl_interface override
179          *
180          * This parameter can be used to override the ctrl_interface parameter
181          * in dynamic interface addition to force a control interface to be
182          * created.
183          */
184         char *override_ctrl_interface;
185
186         /**
187          * entropy_file - Optional entropy file
188          *
189          * This parameter can be used to configure wpa_supplicant to maintain
190          * its internal entropy store over restarts.
191          */
192         char *entropy_file;
193 };
194
195 struct p2p_srv_bonjour {
196         struct dl_list list;
197         struct wpabuf *query;
198         struct wpabuf *resp;
199 };
200
201 struct p2p_srv_upnp {
202         struct dl_list list;
203         u8 version;
204         char *service;
205 };
206
207 /**
208  * struct wpa_global - Internal, global data for all %wpa_supplicant interfaces
209  *
210  * This structure is initialized by calling wpa_supplicant_init() when starting
211  * %wpa_supplicant.
212  */
213 struct wpa_global {
214         struct wpa_supplicant *ifaces;
215         struct wpa_params params;
216         struct ctrl_iface_global_priv *ctrl_iface;
217         struct wpas_dbus_priv *dbus;
218         void **drv_priv;
219         size_t drv_count;
220         struct os_time suspend_time;
221         struct p2p_data *p2p;
222         struct wpa_supplicant *p2p_group_formation;
223         u8 p2p_dev_addr[ETH_ALEN];
224         struct dl_list p2p_srv_bonjour; /* struct p2p_srv_bonjour */
225         struct dl_list p2p_srv_upnp; /* struct p2p_srv_upnp */
226         int p2p_disabled;
227         int cross_connection;
228 };
229
230
231 struct wpa_client_mlme {
232 #ifdef CONFIG_CLIENT_MLME
233         enum {
234                 IEEE80211_DISABLED, IEEE80211_AUTHENTICATE,
235                 IEEE80211_ASSOCIATE, IEEE80211_ASSOCIATED,
236                 IEEE80211_IBSS_SEARCH, IEEE80211_IBSS_JOINED
237         } state;
238         u8 prev_bssid[ETH_ALEN];
239         u8 ssid[32];
240         size_t ssid_len;
241         u16 aid;
242         u16 ap_capab, capab;
243         u8 *extra_ie; /* to be added to the end of AssocReq */
244         size_t extra_ie_len;
245         u8 *extra_probe_ie; /* to be added to the end of ProbeReq */
246         size_t extra_probe_ie_len;
247         enum wpa_key_mgmt key_mgmt;
248
249         /* The last AssocReq/Resp IEs */
250         u8 *assocreq_ies, *assocresp_ies;
251         size_t assocreq_ies_len, assocresp_ies_len;
252
253         int auth_tries, assoc_tries;
254
255         unsigned int ssid_set:1;
256         unsigned int bssid_set:1;
257         unsigned int prev_bssid_set:1;
258         unsigned int authenticated:1;
259         unsigned int associated:1;
260         unsigned int probereq_poll:1;
261         unsigned int use_protection:1;
262         unsigned int create_ibss:1;
263         unsigned int mixed_cell:1;
264         unsigned int wmm_enabled:1;
265
266         struct os_time last_probe;
267
268         unsigned int auth_algs; /* bitfield of allowed auth algs
269                                  * (WPA_AUTH_ALG_*) */
270         int auth_alg; /* currently used IEEE 802.11 authentication algorithm */
271         int auth_transaction;
272
273         struct os_time ibss_join_req;
274         u8 *probe_resp; /* ProbeResp template for IBSS */
275         size_t probe_resp_len;
276         u32 supp_rates_bits;
277
278         int wmm_last_param_set;
279
280         int sta_scanning;
281         int scan_hw_mode_idx;
282         int scan_channel_idx;
283         enum { SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state;
284         struct os_time last_scan_completed;
285         int scan_oper_channel;
286         int scan_oper_freq;
287         int scan_oper_phymode;
288         u8 scan_ssid[32];
289         size_t scan_ssid_len;
290         int scan_skip_11b;
291         int *scan_freqs;
292
293         struct ieee80211_sta_bss *sta_bss_list;
294 #define STA_HASH_SIZE 256
295 #define STA_HASH(sta) (sta[5])
296         struct ieee80211_sta_bss *sta_bss_hash[STA_HASH_SIZE];
297
298         int cts_protect_erp_frames;
299
300         enum hostapd_hw_mode phymode; /* current mode */
301         struct hostapd_hw_modes *modes;
302         size_t num_modes;
303         unsigned int hw_modes; /* bitfield of allowed hardware modes;
304                                 * (1 << HOSTAPD_MODE_*) */
305         int num_curr_rates;
306         int *curr_rates;
307         int freq; /* The current frequency in MHz */
308         int channel; /* The current IEEE 802.11 channel number */
309
310 #ifdef CONFIG_IEEE80211R
311         u8 current_md[6];
312         u8 *ft_ies;
313         size_t ft_ies_len;
314 #endif /* CONFIG_IEEE80211R */
315
316         void (*public_action_cb)(void *ctx, const u8 *buf, size_t len,
317                                  int freq);
318         void *public_action_cb_ctx;
319
320 #else /* CONFIG_CLIENT_MLME */
321         int dummy; /* to keep MSVC happy */
322 #endif /* CONFIG_CLIENT_MLME */
323 };
324
325 enum offchannel_send_action_result {
326         OFFCHANNEL_SEND_ACTION_SUCCESS /* Frame was send and acknowledged */,
327         OFFCHANNEL_SEND_ACTION_NO_ACK /* Frame was sent, but not acknowledged
328                                        */,
329         OFFCHANNEL_SEND_ACTION_FAILED /* Frame was not sent due to a failure */
330 };
331
332 /**
333  * struct wpa_supplicant - Internal data for wpa_supplicant interface
334  *
335  * This structure contains the internal data for core wpa_supplicant code. This
336  * should be only used directly from the core code. However, a pointer to this
337  * data is used from other files as an arbitrary context pointer in calls to
338  * core functions.
339  */
340 struct wpa_supplicant {
341         struct wpa_global *global;
342         struct wpa_supplicant *parent;
343         struct wpa_supplicant *next;
344         struct l2_packet_data *l2;
345         struct l2_packet_data *l2_br;
346         unsigned char own_addr[ETH_ALEN];
347         char ifname[100];
348 #ifdef CONFIG_CTRL_IFACE_DBUS
349         char *dbus_path;
350 #endif /* CONFIG_CTRL_IFACE_DBUS */
351 #ifdef CONFIG_CTRL_IFACE_DBUS_NEW
352         char *dbus_new_path;
353         char *dbus_groupobj_path;
354 #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
355         char bridge_ifname[16];
356
357         char *confname;
358         struct wpa_config *conf;
359         int countermeasures;
360         os_time_t last_michael_mic_error;
361         u8 bssid[ETH_ALEN];
362         u8 pending_bssid[ETH_ALEN]; /* If wpa_state == WPA_ASSOCIATING, this
363                                      * field contains the targer BSSID. */
364         int reassociate; /* reassociation requested */
365         int disconnected; /* all connections disabled; i.e., do no reassociate
366                            * before this has been cleared */
367         struct wpa_ssid *current_ssid;
368         struct wpa_bss *current_bss;
369         int ap_ies_from_associnfo;
370         unsigned int assoc_freq;
371
372         /* Selected configuration (based on Beacon/ProbeResp WPA IE) */
373         int pairwise_cipher;
374         int group_cipher;
375         int key_mgmt;
376         int wpa_proto;
377         int mgmt_group_cipher;
378
379         void *drv_priv; /* private data used by driver_ops */
380         void *global_drv_priv;
381
382         struct wpa_ssid *prev_scan_ssid; /* previously scanned SSID;
383                                           * NULL = not yet initialized (start
384                                           * with wildcard SSID)
385                                           * WILDCARD_SSID_SCAN = wildcard
386                                           * SSID was used in the previous scan
387                                           */
388 #define WILDCARD_SSID_SCAN ((struct wpa_ssid *) 1)
389
390         struct wpa_ssid *prev_sched_ssid; /* last SSID used in sched scan */
391         int sched_scan_timeout;
392         int sched_scan_interval;
393         int first_sched_scan;
394         int sched_scan_timed_out;
395
396         void (*scan_res_handler)(struct wpa_supplicant *wpa_s,
397                                  struct wpa_scan_results *scan_res);
398         struct dl_list bss; /* struct wpa_bss::list */
399         struct dl_list bss_id; /* struct wpa_bss::list_id */
400         size_t num_bss;
401         unsigned int bss_update_idx;
402         unsigned int bss_next_id;
403
404         struct wpa_driver_ops *driver;
405         int interface_removed; /* whether the network interface has been
406                                 * removed */
407         struct wpa_sm *wpa;
408         struct eapol_sm *eapol;
409
410         struct ctrl_iface_priv *ctrl_iface;
411
412         enum wpa_states wpa_state;
413         int scanning;
414         int sched_scanning;
415         int new_connection;
416         int reassociated_connection;
417
418         int eapol_received; /* number of EAPOL packets received after the
419                              * previous association event */
420
421         struct scard_data *scard;
422
423         unsigned char last_eapol_src[ETH_ALEN];
424
425         int keys_cleared;
426
427         struct wpa_blacklist *blacklist;
428
429         int scan_req; /* manual scan request; this forces a scan even if there
430                        * are no enabled networks in the configuration */
431         int scan_runs; /* number of scan runs since WPS was started */
432         int *next_scan_freqs;
433         int scan_interval; /* time in sec between scans to find suitable AP */
434
435         struct wpa_client_mlme mlme;
436         unsigned int drv_flags;
437         int max_scan_ssids;
438         int max_sched_scan_ssids;
439         int sched_scan_supported;
440         unsigned int max_match_sets;
441         unsigned int max_remain_on_chan;
442         unsigned int max_stations;
443
444         int pending_mic_error_report;
445         int pending_mic_error_pairwise;
446         int mic_errors_seen; /* Michael MIC errors with the current PTK */
447
448         struct wps_context *wps;
449         int wps_success; /* WPS success event received */
450         struct wps_er *wps_er;
451         int blacklist_cleared;
452
453         struct wpabuf *pending_eapol_rx;
454         struct os_time pending_eapol_rx_time;
455         u8 pending_eapol_rx_src[ETH_ALEN];
456
457         struct ibss_rsn *ibss_rsn;
458
459         int set_sta_uapsd;
460         int sta_uapsd;
461         int set_ap_uapsd;
462         int ap_uapsd;
463
464 #ifdef CONFIG_SME
465         struct {
466                 u8 ssid[32];
467                 size_t ssid_len;
468                 int freq;
469                 u8 assoc_req_ie[200];
470                 size_t assoc_req_ie_len;
471                 int mfp;
472                 int ft_used;
473                 u8 mobility_domain[2];
474                 u8 *ft_ies;
475                 size_t ft_ies_len;
476                 u8 prev_bssid[ETH_ALEN];
477                 int prev_bssid_set;
478                 int auth_alg;
479                 int proto;
480
481                 int sa_query_count; /* number of pending SA Query requests;
482                                      * 0 = no SA Query in progress */
483                 int sa_query_timed_out;
484                 u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN *
485                                         * sa_query_count octets of pending
486                                         * SA Query transaction identifiers */
487                 struct os_time sa_query_start;
488         } sme;
489 #endif /* CONFIG_SME */
490
491 #ifdef CONFIG_AP
492         struct hostapd_iface *ap_iface;
493         void (*ap_configured_cb)(void *ctx, void *data);
494         void *ap_configured_cb_ctx;
495         void *ap_configured_cb_data;
496 #endif /* CONFIG_AP */
497
498         unsigned int off_channel_freq;
499         struct wpabuf *pending_action_tx;
500         u8 pending_action_src[ETH_ALEN];
501         u8 pending_action_dst[ETH_ALEN];
502         u8 pending_action_bssid[ETH_ALEN];
503         unsigned int pending_action_freq;
504         int pending_action_without_roc;
505         void (*pending_action_tx_status_cb)(struct wpa_supplicant *wpa_s,
506                                             unsigned int freq, const u8 *dst,
507                                             const u8 *src, const u8 *bssid,
508                                             const u8 *data, size_t data_len,
509                                             enum offchannel_send_action_result
510                                             result);
511         unsigned int roc_waiting_drv_freq;
512         int action_tx_wait_time;
513
514 #ifdef CONFIG_P2P
515         struct p2p_go_neg_results *go_params;
516         int create_p2p_iface;
517         u8 pending_interface_addr[ETH_ALEN];
518         char pending_interface_name[100];
519         int pending_interface_type;
520         int p2p_group_idx;
521         unsigned int pending_listen_freq;
522         unsigned int pending_listen_duration;
523         enum {
524                 NOT_P2P_GROUP_INTERFACE,
525                 P2P_GROUP_INTERFACE_PENDING,
526                 P2P_GROUP_INTERFACE_GO,
527                 P2P_GROUP_INTERFACE_CLIENT
528         } p2p_group_interface;
529         struct p2p_group *p2p_group;
530         int p2p_long_listen; /* remaining time in long Listen state in ms */
531         char p2p_pin[10];
532         int p2p_wps_method;
533         u8 p2p_auth_invite[ETH_ALEN];
534         int p2p_sd_over_ctrl_iface;
535         int p2p_in_provisioning;
536         int pending_invite_ssid_id;
537         int show_group_started;
538         u8 go_dev_addr[ETH_ALEN];
539         int pending_pd_before_join;
540         u8 pending_join_iface_addr[ETH_ALEN];
541         u8 pending_join_dev_addr[ETH_ALEN];
542         int pending_join_wps_method;
543         int p2p_join_scan_count;
544         int force_long_sd;
545
546         /*
547          * Whether cross connection is disallowed by the AP to which this
548          * interface is associated (only valid if there is an association).
549          */
550         int cross_connect_disallowed;
551
552         /*
553          * Whether this P2P group is configured to use cross connection (only
554          * valid if this is P2P GO interface). The actual cross connect packet
555          * forwarding may not be configured depending on the uplink status.
556          */
557         int cross_connect_enabled;
558
559         /* Whether cross connection forwarding is in use at the moment. */
560         int cross_connect_in_use;
561
562         /*
563          * Uplink interface name for cross connection
564          */
565         char cross_connect_uplink[100];
566
567         enum {
568                 P2P_GROUP_REMOVAL_UNKNOWN,
569                 P2P_GROUP_REMOVAL_REQUESTED,
570                 P2P_GROUP_REMOVAL_IDLE_TIMEOUT,
571                 P2P_GROUP_REMOVAL_UNAVAILABLE
572         } removal_reason;
573 #endif /* CONFIG_P2P */
574
575         struct wpa_ssid *bgscan_ssid;
576         const struct bgscan_ops *bgscan;
577         void *bgscan_priv;
578
579         struct wpa_ssid *connect_without_scan;
580
581         int after_wps;
582         unsigned int wps_freq;
583         int wps_fragment_size;
584         int auto_reconnect_disabled;
585
586          /* Channel preferences for AP/P2P GO use */
587         int best_24_freq;
588         int best_5_freq;
589         int best_overall_freq;
590
591         struct gas_query *gas;
592
593 #ifdef CONFIG_INTERWORKING
594         int fetch_anqp_in_progress;
595 #endif /* CONFIG_INTERWORKING */
596 };
597
598
599 /* wpa_supplicant.c */
600 int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
601
602 int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s);
603
604 const char * wpa_supplicant_state_txt(enum wpa_states state);
605 int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s);
606 int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
607                               struct wpa_bss *bss, struct wpa_ssid *ssid,
608                               u8 *wpa_ie, size_t *wpa_ie_len);
609 void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
610                               struct wpa_bss *bss,
611                               struct wpa_ssid *ssid);
612 void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s,
613                                        struct wpa_ssid *ssid);
614 void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s);
615 void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr);
616 void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
617                                      int sec, int usec);
618 void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
619                               enum wpa_states state);
620 struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s);
621 const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s);
622 void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
623 void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
624                                    int reason_code);
625 void wpa_supplicant_disassociate(struct wpa_supplicant *wpa_s,
626                                  int reason_code);
627
628 void wpa_supplicant_enable_network(struct wpa_supplicant *wpa_s,
629                                    struct wpa_ssid *ssid);
630 void wpa_supplicant_disable_network(struct wpa_supplicant *wpa_s,
631                                     struct wpa_ssid *ssid);
632 void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s,
633                                    struct wpa_ssid *ssid);
634 int wpa_supplicant_set_ap_scan(struct wpa_supplicant *wpa_s,
635                                int ap_scan);
636 int wpa_supplicant_set_bss_expiration_age(struct wpa_supplicant *wpa_s,
637                                           unsigned int expire_age);
638 int wpa_supplicant_set_bss_expiration_count(struct wpa_supplicant *wpa_s,
639                                             unsigned int expire_count);
640 int wpa_supplicant_set_debug_params(struct wpa_global *global,
641                                     int debug_level, int debug_timestamp,
642                                     int debug_show_keys);
643
644 void wpa_show_license(void);
645
646 struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
647                                                  struct wpa_interface *iface);
648 int wpa_supplicant_remove_iface(struct wpa_global *global,
649                                 struct wpa_supplicant *wpa_s);
650 struct wpa_supplicant * wpa_supplicant_get_iface(struct wpa_global *global,
651                                                  const char *ifname);
652 struct wpa_global * wpa_supplicant_init(struct wpa_params *params);
653 int wpa_supplicant_run(struct wpa_global *global);
654 void wpa_supplicant_deinit(struct wpa_global *global);
655
656 int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
657                               struct wpa_ssid *ssid);
658 void wpa_supplicant_terminate_proc(struct wpa_global *global);
659 void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
660                              const u8 *buf, size_t len);
661 enum wpa_key_mgmt key_mgmt2driver(int key_mgmt);
662 enum wpa_cipher cipher_suite2driver(int cipher);
663 void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s);
664 void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s);
665 void ieee80211_sta_free_hw_features(struct hostapd_hw_modes *hw_features,
666                                     size_t num_hw_features);
667 void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid);
668 int wpas_driver_bss_selection(struct wpa_supplicant *wpa_s);
669
670 /* events.c */
671 void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s);
672 void wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
673                             struct wpa_bss *selected,
674                             struct wpa_ssid *ssid);
675
676 /* eap_register.c */
677 int eap_register_methods(void);
678
679 /**
680  * Utility method to tell if a given network is a persistent group
681  * @ssid: Network object
682  * Returns: 1 if network is a persistent group, 0 otherwise
683  */
684 static inline int network_is_persistent_group(struct wpa_ssid *ssid)
685 {
686         return ((ssid->disabled == 2) || ssid->p2p_persistent_group);
687 }
688
689 #endif /* WPA_SUPPLICANT_I_H */