]> git.ipfire.org Git - thirdparty/hostap.git/blame - wpa_supplicant/wpa_supplicant_i.h
GAS: Add a generic GAS query module
[thirdparty/hostap.git] / wpa_supplicant / wpa_supplicant_i.h
CommitLineData
6fc6879b
JM
1/*
2 * wpa_supplicant - Internal definitions
207ef3fb 3 * Copyright (c) 2003-2010, Jouni Malinen <j@w1.fi>
6fc6879b
JM
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
83922c2d 18#include "utils/list.h"
2d5b792d 19#include "common/defs.h"
c2762e41 20#include "config_ssid.h"
6fc6879b 21
7e5ba1b9
JM
22extern const char *wpa_supplicant_version;
23extern const char *wpa_supplicant_license;
24#ifndef CONFIG_NO_STDOUT_DEBUG
25extern const char *wpa_supplicant_full_license1;
26extern const char *wpa_supplicant_full_license2;
27extern const char *wpa_supplicant_full_license3;
28extern const char *wpa_supplicant_full_license4;
29extern const char *wpa_supplicant_full_license5;
30#endif /* CONFIG_NO_STDOUT_DEBUG */
31
6fc6879b
JM
32struct wpa_sm;
33struct wpa_supplicant;
11ef8d35 34struct ibss_rsn;
8d923a4a 35struct scan_info;
6fa81a3b 36struct wpa_bss;
64e58f51 37struct wpa_scan_results;
0ae2aa14 38struct hostapd_hw_modes;
6fc6879b
JM
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 */
45struct ctrl_iface_priv;
46struct ctrl_iface_global_priv;
8ddef94b 47struct wpas_dbus_priv;
6fc6879b
JM
48
49/**
50 * struct wpa_interface - Parameters for wpa_supplicant_add_iface()
51 */
52struct 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 */
108struct 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;
daa70d49
SL
162
163 /**
164 * wpa_debug_syslog - Enable log output through syslog
165 */
166 int wpa_debug_syslog;
d27df100
JM
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;
38e24575
JM
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;
6fc6879b
JM
193};
194
b22128ef
JM
195struct p2p_srv_bonjour {
196 struct dl_list list;
197 struct wpabuf *query;
198 struct wpabuf *resp;
199};
200
201struct p2p_srv_upnp {
202 struct dl_list list;
203 u8 version;
204 char *service;
205};
206
6fc6879b
JM
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 */
213struct wpa_global {
214 struct wpa_supplicant *ifaces;
215 struct wpa_params params;
216 struct ctrl_iface_global_priv *ctrl_iface;
8ddef94b 217 struct wpas_dbus_priv *dbus;
ac305589
JM
218 void **drv_priv;
219 size_t drv_count;
207ef3fb 220 struct os_time suspend_time;
b22128ef
JM
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;
72044390 227 int cross_connection;
6fc6879b
JM
228};
229
230
231struct 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;
71934751 247 enum wpa_key_mgmt key_mgmt;
6fc6879b
JM
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
abd9fafa
JM
268 unsigned int auth_algs; /* bitfield of allowed auth algs
269 * (WPA_AUTH_ALG_*) */
6fc6879b
JM
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;
d009a9da 291 int *scan_freqs;
6fc6879b
JM
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
71934751 300 enum hostapd_hw_mode phymode; /* current mode */
6caf9ca6 301 struct hostapd_hw_modes *modes;
6fc6879b
JM
302 size_t num_modes;
303 unsigned int hw_modes; /* bitfield of allowed hardware modes;
6caf9ca6 304 * (1 << HOSTAPD_MODE_*) */
6fc6879b 305 int num_curr_rates;
fb7842aa 306 int *curr_rates;
6fc6879b
JM
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
c706d5aa
JM
316 void (*public_action_cb)(void *ctx, const u8 *buf, size_t len,
317 int freq);
318 void *public_action_cb_ctx;
319
6fc6879b
JM
320#else /* CONFIG_CLIENT_MLME */
321 int dummy; /* to keep MSVC happy */
322#endif /* CONFIG_CLIENT_MLME */
323};
324
325/**
326 * struct wpa_supplicant - Internal data for wpa_supplicant interface
327 *
328 * This structure contains the internal data for core wpa_supplicant code. This
329 * should be only used directly from the core code. However, a pointer to this
330 * data is used from other files as an arbitrary context pointer in calls to
331 * core functions.
332 */
333struct wpa_supplicant {
334 struct wpa_global *global;
b22128ef 335 struct wpa_supplicant *parent;
6fc6879b
JM
336 struct wpa_supplicant *next;
337 struct l2_packet_data *l2;
338 struct l2_packet_data *l2_br;
339 unsigned char own_addr[ETH_ALEN];
340 char ifname[100];
341#ifdef CONFIG_CTRL_IFACE_DBUS
342 char *dbus_path;
343#endif /* CONFIG_CTRL_IFACE_DBUS */
8fc2fb56
WS
344#ifdef CONFIG_CTRL_IFACE_DBUS_NEW
345 char *dbus_new_path;
9abafccc 346 char *dbus_groupobj_path;
8fc2fb56 347#endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
6fc6879b
JM
348 char bridge_ifname[16];
349
350 char *confname;
351 struct wpa_config *conf;
352 int countermeasures;
353 os_time_t last_michael_mic_error;
354 u8 bssid[ETH_ALEN];
355 u8 pending_bssid[ETH_ALEN]; /* If wpa_state == WPA_ASSOCIATING, this
356 * field contains the targer BSSID. */
357 int reassociate; /* reassociation requested */
358 int disconnected; /* all connections disabled; i.e., do no reassociate
359 * before this has been cleared */
360 struct wpa_ssid *current_ssid;
8f770587 361 struct wpa_bss *current_bss;
6fc6879b 362 int ap_ies_from_associnfo;
4832ecd7 363 unsigned int assoc_freq;
6fc6879b
JM
364
365 /* Selected configuration (based on Beacon/ProbeResp WPA IE) */
366 int pairwise_cipher;
367 int group_cipher;
368 int key_mgmt;
64fa840a 369 int wpa_proto;
6fc6879b
JM
370 int mgmt_group_cipher;
371
372 void *drv_priv; /* private data used by driver_ops */
8a5ab9f5 373 void *global_drv_priv;
6fc6879b
JM
374
375 struct wpa_ssid *prev_scan_ssid; /* previously scanned SSID;
376 * NULL = not yet initialized (start
ba2a573c
JM
377 * with wildcard SSID)
378 * WILDCARD_SSID_SCAN = wildcard
6fc6879b
JM
379 * SSID was used in the previous scan
380 */
ba2a573c 381#define WILDCARD_SSID_SCAN ((struct wpa_ssid *) 1)
6fc6879b 382
64e58f51
JM
383 void (*scan_res_handler)(struct wpa_supplicant *wpa_s,
384 struct wpa_scan_results *scan_res);
83922c2d 385 struct dl_list bss; /* struct wpa_bss::list */
d4bf8f13 386 struct dl_list bss_id; /* struct wpa_bss::list_id */
83922c2d
JM
387 size_t num_bss;
388 unsigned int bss_update_idx;
389 unsigned int bss_next_id;
6fc6879b
JM
390
391 struct wpa_driver_ops *driver;
392 int interface_removed; /* whether the network interface has been
393 * removed */
394 struct wpa_sm *wpa;
395 struct eapol_sm *eapol;
396
397 struct ctrl_iface_priv *ctrl_iface;
398
71934751 399 enum wpa_states wpa_state;
cb8564b1 400 int scanning;
6fc6879b
JM
401 int new_connection;
402 int reassociated_connection;
403
404 int eapol_received; /* number of EAPOL packets received after the
405 * previous association event */
406
407 struct scard_data *scard;
408
409 unsigned char last_eapol_src[ETH_ALEN];
410
411 int keys_cleared;
412
413 struct wpa_blacklist *blacklist;
414
415 int scan_req; /* manual scan request; this forces a scan even if there
416 * are no enabled networks in the configuration */
a6099152 417 int scan_runs; /* number of scan runs since WPS was started */
f47d639d 418 int *next_scan_freqs;
67b9bd08 419 int scan_interval; /* time in sec between scans to find suitable AP */
6fc6879b
JM
420
421 struct wpa_client_mlme mlme;
c2a04078 422 unsigned int drv_flags;
80bc75f1 423 int max_scan_ssids;
814782b9 424 unsigned int max_remain_on_chan;
c4ea4c5c 425 unsigned int max_stations;
46690a3b
JM
426
427 int pending_mic_error_report;
428 int pending_mic_error_pairwise;
429 int mic_errors_seen; /* Michael MIC errors with the current PTK */
116654ce
JM
430
431 struct wps_context *wps;
a6099152 432 int wps_success; /* WPS success event received */
e9bcfebf 433 struct wps_er *wps_er;
a6099152 434 int blacklist_cleared;
11ef8d35 435
1ff73338
JM
436 struct wpabuf *pending_eapol_rx;
437 struct os_time pending_eapol_rx_time;
438 u8 pending_eapol_rx_src[ETH_ALEN];
439
11ef8d35 440 struct ibss_rsn *ibss_rsn;
c2a04078 441
eea2fd9e
JM
442 int set_sta_uapsd;
443 int sta_uapsd;
444 int set_ap_uapsd;
445 int ap_uapsd;
446
c2a04078
JM
447#ifdef CONFIG_SME
448 struct {
449 u8 ssid[32];
450 size_t ssid_len;
451 int freq;
b22128ef 452 u8 assoc_req_ie[200];
c2a04078
JM
453 size_t assoc_req_ie_len;
454 int mfp;
455 int ft_used;
456 u8 mobility_domain[2];
457 u8 *ft_ies;
458 size_t ft_ies_len;
62fa124c
JM
459 u8 prev_bssid[ETH_ALEN];
460 int prev_bssid_set;
62c72d72 461 int auth_alg;
64fa840a 462 int proto;
7d878ca7
JM
463
464 int sa_query_count; /* number of pending SA Query requests;
465 * 0 = no SA Query in progress */
466 int sa_query_timed_out;
467 u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN *
468 * sa_query_count octets of pending
469 * SA Query transaction identifiers */
470 struct os_time sa_query_start;
c2a04078
JM
471 } sme;
472#endif /* CONFIG_SME */
2d5b792d
JM
473
474#ifdef CONFIG_AP
475 struct hostapd_iface *ap_iface;
4b768ed0
JM
476 void (*ap_configured_cb)(void *ctx, void *data);
477 void *ap_configured_cb_ctx;
478 void *ap_configured_cb_data;
2d5b792d 479#endif /* CONFIG_AP */
60b94c98 480
b22128ef
JM
481#ifdef CONFIG_P2P
482 struct p2p_go_neg_results *go_params;
483 int create_p2p_iface;
484 u8 pending_interface_addr[ETH_ALEN];
0f85ef5c 485 char pending_interface_name[100];
b22128ef
JM
486 int pending_interface_type;
487 int p2p_group_idx;
488 unsigned int off_channel_freq;
489 struct wpabuf *pending_action_tx;
490 u8 pending_action_src[ETH_ALEN];
491 u8 pending_action_dst[ETH_ALEN];
492 u8 pending_action_bssid[ETH_ALEN];
493 unsigned int pending_action_freq;
494 int pending_action_without_roc;
495 unsigned int pending_listen_freq;
496 unsigned int pending_listen_duration;
497 enum {
498 NOT_P2P_GROUP_INTERFACE,
499 P2P_GROUP_INTERFACE_PENDING,
500 P2P_GROUP_INTERFACE_GO,
501 P2P_GROUP_INTERFACE_CLIENT
502 } p2p_group_interface;
503 struct p2p_group *p2p_group;
11fb02be 504 int p2p_long_listen; /* remaining time in long Listen state in ms */
b22128ef 505 char p2p_pin[10];
3c5126a4 506 int p2p_wps_method;
108def93 507 u8 p2p_auth_invite[ETH_ALEN];
b22128ef
JM
508 int p2p_sd_over_ctrl_iface;
509 int p2p_in_provisioning;
510 int pending_invite_ssid_id;
511 int show_group_started;
512 u8 go_dev_addr[ETH_ALEN];
513 int pending_pd_before_join;
514 u8 pending_join_iface_addr[ETH_ALEN];
515 u8 pending_join_dev_addr[ETH_ALEN];
516 int pending_join_wps_method;
9b1ab931 517 int p2p_join_scan_count;
07a30a66 518 unsigned int roc_waiting_drv_freq;
190b9062 519 int action_tx_wait_time;
6e6963ea 520 int force_long_sd;
72044390
JM
521
522 /*
523 * Whether cross connection is disallowed by the AP to which this
524 * interface is associated (only valid if there is an association).
525 */
526 int cross_connect_disallowed;
527
528 /*
529 * Whether this P2P group is configured to use cross connection (only
530 * valid if this is P2P GO interface). The actual cross connect packet
531 * forwarding may not be configured depending on the uplink status.
532 */
533 int cross_connect_enabled;
534
535 /* Whether cross connection forwarding is in use at the moment. */
536 int cross_connect_in_use;
537
538 /*
539 * Uplink interface name for cross connection
540 */
541 char cross_connect_uplink[100];
3071e181
JM
542
543 enum {
544 P2P_GROUP_REMOVAL_UNKNOWN,
545 P2P_GROUP_REMOVAL_REQUESTED,
c973f386
JM
546 P2P_GROUP_REMOVAL_IDLE_TIMEOUT,
547 P2P_GROUP_REMOVAL_UNAVAILABLE
3071e181 548 } removal_reason;
b22128ef
JM
549#endif /* CONFIG_P2P */
550
60b94c98
JM
551 struct wpa_ssid *bgscan_ssid;
552 const struct bgscan_ops *bgscan;
553 void *bgscan_priv;
17a4734d 554
7dcdcfd6 555 struct wpa_ssid *connect_without_scan;
8cd82735 556
17a4734d
JM
557 int after_wps;
558 unsigned int wps_freq;
42f50264 559 int wps_fragment_size;
0d0a8ca1 560 int auto_reconnect_disabled;
7cfc4ac3
AGS
561
562 /* Channel preferences for AP/P2P GO use */
563 int best_24_freq;
564 int best_5_freq;
565 int best_overall_freq;
04ea7b79
JM
566
567 struct gas_query *gas;
6fc6879b
JM
568};
569
570
571/* wpa_supplicant.c */
0194fedb
JB
572int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
573
6fc6879b
JM
574int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s);
575
71934751 576const char * wpa_supplicant_state_txt(enum wpa_states state);
6fc6879b
JM
577int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s);
578int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
6fa81a3b 579 struct wpa_bss *bss, struct wpa_ssid *ssid,
6fc6879b
JM
580 u8 *wpa_ie, size_t *wpa_ie_len);
581void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
6fa81a3b 582 struct wpa_bss *bss,
6fc6879b
JM
583 struct wpa_ssid *ssid);
584void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s,
585 struct wpa_ssid *ssid);
586void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s);
6fc6879b
JM
587void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr);
588void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
589 int sec, int usec);
71934751
JM
590void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
591 enum wpa_states state);
6fc6879b 592struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s);
cf83fb0b 593const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s);
6fc6879b
JM
594void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
595void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
596 int reason_code);
597void wpa_supplicant_disassociate(struct wpa_supplicant *wpa_s,
598 int reason_code);
599
86b89452
WS
600void wpa_supplicant_enable_network(struct wpa_supplicant *wpa_s,
601 struct wpa_ssid *ssid);
602void wpa_supplicant_disable_network(struct wpa_supplicant *wpa_s,
603 struct wpa_ssid *ssid);
604void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s,
605 struct wpa_ssid *ssid);
606int wpa_supplicant_set_ap_scan(struct wpa_supplicant *wpa_s,
607 int ap_scan);
78633c37
SL
608int wpa_supplicant_set_bss_expiration_age(struct wpa_supplicant *wpa_s,
609 unsigned int expire_age);
610int wpa_supplicant_set_bss_expiration_count(struct wpa_supplicant *wpa_s,
611 unsigned int expire_count);
86b89452
WS
612int wpa_supplicant_set_debug_params(struct wpa_global *global,
613 int debug_level, int debug_timestamp,
614 int debug_show_keys);
615
6fc6879b
JM
616void wpa_show_license(void);
617
618struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
619 struct wpa_interface *iface);
620int wpa_supplicant_remove_iface(struct wpa_global *global,
621 struct wpa_supplicant *wpa_s);
622struct wpa_supplicant * wpa_supplicant_get_iface(struct wpa_global *global,
623 const char *ifname);
624struct wpa_global * wpa_supplicant_init(struct wpa_params *params);
625int wpa_supplicant_run(struct wpa_global *global);
626void wpa_supplicant_deinit(struct wpa_global *global);
627
628int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
629 struct wpa_ssid *ssid);
1a1bf008 630void wpa_supplicant_terminate_proc(struct wpa_global *global);
a8e0505b
JM
631void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
632 const u8 *buf, size_t len);
508545f3
JM
633enum wpa_key_mgmt key_mgmt2driver(int key_mgmt);
634enum wpa_cipher cipher_suite2driver(int cipher);
611aea7d 635void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s);
b22128ef 636void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s);
2f9c6aa6
JM
637void ieee80211_sta_free_hw_features(struct hostapd_hw_modes *hw_features,
638 size_t num_hw_features);
0fb337c1 639void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid);
22628eca 640int wpas_driver_bss_selection(struct wpa_supplicant *wpa_s);
6fc6879b 641
6fc6879b
JM
642/* events.c */
643void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s);
86d4f806
JM
644void wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
645 struct wpa_bss *selected,
646 struct wpa_ssid *ssid);
6fc6879b 647
12760815
JM
648/* eap_register.c */
649int eap_register_methods(void);
650
c2762e41
JS
651/**
652 * Utility method to tell if a given network is a persistent group
653 * @ssid: Network object
654 * Returns: 1 if network is a persistent group, 0 otherwise
655 */
656static inline int network_is_persistent_group(struct wpa_ssid *ssid)
657{
658 return ((ssid->disabled == 2) || ssid->p2p_persistent_group);
659}
660
6fc6879b 661#endif /* WPA_SUPPLICANT_I_H */