wpa_supplicant_i.h 44 KB

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