wpa_supplicant_i.h 39 KB

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