wpa_supplicant_i.h 20 KB

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