blob: dfe5c7453af59ab63dc7e306a6cdd56d2c82127b [file] [log] [blame]
Gabriel Biren57ededa2021-09-03 16:08:50 +00001/*
2 * WPA Supplicant - Aidl entry point to wpa_supplicant core
3 * Copyright (c) 2021, Google Inc. All rights reserved.
4 *
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
7 */
8
9#ifndef WPA_SUPPLICANT_AIDL_AIDL_H
10#define WPA_SUPPLICANT_AIDL_AIDL_H
11
12#ifdef _cplusplus
13extern "C"
14{
15#endif // _cplusplus
16
17 /**
18 * This is the aidl RPC interface entry point to the wpa_supplicant
19 * core. This initializes the aidl driver & AidlManager instance and
20 * then forwards all the notifcations from the supplicant core to the
21 * AidlManager.
22 */
23 struct wpas_aidl_priv;
24 struct wpa_global;
25
26 struct wpas_aidl_priv *wpas_aidl_init(struct wpa_global *global);
27 void wpas_aidl_deinit(struct wpas_aidl_priv *priv);
28
29#ifdef CONFIG_CTRL_IFACE_AIDL
30 int wpas_aidl_register_interface(struct wpa_supplicant *wpa_s);
31 int wpas_aidl_unregister_interface(struct wpa_supplicant *wpa_s);
32 int wpas_aidl_register_network(
33 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
34 int wpas_aidl_unregister_network(
35 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
36 int wpas_aidl_notify_state_changed(struct wpa_supplicant *wpa_s);
37 int wpas_aidl_notify_network_request(
38 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
39 enum wpa_ctrl_req_type rtype, const char *default_txt);
Steven Liu850c2e02022-11-28 17:26:39 +000040 void wpas_aidl_notify_permanent_id_req_denied(struct wpa_supplicant *wpa_s);
Gabriel Biren57ededa2021-09-03 16:08:50 +000041 void wpas_aidl_notify_anqp_query_done(
42 struct wpa_supplicant *wpa_s, const u8 *bssid, const char *result,
43 const struct wpa_bss_anqp *anqp);
44 void wpas_aidl_notify_hs20_icon_query_done(
45 struct wpa_supplicant *wpa_s, const u8 *bssid,
46 const char *file_name, const u8 *image, u32 image_length);
47 void wpas_aidl_notify_hs20_rx_subscription_remediation(
48 struct wpa_supplicant *wpa_s, const char *url, u8 osu_method);
49 void wpas_aidl_notify_hs20_rx_deauth_imminent_notice(
50 struct wpa_supplicant *wpa_s, u8 code, u16 reauth_delay,
51 const char *url);
52 void wpas_aidl_notify_hs20_rx_terms_and_conditions_acceptance(
53 struct wpa_supplicant *wpa_s, const char *url);
54 void wpas_aidl_notify_disconnect_reason(struct wpa_supplicant *wpa_s);
Veerendranath Jakkambc2fa492023-05-25 01:26:50 +053055 void wpas_aidl_notify_mlo_info_change_reason(
56 struct wpa_supplicant *wpa_s,
57 enum mlo_info_change_reason reason);
58
Gabriel Biren57ededa2021-09-03 16:08:50 +000059 void wpas_aidl_notify_assoc_reject(struct wpa_supplicant *wpa_s, const u8 *bssid,
60 u8 timed_out, const u8 *assoc_resp_ie, size_t assoc_resp_ie_len);
61 void wpas_aidl_notify_auth_timeout(struct wpa_supplicant *wpa_s);
62 void wpas_aidl_notify_bssid_changed(struct wpa_supplicant *wpa_s);
63 void wpas_aidl_notify_wps_event_fail(
64 struct wpa_supplicant *wpa_s, uint8_t *peer_macaddr,
65 uint16_t config_error, uint16_t error_indication);
66 void wpas_aidl_notify_wps_event_success(struct wpa_supplicant *wpa_s);
67 void wpas_aidl_notify_wps_event_pbc_overlap(
68 struct wpa_supplicant *wpa_s);
69 void wpas_aidl_notify_p2p_device_found(
70 struct wpa_supplicant *wpa_s, const u8 *addr,
71 const struct p2p_peer_info *info, const u8 *peer_wfd_device_info,
72 u8 peer_wfd_device_info_len, const u8 *peer_wfd_r2_device_info,
73 u8 peer_wfd_r2_device_info_len);
74 void wpas_aidl_notify_p2p_device_lost(
75 struct wpa_supplicant *wpa_s, const u8 *p2p_device_addr);
76 void wpas_aidl_notify_p2p_find_stopped(struct wpa_supplicant *wpa_s);
77 void wpas_aidl_notify_p2p_go_neg_req(
78 struct wpa_supplicant *wpa_s, const u8 *src_addr, u16 dev_passwd_id,
79 u8 go_intent);
80 void wpas_aidl_notify_p2p_go_neg_completed(
81 struct wpa_supplicant *wpa_s, const struct p2p_go_neg_results *res);
82 void wpas_aidl_notify_p2p_group_formation_failure(
83 struct wpa_supplicant *wpa_s, const char *reason);
84 void wpas_aidl_notify_p2p_group_started(
85 struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid,
Sunil Ravi68c25c22023-02-04 06:17:03 +000086 int persistent, int client, const u8 *ip);
Gabriel Biren57ededa2021-09-03 16:08:50 +000087 void wpas_aidl_notify_p2p_group_removed(
88 struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid,
89 const char *role);
90 void wpas_aidl_notify_p2p_invitation_received(
91 struct wpa_supplicant *wpa_s, const u8 *sa, const u8 *go_dev_addr,
92 const u8 *bssid, int id, int op_freq);
93 void wpas_aidl_notify_p2p_invitation_result(
94 struct wpa_supplicant *wpa_s, int status, const u8 *bssid);
95 void wpas_aidl_notify_p2p_provision_discovery(
96 struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request,
97 enum p2p_prov_disc_status status, u16 config_methods,
98 unsigned int generated_pin);
99 void wpas_aidl_notify_p2p_sd_response(
100 struct wpa_supplicant *wpa_s, const u8 *sa, u16 update_indic,
101 const u8 *tlvs, size_t tlvs_len);
102 void wpas_aidl_notify_ap_sta_authorized(
103 struct wpa_supplicant *wpa_s, const u8 *sta,
104 const u8 *p2p_dev_addr);
105 void wpas_aidl_notify_ap_sta_deauthorized(
106 struct wpa_supplicant *wpa_s, const u8 *sta,
107 const u8 *p2p_dev_addr);
108 void wpas_aidl_notify_eap_error(
109 struct wpa_supplicant *wpa_s, int error_code);
110 void wpas_aidl_notify_dpp_config_received(struct wpa_supplicant *wpa_s,
Sunil Ravi546a7b52022-08-26 22:06:04 +0000111 struct wpa_ssid *ssid, bool conn_status_requested);
Gabriel Biren57ededa2021-09-03 16:08:50 +0000112 void wpas_aidl_notify_dpp_config_sent(struct wpa_supplicant *wpa_s);
Sunil Ravi546a7b52022-08-26 22:06:04 +0000113 void wpas_aidl_notify_dpp_connection_status_sent(struct wpa_supplicant *wpa_s,
114 enum dpp_status_error result);
Gabriel Biren57ededa2021-09-03 16:08:50 +0000115 void wpas_aidl_notify_dpp_auth_success(struct wpa_supplicant *wpa_s);
116 void wpas_aidl_notify_dpp_resp_pending(struct wpa_supplicant *wpa_s);
117 void wpas_aidl_notify_dpp_not_compatible(struct wpa_supplicant *wpa_s);
118 void wpas_aidl_notify_dpp_missing_auth(struct wpa_supplicant *wpa_s);
119 void wpas_aidl_notify_dpp_configuration_failure(struct wpa_supplicant *wpa_s);
120 void wpas_aidl_notify_dpp_invalid_uri(struct wpa_supplicant *wpa_s);
121 void wpas_aidl_notify_dpp_timeout(struct wpa_supplicant *wpa_s);
122 void wpas_aidl_notify_dpp_auth_failure(struct wpa_supplicant *wpa_s);
123 void wpas_aidl_notify_dpp_fail(struct wpa_supplicant *wpa_s);
124 void wpas_aidl_notify_dpp_config_sent_wait_response(struct wpa_supplicant *wpa_s);
125 void wpas_aidl_notify_dpp_config_accepted(struct wpa_supplicant *wpa_s);
126 void wpas_aidl_notify_dpp_config_rejected(struct wpa_supplicant *wpa_s);
127 void wpas_aidl_notify_dpp_conn_status(struct wpa_supplicant *wpa_s,
128 enum dpp_status_error status, const char *ssid,
129 const char *channel_list, unsigned short band_list[], int size);
130 void wpas_aidl_notify_pmk_cache_added(
131 struct wpa_supplicant *wpas, struct rsn_pmksa_cache_entry *pmksa_entry);
132 void wpas_aidl_notify_bss_tm_status(struct wpa_supplicant *wpa_s);
133 void wpas_aidl_notify_transition_disable(
134 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, u8 bitmap);
135 void wpas_aidl_notify_network_not_found(struct wpa_supplicant *wpa_s);
Sunil Ravi65a724b2022-05-24 11:06:09 -0700136 void wpas_aidl_notify_frequency_changed(struct wpa_supplicant *wpa_s, int frequency);
Jimmy Chen429daf92021-10-20 13:27:23 +0800137 void wpas_aidl_notify_ceritification(struct wpa_supplicant *wpa_s,
138 int depth, const char *subject,
139 const char *altsubject[],
140 int num_altsubject,
141 const char *cert_hash,
142 const struct wpabuf *cert);
Gabriel Biren3a2ec2c2022-03-07 17:59:41 +0000143 void wpas_aidl_notify_eap_method_selected(struct wpa_supplicant *wpa_s,
144 const char *reason_string);
145 void wpas_aidl_notify_ssid_temp_disabled(struct wpa_supplicant *wpa_s,
146 const char *reason_string);
147 void wpas_aidl_notify_open_ssl_failure(struct wpa_supplicant *wpa_s,
148 const char *reason_string);
Shivani Baranwal84940f82022-02-02 10:21:47 +0530149 void wpas_aidl_notify_qos_policy_reset(struct wpa_supplicant *wpa_s);
150 void wpas_aidl_notify_qos_policy_request(struct wpa_supplicant *wpa_s,
151 struct dscp_policy_data *policies, int num_policies);
Gabriel Biren93398232022-12-15 19:18:28 +0000152 ssize_t wpas_aidl_get_certificate(const char* alias, uint8_t** value);
Xinyue Ling1629ad82023-03-24 16:19:51 +0800153 ssize_t wpas_aidl_list_aliases(const char *prefix, char ***aliases);
Swarn Singhc450e7b2023-03-28 17:36:22 +0530154 void wpas_aidl_notify_qos_policy_scs_response(struct wpa_supplicant *wpa_s,
155 unsigned int count, int **scs_resp);
Gabriel Biren57ededa2021-09-03 16:08:50 +0000156#else // CONFIG_CTRL_IFACE_AIDL
157static inline int wpas_aidl_register_interface(struct wpa_supplicant *wpa_s)
158{
159 return 0;
160}
161static inline int wpas_aidl_unregister_interface(struct wpa_supplicant *wpa_s)
162{
163 return 0;
164}
165static inline int wpas_aidl_register_network(
166 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
167{
168 return 0;
169}
170static inline int wpas_aidl_unregister_network(
171 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
172{
173 return 0;
174}
175static inline int wpas_aidl_notify_state_changed(struct wpa_supplicant *wpa_s)
176{
177 return 0;
178}
179static inline int wpas_aidl_notify_network_request(
180 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
181 enum wpa_ctrl_req_type rtype, const char *default_txt)
182{
183 return 0;
184}
Steven Liu850c2e02022-11-28 17:26:39 +0000185static void wpas_aidl_notify_permanent_id_req_denied(struct wpa_supplicant *wpa_s)
186{}
Gabriel Biren57ededa2021-09-03 16:08:50 +0000187static void wpas_aidl_notify_anqp_query_done(
188 struct wpa_supplicant *wpa_s, const u8 *bssid, const char *result,
189 const struct wpa_bss_anqp *anqp)
190{}
191static void wpas_aidl_notify_hs20_icon_query_done(
192 struct wpa_supplicant *wpa_s, const u8 *bssid, const char *file_name,
193 const u8 *image, u32 image_length)
194{}
195static void wpas_aidl_notify_hs20_rx_subscription_remediation(
196 struct wpa_supplicant *wpa_s, const char *url, u8 osu_method)
197{}
198static void wpas_aidl_notify_hs20_rx_deauth_imminent_notice(
199 struct wpa_supplicant *wpa_s, u8 code, u16 reauth_delay, const char *url)
200{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530201static void wpas_aidl_notify_hs20_rx_terms_and_conditions_acceptance(
Gabriel Biren57ededa2021-09-03 16:08:50 +0000202 struct wpa_supplicant *wpa_s, const char *url)
203{}
204static void wpas_aidl_notify_disconnect_reason(struct wpa_supplicant *wpa_s) {}
Veerendranath Jakkambc2fa492023-05-25 01:26:50 +0530205static void wpas_aidl_notify_mlo_info_change_reason(
206 struct wpa_supplicant *wpa_s, enum mlo_info_change_reason reason)
207{}
Gabriel Biren57ededa2021-09-03 16:08:50 +0000208static void wpas_aidl_notify_assoc_reject(struct wpa_supplicant *wpa_s, const u8 *bssid,
209 u8 timed_out, const u8 *assoc_resp_ie, size_t assoc_resp_ie_len) {}
210static void wpas_aidl_notify_auth_timeout(struct wpa_supplicant *wpa_s) {}
211static void wpas_aidl_notify_wps_event_fail(
212 struct wpa_supplicant *wpa_s, uint8_t *peer_macaddr, uint16_t config_error,
213 uint16_t error_indication)
214{}
215static void wpas_aidl_notify_bssid_changed(struct wpa_supplicant *wpa_s) {}
216static void wpas_aidl_notify_wps_event_success(struct wpa_supplicant *wpa_s) {}
217static void wpas_aidl_notify_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s)
218{}
219static void wpas_aidl_notify_p2p_device_found(
220 struct wpa_supplicant *wpa_s, const u8 *addr,
221 const struct p2p_peer_info *info, const u8 *peer_wfd_device_info,
Gabriel Biren75efb072023-02-02 18:10:52 +0000222 u8 peer_wfd_device_info_len, const u8 *peer_wfd_r2_device_info,
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530223 u8 peer_wfd_r2_device_info_len)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000224{}
225static void wpas_aidl_notify_p2p_device_lost(
226 struct wpa_supplicant *wpa_s, const u8 *p2p_device_addr)
227{}
228static void wpas_aidl_notify_p2p_find_stopped(struct wpa_supplicant *wpa_s) {}
229static void wpas_aidl_notify_p2p_go_neg_req(
230 struct wpa_supplicant *wpa_s, const u8 *src_addr, u16 dev_passwd_id,
231 u8 go_intent)
232{}
233static void wpas_aidl_notify_p2p_go_neg_completed(
234 struct wpa_supplicant *wpa_s, const struct p2p_go_neg_results *res)
235{}
236static void wpas_aidl_notify_p2p_group_formation_failure(
237 struct wpa_supplicant *wpa_s, const char *reason)
238{}
239static void wpas_aidl_notify_p2p_group_started(
240 struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, int persistent,
Sunil Ravi68c25c22023-02-04 06:17:03 +0000241 int client, const u8 *ip)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000242{}
243static void wpas_aidl_notify_p2p_group_removed(
244 struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, const char *role)
245{}
246static void wpas_aidl_notify_p2p_invitation_received(
247 struct wpa_supplicant *wpa_s, const u8 *sa, const u8 *go_dev_addr,
248 const u8 *bssid, int id, int op_freq)
249{}
250static void wpas_aidl_notify_p2p_invitation_result(
251 struct wpa_supplicant *wpa_s, int status, const u8 *bssid)
252{}
253static void wpas_aidl_notify_p2p_provision_discovery(
254 struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request,
255 enum p2p_prov_disc_status status, u16 config_methods,
256 unsigned int generated_pin)
257{}
258static void wpas_aidl_notify_p2p_sd_response(
259 struct wpa_supplicant *wpa_s, const u8 *sa, u16 update_indic,
260 const u8 *tlvs, size_t tlvs_len)
261{}
262static void wpas_aidl_notify_ap_sta_authorized(
263 struct wpa_supplicant *wpa_s, const u8 *sta, const u8 *p2p_dev_addr)
264{}
265static void wpas_aidl_notify_ap_sta_deauthorized(
266 struct wpa_supplicant *wpa_s, const u8 *sta, const u8 *p2p_dev_addr)
267{}
268static void wpas_aidl_notify_eap_error(
269 struct wpa_supplicant *wpa_s, int error_code)
270{}
271static void wpas_aidl_notify_dpp_config_received(struct wpa_supplicant *wpa_s,
Sunil Ravi546a7b52022-08-26 22:06:04 +0000272 struct wpa_ssid *ssid, bool conn_status_requested)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000273{}
Gabriel Biren57ededa2021-09-03 16:08:50 +0000274static void wpas_aidl_notify_dpp_config_sent(struct wpa_supplicant *wpa_s)
275{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530276static void wpas_aidl_notify_dpp_connection_status_sent(struct wpa_supplicant *wpa_s,
Sunil Ravi546a7b52022-08-26 22:06:04 +0000277 enum dpp_status_error result)
278{}
Gabriel Biren57ededa2021-09-03 16:08:50 +0000279static void wpas_aidl_notify_dpp_auth_success(struct wpa_supplicant *wpa_s)
280{}
281static void wpas_aidl_notify_dpp_resp_pending(struct wpa_supplicant *wpa_s)
282{}
283static void wpas_aidl_notify_dpp_not_compatible(struct wpa_supplicant *wpa_s)
284{}
285static void wpas_aidl_notify_dpp_missing_auth(struct wpa_supplicant *wpa_s)
286{}
287static void wpas_aidl_notify_dpp_configuration_failure(struct wpa_supplicant *wpa_s)
288{}
289static void wpas_aidl_notify_dpp_invalid_uri(struct wpa_supplicant *wpa_s)
290{}
291static void wpas_aidl_notify_dpp_timeout(struct wpa_supplicant *wpa_s)
292{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530293static void wpas_aidl_notify_dpp_auth_failure(struct wpa_supplicant *wpa_s)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000294{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530295static void wpas_aidl_notify_dpp_fail(struct wpa_supplicant *wpa_s)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000296{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530297static void wpas_aidl_notify_dpp_config_sent_wait_response(struct wpa_supplicant *wpa_s)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000298{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530299static void wpas_aidl_notify_dpp_config_accepted(struct wpa_supplicant *wpa_s)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000300{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530301static void wpas_aidl_notify_dpp_config_rejected(struct wpa_supplicant *wpa_s)
302{}
303static void wpas_aidl_notify_dpp_conn_status(struct wpa_supplicant *wpa_s,
304 enum dpp_status_error status, const char *ssid,
305 const char *channel_list, unsigned short band_list[], int size)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000306{}
307static void wpas_aidl_notify_pmk_cache_added(struct wpa_supplicant *wpas,
308 struct rsn_pmksa_cache_entry *pmksa_entry)
309{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530310static void wpas_aidl_notify_bss_tm_status(struct wpa_supplicant *wpa_s)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000311{}
312static void wpas_aidl_notify_transition_disable(struct wpa_supplicant *wpa_s,
313 struct wpa_ssid *ssid,
314 u8 bitmap)
315{}
316static void wpas_aidl_notify_network_not_found(struct wpa_supplicant *wpa_s)
317{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530318static void wpas_aidl_notify_frequency_changed(struct wpa_supplicant *wpa_s, int frequency)
Sunil Ravi23087aa2021-12-08 19:01:44 -0800319{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530320static void wpas_aidl_notify_ceritification(struct wpa_supplicant *wpa_s,
Jimmy Chen429daf92021-10-20 13:27:23 +0800321 int depth, const char *subject,
322 const char *altsubject[],
323 int num_altsubject,
324 const char *cert_hash,
325 const struct wpabuf *cert)
326{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530327static void wpas_aidl_notify_eap_method_selected(struct wpa_supplicant *wpa_s,
Gabriel Biren3a2ec2c2022-03-07 17:59:41 +0000328 const char *reason_string)
329{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530330static void wpas_aidl_notify_ssid_temp_disabled(struct wpa_supplicant *wpa_s,
Gabriel Biren3a2ec2c2022-03-07 17:59:41 +0000331 const char *reason_string)
332{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530333static void wpas_aidl_notify_open_ssl_failure(struct wpa_supplicant *wpa_s,
Gabriel Biren3a2ec2c2022-03-07 17:59:41 +0000334 const char *reason_string)
335{}
Shivani Baranwal84940f82022-02-02 10:21:47 +0530336static void wpas_aidl_notify_qos_policy_reset(struct wpa_supplicant *wpa_s) {}
337static void wpas_aidl_notify_qos_policy_request(struct wpa_supplicant *wpa_s,
338 struct dscp_policy_data *policies,
339 int num_policies)
340{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530341static ssize_t wpas_aidl_get_certificate(const char* alias, uint8_t** value)
342{
343 return -1;
344}
Xinyue Ling1629ad82023-03-24 16:19:51 +0800345static ssize_t wpas_aidl_list_aliases(const char *prefix, char ***aliases)
346{
347 return -1;
348}
Swarn Singhc450e7b2023-03-28 17:36:22 +0530349static void wpas_aidl_notify_qos_policy_scs_response(struct wpa_supplicant *wpa_s,
350 unsigned int count, int **scs_resp) {}
Gabriel Biren57ededa2021-09-03 16:08:50 +0000351#endif // CONFIG_CTRL_IFACE_AIDL
352
353#ifdef _cplusplus
354}
355#endif // _cplusplus
356
357#endif // WPA_SUPPLICANT_AIDL_AIDL_H