wpa_supplicant_i.h 19 KB

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