wpa_supplicant_i.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685
  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. enum offchannel_send_action_result {
  282. OFFCHANNEL_SEND_ACTION_SUCCESS /* Frame was send and acknowledged */,
  283. OFFCHANNEL_SEND_ACTION_NO_ACK /* Frame was sent, but not acknowledged
  284. */,
  285. OFFCHANNEL_SEND_ACTION_FAILED /* Frame was not sent due to a failure */
  286. };
  287. /**
  288. * struct wpa_supplicant - Internal data for wpa_supplicant interface
  289. *
  290. * This structure contains the internal data for core wpa_supplicant code. This
  291. * should be only used directly from the core code. However, a pointer to this
  292. * data is used from other files as an arbitrary context pointer in calls to
  293. * core functions.
  294. */
  295. struct wpa_supplicant {
  296. struct wpa_global *global;
  297. struct wpa_supplicant *parent;
  298. struct wpa_supplicant *next;
  299. struct l2_packet_data *l2;
  300. struct l2_packet_data *l2_br;
  301. unsigned char own_addr[ETH_ALEN];
  302. char ifname[100];
  303. #ifdef CONFIG_CTRL_IFACE_DBUS
  304. char *dbus_path;
  305. #endif /* CONFIG_CTRL_IFACE_DBUS */
  306. #ifdef CONFIG_CTRL_IFACE_DBUS_NEW
  307. char *dbus_new_path;
  308. char *dbus_groupobj_path;
  309. #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
  310. char bridge_ifname[16];
  311. char *confname;
  312. struct wpa_config *conf;
  313. int countermeasures;
  314. os_time_t last_michael_mic_error;
  315. u8 bssid[ETH_ALEN];
  316. u8 pending_bssid[ETH_ALEN]; /* If wpa_state == WPA_ASSOCIATING, this
  317. * field contains the targer BSSID. */
  318. int reassociate; /* reassociation requested */
  319. int disconnected; /* all connections disabled; i.e., do no reassociate
  320. * before this has been cleared */
  321. struct wpa_ssid *current_ssid;
  322. struct wpa_bss *current_bss;
  323. int ap_ies_from_associnfo;
  324. unsigned int assoc_freq;
  325. /* Selected configuration (based on Beacon/ProbeResp WPA IE) */
  326. int pairwise_cipher;
  327. int group_cipher;
  328. int key_mgmt;
  329. int wpa_proto;
  330. int mgmt_group_cipher;
  331. void *drv_priv; /* private data used by driver_ops */
  332. void *global_drv_priv;
  333. struct wpa_ssid *prev_scan_ssid; /* previously scanned SSID;
  334. * NULL = not yet initialized (start
  335. * with wildcard SSID)
  336. * WILDCARD_SSID_SCAN = wildcard
  337. * SSID was used in the previous scan
  338. */
  339. #define WILDCARD_SSID_SCAN ((struct wpa_ssid *) 1)
  340. struct wpa_ssid *prev_sched_ssid; /* last SSID used in sched scan */
  341. int sched_scan_timeout;
  342. int sched_scan_interval;
  343. int first_sched_scan;
  344. int sched_scan_timed_out;
  345. void (*scan_res_handler)(struct wpa_supplicant *wpa_s,
  346. struct wpa_scan_results *scan_res);
  347. struct dl_list bss; /* struct wpa_bss::list */
  348. struct dl_list bss_id; /* struct wpa_bss::list_id */
  349. size_t num_bss;
  350. unsigned int bss_update_idx;
  351. unsigned int bss_next_id;
  352. struct wpa_driver_ops *driver;
  353. int interface_removed; /* whether the network interface has been
  354. * removed */
  355. struct wpa_sm *wpa;
  356. struct eapol_sm *eapol;
  357. struct ctrl_iface_priv *ctrl_iface;
  358. enum wpa_states wpa_state;
  359. int scanning;
  360. int sched_scanning;
  361. int new_connection;
  362. int reassociated_connection;
  363. int eapol_received; /* number of EAPOL packets received after the
  364. * previous association event */
  365. struct scard_data *scard;
  366. unsigned char last_eapol_src[ETH_ALEN];
  367. int keys_cleared;
  368. struct wpa_blacklist *blacklist;
  369. int scan_req; /* manual scan request; this forces a scan even if there
  370. * are no enabled networks in the configuration */
  371. int scan_runs; /* number of scan runs since WPS was started */
  372. int *next_scan_freqs;
  373. int scan_interval; /* time in sec between scans to find suitable AP */
  374. struct wpa_client_mlme mlme;
  375. unsigned int drv_flags;
  376. int max_scan_ssids;
  377. int max_sched_scan_ssids;
  378. int sched_scan_supported;
  379. unsigned int max_match_sets;
  380. unsigned int max_remain_on_chan;
  381. unsigned int max_stations;
  382. int pending_mic_error_report;
  383. int pending_mic_error_pairwise;
  384. int mic_errors_seen; /* Michael MIC errors with the current PTK */
  385. struct wps_context *wps;
  386. int wps_success; /* WPS success event received */
  387. struct wps_er *wps_er;
  388. int blacklist_cleared;
  389. struct wpabuf *pending_eapol_rx;
  390. struct os_time pending_eapol_rx_time;
  391. u8 pending_eapol_rx_src[ETH_ALEN];
  392. struct ibss_rsn *ibss_rsn;
  393. int set_sta_uapsd;
  394. int sta_uapsd;
  395. int set_ap_uapsd;
  396. int ap_uapsd;
  397. #ifdef CONFIG_SME
  398. struct {
  399. u8 ssid[32];
  400. size_t ssid_len;
  401. int freq;
  402. u8 assoc_req_ie[200];
  403. size_t assoc_req_ie_len;
  404. int mfp;
  405. int ft_used;
  406. u8 mobility_domain[2];
  407. u8 *ft_ies;
  408. size_t ft_ies_len;
  409. u8 prev_bssid[ETH_ALEN];
  410. int prev_bssid_set;
  411. int auth_alg;
  412. int proto;
  413. int sa_query_count; /* number of pending SA Query requests;
  414. * 0 = no SA Query in progress */
  415. int sa_query_timed_out;
  416. u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN *
  417. * sa_query_count octets of pending
  418. * SA Query transaction identifiers */
  419. struct os_time sa_query_start;
  420. } sme;
  421. #endif /* CONFIG_SME */
  422. #ifdef CONFIG_AP
  423. struct hostapd_iface *ap_iface;
  424. void (*ap_configured_cb)(void *ctx, void *data);
  425. void *ap_configured_cb_ctx;
  426. void *ap_configured_cb_data;
  427. #endif /* CONFIG_AP */
  428. unsigned int off_channel_freq;
  429. struct wpabuf *pending_action_tx;
  430. u8 pending_action_src[ETH_ALEN];
  431. u8 pending_action_dst[ETH_ALEN];
  432. u8 pending_action_bssid[ETH_ALEN];
  433. unsigned int pending_action_freq;
  434. int pending_action_without_roc;
  435. void (*pending_action_tx_status_cb)(struct wpa_supplicant *wpa_s,
  436. unsigned int freq, const u8 *dst,
  437. const u8 *src, const u8 *bssid,
  438. const u8 *data, size_t data_len,
  439. enum offchannel_send_action_result
  440. result);
  441. unsigned int roc_waiting_drv_freq;
  442. int action_tx_wait_time;
  443. #ifdef CONFIG_P2P
  444. struct p2p_go_neg_results *go_params;
  445. int create_p2p_iface;
  446. u8 pending_interface_addr[ETH_ALEN];
  447. char pending_interface_name[100];
  448. int pending_interface_type;
  449. int p2p_group_idx;
  450. unsigned int pending_listen_freq;
  451. unsigned int pending_listen_duration;
  452. enum {
  453. NOT_P2P_GROUP_INTERFACE,
  454. P2P_GROUP_INTERFACE_PENDING,
  455. P2P_GROUP_INTERFACE_GO,
  456. P2P_GROUP_INTERFACE_CLIENT
  457. } p2p_group_interface;
  458. struct p2p_group *p2p_group;
  459. int p2p_long_listen; /* remaining time in long Listen state in ms */
  460. char p2p_pin[10];
  461. int p2p_wps_method;
  462. u8 p2p_auth_invite[ETH_ALEN];
  463. int p2p_sd_over_ctrl_iface;
  464. int p2p_in_provisioning;
  465. int pending_invite_ssid_id;
  466. int show_group_started;
  467. u8 go_dev_addr[ETH_ALEN];
  468. int pending_pd_before_join;
  469. u8 pending_join_iface_addr[ETH_ALEN];
  470. u8 pending_join_dev_addr[ETH_ALEN];
  471. int pending_join_wps_method;
  472. int p2p_join_scan_count;
  473. int force_long_sd;
  474. /*
  475. * Whether cross connection is disallowed by the AP to which this
  476. * interface is associated (only valid if there is an association).
  477. */
  478. int cross_connect_disallowed;
  479. /*
  480. * Whether this P2P group is configured to use cross connection (only
  481. * valid if this is P2P GO interface). The actual cross connect packet
  482. * forwarding may not be configured depending on the uplink status.
  483. */
  484. int cross_connect_enabled;
  485. /* Whether cross connection forwarding is in use at the moment. */
  486. int cross_connect_in_use;
  487. /*
  488. * Uplink interface name for cross connection
  489. */
  490. char cross_connect_uplink[100];
  491. enum {
  492. P2P_GROUP_REMOVAL_UNKNOWN,
  493. P2P_GROUP_REMOVAL_REQUESTED,
  494. P2P_GROUP_REMOVAL_IDLE_TIMEOUT,
  495. P2P_GROUP_REMOVAL_UNAVAILABLE
  496. } removal_reason;
  497. #endif /* CONFIG_P2P */
  498. struct wpa_ssid *bgscan_ssid;
  499. const struct bgscan_ops *bgscan;
  500. void *bgscan_priv;
  501. struct wpa_ssid *connect_without_scan;
  502. int after_wps;
  503. unsigned int wps_freq;
  504. int wps_fragment_size;
  505. int auto_reconnect_disabled;
  506. /* Channel preferences for AP/P2P GO use */
  507. int best_24_freq;
  508. int best_5_freq;
  509. int best_overall_freq;
  510. struct gas_query *gas;
  511. };
  512. /* wpa_supplicant.c */
  513. int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
  514. int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s);
  515. const char * wpa_supplicant_state_txt(enum wpa_states state);
  516. int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s);
  517. int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
  518. struct wpa_bss *bss, struct wpa_ssid *ssid,
  519. u8 *wpa_ie, size_t *wpa_ie_len);
  520. void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
  521. struct wpa_bss *bss,
  522. struct wpa_ssid *ssid);
  523. void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s,
  524. struct wpa_ssid *ssid);
  525. void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s);
  526. void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr);
  527. void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
  528. int sec, int usec);
  529. void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
  530. enum wpa_states state);
  531. struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s);
  532. const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s);
  533. void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
  534. void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
  535. int reason_code);
  536. void wpa_supplicant_disassociate(struct wpa_supplicant *wpa_s,
  537. int reason_code);
  538. void wpa_supplicant_enable_network(struct wpa_supplicant *wpa_s,
  539. struct wpa_ssid *ssid);
  540. void wpa_supplicant_disable_network(struct wpa_supplicant *wpa_s,
  541. struct wpa_ssid *ssid);
  542. void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s,
  543. struct wpa_ssid *ssid);
  544. int wpa_supplicant_set_ap_scan(struct wpa_supplicant *wpa_s,
  545. int ap_scan);
  546. int wpa_supplicant_set_bss_expiration_age(struct wpa_supplicant *wpa_s,
  547. unsigned int expire_age);
  548. int wpa_supplicant_set_bss_expiration_count(struct wpa_supplicant *wpa_s,
  549. unsigned int expire_count);
  550. int wpa_supplicant_set_debug_params(struct wpa_global *global,
  551. int debug_level, int debug_timestamp,
  552. int debug_show_keys);
  553. void wpa_show_license(void);
  554. struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
  555. struct wpa_interface *iface);
  556. int wpa_supplicant_remove_iface(struct wpa_global *global,
  557. struct wpa_supplicant *wpa_s);
  558. struct wpa_supplicant * wpa_supplicant_get_iface(struct wpa_global *global,
  559. const char *ifname);
  560. struct wpa_global * wpa_supplicant_init(struct wpa_params *params);
  561. int wpa_supplicant_run(struct wpa_global *global);
  562. void wpa_supplicant_deinit(struct wpa_global *global);
  563. int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
  564. struct wpa_ssid *ssid);
  565. void wpa_supplicant_terminate_proc(struct wpa_global *global);
  566. void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
  567. const u8 *buf, size_t len);
  568. enum wpa_key_mgmt key_mgmt2driver(int key_mgmt);
  569. enum wpa_cipher cipher_suite2driver(int cipher);
  570. void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s);
  571. void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s);
  572. void ieee80211_sta_free_hw_features(struct hostapd_hw_modes *hw_features,
  573. size_t num_hw_features);
  574. void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid);
  575. int wpas_driver_bss_selection(struct wpa_supplicant *wpa_s);
  576. /* events.c */
  577. void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s);
  578. void wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
  579. struct wpa_bss *selected,
  580. struct wpa_ssid *ssid);
  581. /* eap_register.c */
  582. int eap_register_methods(void);
  583. /**
  584. * Utility method to tell if a given network is a persistent group
  585. * @ssid: Network object
  586. * Returns: 1 if network is a persistent group, 0 otherwise
  587. */
  588. static inline int network_is_persistent_group(struct wpa_ssid *ssid)
  589. {
  590. return ((ssid->disabled == 2) || ssid->p2p_persistent_group);
  591. }
  592. #endif /* WPA_SUPPLICANT_I_H */