blob: b0ad1f2bb3e018c705c91cd12fa9ebe492fc25fa [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,
82 int persistent, int client);
83 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);
Gabriel Biren57ededa2021-09-03 16:08:50 +0000149#else // CONFIG_CTRL_IFACE_AIDL
150static inline int wpas_aidl_register_interface(struct wpa_supplicant *wpa_s)
151{
152 return 0;
153}
154static inline int wpas_aidl_unregister_interface(struct wpa_supplicant *wpa_s)
155{
156 return 0;
157}
158static inline int wpas_aidl_register_network(
159 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
160{
161 return 0;
162}
163static inline int wpas_aidl_unregister_network(
164 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
165{
166 return 0;
167}
168static inline int wpas_aidl_notify_state_changed(struct wpa_supplicant *wpa_s)
169{
170 return 0;
171}
172static inline int wpas_aidl_notify_network_request(
173 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
174 enum wpa_ctrl_req_type rtype, const char *default_txt)
175{
176 return 0;
177}
Steven Liu850c2e02022-11-28 17:26:39 +0000178static void wpas_aidl_notify_permanent_id_req_denied(struct wpa_supplicant *wpa_s)
179{}
Gabriel Biren57ededa2021-09-03 16:08:50 +0000180static void wpas_aidl_notify_anqp_query_done(
181 struct wpa_supplicant *wpa_s, const u8 *bssid, const char *result,
182 const struct wpa_bss_anqp *anqp)
183{}
184static void wpas_aidl_notify_hs20_icon_query_done(
185 struct wpa_supplicant *wpa_s, const u8 *bssid, const char *file_name,
186 const u8 *image, u32 image_length)
187{}
188static void wpas_aidl_notify_hs20_rx_subscription_remediation(
189 struct wpa_supplicant *wpa_s, const char *url, u8 osu_method)
190{}
191static void wpas_aidl_notify_hs20_rx_deauth_imminent_notice(
192 struct wpa_supplicant *wpa_s, u8 code, u16 reauth_delay, const char *url)
193{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530194static void wpas_aidl_notify_hs20_rx_terms_and_conditions_acceptance(
Gabriel Biren57ededa2021-09-03 16:08:50 +0000195 struct wpa_supplicant *wpa_s, const char *url)
196{}
197static void wpas_aidl_notify_disconnect_reason(struct wpa_supplicant *wpa_s) {}
198static void wpas_aidl_notify_assoc_reject(struct wpa_supplicant *wpa_s, const u8 *bssid,
199 u8 timed_out, const u8 *assoc_resp_ie, size_t assoc_resp_ie_len) {}
200static void wpas_aidl_notify_auth_timeout(struct wpa_supplicant *wpa_s) {}
201static void wpas_aidl_notify_wps_event_fail(
202 struct wpa_supplicant *wpa_s, uint8_t *peer_macaddr, uint16_t config_error,
203 uint16_t error_indication)
204{}
205static void wpas_aidl_notify_bssid_changed(struct wpa_supplicant *wpa_s) {}
206static void wpas_aidl_notify_wps_event_success(struct wpa_supplicant *wpa_s) {}
207static void wpas_aidl_notify_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s)
208{}
209static void wpas_aidl_notify_p2p_device_found(
210 struct wpa_supplicant *wpa_s, const u8 *addr,
211 const struct p2p_peer_info *info, const u8 *peer_wfd_device_info,
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530212 u8 peer_wfd_device_info_lenconst, u8 *peer_wfd_r2_device_info,
213 u8 peer_wfd_r2_device_info_len)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000214{}
215static void wpas_aidl_notify_p2p_device_lost(
216 struct wpa_supplicant *wpa_s, const u8 *p2p_device_addr)
217{}
218static void wpas_aidl_notify_p2p_find_stopped(struct wpa_supplicant *wpa_s) {}
219static void wpas_aidl_notify_p2p_go_neg_req(
220 struct wpa_supplicant *wpa_s, const u8 *src_addr, u16 dev_passwd_id,
221 u8 go_intent)
222{}
223static void wpas_aidl_notify_p2p_go_neg_completed(
224 struct wpa_supplicant *wpa_s, const struct p2p_go_neg_results *res)
225{}
226static void wpas_aidl_notify_p2p_group_formation_failure(
227 struct wpa_supplicant *wpa_s, const char *reason)
228{}
229static void wpas_aidl_notify_p2p_group_started(
230 struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, int persistent,
231 int client)
232{}
233static void wpas_aidl_notify_p2p_group_removed(
234 struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, const char *role)
235{}
236static void wpas_aidl_notify_p2p_invitation_received(
237 struct wpa_supplicant *wpa_s, const u8 *sa, const u8 *go_dev_addr,
238 const u8 *bssid, int id, int op_freq)
239{}
240static void wpas_aidl_notify_p2p_invitation_result(
241 struct wpa_supplicant *wpa_s, int status, const u8 *bssid)
242{}
243static void wpas_aidl_notify_p2p_provision_discovery(
244 struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request,
245 enum p2p_prov_disc_status status, u16 config_methods,
246 unsigned int generated_pin)
247{}
248static void wpas_aidl_notify_p2p_sd_response(
249 struct wpa_supplicant *wpa_s, const u8 *sa, u16 update_indic,
250 const u8 *tlvs, size_t tlvs_len)
251{}
252static void wpas_aidl_notify_ap_sta_authorized(
253 struct wpa_supplicant *wpa_s, const u8 *sta, const u8 *p2p_dev_addr)
254{}
255static void wpas_aidl_notify_ap_sta_deauthorized(
256 struct wpa_supplicant *wpa_s, const u8 *sta, const u8 *p2p_dev_addr)
257{}
258static void wpas_aidl_notify_eap_error(
259 struct wpa_supplicant *wpa_s, int error_code)
260{}
261static void wpas_aidl_notify_dpp_config_received(struct wpa_supplicant *wpa_s,
Sunil Ravi546a7b52022-08-26 22:06:04 +0000262 struct wpa_ssid *ssid, bool conn_status_requested)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000263{}
Gabriel Biren57ededa2021-09-03 16:08:50 +0000264static void wpas_aidl_notify_dpp_config_sent(struct wpa_supplicant *wpa_s)
265{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530266static void wpas_aidl_notify_dpp_connection_status_sent(struct wpa_supplicant *wpa_s,
Sunil Ravi546a7b52022-08-26 22:06:04 +0000267 enum dpp_status_error result)
268{}
Gabriel Biren57ededa2021-09-03 16:08:50 +0000269static void wpas_aidl_notify_dpp_auth_success(struct wpa_supplicant *wpa_s)
270{}
271static void wpas_aidl_notify_dpp_resp_pending(struct wpa_supplicant *wpa_s)
272{}
273static void wpas_aidl_notify_dpp_not_compatible(struct wpa_supplicant *wpa_s)
274{}
275static void wpas_aidl_notify_dpp_missing_auth(struct wpa_supplicant *wpa_s)
276{}
277static void wpas_aidl_notify_dpp_configuration_failure(struct wpa_supplicant *wpa_s)
278{}
279static void wpas_aidl_notify_dpp_invalid_uri(struct wpa_supplicant *wpa_s)
280{}
281static void wpas_aidl_notify_dpp_timeout(struct wpa_supplicant *wpa_s)
282{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530283static void wpas_aidl_notify_dpp_auth_failure(struct wpa_supplicant *wpa_s)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000284{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530285static void wpas_aidl_notify_dpp_fail(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_config_sent_wait_response(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_accepted(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_rejected(struct wpa_supplicant *wpa_s)
292{}
293static void wpas_aidl_notify_dpp_conn_status(struct wpa_supplicant *wpa_s,
294 enum dpp_status_error status, const char *ssid,
295 const char *channel_list, unsigned short band_list[], int size)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000296{}
297static void wpas_aidl_notify_pmk_cache_added(struct wpa_supplicant *wpas,
298 struct rsn_pmksa_cache_entry *pmksa_entry)
299{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530300static void wpas_aidl_notify_bss_tm_status(struct wpa_supplicant *wpa_s)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000301{}
302static void wpas_aidl_notify_transition_disable(struct wpa_supplicant *wpa_s,
303 struct wpa_ssid *ssid,
304 u8 bitmap)
305{}
306static void wpas_aidl_notify_network_not_found(struct wpa_supplicant *wpa_s)
307{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530308static void wpas_aidl_notify_frequency_changed(struct wpa_supplicant *wpa_s, int frequency)
Sunil Ravi23087aa2021-12-08 19:01:44 -0800309{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530310static void wpas_aidl_notify_ceritification(struct wpa_supplicant *wpa_s,
Jimmy Chen429daf92021-10-20 13:27:23 +0800311 int depth, const char *subject,
312 const char *altsubject[],
313 int num_altsubject,
314 const char *cert_hash,
315 const struct wpabuf *cert)
316{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530317static void wpas_aidl_notify_eap_method_selected(struct wpa_supplicant *wpa_s,
Gabriel Biren3a2ec2c2022-03-07 17:59:41 +0000318 const char *reason_string)
319{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530320static void wpas_aidl_notify_ssid_temp_disabled(struct wpa_supplicant *wpa_s,
Gabriel Biren3a2ec2c2022-03-07 17:59:41 +0000321 const char *reason_string)
322{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530323static void wpas_aidl_notify_open_ssl_failure(struct wpa_supplicant *wpa_s,
Gabriel Biren3a2ec2c2022-03-07 17:59:41 +0000324 const char *reason_string)
325{}
Shivani Baranwal84940f82022-02-02 10:21:47 +0530326static void wpas_aidl_notify_qos_policy_reset(struct wpa_supplicant *wpa_s) {}
327static void wpas_aidl_notify_qos_policy_request(struct wpa_supplicant *wpa_s,
328 struct dscp_policy_data *policies,
329 int num_policies)
330{}
Shivani Baranwalc58b6092022-12-01 11:17:24 +0530331static ssize_t wpas_aidl_get_certificate(const char* alias, uint8_t** value)
332{
333 return -1;
334}
Gabriel Biren57ededa2021-09-03 16:08:50 +0000335#endif // CONFIG_CTRL_IFACE_AIDL
336
337#ifdef _cplusplus
338}
339#endif // _cplusplus
340
341#endif // WPA_SUPPLICANT_AIDL_AIDL_H