blob: f4afc7efd918e0db90087b0f387ed3e8e2dc21bf [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);
55 void wpas_aidl_notify_assoc_reject(struct wpa_supplicant *wpa_s, const u8 *bssid,
56 u8 timed_out, const u8 *assoc_resp_ie, size_t assoc_resp_ie_len);
57 void wpas_aidl_notify_auth_timeout(struct wpa_supplicant *wpa_s);
58 void wpas_aidl_notify_bssid_changed(struct wpa_supplicant *wpa_s);
59 void wpas_aidl_notify_wps_event_fail(
60 struct wpa_supplicant *wpa_s, uint8_t *peer_macaddr,
61 uint16_t config_error, uint16_t error_indication);
62 void wpas_aidl_notify_wps_event_success(struct wpa_supplicant *wpa_s);
63 void wpas_aidl_notify_wps_event_pbc_overlap(
64 struct wpa_supplicant *wpa_s);
65 void wpas_aidl_notify_p2p_device_found(
66 struct wpa_supplicant *wpa_s, const u8 *addr,
67 const struct p2p_peer_info *info, const u8 *peer_wfd_device_info,
68 u8 peer_wfd_device_info_len, const u8 *peer_wfd_r2_device_info,
69 u8 peer_wfd_r2_device_info_len);
70 void wpas_aidl_notify_p2p_device_lost(
71 struct wpa_supplicant *wpa_s, const u8 *p2p_device_addr);
72 void wpas_aidl_notify_p2p_find_stopped(struct wpa_supplicant *wpa_s);
73 void wpas_aidl_notify_p2p_go_neg_req(
74 struct wpa_supplicant *wpa_s, const u8 *src_addr, u16 dev_passwd_id,
75 u8 go_intent);
76 void wpas_aidl_notify_p2p_go_neg_completed(
77 struct wpa_supplicant *wpa_s, const struct p2p_go_neg_results *res);
78 void wpas_aidl_notify_p2p_group_formation_failure(
79 struct wpa_supplicant *wpa_s, const char *reason);
80 void wpas_aidl_notify_p2p_group_started(
81 struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid,
Sunil Ravi68c25c22023-02-04 06:17:03 +000082 int persistent, int client, const u8 *ip);
Gabriel Biren57ededa2021-09-03 16:08:50 +000083 void wpas_aidl_notify_p2p_group_removed(
84 struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid,
85 const char *role);
86 void wpas_aidl_notify_p2p_invitation_received(
87 struct wpa_supplicant *wpa_s, const u8 *sa, const u8 *go_dev_addr,
88 const u8 *bssid, int id, int op_freq);
89 void wpas_aidl_notify_p2p_invitation_result(
90 struct wpa_supplicant *wpa_s, int status, const u8 *bssid);
91 void wpas_aidl_notify_p2p_provision_discovery(
92 struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request,
93 enum p2p_prov_disc_status status, u16 config_methods,
94 unsigned int generated_pin);
95 void wpas_aidl_notify_p2p_sd_response(
96 struct wpa_supplicant *wpa_s, const u8 *sa, u16 update_indic,
97 const u8 *tlvs, size_t tlvs_len);
98 void wpas_aidl_notify_ap_sta_authorized(
99 struct wpa_supplicant *wpa_s, const u8 *sta,
100 const u8 *p2p_dev_addr);
101 void wpas_aidl_notify_ap_sta_deauthorized(
102 struct wpa_supplicant *wpa_s, const u8 *sta,
103 const u8 *p2p_dev_addr);
104 void wpas_aidl_notify_eap_error(
105 struct wpa_supplicant *wpa_s, int error_code);
106 void wpas_aidl_notify_dpp_config_received(struct wpa_supplicant *wpa_s,
Sunil Ravi546a7b52022-08-26 22:06:04 +0000107 struct wpa_ssid *ssid, bool conn_status_requested);
Gabriel Biren57ededa2021-09-03 16:08:50 +0000108 void wpas_aidl_notify_dpp_config_sent(struct wpa_supplicant *wpa_s);
Sunil Ravi546a7b52022-08-26 22:06:04 +0000109 void wpas_aidl_notify_dpp_connection_status_sent(struct wpa_supplicant *wpa_s,
110 enum dpp_status_error result);
Gabriel Biren57ededa2021-09-03 16:08:50 +0000111 void wpas_aidl_notify_dpp_auth_success(struct wpa_supplicant *wpa_s);
112 void wpas_aidl_notify_dpp_resp_pending(struct wpa_supplicant *wpa_s);
113 void wpas_aidl_notify_dpp_not_compatible(struct wpa_supplicant *wpa_s);
114 void wpas_aidl_notify_dpp_missing_auth(struct wpa_supplicant *wpa_s);
115 void wpas_aidl_notify_dpp_configuration_failure(struct wpa_supplicant *wpa_s);
116 void wpas_aidl_notify_dpp_invalid_uri(struct wpa_supplicant *wpa_s);
117 void wpas_aidl_notify_dpp_timeout(struct wpa_supplicant *wpa_s);
118 void wpas_aidl_notify_dpp_auth_failure(struct wpa_supplicant *wpa_s);
119 void wpas_aidl_notify_dpp_fail(struct wpa_supplicant *wpa_s);
120 void wpas_aidl_notify_dpp_config_sent_wait_response(struct wpa_supplicant *wpa_s);
121 void wpas_aidl_notify_dpp_config_accepted(struct wpa_supplicant *wpa_s);
122 void wpas_aidl_notify_dpp_config_rejected(struct wpa_supplicant *wpa_s);
123 void wpas_aidl_notify_dpp_conn_status(struct wpa_supplicant *wpa_s,
124 enum dpp_status_error status, const char *ssid,
125 const char *channel_list, unsigned short band_list[], int size);
126 void wpas_aidl_notify_pmk_cache_added(
127 struct wpa_supplicant *wpas, struct rsn_pmksa_cache_entry *pmksa_entry);
128 void wpas_aidl_notify_bss_tm_status(struct wpa_supplicant *wpa_s);
129 void wpas_aidl_notify_transition_disable(
130 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, u8 bitmap);
131 void wpas_aidl_notify_network_not_found(struct wpa_supplicant *wpa_s);
Sunil Ravi65a724b2022-05-24 11:06:09 -0700132 void wpas_aidl_notify_frequency_changed(struct wpa_supplicant *wpa_s, int frequency);
Jimmy Chen429daf92021-10-20 13:27:23 +0800133 void wpas_aidl_notify_ceritification(struct wpa_supplicant *wpa_s,
134 int depth, const char *subject,
135 const char *altsubject[],
136 int num_altsubject,
137 const char *cert_hash,
138 const struct wpabuf *cert);
Gabriel Biren3a2ec2c2022-03-07 17:59:41 +0000139 void wpas_aidl_notify_eap_method_selected(struct wpa_supplicant *wpa_s,
140 const char *reason_string);
141 void wpas_aidl_notify_ssid_temp_disabled(struct wpa_supplicant *wpa_s,
142 const char *reason_string);
143 void wpas_aidl_notify_open_ssl_failure(struct wpa_supplicant *wpa_s,
144 const char *reason_string);
Shivani Baranwal84940f82022-02-02 10:21:47 +0530145 void wpas_aidl_notify_qos_policy_reset(struct wpa_supplicant *wpa_s);
146 void wpas_aidl_notify_qos_policy_request(struct wpa_supplicant *wpa_s,
147 struct dscp_policy_data *policies, int num_policies);
Gabriel Biren93398232022-12-15 19:18:28 +0000148 ssize_t wpas_aidl_get_certificate(const char* alias, uint8_t** value);
Swarn Singhc450e7b2023-03-28 17:36:22 +0530149 void wpas_aidl_notify_qos_policy_scs_response(struct wpa_supplicant *wpa_s,
150 unsigned int count, int **scs_resp);
Gabriel Biren57ededa2021-09-03 16:08:50 +0000151#else // CONFIG_CTRL_IFACE_AIDL
152static inline int wpas_aidl_register_interface(struct wpa_supplicant *wpa_s)
153{
154 return 0;
155}
156static inline int wpas_aidl_unregister_interface(struct wpa_supplicant *wpa_s)
157{
158 return 0;
159}
160static inline int wpas_aidl_register_network(
161 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
162{
163 return 0;
164}
165static inline int wpas_aidl_unregister_network(
166 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
167{
168 return 0;
169}
170static inline int wpas_aidl_notify_state_changed(struct wpa_supplicant *wpa_s)
171{
172 return 0;
173}
174static inline int wpas_aidl_notify_network_request(
175 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
176 enum wpa_ctrl_req_type rtype, const char *default_txt)
177{
178 return 0;
179}
Steven Liu850c2e02022-11-28 17:26:39 +0000180static void wpas_aidl_notify_permanent_id_req_denied(struct wpa_supplicant *wpa_s)
181{}
Gabriel Biren57ededa2021-09-03 16:08:50 +0000182static void wpas_aidl_notify_anqp_query_done(
183 struct wpa_supplicant *wpa_s, const u8 *bssid, const char *result,
184 const struct wpa_bss_anqp *anqp)
185{}
186static void wpas_aidl_notify_hs20_icon_query_done(
187 struct wpa_supplicant *wpa_s, const u8 *bssid, const char *file_name,
188 const u8 *image, u32 image_length)
189{}
190static void wpas_aidl_notify_hs20_rx_subscription_remediation(
191 struct wpa_supplicant *wpa_s, const char *url, u8 osu_method)
192{}
193static void wpas_aidl_notify_hs20_rx_deauth_imminent_notice(
194 struct wpa_supplicant *wpa_s, u8 code, u16 reauth_delay, const char *url)
195{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530196static void wpas_aidl_notify_hs20_rx_terms_and_conditions_acceptance(
Gabriel Biren57ededa2021-09-03 16:08:50 +0000197 struct wpa_supplicant *wpa_s, const char *url)
198{}
199static void wpas_aidl_notify_disconnect_reason(struct wpa_supplicant *wpa_s) {}
200static void wpas_aidl_notify_assoc_reject(struct wpa_supplicant *wpa_s, const u8 *bssid,
201 u8 timed_out, const u8 *assoc_resp_ie, size_t assoc_resp_ie_len) {}
202static void wpas_aidl_notify_auth_timeout(struct wpa_supplicant *wpa_s) {}
203static void wpas_aidl_notify_wps_event_fail(
204 struct wpa_supplicant *wpa_s, uint8_t *peer_macaddr, uint16_t config_error,
205 uint16_t error_indication)
206{}
207static void wpas_aidl_notify_bssid_changed(struct wpa_supplicant *wpa_s) {}
208static void wpas_aidl_notify_wps_event_success(struct wpa_supplicant *wpa_s) {}
209static void wpas_aidl_notify_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s)
210{}
211static void wpas_aidl_notify_p2p_device_found(
212 struct wpa_supplicant *wpa_s, const u8 *addr,
213 const struct p2p_peer_info *info, const u8 *peer_wfd_device_info,
Gabriel Biren75efb072023-02-02 18:10:52 +0000214 u8 peer_wfd_device_info_len, const u8 *peer_wfd_r2_device_info,
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530215 u8 peer_wfd_r2_device_info_len)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000216{}
217static void wpas_aidl_notify_p2p_device_lost(
218 struct wpa_supplicant *wpa_s, const u8 *p2p_device_addr)
219{}
220static void wpas_aidl_notify_p2p_find_stopped(struct wpa_supplicant *wpa_s) {}
221static void wpas_aidl_notify_p2p_go_neg_req(
222 struct wpa_supplicant *wpa_s, const u8 *src_addr, u16 dev_passwd_id,
223 u8 go_intent)
224{}
225static void wpas_aidl_notify_p2p_go_neg_completed(
226 struct wpa_supplicant *wpa_s, const struct p2p_go_neg_results *res)
227{}
228static void wpas_aidl_notify_p2p_group_formation_failure(
229 struct wpa_supplicant *wpa_s, const char *reason)
230{}
231static void wpas_aidl_notify_p2p_group_started(
232 struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, int persistent,
Sunil Ravi68c25c22023-02-04 06:17:03 +0000233 int client, const u8 *ip)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000234{}
235static void wpas_aidl_notify_p2p_group_removed(
236 struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, const char *role)
237{}
238static void wpas_aidl_notify_p2p_invitation_received(
239 struct wpa_supplicant *wpa_s, const u8 *sa, const u8 *go_dev_addr,
240 const u8 *bssid, int id, int op_freq)
241{}
242static void wpas_aidl_notify_p2p_invitation_result(
243 struct wpa_supplicant *wpa_s, int status, const u8 *bssid)
244{}
245static void wpas_aidl_notify_p2p_provision_discovery(
246 struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request,
247 enum p2p_prov_disc_status status, u16 config_methods,
248 unsigned int generated_pin)
249{}
250static void wpas_aidl_notify_p2p_sd_response(
251 struct wpa_supplicant *wpa_s, const u8 *sa, u16 update_indic,
252 const u8 *tlvs, size_t tlvs_len)
253{}
254static void wpas_aidl_notify_ap_sta_authorized(
255 struct wpa_supplicant *wpa_s, const u8 *sta, const u8 *p2p_dev_addr)
256{}
257static void wpas_aidl_notify_ap_sta_deauthorized(
258 struct wpa_supplicant *wpa_s, const u8 *sta, const u8 *p2p_dev_addr)
259{}
260static void wpas_aidl_notify_eap_error(
261 struct wpa_supplicant *wpa_s, int error_code)
262{}
263static void wpas_aidl_notify_dpp_config_received(struct wpa_supplicant *wpa_s,
Sunil Ravi546a7b52022-08-26 22:06:04 +0000264 struct wpa_ssid *ssid, bool conn_status_requested)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000265{}
Gabriel Biren57ededa2021-09-03 16:08:50 +0000266static void wpas_aidl_notify_dpp_config_sent(struct wpa_supplicant *wpa_s)
267{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530268static void wpas_aidl_notify_dpp_connection_status_sent(struct wpa_supplicant *wpa_s,
Sunil Ravi546a7b52022-08-26 22:06:04 +0000269 enum dpp_status_error result)
270{}
Gabriel Biren57ededa2021-09-03 16:08:50 +0000271static void wpas_aidl_notify_dpp_auth_success(struct wpa_supplicant *wpa_s)
272{}
273static void wpas_aidl_notify_dpp_resp_pending(struct wpa_supplicant *wpa_s)
274{}
275static void wpas_aidl_notify_dpp_not_compatible(struct wpa_supplicant *wpa_s)
276{}
277static void wpas_aidl_notify_dpp_missing_auth(struct wpa_supplicant *wpa_s)
278{}
279static void wpas_aidl_notify_dpp_configuration_failure(struct wpa_supplicant *wpa_s)
280{}
281static void wpas_aidl_notify_dpp_invalid_uri(struct wpa_supplicant *wpa_s)
282{}
283static void wpas_aidl_notify_dpp_timeout(struct wpa_supplicant *wpa_s)
284{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530285static void wpas_aidl_notify_dpp_auth_failure(struct wpa_supplicant *wpa_s)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000286{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530287static void wpas_aidl_notify_dpp_fail(struct wpa_supplicant *wpa_s)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000288{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530289static void wpas_aidl_notify_dpp_config_sent_wait_response(struct wpa_supplicant *wpa_s)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000290{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530291static void wpas_aidl_notify_dpp_config_accepted(struct wpa_supplicant *wpa_s)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000292{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530293static void wpas_aidl_notify_dpp_config_rejected(struct wpa_supplicant *wpa_s)
294{}
295static void wpas_aidl_notify_dpp_conn_status(struct wpa_supplicant *wpa_s,
296 enum dpp_status_error status, const char *ssid,
297 const char *channel_list, unsigned short band_list[], int size)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000298{}
299static void wpas_aidl_notify_pmk_cache_added(struct wpa_supplicant *wpas,
300 struct rsn_pmksa_cache_entry *pmksa_entry)
301{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530302static void wpas_aidl_notify_bss_tm_status(struct wpa_supplicant *wpa_s)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000303{}
304static void wpas_aidl_notify_transition_disable(struct wpa_supplicant *wpa_s,
305 struct wpa_ssid *ssid,
306 u8 bitmap)
307{}
308static void wpas_aidl_notify_network_not_found(struct wpa_supplicant *wpa_s)
309{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530310static void wpas_aidl_notify_frequency_changed(struct wpa_supplicant *wpa_s, int frequency)
Sunil Ravi23087aa2021-12-08 19:01:44 -0800311{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530312static void wpas_aidl_notify_ceritification(struct wpa_supplicant *wpa_s,
Jimmy Chen429daf92021-10-20 13:27:23 +0800313 int depth, const char *subject,
314 const char *altsubject[],
315 int num_altsubject,
316 const char *cert_hash,
317 const struct wpabuf *cert)
318{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530319static void wpas_aidl_notify_eap_method_selected(struct wpa_supplicant *wpa_s,
Gabriel Biren3a2ec2c2022-03-07 17:59:41 +0000320 const char *reason_string)
321{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530322static void wpas_aidl_notify_ssid_temp_disabled(struct wpa_supplicant *wpa_s,
Gabriel Biren3a2ec2c2022-03-07 17:59:41 +0000323 const char *reason_string)
324{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530325static void wpas_aidl_notify_open_ssl_failure(struct wpa_supplicant *wpa_s,
Gabriel Biren3a2ec2c2022-03-07 17:59:41 +0000326 const char *reason_string)
327{}
Shivani Baranwal84940f82022-02-02 10:21:47 +0530328static void wpas_aidl_notify_qos_policy_reset(struct wpa_supplicant *wpa_s) {}
329static void wpas_aidl_notify_qos_policy_request(struct wpa_supplicant *wpa_s,
330 struct dscp_policy_data *policies,
331 int num_policies)
332{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530333static ssize_t wpas_aidl_get_certificate(const char* alias, uint8_t** value)
334{
335 return -1;
336}
Swarn Singhc450e7b2023-03-28 17:36:22 +0530337static void wpas_aidl_notify_qos_policy_scs_response(struct wpa_supplicant *wpa_s,
338 unsigned int count, int **scs_resp) {}
Gabriel Biren57ededa2021-09-03 16:08:50 +0000339#endif // CONFIG_CTRL_IFACE_AIDL
340
341#ifdef _cplusplus
342}
343#endif // _cplusplus
344
345#endif // WPA_SUPPLICANT_AIDL_AIDL_H