wpa_supplicant_i.h 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280
  1. /*
  2. * wpa_supplicant - Internal definitions
  3. * Copyright (c) 2003-2014, 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 "common/wpa_ctrl.h"
  14. #include "wps/wps_defs.h"
  15. #include "config_ssid.h"
  16. #include "wmm_ac.h"
  17. extern const char *const wpa_supplicant_version;
  18. extern const char *const wpa_supplicant_license;
  19. #ifndef CONFIG_NO_STDOUT_DEBUG
  20. extern const char *const wpa_supplicant_full_license1;
  21. extern const char *const wpa_supplicant_full_license2;
  22. extern const char *const wpa_supplicant_full_license3;
  23. extern const char *const wpa_supplicant_full_license4;
  24. extern const char *const wpa_supplicant_full_license5;
  25. #endif /* CONFIG_NO_STDOUT_DEBUG */
  26. struct wpa_sm;
  27. struct wpa_supplicant;
  28. struct ibss_rsn;
  29. struct scan_info;
  30. struct wpa_bss;
  31. struct wpa_scan_results;
  32. struct hostapd_hw_modes;
  33. struct wpa_driver_associate_params;
  34. /*
  35. * Forward declarations of private structures used within the ctrl_iface
  36. * backends. Other parts of wpa_supplicant do not have access to data stored in
  37. * these structures.
  38. */
  39. struct ctrl_iface_priv;
  40. struct ctrl_iface_global_priv;
  41. struct wpas_dbus_priv;
  42. /**
  43. * struct wpa_interface - Parameters for wpa_supplicant_add_iface()
  44. */
  45. struct wpa_interface {
  46. /**
  47. * confname - Configuration name (file or profile) name
  48. *
  49. * This can also be %NULL when a configuration file is not used. In
  50. * that case, ctrl_interface must be set to allow the interface to be
  51. * configured.
  52. */
  53. const char *confname;
  54. /**
  55. * confanother - Additional configuration name (file or profile) name
  56. *
  57. * This can also be %NULL when the additional configuration file is not
  58. * used.
  59. */
  60. const char *confanother;
  61. /**
  62. * ctrl_interface - Control interface parameter
  63. *
  64. * If a configuration file is not used, this variable can be used to
  65. * set the ctrl_interface parameter that would have otherwise been read
  66. * from the configuration file. If both confname and ctrl_interface are
  67. * set, ctrl_interface is used to override the value from configuration
  68. * file.
  69. */
  70. const char *ctrl_interface;
  71. /**
  72. * driver - Driver interface name, or %NULL to use the default driver
  73. */
  74. const char *driver;
  75. /**
  76. * driver_param - Driver interface parameters
  77. *
  78. * If a configuration file is not used, this variable can be used to
  79. * set the driver_param parameters that would have otherwise been read
  80. * from the configuration file. If both confname and driver_param are
  81. * set, driver_param is used to override the value from configuration
  82. * file.
  83. */
  84. const char *driver_param;
  85. /**
  86. * ifname - Interface name
  87. */
  88. const char *ifname;
  89. /**
  90. * bridge_ifname - Optional bridge interface name
  91. *
  92. * If the driver interface (ifname) is included in a Linux bridge
  93. * device, the bridge interface may need to be used for receiving EAPOL
  94. * frames. This can be enabled by setting this variable to enable
  95. * receiving of EAPOL frames from an additional interface.
  96. */
  97. const char *bridge_ifname;
  98. /**
  99. * p2p_mgmt - Interface used for P2P management (P2P Device operations)
  100. *
  101. * Indicates whether wpas_p2p_init() must be called for this interface.
  102. * This is used only when the driver supports a dedicated P2P Device
  103. * interface that is not a network interface.
  104. */
  105. int p2p_mgmt;
  106. };
  107. /**
  108. * struct wpa_params - Parameters for wpa_supplicant_init()
  109. */
  110. struct wpa_params {
  111. /**
  112. * daemonize - Run %wpa_supplicant in the background
  113. */
  114. int daemonize;
  115. /**
  116. * wait_for_monitor - Wait for a monitor program before starting
  117. */
  118. int wait_for_monitor;
  119. /**
  120. * pid_file - Path to a PID (process ID) file
  121. *
  122. * If this and daemonize are set, process ID of the background process
  123. * will be written to the specified file.
  124. */
  125. char *pid_file;
  126. /**
  127. * wpa_debug_level - Debugging verbosity level (e.g., MSG_INFO)
  128. */
  129. int wpa_debug_level;
  130. /**
  131. * wpa_debug_show_keys - Whether keying material is included in debug
  132. *
  133. * This parameter can be used to allow keying material to be included
  134. * in debug messages. This is a security risk and this option should
  135. * not be enabled in normal configuration. If needed during
  136. * development or while troubleshooting, this option can provide more
  137. * details for figuring out what is happening.
  138. */
  139. int wpa_debug_show_keys;
  140. /**
  141. * wpa_debug_timestamp - Whether to include timestamp in debug messages
  142. */
  143. int wpa_debug_timestamp;
  144. /**
  145. * ctrl_interface - Global ctrl_iface path/parameter
  146. */
  147. char *ctrl_interface;
  148. /**
  149. * ctrl_interface_group - Global ctrl_iface group
  150. */
  151. char *ctrl_interface_group;
  152. /**
  153. * dbus_ctrl_interface - Enable the DBus control interface
  154. */
  155. int dbus_ctrl_interface;
  156. /**
  157. * wpa_debug_file_path - Path of debug file or %NULL to use stdout
  158. */
  159. const char *wpa_debug_file_path;
  160. /**
  161. * wpa_debug_syslog - Enable log output through syslog
  162. */
  163. int wpa_debug_syslog;
  164. /**
  165. * wpa_debug_tracing - Enable log output through Linux tracing
  166. */
  167. int wpa_debug_tracing;
  168. /**
  169. * override_driver - Optional driver parameter override
  170. *
  171. * This parameter can be used to override the driver parameter in
  172. * dynamic interface addition to force a specific driver wrapper to be
  173. * used instead.
  174. */
  175. char *override_driver;
  176. /**
  177. * override_ctrl_interface - Optional ctrl_interface override
  178. *
  179. * This parameter can be used to override the ctrl_interface parameter
  180. * in dynamic interface addition to force a control interface to be
  181. * created.
  182. */
  183. char *override_ctrl_interface;
  184. /**
  185. * entropy_file - Optional entropy file
  186. *
  187. * This parameter can be used to configure wpa_supplicant to maintain
  188. * its internal entropy store over restarts.
  189. */
  190. char *entropy_file;
  191. #ifdef CONFIG_P2P
  192. /**
  193. * conf_p2p_dev - Configuration file used to hold the
  194. * P2P Device configuration parameters.
  195. *
  196. * This can also be %NULL. In such a case, if a P2P Device dedicated
  197. * interfaces is created, the main configuration file will be used.
  198. */
  199. char *conf_p2p_dev;
  200. #endif /* CONFIG_P2P */
  201. #ifdef CONFIG_MATCH_IFACE
  202. /**
  203. * match_ifaces - Interface descriptions to match
  204. */
  205. struct wpa_interface *match_ifaces;
  206. /**
  207. * match_iface_count - Number of defined matching interfaces
  208. */
  209. int match_iface_count;
  210. #endif /* CONFIG_MATCH_IFACE */
  211. };
  212. struct p2p_srv_bonjour {
  213. struct dl_list list;
  214. struct wpabuf *query;
  215. struct wpabuf *resp;
  216. };
  217. struct p2p_srv_upnp {
  218. struct dl_list list;
  219. u8 version;
  220. char *service;
  221. };
  222. /**
  223. * struct wpa_global - Internal, global data for all %wpa_supplicant interfaces
  224. *
  225. * This structure is initialized by calling wpa_supplicant_init() when starting
  226. * %wpa_supplicant.
  227. */
  228. struct wpa_global {
  229. struct wpa_supplicant *ifaces;
  230. struct wpa_params params;
  231. struct ctrl_iface_global_priv *ctrl_iface;
  232. struct wpas_dbus_priv *dbus;
  233. void **drv_priv;
  234. size_t drv_count;
  235. struct os_time suspend_time;
  236. struct p2p_data *p2p;
  237. struct wpa_supplicant *p2p_init_wpa_s;
  238. struct wpa_supplicant *p2p_group_formation;
  239. struct wpa_supplicant *p2p_invite_group;
  240. u8 p2p_dev_addr[ETH_ALEN];
  241. struct os_reltime p2p_go_wait_client;
  242. struct dl_list p2p_srv_bonjour; /* struct p2p_srv_bonjour */
  243. struct dl_list p2p_srv_upnp; /* struct p2p_srv_upnp */
  244. int p2p_disabled;
  245. int cross_connection;
  246. struct wpa_freq_range_list p2p_disallow_freq;
  247. struct wpa_freq_range_list p2p_go_avoid_freq;
  248. enum wpa_conc_pref {
  249. WPA_CONC_PREF_NOT_SET,
  250. WPA_CONC_PREF_STA,
  251. WPA_CONC_PREF_P2P
  252. } conc_pref;
  253. unsigned int p2p_per_sta_psk:1;
  254. unsigned int p2p_fail_on_wps_complete:1;
  255. unsigned int p2p_24ghz_social_channels:1;
  256. unsigned int pending_p2ps_group:1;
  257. unsigned int pending_group_iface_for_p2ps:1;
  258. unsigned int pending_p2ps_group_freq;
  259. #ifdef CONFIG_WIFI_DISPLAY
  260. int wifi_display;
  261. #define MAX_WFD_SUBELEMS 10
  262. struct wpabuf *wfd_subelem[MAX_WFD_SUBELEMS];
  263. #endif /* CONFIG_WIFI_DISPLAY */
  264. struct psk_list_entry *add_psk; /* From group formation */
  265. };
  266. /**
  267. * struct wpa_radio - Internal data for per-radio information
  268. *
  269. * This structure is used to share data about configured interfaces
  270. * (struct wpa_supplicant) that share the same physical radio, e.g., to allow
  271. * better coordination of offchannel operations.
  272. */
  273. struct wpa_radio {
  274. char name[16]; /* from driver_ops get_radio_name() or empty if not
  275. * available */
  276. unsigned int external_scan_running:1;
  277. unsigned int num_active_works;
  278. struct dl_list ifaces; /* struct wpa_supplicant::radio_list entries */
  279. struct dl_list work; /* struct wpa_radio_work::list entries */
  280. };
  281. #define MAX_ACTIVE_WORKS 2
  282. /**
  283. * struct wpa_radio_work - Radio work item
  284. */
  285. struct wpa_radio_work {
  286. struct dl_list list;
  287. unsigned int freq; /* known frequency (MHz) or 0 for multiple/unknown */
  288. const char *type;
  289. struct wpa_supplicant *wpa_s;
  290. void (*cb)(struct wpa_radio_work *work, int deinit);
  291. void *ctx;
  292. unsigned int started:1;
  293. struct os_reltime time;
  294. unsigned int bands;
  295. };
  296. int radio_add_work(struct wpa_supplicant *wpa_s, unsigned int freq,
  297. const char *type, int next,
  298. void (*cb)(struct wpa_radio_work *work, int deinit),
  299. void *ctx);
  300. void radio_work_done(struct wpa_radio_work *work);
  301. void radio_remove_works(struct wpa_supplicant *wpa_s,
  302. const char *type, int remove_all);
  303. void radio_work_check_next(struct wpa_supplicant *wpa_s);
  304. struct wpa_radio_work *
  305. radio_work_pending(struct wpa_supplicant *wpa_s, const char *type);
  306. struct wpa_connect_work {
  307. unsigned int sme:1;
  308. unsigned int bss_removed:1;
  309. struct wpa_bss *bss;
  310. struct wpa_ssid *ssid;
  311. };
  312. int wpas_valid_bss_ssid(struct wpa_supplicant *wpa_s, struct wpa_bss *test_bss,
  313. struct wpa_ssid *test_ssid);
  314. void wpas_connect_work_free(struct wpa_connect_work *cwork);
  315. void wpas_connect_work_done(struct wpa_supplicant *wpa_s);
  316. struct wpa_external_work {
  317. unsigned int id;
  318. char type[100];
  319. unsigned int timeout;
  320. };
  321. enum wpa_radio_work_band wpas_freq_to_band(int freq);
  322. unsigned int wpas_get_bands(struct wpa_supplicant *wpa_s, const int *freqs);
  323. /**
  324. * offchannel_send_action_result - Result of offchannel send Action frame
  325. */
  326. enum offchannel_send_action_result {
  327. OFFCHANNEL_SEND_ACTION_SUCCESS /**< Frame was send and acknowledged */,
  328. OFFCHANNEL_SEND_ACTION_NO_ACK /**< Frame was sent, but not acknowledged
  329. */,
  330. OFFCHANNEL_SEND_ACTION_FAILED /**< Frame was not sent due to a failure
  331. */
  332. };
  333. struct wps_ap_info {
  334. u8 bssid[ETH_ALEN];
  335. enum wps_ap_info_type {
  336. WPS_AP_NOT_SEL_REG,
  337. WPS_AP_SEL_REG,
  338. WPS_AP_SEL_REG_OUR
  339. } type;
  340. unsigned int tries;
  341. struct os_reltime last_attempt;
  342. unsigned int pbc_active;
  343. u8 uuid[WPS_UUID_LEN];
  344. };
  345. struct wpa_ssid_value {
  346. u8 ssid[SSID_MAX_LEN];
  347. size_t ssid_len;
  348. };
  349. #define WPA_FREQ_USED_BY_INFRA_STATION BIT(0)
  350. #define WPA_FREQ_USED_BY_P2P_CLIENT BIT(1)
  351. struct wpa_used_freq_data {
  352. int freq;
  353. unsigned int flags;
  354. };
  355. #define RRM_NEIGHBOR_REPORT_TIMEOUT 1 /* 1 second for AP to send a report */
  356. /*
  357. * struct rrm_data - Data used for managing RRM features
  358. */
  359. struct rrm_data {
  360. /* rrm_used - indication regarding the current connection */
  361. unsigned int rrm_used:1;
  362. /*
  363. * notify_neighbor_rep - Callback for notifying report requester
  364. */
  365. void (*notify_neighbor_rep)(void *ctx, struct wpabuf *neighbor_rep);
  366. /*
  367. * neighbor_rep_cb_ctx - Callback context
  368. * Received in the callback registration, and sent to the callback
  369. * function as a parameter.
  370. */
  371. void *neighbor_rep_cb_ctx;
  372. /* next_neighbor_rep_token - Next request's dialog token */
  373. u8 next_neighbor_rep_token;
  374. };
  375. enum wpa_supplicant_test_failure {
  376. WPAS_TEST_FAILURE_NONE,
  377. WPAS_TEST_FAILURE_SCAN_TRIGGER,
  378. };
  379. struct icon_entry {
  380. struct dl_list list;
  381. u8 bssid[ETH_ALEN];
  382. u8 dialog_token;
  383. char *file_name;
  384. u8 *image;
  385. size_t image_len;
  386. };
  387. struct wpa_bss_tmp_disallowed {
  388. struct dl_list list;
  389. u8 bssid[ETH_ALEN];
  390. struct os_reltime disallowed_until;
  391. };
  392. /**
  393. * struct wpa_supplicant - Internal data for wpa_supplicant interface
  394. *
  395. * This structure contains the internal data for core wpa_supplicant code. This
  396. * should be only used directly from the core code. However, a pointer to this
  397. * data is used from other files as an arbitrary context pointer in calls to
  398. * core functions.
  399. */
  400. struct wpa_supplicant {
  401. struct wpa_global *global;
  402. struct wpa_radio *radio; /* shared radio context */
  403. struct dl_list radio_list; /* list head: struct wpa_radio::ifaces */
  404. struct wpa_supplicant *parent;
  405. struct wpa_supplicant *p2pdev;
  406. struct wpa_supplicant *next;
  407. struct l2_packet_data *l2;
  408. struct l2_packet_data *l2_br;
  409. unsigned char own_addr[ETH_ALEN];
  410. unsigned char perm_addr[ETH_ALEN];
  411. char ifname[100];
  412. #ifdef CONFIG_MATCH_IFACE
  413. int matched;
  414. #endif /* CONFIG_MATCH_IFACE */
  415. #ifdef CONFIG_CTRL_IFACE_DBUS
  416. char *dbus_path;
  417. #endif /* CONFIG_CTRL_IFACE_DBUS */
  418. #ifdef CONFIG_CTRL_IFACE_DBUS_NEW
  419. char *dbus_new_path;
  420. char *dbus_groupobj_path;
  421. #ifdef CONFIG_AP
  422. char *preq_notify_peer;
  423. #endif /* CONFIG_AP */
  424. #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
  425. char bridge_ifname[16];
  426. char *confname;
  427. char *confanother;
  428. struct wpa_config *conf;
  429. int countermeasures;
  430. struct os_reltime last_michael_mic_error;
  431. u8 bssid[ETH_ALEN];
  432. u8 pending_bssid[ETH_ALEN]; /* If wpa_state == WPA_ASSOCIATING, this
  433. * field contains the target BSSID. */
  434. int reassociate; /* reassociation requested */
  435. int reassoc_same_bss; /* reassociating to the same bss */
  436. int disconnected; /* all connections disabled; i.e., do no reassociate
  437. * before this has been cleared */
  438. struct wpa_ssid *current_ssid;
  439. struct wpa_ssid *last_ssid;
  440. struct wpa_bss *current_bss;
  441. int ap_ies_from_associnfo;
  442. unsigned int assoc_freq;
  443. /* Selected configuration (based on Beacon/ProbeResp WPA IE) */
  444. int pairwise_cipher;
  445. int group_cipher;
  446. int key_mgmt;
  447. int wpa_proto;
  448. int mgmt_group_cipher;
  449. void *drv_priv; /* private data used by driver_ops */
  450. void *global_drv_priv;
  451. u8 *bssid_filter;
  452. size_t bssid_filter_count;
  453. u8 *disallow_aps_bssid;
  454. size_t disallow_aps_bssid_count;
  455. struct wpa_ssid_value *disallow_aps_ssid;
  456. size_t disallow_aps_ssid_count;
  457. enum set_band setband;
  458. /* Preferred network for the next connection attempt */
  459. struct wpa_ssid *next_ssid;
  460. /* previous scan was wildcard when interleaving between
  461. * wildcard scans and specific SSID scan when max_ssids=1 */
  462. int prev_scan_wildcard;
  463. struct wpa_ssid *prev_scan_ssid; /* previously scanned SSID;
  464. * NULL = not yet initialized (start
  465. * with wildcard SSID)
  466. * WILDCARD_SSID_SCAN = wildcard
  467. * SSID was used in the previous scan
  468. */
  469. #define WILDCARD_SSID_SCAN ((struct wpa_ssid *) 1)
  470. struct wpa_ssid *prev_sched_ssid; /* last SSID used in sched scan */
  471. int sched_scan_timeout;
  472. int first_sched_scan;
  473. int sched_scan_timed_out;
  474. struct sched_scan_plan *sched_scan_plans;
  475. size_t sched_scan_plans_num;
  476. void (*scan_res_handler)(struct wpa_supplicant *wpa_s,
  477. struct wpa_scan_results *scan_res);
  478. struct dl_list bss; /* struct wpa_bss::list */
  479. struct dl_list bss_id; /* struct wpa_bss::list_id */
  480. size_t num_bss;
  481. unsigned int bss_update_idx;
  482. unsigned int bss_next_id;
  483. /*
  484. * Pointers to BSS entries in the order they were in the last scan
  485. * results.
  486. */
  487. struct wpa_bss **last_scan_res;
  488. unsigned int last_scan_res_used;
  489. unsigned int last_scan_res_size;
  490. struct os_reltime last_scan;
  491. const struct wpa_driver_ops *driver;
  492. int interface_removed; /* whether the network interface has been
  493. * removed */
  494. struct wpa_sm *wpa;
  495. struct eapol_sm *eapol;
  496. struct ctrl_iface_priv *ctrl_iface;
  497. enum wpa_states wpa_state;
  498. struct wpa_radio_work *scan_work;
  499. int scanning;
  500. int sched_scanning;
  501. int new_connection;
  502. int eapol_received; /* number of EAPOL packets received after the
  503. * previous association event */
  504. struct scard_data *scard;
  505. char imsi[20];
  506. int mnc_len;
  507. unsigned char last_eapol_src[ETH_ALEN];
  508. unsigned int keys_cleared; /* bitfield of key indexes that the driver is
  509. * known not to be configured with a key */
  510. struct wpa_blacklist *blacklist;
  511. /**
  512. * extra_blacklist_count - Sum of blacklist counts after last connection
  513. *
  514. * This variable is used to maintain a count of temporary blacklisting
  515. * failures (maximum number for any BSS) over blacklist clear
  516. * operations. This is needed for figuring out whether there has been
  517. * failures prior to the last blacklist clear operation which happens
  518. * whenever no other not-blacklisted BSS candidates are available. This
  519. * gets cleared whenever a connection has been established successfully.
  520. */
  521. int extra_blacklist_count;
  522. /**
  523. * scan_req - Type of the scan request
  524. */
  525. enum scan_req_type {
  526. /**
  527. * NORMAL_SCAN_REQ - Normal scan request
  528. *
  529. * This is used for scans initiated by wpa_supplicant to find an
  530. * AP for a connection.
  531. */
  532. NORMAL_SCAN_REQ,
  533. /**
  534. * INITIAL_SCAN_REQ - Initial scan request
  535. *
  536. * This is used for the first scan on an interface to force at
  537. * least one scan to be run even if the configuration does not
  538. * include any enabled networks.
  539. */
  540. INITIAL_SCAN_REQ,
  541. /**
  542. * MANUAL_SCAN_REQ - Manual scan request
  543. *
  544. * This is used for scans where the user request a scan or
  545. * a specific wpa_supplicant operation (e.g., WPS) requires scan
  546. * to be run.
  547. */
  548. MANUAL_SCAN_REQ
  549. } scan_req, last_scan_req;
  550. enum wpa_states scan_prev_wpa_state;
  551. struct os_reltime scan_trigger_time, scan_start_time;
  552. /* Minimum freshness requirement for connection purposes */
  553. struct os_reltime scan_min_time;
  554. int scan_runs; /* number of scan runs since WPS was started */
  555. int *next_scan_freqs;
  556. int *manual_scan_freqs;
  557. int *manual_sched_scan_freqs;
  558. unsigned int manual_scan_passive:1;
  559. unsigned int manual_scan_use_id:1;
  560. unsigned int manual_scan_only_new:1;
  561. unsigned int own_scan_requested:1;
  562. unsigned int own_scan_running:1;
  563. unsigned int clear_driver_scan_cache:1;
  564. unsigned int manual_scan_id;
  565. int scan_interval; /* time in sec between scans to find suitable AP */
  566. int normal_scans; /* normal scans run before sched_scan */
  567. int scan_for_connection; /* whether the scan request was triggered for
  568. * finding a connection */
  569. #define MAX_SCAN_ID 16
  570. int scan_id[MAX_SCAN_ID];
  571. unsigned int scan_id_count;
  572. u8 next_scan_bssid[ETH_ALEN];
  573. struct wpa_ssid_value *ssids_from_scan_req;
  574. unsigned int num_ssids_from_scan_req;
  575. u64 drv_flags;
  576. unsigned int drv_enc;
  577. unsigned int drv_smps_modes;
  578. unsigned int drv_rrm_flags;
  579. /*
  580. * A bitmap of supported protocols for probe response offload. See
  581. * struct wpa_driver_capa in driver.h
  582. */
  583. unsigned int probe_resp_offloads;
  584. /* extended capabilities supported by the driver */
  585. const u8 *extended_capa, *extended_capa_mask;
  586. unsigned int extended_capa_len;
  587. int max_scan_ssids;
  588. int max_sched_scan_ssids;
  589. unsigned int max_sched_scan_plans;
  590. unsigned int max_sched_scan_plan_interval;
  591. unsigned int max_sched_scan_plan_iterations;
  592. int sched_scan_supported;
  593. unsigned int max_match_sets;
  594. unsigned int max_remain_on_chan;
  595. unsigned int max_stations;
  596. int pending_mic_error_report;
  597. int pending_mic_error_pairwise;
  598. int mic_errors_seen; /* Michael MIC errors with the current PTK */
  599. struct wps_context *wps;
  600. int wps_success; /* WPS success event received */
  601. struct wps_er *wps_er;
  602. unsigned int wps_run;
  603. struct os_reltime wps_pin_start_time;
  604. int blacklist_cleared;
  605. struct wpabuf *pending_eapol_rx;
  606. struct os_reltime pending_eapol_rx_time;
  607. u8 pending_eapol_rx_src[ETH_ALEN];
  608. unsigned int last_eapol_matches_bssid:1;
  609. unsigned int eap_expected_failure:1;
  610. unsigned int reattach:1; /* reassociation to the same BSS requested */
  611. unsigned int mac_addr_changed:1;
  612. unsigned int added_vif:1;
  613. unsigned int wnmsleep_used:1;
  614. struct os_reltime last_mac_addr_change;
  615. int last_mac_addr_style;
  616. struct ibss_rsn *ibss_rsn;
  617. int set_sta_uapsd;
  618. int sta_uapsd;
  619. int set_ap_uapsd;
  620. int ap_uapsd;
  621. #ifdef CONFIG_SME
  622. struct {
  623. u8 ssid[SSID_MAX_LEN];
  624. size_t ssid_len;
  625. int freq;
  626. u8 assoc_req_ie[200];
  627. size_t assoc_req_ie_len;
  628. int mfp;
  629. int ft_used;
  630. u8 mobility_domain[2];
  631. u8 *ft_ies;
  632. size_t ft_ies_len;
  633. u8 prev_bssid[ETH_ALEN];
  634. int prev_bssid_set;
  635. int auth_alg;
  636. int proto;
  637. int sa_query_count; /* number of pending SA Query requests;
  638. * 0 = no SA Query in progress */
  639. int sa_query_timed_out;
  640. u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN *
  641. * sa_query_count octets of pending
  642. * SA Query transaction identifiers */
  643. struct os_reltime sa_query_start;
  644. struct os_reltime last_unprot_disconnect;
  645. enum { HT_SEC_CHAN_UNKNOWN,
  646. HT_SEC_CHAN_ABOVE,
  647. HT_SEC_CHAN_BELOW } ht_sec_chan;
  648. u8 sched_obss_scan;
  649. u16 obss_scan_int;
  650. u16 bss_max_idle_period;
  651. #ifdef CONFIG_SAE
  652. struct sae_data sae;
  653. struct wpabuf *sae_token;
  654. int sae_group_index;
  655. unsigned int sae_pmksa_caching:1;
  656. #endif /* CONFIG_SAE */
  657. } sme;
  658. #endif /* CONFIG_SME */
  659. #ifdef CONFIG_AP
  660. struct hostapd_iface *ap_iface;
  661. void (*ap_configured_cb)(void *ctx, void *data);
  662. void *ap_configured_cb_ctx;
  663. void *ap_configured_cb_data;
  664. #endif /* CONFIG_AP */
  665. struct hostapd_iface *ifmsh;
  666. #ifdef CONFIG_MESH
  667. struct mesh_rsn *mesh_rsn;
  668. int mesh_if_idx;
  669. unsigned int mesh_if_created:1;
  670. unsigned int mesh_ht_enabled:1;
  671. unsigned int mesh_vht_enabled:1;
  672. #endif /* CONFIG_MESH */
  673. unsigned int off_channel_freq;
  674. struct wpabuf *pending_action_tx;
  675. u8 pending_action_src[ETH_ALEN];
  676. u8 pending_action_dst[ETH_ALEN];
  677. u8 pending_action_bssid[ETH_ALEN];
  678. unsigned int pending_action_freq;
  679. int pending_action_no_cck;
  680. int pending_action_without_roc;
  681. unsigned int pending_action_tx_done:1;
  682. void (*pending_action_tx_status_cb)(struct wpa_supplicant *wpa_s,
  683. unsigned int freq, const u8 *dst,
  684. const u8 *src, const u8 *bssid,
  685. const u8 *data, size_t data_len,
  686. enum offchannel_send_action_result
  687. result);
  688. unsigned int roc_waiting_drv_freq;
  689. int action_tx_wait_time;
  690. int p2p_mgmt;
  691. #ifdef CONFIG_P2P
  692. struct p2p_go_neg_results *go_params;
  693. int create_p2p_iface;
  694. u8 pending_interface_addr[ETH_ALEN];
  695. char pending_interface_name[100];
  696. int pending_interface_type;
  697. int p2p_group_idx;
  698. unsigned int pending_listen_freq;
  699. unsigned int pending_listen_duration;
  700. enum {
  701. NOT_P2P_GROUP_INTERFACE,
  702. P2P_GROUP_INTERFACE_PENDING,
  703. P2P_GROUP_INTERFACE_GO,
  704. P2P_GROUP_INTERFACE_CLIENT
  705. } p2p_group_interface;
  706. struct p2p_group *p2p_group;
  707. int p2p_long_listen; /* remaining time in long Listen state in ms */
  708. char p2p_pin[10];
  709. int p2p_wps_method;
  710. u8 p2p_auth_invite[ETH_ALEN];
  711. int p2p_sd_over_ctrl_iface;
  712. int p2p_in_provisioning;
  713. int p2p_in_invitation;
  714. int p2p_invite_go_freq;
  715. int pending_invite_ssid_id;
  716. int show_group_started;
  717. u8 go_dev_addr[ETH_ALEN];
  718. int pending_pd_before_join;
  719. u8 pending_join_iface_addr[ETH_ALEN];
  720. u8 pending_join_dev_addr[ETH_ALEN];
  721. int pending_join_wps_method;
  722. u8 p2p_join_ssid[SSID_MAX_LEN];
  723. size_t p2p_join_ssid_len;
  724. int p2p_join_scan_count;
  725. int auto_pd_scan_retry;
  726. int force_long_sd;
  727. u16 pending_pd_config_methods;
  728. enum {
  729. NORMAL_PD, AUTO_PD_GO_NEG, AUTO_PD_JOIN, AUTO_PD_ASP
  730. } pending_pd_use;
  731. /*
  732. * Whether cross connection is disallowed by the AP to which this
  733. * interface is associated (only valid if there is an association).
  734. */
  735. int cross_connect_disallowed;
  736. /*
  737. * Whether this P2P group is configured to use cross connection (only
  738. * valid if this is P2P GO interface). The actual cross connect packet
  739. * forwarding may not be configured depending on the uplink status.
  740. */
  741. int cross_connect_enabled;
  742. /* Whether cross connection forwarding is in use at the moment. */
  743. int cross_connect_in_use;
  744. /*
  745. * Uplink interface name for cross connection
  746. */
  747. char cross_connect_uplink[100];
  748. unsigned int p2p_auto_join:1;
  749. unsigned int p2p_auto_pd:1;
  750. unsigned int p2p_persistent_group:1;
  751. unsigned int p2p_fallback_to_go_neg:1;
  752. unsigned int p2p_pd_before_go_neg:1;
  753. unsigned int p2p_go_ht40:1;
  754. unsigned int p2p_go_vht:1;
  755. unsigned int user_initiated_pd:1;
  756. unsigned int p2p_go_group_formation_completed:1;
  757. unsigned int group_formation_reported:1;
  758. unsigned int waiting_presence_resp;
  759. int p2p_first_connection_timeout;
  760. unsigned int p2p_nfc_tag_enabled:1;
  761. unsigned int p2p_peer_oob_pk_hash_known:1;
  762. unsigned int p2p_disable_ip_addr_req:1;
  763. unsigned int p2ps_method_config_any:1;
  764. unsigned int p2p_cli_probe:1;
  765. int p2p_persistent_go_freq;
  766. int p2p_persistent_id;
  767. int p2p_go_intent;
  768. int p2p_connect_freq;
  769. struct os_reltime p2p_auto_started;
  770. struct wpa_ssid *p2p_last_4way_hs_fail;
  771. struct wpa_radio_work *p2p_scan_work;
  772. struct wpa_radio_work *p2p_listen_work;
  773. struct wpa_radio_work *p2p_send_action_work;
  774. u16 p2p_oob_dev_pw_id; /* OOB Device Password Id for group formation */
  775. struct wpabuf *p2p_oob_dev_pw; /* OOB Device Password for group
  776. * formation */
  777. u8 p2p_peer_oob_pubkey_hash[WPS_OOB_PUBKEY_HASH_LEN];
  778. u8 p2p_ip_addr_info[3 * 4];
  779. /* group common frequencies */
  780. int *p2p_group_common_freqs;
  781. unsigned int p2p_group_common_freqs_num;
  782. u8 p2ps_join_addr[ETH_ALEN];
  783. unsigned int p2p_go_max_oper_chwidth;
  784. unsigned int p2p_go_vht_center_freq2;
  785. #endif /* CONFIG_P2P */
  786. struct wpa_ssid *bgscan_ssid;
  787. const struct bgscan_ops *bgscan;
  788. void *bgscan_priv;
  789. const struct autoscan_ops *autoscan;
  790. struct wpa_driver_scan_params *autoscan_params;
  791. void *autoscan_priv;
  792. struct wpa_ssid *connect_without_scan;
  793. struct wps_ap_info *wps_ap;
  794. size_t num_wps_ap;
  795. int wps_ap_iter;
  796. int after_wps;
  797. int known_wps_freq;
  798. unsigned int wps_freq;
  799. int wps_fragment_size;
  800. int auto_reconnect_disabled;
  801. /* Channel preferences for AP/P2P GO use */
  802. int best_24_freq;
  803. int best_5_freq;
  804. int best_overall_freq;
  805. struct gas_query *gas;
  806. #ifdef CONFIG_INTERWORKING
  807. unsigned int fetch_anqp_in_progress:1;
  808. unsigned int network_select:1;
  809. unsigned int auto_select:1;
  810. unsigned int auto_network_select:1;
  811. unsigned int interworking_fast_assoc_tried:1;
  812. unsigned int fetch_all_anqp:1;
  813. unsigned int fetch_osu_info:1;
  814. unsigned int fetch_osu_waiting_scan:1;
  815. unsigned int fetch_osu_icon_in_progress:1;
  816. struct wpa_bss *interworking_gas_bss;
  817. unsigned int osu_icon_id;
  818. struct dl_list icon_head; /* struct icon_entry */
  819. struct osu_provider *osu_prov;
  820. size_t osu_prov_count;
  821. struct os_reltime osu_icon_fetch_start;
  822. unsigned int num_osu_scans;
  823. unsigned int num_prov_found;
  824. #endif /* CONFIG_INTERWORKING */
  825. unsigned int drv_capa_known;
  826. struct {
  827. struct hostapd_hw_modes *modes;
  828. u16 num_modes;
  829. u16 flags;
  830. } hw;
  831. enum local_hw_capab {
  832. CAPAB_NO_HT_VHT,
  833. CAPAB_HT,
  834. CAPAB_HT40,
  835. CAPAB_VHT,
  836. } hw_capab;
  837. #ifdef CONFIG_MACSEC
  838. struct ieee802_1x_kay *kay;
  839. #endif /* CONFIG_MACSEC */
  840. int pno;
  841. int pno_sched_pending;
  842. /* WLAN_REASON_* reason codes. Negative if locally generated. */
  843. int disconnect_reason;
  844. /* WLAN_STATUS_* status codes from (Re)Association Response frame. */
  845. u16 assoc_status_code;
  846. struct ext_password_data *ext_pw;
  847. struct wpabuf *last_gas_resp, *prev_gas_resp;
  848. u8 last_gas_addr[ETH_ALEN], prev_gas_addr[ETH_ALEN];
  849. u8 last_gas_dialog_token, prev_gas_dialog_token;
  850. unsigned int no_keep_alive:1;
  851. unsigned int ext_mgmt_frame_handling:1;
  852. unsigned int ext_eapol_frame_io:1;
  853. unsigned int wmm_ac_supported:1;
  854. unsigned int ext_work_in_progress:1;
  855. unsigned int own_disconnect_req:1;
  856. #define MAC_ADDR_RAND_SCAN BIT(0)
  857. #define MAC_ADDR_RAND_SCHED_SCAN BIT(1)
  858. #define MAC_ADDR_RAND_PNO BIT(2)
  859. #define MAC_ADDR_RAND_ALL (MAC_ADDR_RAND_SCAN | \
  860. MAC_ADDR_RAND_SCHED_SCAN | \
  861. MAC_ADDR_RAND_PNO)
  862. unsigned int mac_addr_rand_supported;
  863. unsigned int mac_addr_rand_enable;
  864. /* MAC Address followed by mask (2 * ETH_ALEN) */
  865. u8 *mac_addr_scan;
  866. u8 *mac_addr_sched_scan;
  867. u8 *mac_addr_pno;
  868. #ifdef CONFIG_WNM
  869. u8 wnm_dialog_token;
  870. u8 wnm_reply;
  871. u8 wnm_num_neighbor_report;
  872. u8 wnm_mode;
  873. u16 wnm_dissoc_timer;
  874. u8 wnm_bss_termination_duration[12];
  875. struct neighbor_report *wnm_neighbor_report_elements;
  876. struct os_reltime wnm_cand_valid_until;
  877. u8 wnm_cand_from_bss[ETH_ALEN];
  878. #endif /* CONFIG_WNM */
  879. #ifdef CONFIG_TESTING_GET_GTK
  880. u8 last_gtk[32];
  881. size_t last_gtk_len;
  882. #endif /* CONFIG_TESTING_GET_GTK */
  883. unsigned int num_multichan_concurrent;
  884. struct wpa_radio_work *connect_work;
  885. unsigned int ext_work_id;
  886. struct wpabuf *vendor_elem[NUM_VENDOR_ELEM_FRAMES];
  887. #ifdef CONFIG_TESTING_OPTIONS
  888. struct l2_packet_data *l2_test;
  889. unsigned int extra_roc_dur;
  890. enum wpa_supplicant_test_failure test_failure;
  891. unsigned int p2p_go_csa_on_inv:1;
  892. #endif /* CONFIG_TESTING_OPTIONS */
  893. struct wmm_ac_assoc_data *wmm_ac_assoc_info;
  894. struct wmm_tspec_element *tspecs[WMM_AC_NUM][TS_DIR_IDX_COUNT];
  895. struct wmm_ac_addts_request *addts_request;
  896. u8 wmm_ac_last_dialog_token;
  897. struct wmm_tspec_element *last_tspecs;
  898. u8 last_tspecs_count;
  899. struct rrm_data rrm;
  900. #ifdef CONFIG_FST
  901. struct fst_iface *fst;
  902. const struct wpabuf *fst_ies;
  903. struct wpabuf *received_mb_ies;
  904. #endif /* CONFIG_FST */
  905. #ifdef CONFIG_MBO
  906. /* Multiband operation non-preferred channel */
  907. struct wpa_mbo_non_pref_channel {
  908. enum mbo_non_pref_chan_reason reason;
  909. u8 oper_class;
  910. u8 chan;
  911. u8 reason_detail;
  912. u8 preference;
  913. } *non_pref_chan;
  914. size_t non_pref_chan_num;
  915. u8 mbo_wnm_token;
  916. #endif /* CONFIG_MBO */
  917. /*
  918. * This should be under CONFIG_MBO, but it is left out to allow using
  919. * the bss_temp_disallowed list for other purposes as well.
  920. */
  921. struct dl_list bss_tmp_disallowed;
  922. };
  923. /* wpa_supplicant.c */
  924. void wpa_supplicant_apply_ht_overrides(
  925. struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
  926. struct wpa_driver_associate_params *params);
  927. void wpa_supplicant_apply_vht_overrides(
  928. struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
  929. struct wpa_driver_associate_params *params);
  930. int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
  931. int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s,
  932. struct wpa_ssid *ssid);
  933. int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s);
  934. const char * wpa_supplicant_state_txt(enum wpa_states state);
  935. int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s);
  936. int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s);
  937. int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
  938. struct wpa_bss *bss, struct wpa_ssid *ssid,
  939. u8 *wpa_ie, size_t *wpa_ie_len);
  940. void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
  941. struct wpa_bss *bss,
  942. struct wpa_ssid *ssid);
  943. void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s,
  944. struct wpa_ssid *ssid);
  945. void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s);
  946. void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr);
  947. void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
  948. int sec, int usec);
  949. void wpa_supplicant_reinit_autoscan(struct wpa_supplicant *wpa_s);
  950. void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
  951. enum wpa_states state);
  952. struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s);
  953. const char * wpa_supplicant_get_eap_mode(struct wpa_supplicant *wpa_s);
  954. void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
  955. void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
  956. int reason_code);
  957. void wpa_supplicant_enable_network(struct wpa_supplicant *wpa_s,
  958. struct wpa_ssid *ssid);
  959. void wpa_supplicant_disable_network(struct wpa_supplicant *wpa_s,
  960. struct wpa_ssid *ssid);
  961. void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s,
  962. struct wpa_ssid *ssid);
  963. int wpas_set_pkcs11_engine_and_module_path(struct wpa_supplicant *wpa_s,
  964. const char *pkcs11_engine_path,
  965. const char *pkcs11_module_path);
  966. int wpa_supplicant_set_ap_scan(struct wpa_supplicant *wpa_s,
  967. int ap_scan);
  968. int wpa_supplicant_set_bss_expiration_age(struct wpa_supplicant *wpa_s,
  969. unsigned int expire_age);
  970. int wpa_supplicant_set_bss_expiration_count(struct wpa_supplicant *wpa_s,
  971. unsigned int expire_count);
  972. int wpa_supplicant_set_scan_interval(struct wpa_supplicant *wpa_s,
  973. int scan_interval);
  974. int wpa_supplicant_set_debug_params(struct wpa_global *global,
  975. int debug_level, int debug_timestamp,
  976. int debug_show_keys);
  977. void free_hw_features(struct wpa_supplicant *wpa_s);
  978. void wpa_show_license(void);
  979. struct wpa_interface * wpa_supplicant_match_iface(struct wpa_global *global,
  980. const char *ifname);
  981. struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
  982. struct wpa_interface *iface,
  983. struct wpa_supplicant *parent);
  984. int wpa_supplicant_remove_iface(struct wpa_global *global,
  985. struct wpa_supplicant *wpa_s,
  986. int terminate);
  987. struct wpa_supplicant * wpa_supplicant_get_iface(struct wpa_global *global,
  988. const char *ifname);
  989. struct wpa_global * wpa_supplicant_init(struct wpa_params *params);
  990. int wpa_supplicant_run(struct wpa_global *global);
  991. void wpa_supplicant_deinit(struct wpa_global *global);
  992. int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
  993. struct wpa_ssid *ssid);
  994. void wpa_supplicant_terminate_proc(struct wpa_global *global);
  995. void wpa_supplicant_rx_eapol(void *ctx, const u8 *src_addr,
  996. const u8 *buf, size_t len);
  997. void wpa_supplicant_update_config(struct wpa_supplicant *wpa_s);
  998. void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s);
  999. void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid);
  1000. int wpas_driver_bss_selection(struct wpa_supplicant *wpa_s);
  1001. int wpas_is_p2p_prioritized(struct wpa_supplicant *wpa_s);
  1002. void wpas_auth_failed(struct wpa_supplicant *wpa_s, char *reason);
  1003. void wpas_clear_temp_disabled(struct wpa_supplicant *wpa_s,
  1004. struct wpa_ssid *ssid, int clear_failures);
  1005. int disallowed_bssid(struct wpa_supplicant *wpa_s, const u8 *bssid);
  1006. int disallowed_ssid(struct wpa_supplicant *wpa_s, const u8 *ssid,
  1007. size_t ssid_len);
  1008. void wpas_request_connection(struct wpa_supplicant *wpa_s);
  1009. int wpas_build_ext_capab(struct wpa_supplicant *wpa_s, u8 *buf, size_t buflen);
  1010. int wpas_update_random_addr(struct wpa_supplicant *wpa_s, int style);
  1011. int wpas_update_random_addr_disassoc(struct wpa_supplicant *wpa_s);
  1012. void add_freq(int *freqs, int *num_freqs, int freq);
  1013. void wpas_rrm_reset(struct wpa_supplicant *wpa_s);
  1014. void wpas_rrm_process_neighbor_rep(struct wpa_supplicant *wpa_s,
  1015. const u8 *report, size_t report_len);
  1016. int wpas_rrm_send_neighbor_rep_request(struct wpa_supplicant *wpa_s,
  1017. const struct wpa_ssid *ssid,
  1018. void (*cb)(void *ctx,
  1019. struct wpabuf *neighbor_rep),
  1020. void *cb_ctx);
  1021. void wpas_rrm_handle_link_measurement_request(struct wpa_supplicant *wpa_s,
  1022. const u8 *src,
  1023. const u8 *frame, size_t len,
  1024. int rssi);
  1025. /* MBO functions */
  1026. int wpas_mbo_ie(struct wpa_supplicant *wpa_s, u8 *buf, size_t len);
  1027. const u8 * wpas_mbo_get_bss_attr(struct wpa_bss *bss, enum mbo_attr_id attr);
  1028. int wpas_mbo_update_non_pref_chan(struct wpa_supplicant *wpa_s,
  1029. const char *non_pref_chan);
  1030. void wpas_mbo_scan_ie(struct wpa_supplicant *wpa_s, struct wpabuf *ie);
  1031. int wpas_mbo_supp_op_class_ie(struct wpa_supplicant *wpa_s, int freq, u8 *pos,
  1032. size_t len);
  1033. void wpas_mbo_ie_trans_req(struct wpa_supplicant *wpa_s, const u8 *ie,
  1034. size_t len);
  1035. size_t wpas_mbo_ie_bss_trans_reject(struct wpa_supplicant *wpa_s, u8 *pos,
  1036. size_t len,
  1037. enum mbo_transition_reject_reason reason);
  1038. void wpas_mbo_update_cell_capa(struct wpa_supplicant *wpa_s, u8 mbo_cell_capa);
  1039. /**
  1040. * wpa_supplicant_ctrl_iface_ctrl_rsp_handle - Handle a control response
  1041. * @wpa_s: Pointer to wpa_supplicant data
  1042. * @ssid: Pointer to the network block the reply is for
  1043. * @field: field the response is a reply for
  1044. * @value: value (ie, password, etc) for @field
  1045. * Returns: 0 on success, non-zero on error
  1046. *
  1047. * Helper function to handle replies to control interface requests.
  1048. */
  1049. int wpa_supplicant_ctrl_iface_ctrl_rsp_handle(struct wpa_supplicant *wpa_s,
  1050. struct wpa_ssid *ssid,
  1051. const char *field,
  1052. const char *value);
  1053. void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
  1054. const struct wpa_ssid *ssid,
  1055. struct hostapd_freq_params *freq);
  1056. /* events.c */
  1057. void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s);
  1058. int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
  1059. struct wpa_bss *selected,
  1060. struct wpa_ssid *ssid);
  1061. void wpa_supplicant_stop_countermeasures(void *eloop_ctx, void *sock_ctx);
  1062. void wpa_supplicant_delayed_mic_error_report(void *eloop_ctx, void *sock_ctx);
  1063. void wnm_bss_keep_alive_deinit(struct wpa_supplicant *wpa_s);
  1064. int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s);
  1065. struct wpa_bss * wpa_supplicant_pick_network(struct wpa_supplicant *wpa_s,
  1066. struct wpa_ssid **selected_ssid);
  1067. /* eap_register.c */
  1068. int eap_register_methods(void);
  1069. /**
  1070. * Utility method to tell if a given network is for persistent group storage
  1071. * @ssid: Network object
  1072. * Returns: 1 if network is a persistent group, 0 otherwise
  1073. */
  1074. static inline int network_is_persistent_group(struct wpa_ssid *ssid)
  1075. {
  1076. return ssid->disabled == 2 && ssid->p2p_persistent_group;
  1077. }
  1078. int wpas_network_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
  1079. int wpas_get_ssid_pmf(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
  1080. int wpas_init_ext_pw(struct wpa_supplicant *wpa_s);
  1081. void dump_freq_data(struct wpa_supplicant *wpa_s, const char *title,
  1082. struct wpa_used_freq_data *freqs_data,
  1083. unsigned int len);
  1084. int get_shared_radio_freqs_data(struct wpa_supplicant *wpa_s,
  1085. struct wpa_used_freq_data *freqs_data,
  1086. unsigned int len);
  1087. int get_shared_radio_freqs(struct wpa_supplicant *wpa_s,
  1088. int *freq_array, unsigned int len);
  1089. void wpas_network_reenabled(void *eloop_ctx, void *timeout_ctx);
  1090. void wpas_vendor_elem_update(struct wpa_supplicant *wpa_s);
  1091. struct wpa_supplicant * wpas_vendor_elem(struct wpa_supplicant *wpa_s,
  1092. enum wpa_vendor_elem_frame frame);
  1093. int wpas_vendor_elem_remove(struct wpa_supplicant *wpa_s, int frame,
  1094. const u8 *elem, size_t len);
  1095. #ifdef CONFIG_FST
  1096. struct fst_wpa_obj;
  1097. void fst_wpa_supplicant_fill_iface_obj(struct wpa_supplicant *wpa_s,
  1098. struct fst_wpa_obj *iface_obj);
  1099. #endif /* CONFIG_FST */
  1100. int wpas_sched_scan_plans_set(struct wpa_supplicant *wpa_s, const char *cmd);
  1101. struct hostapd_hw_modes * get_mode(struct hostapd_hw_modes *modes,
  1102. u16 num_modes, enum hostapd_hw_mode mode);
  1103. void wpa_bss_tmp_disallow(struct wpa_supplicant *wpa_s, const u8 *bssid,
  1104. unsigned int sec);
  1105. int wpa_is_bss_tmp_disallowed(struct wpa_supplicant *wpa_s, const u8 *bssid);
  1106. struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
  1107. int i, struct wpa_bss *bss,
  1108. struct wpa_ssid *group,
  1109. int only_first_ssid);
  1110. #endif /* WPA_SUPPLICANT_I_H */