]>
Commit | Line | Data |
---|---|---|
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 |
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 | ||
6fc6879b JM |
32 | struct wpa_sm; |
33 | struct wpa_supplicant; | |
11ef8d35 | 34 | struct ibss_rsn; |
8d923a4a | 35 | struct scan_info; |
6fa81a3b | 36 | struct wpa_bss; |
64e58f51 | 37 | struct wpa_scan_results; |
0ae2aa14 | 38 | struct 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 | */ | |
45 | struct ctrl_iface_priv; | |
46 | struct ctrl_iface_global_priv; | |
8ddef94b | 47 | struct wpas_dbus_priv; |
6fc6879b JM |
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; | |
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 |
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 | ||
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 | */ | |
213 | struct 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 | ||
24f6497c JM |
231 | enum offchannel_send_action_result { |
232 | OFFCHANNEL_SEND_ACTION_SUCCESS /* Frame was send and acknowledged */, | |
233 | OFFCHANNEL_SEND_ACTION_NO_ACK /* Frame was sent, but not acknowledged | |
234 | */, | |
235 | OFFCHANNEL_SEND_ACTION_FAILED /* Frame was not sent due to a failure */ | |
236 | }; | |
237 | ||
6fc6879b JM |
238 | /** |
239 | * struct wpa_supplicant - Internal data for wpa_supplicant interface | |
240 | * | |
241 | * This structure contains the internal data for core wpa_supplicant code. This | |
242 | * should be only used directly from the core code. However, a pointer to this | |
243 | * data is used from other files as an arbitrary context pointer in calls to | |
244 | * core functions. | |
245 | */ | |
246 | struct wpa_supplicant { | |
247 | struct wpa_global *global; | |
b22128ef | 248 | struct wpa_supplicant *parent; |
6fc6879b JM |
249 | struct wpa_supplicant *next; |
250 | struct l2_packet_data *l2; | |
251 | struct l2_packet_data *l2_br; | |
252 | unsigned char own_addr[ETH_ALEN]; | |
253 | char ifname[100]; | |
254 | #ifdef CONFIG_CTRL_IFACE_DBUS | |
255 | char *dbus_path; | |
256 | #endif /* CONFIG_CTRL_IFACE_DBUS */ | |
8fc2fb56 WS |
257 | #ifdef CONFIG_CTRL_IFACE_DBUS_NEW |
258 | char *dbus_new_path; | |
9abafccc | 259 | char *dbus_groupobj_path; |
8fc2fb56 | 260 | #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ |
6fc6879b JM |
261 | char bridge_ifname[16]; |
262 | ||
263 | char *confname; | |
264 | struct wpa_config *conf; | |
265 | int countermeasures; | |
266 | os_time_t last_michael_mic_error; | |
267 | u8 bssid[ETH_ALEN]; | |
268 | u8 pending_bssid[ETH_ALEN]; /* If wpa_state == WPA_ASSOCIATING, this | |
a4cef162 | 269 | * field contains the target BSSID. */ |
6fc6879b JM |
270 | int reassociate; /* reassociation requested */ |
271 | int disconnected; /* all connections disabled; i.e., do no reassociate | |
272 | * before this has been cleared */ | |
273 | struct wpa_ssid *current_ssid; | |
8f770587 | 274 | struct wpa_bss *current_bss; |
6fc6879b | 275 | int ap_ies_from_associnfo; |
4832ecd7 | 276 | unsigned int assoc_freq; |
6fc6879b JM |
277 | |
278 | /* Selected configuration (based on Beacon/ProbeResp WPA IE) */ | |
279 | int pairwise_cipher; | |
280 | int group_cipher; | |
281 | int key_mgmt; | |
64fa840a | 282 | int wpa_proto; |
6fc6879b JM |
283 | int mgmt_group_cipher; |
284 | ||
285 | void *drv_priv; /* private data used by driver_ops */ | |
8a5ab9f5 | 286 | void *global_drv_priv; |
6fc6879b JM |
287 | |
288 | struct wpa_ssid *prev_scan_ssid; /* previously scanned SSID; | |
289 | * NULL = not yet initialized (start | |
ba2a573c JM |
290 | * with wildcard SSID) |
291 | * WILDCARD_SSID_SCAN = wildcard | |
6fc6879b JM |
292 | * SSID was used in the previous scan |
293 | */ | |
ba2a573c | 294 | #define WILDCARD_SSID_SCAN ((struct wpa_ssid *) 1) |
6fc6879b | 295 | |
cbdf3507 LC |
296 | struct wpa_ssid *prev_sched_ssid; /* last SSID used in sched scan */ |
297 | int sched_scan_timeout; | |
298 | int sched_scan_interval; | |
299 | int first_sched_scan; | |
300 | int sched_scan_timed_out; | |
301 | ||
64e58f51 JM |
302 | void (*scan_res_handler)(struct wpa_supplicant *wpa_s, |
303 | struct wpa_scan_results *scan_res); | |
83922c2d | 304 | struct dl_list bss; /* struct wpa_bss::list */ |
d4bf8f13 | 305 | struct dl_list bss_id; /* struct wpa_bss::list_id */ |
83922c2d JM |
306 | size_t num_bss; |
307 | unsigned int bss_update_idx; | |
308 | unsigned int bss_next_id; | |
6fc6879b JM |
309 | |
310 | struct wpa_driver_ops *driver; | |
311 | int interface_removed; /* whether the network interface has been | |
312 | * removed */ | |
313 | struct wpa_sm *wpa; | |
314 | struct eapol_sm *eapol; | |
315 | ||
316 | struct ctrl_iface_priv *ctrl_iface; | |
317 | ||
71934751 | 318 | enum wpa_states wpa_state; |
cb8564b1 | 319 | int scanning; |
cbdf3507 | 320 | int sched_scanning; |
6fc6879b JM |
321 | int new_connection; |
322 | int reassociated_connection; | |
323 | ||
324 | int eapol_received; /* number of EAPOL packets received after the | |
325 | * previous association event */ | |
326 | ||
327 | struct scard_data *scard; | |
328 | ||
329 | unsigned char last_eapol_src[ETH_ALEN]; | |
330 | ||
331 | int keys_cleared; | |
332 | ||
333 | struct wpa_blacklist *blacklist; | |
334 | ||
335 | int scan_req; /* manual scan request; this forces a scan even if there | |
336 | * are no enabled networks in the configuration */ | |
a6099152 | 337 | int scan_runs; /* number of scan runs since WPS was started */ |
f47d639d | 338 | int *next_scan_freqs; |
67b9bd08 | 339 | int scan_interval; /* time in sec between scans to find suitable AP */ |
0b7a25c0 | 340 | int normal_scans; /* normal scans run before sched_scan */ |
6fc6879b | 341 | |
c2a04078 | 342 | unsigned int drv_flags; |
4f73d88a AN |
343 | |
344 | /* | |
345 | * A bitmap of supported protocols for probe response offload. See | |
346 | * struct wpa_driver_capa in driver.h | |
347 | */ | |
348 | unsigned int probe_resp_offloads; | |
349 | ||
80bc75f1 | 350 | int max_scan_ssids; |
cbdf3507 LC |
351 | int max_sched_scan_ssids; |
352 | int sched_scan_supported; | |
b59e6f26 | 353 | unsigned int max_match_sets; |
814782b9 | 354 | unsigned int max_remain_on_chan; |
c4ea4c5c | 355 | unsigned int max_stations; |
46690a3b JM |
356 | |
357 | int pending_mic_error_report; | |
358 | int pending_mic_error_pairwise; | |
359 | int mic_errors_seen; /* Michael MIC errors with the current PTK */ | |
116654ce JM |
360 | |
361 | struct wps_context *wps; | |
a6099152 | 362 | int wps_success; /* WPS success event received */ |
e9bcfebf | 363 | struct wps_er *wps_er; |
a6099152 | 364 | int blacklist_cleared; |
11ef8d35 | 365 | |
1ff73338 JM |
366 | struct wpabuf *pending_eapol_rx; |
367 | struct os_time pending_eapol_rx_time; | |
368 | u8 pending_eapol_rx_src[ETH_ALEN]; | |
369 | ||
11ef8d35 | 370 | struct ibss_rsn *ibss_rsn; |
c2a04078 | 371 | |
eea2fd9e JM |
372 | int set_sta_uapsd; |
373 | int sta_uapsd; | |
374 | int set_ap_uapsd; | |
375 | int ap_uapsd; | |
376 | ||
c2a04078 JM |
377 | #ifdef CONFIG_SME |
378 | struct { | |
379 | u8 ssid[32]; | |
380 | size_t ssid_len; | |
381 | int freq; | |
b22128ef | 382 | u8 assoc_req_ie[200]; |
c2a04078 JM |
383 | size_t assoc_req_ie_len; |
384 | int mfp; | |
385 | int ft_used; | |
386 | u8 mobility_domain[2]; | |
387 | u8 *ft_ies; | |
388 | size_t ft_ies_len; | |
62fa124c JM |
389 | u8 prev_bssid[ETH_ALEN]; |
390 | int prev_bssid_set; | |
62c72d72 | 391 | int auth_alg; |
64fa840a | 392 | int proto; |
7d878ca7 JM |
393 | |
394 | int sa_query_count; /* number of pending SA Query requests; | |
395 | * 0 = no SA Query in progress */ | |
396 | int sa_query_timed_out; | |
397 | u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN * | |
398 | * sa_query_count octets of pending | |
399 | * SA Query transaction identifiers */ | |
400 | struct os_time sa_query_start; | |
c2a04078 JM |
401 | } sme; |
402 | #endif /* CONFIG_SME */ | |
2d5b792d JM |
403 | |
404 | #ifdef CONFIG_AP | |
405 | struct hostapd_iface *ap_iface; | |
4b768ed0 JM |
406 | void (*ap_configured_cb)(void *ctx, void *data); |
407 | void *ap_configured_cb_ctx; | |
408 | void *ap_configured_cb_data; | |
2d5b792d | 409 | #endif /* CONFIG_AP */ |
60b94c98 | 410 | |
b22128ef JM |
411 | unsigned int off_channel_freq; |
412 | struct wpabuf *pending_action_tx; | |
413 | u8 pending_action_src[ETH_ALEN]; | |
414 | u8 pending_action_dst[ETH_ALEN]; | |
415 | u8 pending_action_bssid[ETH_ALEN]; | |
416 | unsigned int pending_action_freq; | |
b106173a | 417 | int pending_action_no_cck; |
b22128ef | 418 | int pending_action_without_roc; |
24f6497c JM |
419 | void (*pending_action_tx_status_cb)(struct wpa_supplicant *wpa_s, |
420 | unsigned int freq, const u8 *dst, | |
421 | const u8 *src, const u8 *bssid, | |
422 | const u8 *data, size_t data_len, | |
423 | enum offchannel_send_action_result | |
424 | result); | |
425 | unsigned int roc_waiting_drv_freq; | |
426 | int action_tx_wait_time; | |
427 | ||
428 | #ifdef CONFIG_P2P | |
429 | struct p2p_go_neg_results *go_params; | |
430 | int create_p2p_iface; | |
431 | u8 pending_interface_addr[ETH_ALEN]; | |
432 | char pending_interface_name[100]; | |
433 | int pending_interface_type; | |
434 | int p2p_group_idx; | |
b22128ef JM |
435 | unsigned int pending_listen_freq; |
436 | unsigned int pending_listen_duration; | |
437 | enum { | |
438 | NOT_P2P_GROUP_INTERFACE, | |
439 | P2P_GROUP_INTERFACE_PENDING, | |
440 | P2P_GROUP_INTERFACE_GO, | |
441 | P2P_GROUP_INTERFACE_CLIENT | |
442 | } p2p_group_interface; | |
443 | struct p2p_group *p2p_group; | |
11fb02be | 444 | int p2p_long_listen; /* remaining time in long Listen state in ms */ |
b22128ef | 445 | char p2p_pin[10]; |
3c5126a4 | 446 | int p2p_wps_method; |
108def93 | 447 | u8 p2p_auth_invite[ETH_ALEN]; |
b22128ef JM |
448 | int p2p_sd_over_ctrl_iface; |
449 | int p2p_in_provisioning; | |
450 | int pending_invite_ssid_id; | |
451 | int show_group_started; | |
452 | u8 go_dev_addr[ETH_ALEN]; | |
453 | int pending_pd_before_join; | |
454 | u8 pending_join_iface_addr[ETH_ALEN]; | |
455 | u8 pending_join_dev_addr[ETH_ALEN]; | |
456 | int pending_join_wps_method; | |
9b1ab931 | 457 | int p2p_join_scan_count; |
6e6963ea | 458 | int force_long_sd; |
72044390 JM |
459 | |
460 | /* | |
461 | * Whether cross connection is disallowed by the AP to which this | |
462 | * interface is associated (only valid if there is an association). | |
463 | */ | |
464 | int cross_connect_disallowed; | |
465 | ||
466 | /* | |
467 | * Whether this P2P group is configured to use cross connection (only | |
468 | * valid if this is P2P GO interface). The actual cross connect packet | |
469 | * forwarding may not be configured depending on the uplink status. | |
470 | */ | |
471 | int cross_connect_enabled; | |
472 | ||
473 | /* Whether cross connection forwarding is in use at the moment. */ | |
474 | int cross_connect_in_use; | |
475 | ||
476 | /* | |
477 | * Uplink interface name for cross connection | |
478 | */ | |
479 | char cross_connect_uplink[100]; | |
3071e181 JM |
480 | |
481 | enum { | |
482 | P2P_GROUP_REMOVAL_UNKNOWN, | |
483 | P2P_GROUP_REMOVAL_REQUESTED, | |
c973f386 JM |
484 | P2P_GROUP_REMOVAL_IDLE_TIMEOUT, |
485 | P2P_GROUP_REMOVAL_UNAVAILABLE | |
3071e181 | 486 | } removal_reason; |
39185dfa JM |
487 | |
488 | unsigned int p2p_cb_on_scan_complete:1; | |
b22128ef JM |
489 | #endif /* CONFIG_P2P */ |
490 | ||
60b94c98 JM |
491 | struct wpa_ssid *bgscan_ssid; |
492 | const struct bgscan_ops *bgscan; | |
493 | void *bgscan_priv; | |
17a4734d | 494 | |
7dcdcfd6 | 495 | struct wpa_ssid *connect_without_scan; |
8cd82735 | 496 | |
17a4734d JM |
497 | int after_wps; |
498 | unsigned int wps_freq; | |
42f50264 | 499 | int wps_fragment_size; |
0d0a8ca1 | 500 | int auto_reconnect_disabled; |
7cfc4ac3 AGS |
501 | |
502 | /* Channel preferences for AP/P2P GO use */ | |
503 | int best_24_freq; | |
504 | int best_5_freq; | |
505 | int best_overall_freq; | |
04ea7b79 JM |
506 | |
507 | struct gas_query *gas; | |
afc064fe JM |
508 | |
509 | #ifdef CONFIG_INTERWORKING | |
7a25f29d JM |
510 | unsigned int fetch_anqp_in_progress:1; |
511 | unsigned int network_select:1; | |
512 | unsigned int auto_select:1; | |
afc064fe | 513 | #endif /* CONFIG_INTERWORKING */ |
c58ab8f2 | 514 | unsigned int drv_capa_known; |
6bf731e8 CL |
515 | |
516 | struct { | |
517 | struct hostapd_hw_modes *modes; | |
518 | u16 num_modes; | |
519 | u16 flags; | |
520 | } hw; | |
b5c68312 JM |
521 | |
522 | int pno; | |
6fc6879b JM |
523 | }; |
524 | ||
525 | ||
526 | /* wpa_supplicant.c */ | |
0194fedb JB |
527 | int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid); |
528 | ||
6fc6879b JM |
529 | int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s); |
530 | ||
71934751 | 531 | const char * wpa_supplicant_state_txt(enum wpa_states state); |
bfba8deb | 532 | int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s); |
6fc6879b JM |
533 | int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s); |
534 | int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s, | |
6fa81a3b | 535 | struct wpa_bss *bss, struct wpa_ssid *ssid, |
6fc6879b JM |
536 | u8 *wpa_ie, size_t *wpa_ie_len); |
537 | void wpa_supplicant_associate(struct wpa_supplicant *wpa_s, | |
6fa81a3b | 538 | struct wpa_bss *bss, |
6fc6879b JM |
539 | struct wpa_ssid *ssid); |
540 | void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s, | |
541 | struct wpa_ssid *ssid); | |
542 | void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s); | |
6fc6879b JM |
543 | void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr); |
544 | void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s, | |
545 | int sec, int usec); | |
71934751 JM |
546 | void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, |
547 | enum wpa_states state); | |
6fc6879b | 548 | struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s); |
cf83fb0b | 549 | const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s); |
6fc6879b JM |
550 | void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s); |
551 | void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s, | |
552 | int reason_code); | |
553 | void wpa_supplicant_disassociate(struct wpa_supplicant *wpa_s, | |
554 | int reason_code); | |
555 | ||
86b89452 WS |
556 | void wpa_supplicant_enable_network(struct wpa_supplicant *wpa_s, |
557 | struct wpa_ssid *ssid); | |
558 | void wpa_supplicant_disable_network(struct wpa_supplicant *wpa_s, | |
559 | struct wpa_ssid *ssid); | |
560 | void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s, | |
561 | struct wpa_ssid *ssid); | |
562 | int wpa_supplicant_set_ap_scan(struct wpa_supplicant *wpa_s, | |
563 | int ap_scan); | |
78633c37 SL |
564 | int wpa_supplicant_set_bss_expiration_age(struct wpa_supplicant *wpa_s, |
565 | unsigned int expire_age); | |
566 | int wpa_supplicant_set_bss_expiration_count(struct wpa_supplicant *wpa_s, | |
567 | unsigned int expire_count); | |
86b89452 WS |
568 | int wpa_supplicant_set_debug_params(struct wpa_global *global, |
569 | int debug_level, int debug_timestamp, | |
570 | int debug_show_keys); | |
571 | ||
6fc6879b JM |
572 | void wpa_show_license(void); |
573 | ||
574 | struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global, | |
575 | struct wpa_interface *iface); | |
576 | int wpa_supplicant_remove_iface(struct wpa_global *global, | |
577 | struct wpa_supplicant *wpa_s); | |
578 | struct wpa_supplicant * wpa_supplicant_get_iface(struct wpa_global *global, | |
579 | const char *ifname); | |
580 | struct wpa_global * wpa_supplicant_init(struct wpa_params *params); | |
581 | int wpa_supplicant_run(struct wpa_global *global); | |
582 | void wpa_supplicant_deinit(struct wpa_global *global); | |
583 | ||
584 | int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s, | |
585 | struct wpa_ssid *ssid); | |
1a1bf008 | 586 | void wpa_supplicant_terminate_proc(struct wpa_global *global); |
a8e0505b JM |
587 | void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr, |
588 | const u8 *buf, size_t len); | |
508545f3 JM |
589 | enum wpa_key_mgmt key_mgmt2driver(int key_mgmt); |
590 | enum wpa_cipher cipher_suite2driver(int cipher); | |
611aea7d | 591 | void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s); |
b22128ef | 592 | void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s); |
0fb337c1 | 593 | void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid); |
22628eca | 594 | int wpas_driver_bss_selection(struct wpa_supplicant *wpa_s); |
6fc6879b | 595 | |
6fc6879b JM |
596 | /* events.c */ |
597 | void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s); | |
5cbd88d9 JJ |
598 | int wpa_supplicant_connect(struct wpa_supplicant *wpa_s, |
599 | struct wpa_bss *selected, | |
600 | struct wpa_ssid *ssid); | |
01a17491 JM |
601 | void wpa_supplicant_stop_countermeasures(void *eloop_ctx, void *sock_ctx); |
602 | void wpa_supplicant_delayed_mic_error_report(void *eloop_ctx, void *sock_ctx); | |
6fc6879b | 603 | |
12760815 JM |
604 | /* eap_register.c */ |
605 | int eap_register_methods(void); | |
606 | ||
c2762e41 JS |
607 | /** |
608 | * Utility method to tell if a given network is a persistent group | |
609 | * @ssid: Network object | |
610 | * Returns: 1 if network is a persistent group, 0 otherwise | |
611 | */ | |
612 | static inline int network_is_persistent_group(struct wpa_ssid *ssid) | |
613 | { | |
614 | return ((ssid->disabled == 2) || ssid->p2p_persistent_group); | |
615 | } | |
616 | ||
6fc6879b | 617 | #endif /* WPA_SUPPLICANT_I_H */ |