wpa_supplicant_i.h 24 KB

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