wpa_supplicant_i.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801
  1. /*
  2. * wpa_supplicant - Internal definitions
  3. * Copyright (c) 2003-2012, 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. unsigned int p2p_cb_on_scan_complete:1;
  213. #ifdef CONFIG_WIFI_DISPLAY
  214. int wifi_display;
  215. #define MAX_WFD_SUBELEMS 10
  216. struct wpabuf *wfd_subelem[MAX_WFD_SUBELEMS];
  217. #endif /* CONFIG_WIFI_DISPLAY */
  218. };
  219. enum offchannel_send_action_result {
  220. OFFCHANNEL_SEND_ACTION_SUCCESS /* Frame was send and acknowledged */,
  221. OFFCHANNEL_SEND_ACTION_NO_ACK /* Frame was sent, but not acknowledged
  222. */,
  223. OFFCHANNEL_SEND_ACTION_FAILED /* Frame was not sent due to a failure */
  224. };
  225. struct wps_ap_info {
  226. u8 bssid[ETH_ALEN];
  227. enum wps_ap_info_type {
  228. WPS_AP_NOT_SEL_REG,
  229. WPS_AP_SEL_REG,
  230. WPS_AP_SEL_REG_OUR
  231. } type;
  232. unsigned int tries;
  233. struct os_time last_attempt;
  234. };
  235. struct wpa_ssid_value {
  236. u8 ssid[32];
  237. size_t ssid_len;
  238. };
  239. /**
  240. * struct wpa_supplicant - Internal data for wpa_supplicant interface
  241. *
  242. * This structure contains the internal data for core wpa_supplicant code. This
  243. * should be only used directly from the core code. However, a pointer to this
  244. * data is used from other files as an arbitrary context pointer in calls to
  245. * core functions.
  246. */
  247. struct wpa_supplicant {
  248. struct wpa_global *global;
  249. struct wpa_supplicant *parent;
  250. struct wpa_supplicant *next;
  251. struct l2_packet_data *l2;
  252. struct l2_packet_data *l2_br;
  253. unsigned char own_addr[ETH_ALEN];
  254. char ifname[100];
  255. #ifdef CONFIG_CTRL_IFACE_DBUS
  256. char *dbus_path;
  257. #endif /* CONFIG_CTRL_IFACE_DBUS */
  258. #ifdef CONFIG_CTRL_IFACE_DBUS_NEW
  259. char *dbus_new_path;
  260. char *dbus_groupobj_path;
  261. #ifdef CONFIG_AP
  262. char *preq_notify_peer;
  263. #endif /* CONFIG_AP */
  264. #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
  265. char bridge_ifname[16];
  266. char *confname;
  267. struct wpa_config *conf;
  268. int countermeasures;
  269. os_time_t last_michael_mic_error;
  270. u8 bssid[ETH_ALEN];
  271. u8 pending_bssid[ETH_ALEN]; /* If wpa_state == WPA_ASSOCIATING, this
  272. * field contains the target BSSID. */
  273. int reassociate; /* reassociation requested */
  274. int disconnected; /* all connections disabled; i.e., do no reassociate
  275. * before this has been cleared */
  276. struct wpa_ssid *current_ssid;
  277. struct wpa_bss *current_bss;
  278. int ap_ies_from_associnfo;
  279. unsigned int assoc_freq;
  280. /* Selected configuration (based on Beacon/ProbeResp WPA IE) */
  281. int pairwise_cipher;
  282. int group_cipher;
  283. int key_mgmt;
  284. int wpa_proto;
  285. int mgmt_group_cipher;
  286. void *drv_priv; /* private data used by driver_ops */
  287. void *global_drv_priv;
  288. u8 *bssid_filter;
  289. size_t bssid_filter_count;
  290. u8 *disallow_aps_bssid;
  291. size_t disallow_aps_bssid_count;
  292. struct wpa_ssid_value *disallow_aps_ssid;
  293. size_t disallow_aps_ssid_count;
  294. /* previous scan was wildcard when interleaving between
  295. * wildcard scans and specific SSID scan when max_ssids=1 */
  296. int prev_scan_wildcard;
  297. struct wpa_ssid *prev_scan_ssid; /* previously scanned SSID;
  298. * NULL = not yet initialized (start
  299. * with wildcard SSID)
  300. * WILDCARD_SSID_SCAN = wildcard
  301. * SSID was used in the previous scan
  302. */
  303. #define WILDCARD_SSID_SCAN ((struct wpa_ssid *) 1)
  304. struct wpa_ssid *prev_sched_ssid; /* last SSID used in sched scan */
  305. int sched_scan_timeout;
  306. int sched_scan_interval;
  307. int first_sched_scan;
  308. int sched_scan_timed_out;
  309. void (*scan_res_handler)(struct wpa_supplicant *wpa_s,
  310. struct wpa_scan_results *scan_res);
  311. struct dl_list bss; /* struct wpa_bss::list */
  312. struct dl_list bss_id; /* struct wpa_bss::list_id */
  313. size_t num_bss;
  314. unsigned int bss_update_idx;
  315. unsigned int bss_next_id;
  316. /*
  317. * Pointers to BSS entries in the order they were in the last scan
  318. * results.
  319. */
  320. struct wpa_bss **last_scan_res;
  321. unsigned int last_scan_res_used;
  322. unsigned int last_scan_res_size;
  323. int last_scan_full;
  324. struct os_time last_scan;
  325. struct wpa_driver_ops *driver;
  326. int interface_removed; /* whether the network interface has been
  327. * removed */
  328. struct wpa_sm *wpa;
  329. struct eapol_sm *eapol;
  330. struct ctrl_iface_priv *ctrl_iface;
  331. enum wpa_states wpa_state;
  332. int scanning;
  333. int sched_scanning;
  334. int new_connection;
  335. int reassociated_connection;
  336. int eapol_received; /* number of EAPOL packets received after the
  337. * previous association event */
  338. struct scard_data *scard;
  339. #ifdef PCSC_FUNCS
  340. char imsi[20];
  341. int mnc_len;
  342. #endif /* PCSC_FUNCS */
  343. unsigned char last_eapol_src[ETH_ALEN];
  344. int keys_cleared;
  345. struct wpa_blacklist *blacklist;
  346. /**
  347. * extra_blacklist_count - Sum of blacklist counts after last connection
  348. *
  349. * This variable is used to maintain a count of temporary blacklisting
  350. * failures (maximum number for any BSS) over blacklist clear
  351. * operations. This is needed for figuring out whether there has been
  352. * failures prior to the last blacklist clear operation which happens
  353. * whenever no other not-blacklisted BSS candidates are available. This
  354. * gets cleared whenever a connection has been established successfully.
  355. */
  356. int extra_blacklist_count;
  357. /**
  358. * scan_req - Type of the scan request
  359. */
  360. enum scan_req_type {
  361. /**
  362. * NORMAL_SCAN_REQ - Normal scan request
  363. *
  364. * This is used for scans initiated by wpa_supplicant to find an
  365. * AP for a connection.
  366. */
  367. NORMAL_SCAN_REQ,
  368. /**
  369. * INITIAL_SCAN_REQ - Initial scan request
  370. *
  371. * This is used for the first scan on an interface to force at
  372. * least one scan to be run even if the configuration does not
  373. * include any enabled networks.
  374. */
  375. INITIAL_SCAN_REQ,
  376. /**
  377. * MANUAL_SCAN_REQ - Manual scan request
  378. *
  379. * This is used for scans where the user request a scan or
  380. * a specific wpa_supplicant operation (e.g., WPS) requires scan
  381. * to be run.
  382. */
  383. MANUAL_SCAN_REQ
  384. } scan_req;
  385. int scan_runs; /* number of scan runs since WPS was started */
  386. int *next_scan_freqs;
  387. int scan_interval; /* time in sec between scans to find suitable AP */
  388. int normal_scans; /* normal scans run before sched_scan */
  389. int scan_for_connection; /* whether the scan request was triggered for
  390. * finding a connection */
  391. unsigned int drv_flags;
  392. unsigned int drv_enc;
  393. /*
  394. * A bitmap of supported protocols for probe response offload. See
  395. * struct wpa_driver_capa in driver.h
  396. */
  397. unsigned int probe_resp_offloads;
  398. int max_scan_ssids;
  399. int max_sched_scan_ssids;
  400. int sched_scan_supported;
  401. unsigned int max_match_sets;
  402. unsigned int max_remain_on_chan;
  403. unsigned int max_stations;
  404. int pending_mic_error_report;
  405. int pending_mic_error_pairwise;
  406. int mic_errors_seen; /* Michael MIC errors with the current PTK */
  407. struct wps_context *wps;
  408. int wps_success; /* WPS success event received */
  409. struct wps_er *wps_er;
  410. int blacklist_cleared;
  411. struct wpabuf *pending_eapol_rx;
  412. struct os_time pending_eapol_rx_time;
  413. u8 pending_eapol_rx_src[ETH_ALEN];
  414. struct ibss_rsn *ibss_rsn;
  415. int set_sta_uapsd;
  416. int sta_uapsd;
  417. int set_ap_uapsd;
  418. int ap_uapsd;
  419. #ifdef CONFIG_SME
  420. struct {
  421. u8 ssid[32];
  422. size_t ssid_len;
  423. int freq;
  424. u8 assoc_req_ie[200];
  425. size_t assoc_req_ie_len;
  426. int mfp;
  427. int ft_used;
  428. u8 mobility_domain[2];
  429. u8 *ft_ies;
  430. size_t ft_ies_len;
  431. u8 prev_bssid[ETH_ALEN];
  432. int prev_bssid_set;
  433. int auth_alg;
  434. int proto;
  435. int sa_query_count; /* number of pending SA Query requests;
  436. * 0 = no SA Query in progress */
  437. int sa_query_timed_out;
  438. u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN *
  439. * sa_query_count octets of pending
  440. * SA Query transaction identifiers */
  441. struct os_time sa_query_start;
  442. u8 sched_obss_scan;
  443. u16 obss_scan_int;
  444. u16 bss_max_idle_period;
  445. enum {
  446. SME_SAE_INIT,
  447. SME_SAE_COMMIT,
  448. SME_SAE_CONFIRM
  449. } sae_state;
  450. u16 sae_send_confirm;
  451. } sme;
  452. #endif /* CONFIG_SME */
  453. #ifdef CONFIG_AP
  454. struct hostapd_iface *ap_iface;
  455. void (*ap_configured_cb)(void *ctx, void *data);
  456. void *ap_configured_cb_ctx;
  457. void *ap_configured_cb_data;
  458. #endif /* CONFIG_AP */
  459. unsigned int off_channel_freq;
  460. struct wpabuf *pending_action_tx;
  461. u8 pending_action_src[ETH_ALEN];
  462. u8 pending_action_dst[ETH_ALEN];
  463. u8 pending_action_bssid[ETH_ALEN];
  464. unsigned int pending_action_freq;
  465. int pending_action_no_cck;
  466. int pending_action_without_roc;
  467. void (*pending_action_tx_status_cb)(struct wpa_supplicant *wpa_s,
  468. unsigned int freq, const u8 *dst,
  469. const u8 *src, const u8 *bssid,
  470. const u8 *data, size_t data_len,
  471. enum offchannel_send_action_result
  472. result);
  473. unsigned int roc_waiting_drv_freq;
  474. int action_tx_wait_time;
  475. #ifdef CONFIG_P2P
  476. struct p2p_go_neg_results *go_params;
  477. int create_p2p_iface;
  478. u8 pending_interface_addr[ETH_ALEN];
  479. char pending_interface_name[100];
  480. int pending_interface_type;
  481. int p2p_group_idx;
  482. unsigned int pending_listen_freq;
  483. unsigned int pending_listen_duration;
  484. enum {
  485. NOT_P2P_GROUP_INTERFACE,
  486. P2P_GROUP_INTERFACE_PENDING,
  487. P2P_GROUP_INTERFACE_GO,
  488. P2P_GROUP_INTERFACE_CLIENT
  489. } p2p_group_interface;
  490. struct p2p_group *p2p_group;
  491. int p2p_long_listen; /* remaining time in long Listen state in ms */
  492. char p2p_pin[10];
  493. int p2p_wps_method;
  494. u8 p2p_auth_invite[ETH_ALEN];
  495. int p2p_sd_over_ctrl_iface;
  496. int p2p_in_provisioning;
  497. int pending_invite_ssid_id;
  498. int show_group_started;
  499. u8 go_dev_addr[ETH_ALEN];
  500. int pending_pd_before_join;
  501. u8 pending_join_iface_addr[ETH_ALEN];
  502. u8 pending_join_dev_addr[ETH_ALEN];
  503. int pending_join_wps_method;
  504. int p2p_join_scan_count;
  505. int auto_pd_scan_retry;
  506. int force_long_sd;
  507. u16 pending_pd_config_methods;
  508. enum {
  509. NORMAL_PD, AUTO_PD_GO_NEG, AUTO_PD_JOIN
  510. } pending_pd_use;
  511. /*
  512. * Whether cross connection is disallowed by the AP to which this
  513. * interface is associated (only valid if there is an association).
  514. */
  515. int cross_connect_disallowed;
  516. /*
  517. * Whether this P2P group is configured to use cross connection (only
  518. * valid if this is P2P GO interface). The actual cross connect packet
  519. * forwarding may not be configured depending on the uplink status.
  520. */
  521. int cross_connect_enabled;
  522. /* Whether cross connection forwarding is in use at the moment. */
  523. int cross_connect_in_use;
  524. /*
  525. * Uplink interface name for cross connection
  526. */
  527. char cross_connect_uplink[100];
  528. unsigned int sta_scan_pending:1;
  529. unsigned int p2p_auto_join:1;
  530. unsigned int p2p_auto_pd:1;
  531. unsigned int p2p_persistent_group:1;
  532. unsigned int p2p_fallback_to_go_neg:1;
  533. unsigned int p2p_pd_before_go_neg:1;
  534. unsigned int p2p_go_ht40:1;
  535. unsigned int user_initiated_pd:1;
  536. int p2p_persistent_go_freq;
  537. int p2p_persistent_id;
  538. int p2p_go_intent;
  539. int p2p_connect_freq;
  540. struct os_time p2p_auto_started;
  541. #endif /* CONFIG_P2P */
  542. struct wpa_ssid *bgscan_ssid;
  543. const struct bgscan_ops *bgscan;
  544. void *bgscan_priv;
  545. const struct autoscan_ops *autoscan;
  546. struct wpa_driver_scan_params *autoscan_params;
  547. void *autoscan_priv;
  548. struct wpa_ssid *connect_without_scan;
  549. struct wps_ap_info *wps_ap;
  550. size_t num_wps_ap;
  551. int wps_ap_iter;
  552. int after_wps;
  553. int known_wps_freq;
  554. unsigned int wps_freq;
  555. u16 wps_ap_channel;
  556. int wps_fragment_size;
  557. int auto_reconnect_disabled;
  558. /* Channel preferences for AP/P2P GO use */
  559. int best_24_freq;
  560. int best_5_freq;
  561. int best_overall_freq;
  562. struct gas_query *gas;
  563. #ifdef CONFIG_INTERWORKING
  564. unsigned int fetch_anqp_in_progress:1;
  565. unsigned int network_select:1;
  566. unsigned int auto_select:1;
  567. unsigned int auto_network_select:1;
  568. unsigned int fetch_all_anqp:1;
  569. #endif /* CONFIG_INTERWORKING */
  570. unsigned int drv_capa_known;
  571. struct {
  572. struct hostapd_hw_modes *modes;
  573. u16 num_modes;
  574. u16 flags;
  575. } hw;
  576. int pno;
  577. /* WLAN_REASON_* reason codes. Negative if locally generated. */
  578. int disconnect_reason;
  579. struct ext_password_data *ext_pw;
  580. struct wpabuf *last_gas_resp;
  581. u8 last_gas_addr[ETH_ALEN];
  582. u8 last_gas_dialog_token;
  583. };
  584. /* wpa_supplicant.c */
  585. void wpa_supplicant_apply_ht_overrides(
  586. struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
  587. struct wpa_driver_associate_params *params);
  588. int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
  589. int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s);
  590. const char * wpa_supplicant_state_txt(enum wpa_states state);
  591. int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s);
  592. int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s);
  593. int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
  594. struct wpa_bss *bss, struct wpa_ssid *ssid,
  595. u8 *wpa_ie, size_t *wpa_ie_len);
  596. void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
  597. struct wpa_bss *bss,
  598. struct wpa_ssid *ssid);
  599. void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s,
  600. struct wpa_ssid *ssid);
  601. void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s);
  602. void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr);
  603. void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
  604. int sec, int usec);
  605. void wpa_supplicant_reinit_autoscan(struct wpa_supplicant *wpa_s);
  606. void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
  607. enum wpa_states state);
  608. struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s);
  609. const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s);
  610. void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
  611. void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
  612. int reason_code);
  613. void wpa_supplicant_enable_network(struct wpa_supplicant *wpa_s,
  614. struct wpa_ssid *ssid);
  615. void wpa_supplicant_disable_network(struct wpa_supplicant *wpa_s,
  616. struct wpa_ssid *ssid);
  617. void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s,
  618. struct wpa_ssid *ssid);
  619. int wpa_supplicant_set_ap_scan(struct wpa_supplicant *wpa_s,
  620. int ap_scan);
  621. int wpa_supplicant_set_bss_expiration_age(struct wpa_supplicant *wpa_s,
  622. unsigned int expire_age);
  623. int wpa_supplicant_set_bss_expiration_count(struct wpa_supplicant *wpa_s,
  624. unsigned int expire_count);
  625. int wpa_supplicant_set_scan_interval(struct wpa_supplicant *wpa_s,
  626. int scan_interval);
  627. int wpa_supplicant_set_debug_params(struct wpa_global *global,
  628. int debug_level, int debug_timestamp,
  629. int debug_show_keys);
  630. void free_hw_features(struct wpa_supplicant *wpa_s);
  631. void wpa_show_license(void);
  632. struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
  633. struct wpa_interface *iface);
  634. int wpa_supplicant_remove_iface(struct wpa_global *global,
  635. struct wpa_supplicant *wpa_s,
  636. int terminate);
  637. struct wpa_supplicant * wpa_supplicant_get_iface(struct wpa_global *global,
  638. const char *ifname);
  639. struct wpa_global * wpa_supplicant_init(struct wpa_params *params);
  640. int wpa_supplicant_run(struct wpa_global *global);
  641. void wpa_supplicant_deinit(struct wpa_global *global);
  642. int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
  643. struct wpa_ssid *ssid);
  644. void wpa_supplicant_terminate_proc(struct wpa_global *global);
  645. void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
  646. const u8 *buf, size_t len);
  647. enum wpa_key_mgmt key_mgmt2driver(int key_mgmt);
  648. enum wpa_cipher cipher_suite2driver(int cipher);
  649. void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s);
  650. void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s);
  651. void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid);
  652. int wpas_driver_bss_selection(struct wpa_supplicant *wpa_s);
  653. int wpas_is_p2p_prioritized(struct wpa_supplicant *wpa_s);
  654. void wpas_auth_failed(struct wpa_supplicant *wpa_s);
  655. void wpas_clear_temp_disabled(struct wpa_supplicant *wpa_s,
  656. struct wpa_ssid *ssid, int clear_failures);
  657. int disallowed_bssid(struct wpa_supplicant *wpa_s, const u8 *bssid);
  658. int disallowed_ssid(struct wpa_supplicant *wpa_s, const u8 *ssid,
  659. size_t ssid_len);
  660. void wpas_request_connection(struct wpa_supplicant *wpa_s);
  661. /**
  662. * wpa_supplicant_ctrl_iface_ctrl_rsp_handle - Handle a control response
  663. * @wpa_s: Pointer to wpa_supplicant data
  664. * @ssid: Pointer to the network block the reply is for
  665. * @field: field the response is a reply for
  666. * @value: value (ie, password, etc) for @field
  667. * Returns: 0 on success, non-zero on error
  668. *
  669. * Helper function to handle replies to control interface requests.
  670. */
  671. int wpa_supplicant_ctrl_iface_ctrl_rsp_handle(struct wpa_supplicant *wpa_s,
  672. struct wpa_ssid *ssid,
  673. const char *field,
  674. const char *value);
  675. /* events.c */
  676. void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s);
  677. int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
  678. struct wpa_bss *selected,
  679. struct wpa_ssid *ssid);
  680. void wpa_supplicant_stop_countermeasures(void *eloop_ctx, void *sock_ctx);
  681. void wpa_supplicant_delayed_mic_error_report(void *eloop_ctx, void *sock_ctx);
  682. void wnm_bss_keep_alive_deinit(struct wpa_supplicant *wpa_s);
  683. int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s);
  684. /* eap_register.c */
  685. int eap_register_methods(void);
  686. /**
  687. * Utility method to tell if a given network is a persistent group
  688. * @ssid: Network object
  689. * Returns: 1 if network is a persistent group, 0 otherwise
  690. */
  691. static inline int network_is_persistent_group(struct wpa_ssid *ssid)
  692. {
  693. return ((ssid->disabled == 2) || ssid->p2p_persistent_group);
  694. }
  695. int wpas_network_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
  696. int wpas_init_ext_pw(struct wpa_supplicant *wpa_s);
  697. #endif /* WPA_SUPPLICANT_I_H */