blob: e8778c5a4f4563f1b2306d8c6d99707bbb0dd410 [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);
40 void wpas_aidl_notify_anqp_query_done(
41 struct wpa_supplicant *wpa_s, const u8 *bssid, const char *result,
42 const struct wpa_bss_anqp *anqp);
43 void wpas_aidl_notify_hs20_icon_query_done(
44 struct wpa_supplicant *wpa_s, const u8 *bssid,
45 const char *file_name, const u8 *image, u32 image_length);
46 void wpas_aidl_notify_hs20_rx_subscription_remediation(
47 struct wpa_supplicant *wpa_s, const char *url, u8 osu_method);
48 void wpas_aidl_notify_hs20_rx_deauth_imminent_notice(
49 struct wpa_supplicant *wpa_s, u8 code, u16 reauth_delay,
50 const char *url);
51 void wpas_aidl_notify_hs20_rx_terms_and_conditions_acceptance(
52 struct wpa_supplicant *wpa_s, const char *url);
53 void wpas_aidl_notify_disconnect_reason(struct wpa_supplicant *wpa_s);
54 void wpas_aidl_notify_assoc_reject(struct wpa_supplicant *wpa_s, const u8 *bssid,
55 u8 timed_out, const u8 *assoc_resp_ie, size_t assoc_resp_ie_len);
56 void wpas_aidl_notify_auth_timeout(struct wpa_supplicant *wpa_s);
57 void wpas_aidl_notify_bssid_changed(struct wpa_supplicant *wpa_s);
58 void wpas_aidl_notify_wps_event_fail(
59 struct wpa_supplicant *wpa_s, uint8_t *peer_macaddr,
60 uint16_t config_error, uint16_t error_indication);
61 void wpas_aidl_notify_wps_event_success(struct wpa_supplicant *wpa_s);
62 void wpas_aidl_notify_wps_event_pbc_overlap(
63 struct wpa_supplicant *wpa_s);
64 void wpas_aidl_notify_p2p_device_found(
65 struct wpa_supplicant *wpa_s, const u8 *addr,
66 const struct p2p_peer_info *info, const u8 *peer_wfd_device_info,
67 u8 peer_wfd_device_info_len, const u8 *peer_wfd_r2_device_info,
68 u8 peer_wfd_r2_device_info_len);
69 void wpas_aidl_notify_p2p_device_lost(
70 struct wpa_supplicant *wpa_s, const u8 *p2p_device_addr);
71 void wpas_aidl_notify_p2p_find_stopped(struct wpa_supplicant *wpa_s);
72 void wpas_aidl_notify_p2p_go_neg_req(
73 struct wpa_supplicant *wpa_s, const u8 *src_addr, u16 dev_passwd_id,
74 u8 go_intent);
75 void wpas_aidl_notify_p2p_go_neg_completed(
76 struct wpa_supplicant *wpa_s, const struct p2p_go_neg_results *res);
77 void wpas_aidl_notify_p2p_group_formation_failure(
78 struct wpa_supplicant *wpa_s, const char *reason);
79 void wpas_aidl_notify_p2p_group_started(
80 struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid,
81 int persistent, int client);
82 void wpas_aidl_notify_p2p_group_removed(
83 struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid,
84 const char *role);
85 void wpas_aidl_notify_p2p_invitation_received(
86 struct wpa_supplicant *wpa_s, const u8 *sa, const u8 *go_dev_addr,
87 const u8 *bssid, int id, int op_freq);
88 void wpas_aidl_notify_p2p_invitation_result(
89 struct wpa_supplicant *wpa_s, int status, const u8 *bssid);
90 void wpas_aidl_notify_p2p_provision_discovery(
91 struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request,
92 enum p2p_prov_disc_status status, u16 config_methods,
93 unsigned int generated_pin);
94 void wpas_aidl_notify_p2p_sd_response(
95 struct wpa_supplicant *wpa_s, const u8 *sa, u16 update_indic,
96 const u8 *tlvs, size_t tlvs_len);
97 void wpas_aidl_notify_ap_sta_authorized(
98 struct wpa_supplicant *wpa_s, const u8 *sta,
99 const u8 *p2p_dev_addr);
100 void wpas_aidl_notify_ap_sta_deauthorized(
101 struct wpa_supplicant *wpa_s, const u8 *sta,
102 const u8 *p2p_dev_addr);
103 void wpas_aidl_notify_eap_error(
104 struct wpa_supplicant *wpa_s, int error_code);
105 void wpas_aidl_notify_dpp_config_received(struct wpa_supplicant *wpa_s,
106 struct wpa_ssid *ssid);
107 void wpas_aidl_notify_dpp_config_sent(struct wpa_supplicant *wpa_s);
108 void wpas_aidl_notify_dpp_auth_success(struct wpa_supplicant *wpa_s);
109 void wpas_aidl_notify_dpp_resp_pending(struct wpa_supplicant *wpa_s);
110 void wpas_aidl_notify_dpp_not_compatible(struct wpa_supplicant *wpa_s);
111 void wpas_aidl_notify_dpp_missing_auth(struct wpa_supplicant *wpa_s);
112 void wpas_aidl_notify_dpp_configuration_failure(struct wpa_supplicant *wpa_s);
113 void wpas_aidl_notify_dpp_invalid_uri(struct wpa_supplicant *wpa_s);
114 void wpas_aidl_notify_dpp_timeout(struct wpa_supplicant *wpa_s);
115 void wpas_aidl_notify_dpp_auth_failure(struct wpa_supplicant *wpa_s);
116 void wpas_aidl_notify_dpp_fail(struct wpa_supplicant *wpa_s);
117 void wpas_aidl_notify_dpp_config_sent_wait_response(struct wpa_supplicant *wpa_s);
118 void wpas_aidl_notify_dpp_config_accepted(struct wpa_supplicant *wpa_s);
119 void wpas_aidl_notify_dpp_config_rejected(struct wpa_supplicant *wpa_s);
120 void wpas_aidl_notify_dpp_conn_status(struct wpa_supplicant *wpa_s,
121 enum dpp_status_error status, const char *ssid,
122 const char *channel_list, unsigned short band_list[], int size);
123 void wpas_aidl_notify_pmk_cache_added(
124 struct wpa_supplicant *wpas, struct rsn_pmksa_cache_entry *pmksa_entry);
125 void wpas_aidl_notify_bss_tm_status(struct wpa_supplicant *wpa_s);
126 void wpas_aidl_notify_transition_disable(
127 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, u8 bitmap);
128 void wpas_aidl_notify_network_not_found(struct wpa_supplicant *wpa_s);
Sunil Ravi65a724b2022-05-24 11:06:09 -0700129 void wpas_aidl_notify_frequency_changed(struct wpa_supplicant *wpa_s, int frequency);
Jimmy Chen429daf92021-10-20 13:27:23 +0800130 void wpas_aidl_notify_ceritification(struct wpa_supplicant *wpa_s,
131 int depth, const char *subject,
132 const char *altsubject[],
133 int num_altsubject,
134 const char *cert_hash,
135 const struct wpabuf *cert);
Gabriel Biren3a2ec2c2022-03-07 17:59:41 +0000136 void wpas_aidl_notify_eap_method_selected(struct wpa_supplicant *wpa_s,
137 const char *reason_string);
138 void wpas_aidl_notify_ssid_temp_disabled(struct wpa_supplicant *wpa_s,
139 const char *reason_string);
140 void wpas_aidl_notify_open_ssl_failure(struct wpa_supplicant *wpa_s,
141 const char *reason_string);
Shivani Baranwal84940f82022-02-02 10:21:47 +0530142 void wpas_aidl_notify_qos_policy_reset(struct wpa_supplicant *wpa_s);
143 void wpas_aidl_notify_qos_policy_request(struct wpa_supplicant *wpa_s,
144 struct dscp_policy_data *policies, int num_policies);
Gabriel Biren57ededa2021-09-03 16:08:50 +0000145#else // CONFIG_CTRL_IFACE_AIDL
146static inline int wpas_aidl_register_interface(struct wpa_supplicant *wpa_s)
147{
148 return 0;
149}
150static inline int wpas_aidl_unregister_interface(struct wpa_supplicant *wpa_s)
151{
152 return 0;
153}
154static inline int wpas_aidl_register_network(
155 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
156{
157 return 0;
158}
159static inline int wpas_aidl_unregister_network(
160 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
161{
162 return 0;
163}
164static inline int wpas_aidl_notify_state_changed(struct wpa_supplicant *wpa_s)
165{
166 return 0;
167}
168static inline int wpas_aidl_notify_network_request(
169 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
170 enum wpa_ctrl_req_type rtype, const char *default_txt)
171{
172 return 0;
173}
174static void wpas_aidl_notify_anqp_query_done(
175 struct wpa_supplicant *wpa_s, const u8 *bssid, const char *result,
176 const struct wpa_bss_anqp *anqp)
177{}
178static void wpas_aidl_notify_hs20_icon_query_done(
179 struct wpa_supplicant *wpa_s, const u8 *bssid, const char *file_name,
180 const u8 *image, u32 image_length)
181{}
182static void wpas_aidl_notify_hs20_rx_subscription_remediation(
183 struct wpa_supplicant *wpa_s, const char *url, u8 osu_method)
184{}
185static void wpas_aidl_notify_hs20_rx_deauth_imminent_notice(
186 struct wpa_supplicant *wpa_s, u8 code, u16 reauth_delay, const char *url)
187{}
Shivani Baranwala2e6c502022-12-01 11:17:24 +0530188static void wpas_aidl_notify_hs20_rx_terms_and_conditions_acceptance(
Gabriel Biren57ededa2021-09-03 16:08:50 +0000189 struct wpa_supplicant *wpa_s, const char *url)
190{}
191static void wpas_aidl_notify_disconnect_reason(struct wpa_supplicant *wpa_s) {}
192static void wpas_aidl_notify_assoc_reject(struct wpa_supplicant *wpa_s, const u8 *bssid,
193 u8 timed_out, const u8 *assoc_resp_ie, size_t assoc_resp_ie_len) {}
194static void wpas_aidl_notify_auth_timeout(struct wpa_supplicant *wpa_s) {}
195static void wpas_aidl_notify_wps_event_fail(
196 struct wpa_supplicant *wpa_s, uint8_t *peer_macaddr, uint16_t config_error,
197 uint16_t error_indication)
198{}
199static void wpas_aidl_notify_bssid_changed(struct wpa_supplicant *wpa_s) {}
200static void wpas_aidl_notify_wps_event_success(struct wpa_supplicant *wpa_s) {}
201static void wpas_aidl_notify_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s)
202{}
203static void wpas_aidl_notify_p2p_device_found(
204 struct wpa_supplicant *wpa_s, const u8 *addr,
205 const struct p2p_peer_info *info, const u8 *peer_wfd_device_info,
Shivani Baranwala2e6c502022-12-01 11:17:24 +0530206 u8 peer_wfd_device_info_len, const u8 *peer_wfd_r2_device_info,
207 u8 peer_wfd_r2_device_info_len)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000208{}
209static void wpas_aidl_notify_p2p_device_lost(
210 struct wpa_supplicant *wpa_s, const u8 *p2p_device_addr)
211{}
212static void wpas_aidl_notify_p2p_find_stopped(struct wpa_supplicant *wpa_s) {}
213static void wpas_aidl_notify_p2p_go_neg_req(
214 struct wpa_supplicant *wpa_s, const u8 *src_addr, u16 dev_passwd_id,
215 u8 go_intent)
216{}
217static void wpas_aidl_notify_p2p_go_neg_completed(
218 struct wpa_supplicant *wpa_s, const struct p2p_go_neg_results *res)
219{}
220static void wpas_aidl_notify_p2p_group_formation_failure(
221 struct wpa_supplicant *wpa_s, const char *reason)
222{}
223static void wpas_aidl_notify_p2p_group_started(
224 struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, int persistent,
225 int client)
226{}
227static void wpas_aidl_notify_p2p_group_removed(
228 struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, const char *role)
229{}
230static void wpas_aidl_notify_p2p_invitation_received(
231 struct wpa_supplicant *wpa_s, const u8 *sa, const u8 *go_dev_addr,
232 const u8 *bssid, int id, int op_freq)
233{}
234static void wpas_aidl_notify_p2p_invitation_result(
235 struct wpa_supplicant *wpa_s, int status, const u8 *bssid)
236{}
237static void wpas_aidl_notify_p2p_provision_discovery(
238 struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request,
239 enum p2p_prov_disc_status status, u16 config_methods,
240 unsigned int generated_pin)
241{}
242static void wpas_aidl_notify_p2p_sd_response(
243 struct wpa_supplicant *wpa_s, const u8 *sa, u16 update_indic,
244 const u8 *tlvs, size_t tlvs_len)
245{}
246static void wpas_aidl_notify_ap_sta_authorized(
247 struct wpa_supplicant *wpa_s, const u8 *sta, const u8 *p2p_dev_addr)
248{}
249static void wpas_aidl_notify_ap_sta_deauthorized(
250 struct wpa_supplicant *wpa_s, const u8 *sta, const u8 *p2p_dev_addr)
251{}
252static void wpas_aidl_notify_eap_error(
253 struct wpa_supplicant *wpa_s, int error_code)
254{}
255static void wpas_aidl_notify_dpp_config_received(struct wpa_supplicant *wpa_s,
256 struct wpa_ssid *ssid)
257{}
258static void wpas_aidl_notify_dpp_config_received(struct wpa_supplicant *wpa_s,
259 struct wpa_ssid *ssid);
260static void wpas_aidl_notify_dpp_config_sent(struct wpa_supplicant *wpa_s)
261{}
262static void wpas_aidl_notify_dpp_auth_success(struct wpa_supplicant *wpa_s)
263{}
264static void wpas_aidl_notify_dpp_resp_pending(struct wpa_supplicant *wpa_s)
265{}
266static void wpas_aidl_notify_dpp_not_compatible(struct wpa_supplicant *wpa_s)
267{}
268static void wpas_aidl_notify_dpp_missing_auth(struct wpa_supplicant *wpa_s)
269{}
270static void wpas_aidl_notify_dpp_configuration_failure(struct wpa_supplicant *wpa_s)
271{}
272static void wpas_aidl_notify_dpp_invalid_uri(struct wpa_supplicant *wpa_s)
273{}
274static void wpas_aidl_notify_dpp_timeout(struct wpa_supplicant *wpa_s)
275{}
Shivani Baranwala2e6c502022-12-01 11:17:24 +0530276static void wpas_aidl_notify_dpp_auth_failure(struct wpa_supplicant *wpa_s)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000277{}
Shivani Baranwala2e6c502022-12-01 11:17:24 +0530278static void wpas_aidl_notify_dpp_fail(struct wpa_supplicant *wpa_s)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000279{}
Shivani Baranwala2e6c502022-12-01 11:17:24 +0530280static void wpas_aidl_notify_dpp_config_sent_wait_response(struct wpa_supplicant *wpa_s)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000281{}
Shivani Baranwala2e6c502022-12-01 11:17:24 +0530282static void wpas_aidl_notify_dpp_config_accepted(struct wpa_supplicant *wpa_s)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000283{}
Shivani Baranwala2e6c502022-12-01 11:17:24 +0530284static void wpas_aidl_notify_dpp_config_rejected(struct wpa_supplicant *wpa_s)
285{}
286static void wpas_aidl_notify_dpp_conn_status(struct wpa_supplicant *wpa_s,
287 enum dpp_status_error status, const char *ssid,
288 const char *channel_list, unsigned short band_list[], int size)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000289{}
290static void wpas_aidl_notify_pmk_cache_added(struct wpa_supplicant *wpas,
291 struct rsn_pmksa_cache_entry *pmksa_entry)
292{}
Shivani Baranwala2e6c502022-12-01 11:17:24 +0530293static void wpas_aidl_notify_bss_tm_status(struct wpa_supplicant *wpa_s)
Gabriel Biren57ededa2021-09-03 16:08:50 +0000294{}
295static void wpas_aidl_notify_transition_disable(struct wpa_supplicant *wpa_s,
296 struct wpa_ssid *ssid,
297 u8 bitmap)
298{}
299static void wpas_aidl_notify_network_not_found(struct wpa_supplicant *wpa_s)
300{}
Shivani Baranwala2e6c502022-12-01 11:17:24 +0530301static void wpas_aidl_notify_frequency_changed(struct wpa_supplicant *wpa_s, int frequency)
Sunil Ravi23087aa2021-12-08 19:01:44 -0800302{}
Shivani Baranwala2e6c502022-12-01 11:17:24 +0530303static void wpas_aidl_notify_ceritification(struct wpa_supplicant *wpa_s,
Jimmy Chen429daf92021-10-20 13:27:23 +0800304 int depth, const char *subject,
305 const char *altsubject[],
306 int num_altsubject,
307 const char *cert_hash,
308 const struct wpabuf *cert)
309{}
Shivani Baranwala2e6c502022-12-01 11:17:24 +0530310static void wpas_aidl_notify_eap_method_selected(struct wpa_supplicant *wpa_s,
Gabriel Biren3a2ec2c2022-03-07 17:59:41 +0000311 const char *reason_string)
312{}
Shivani Baranwala2e6c502022-12-01 11:17:24 +0530313static void wpas_aidl_notify_ssid_temp_disabled(struct wpa_supplicant *wpa_s,
Gabriel Biren3a2ec2c2022-03-07 17:59:41 +0000314 const char *reason_string)
315{}
Shivani Baranwala2e6c502022-12-01 11:17:24 +0530316static void wpas_aidl_notify_open_ssl_failure(struct wpa_supplicant *wpa_s,
Gabriel Biren3a2ec2c2022-03-07 17:59:41 +0000317 const char *reason_string)
318{}
Shivani Baranwal84940f82022-02-02 10:21:47 +0530319static void wpas_aidl_notify_qos_policy_reset(struct wpa_supplicant *wpa_s) {}
320static void wpas_aidl_notify_qos_policy_request(struct wpa_supplicant *wpa_s,
321 struct dscp_policy_data *policies,
322 int num_policies)
323{}
Gabriel Biren57ededa2021-09-03 16:08:50 +0000324#endif // CONFIG_CTRL_IFACE_AIDL
325
326#ifdef _cplusplus
327}
328#endif // _cplusplus
329
330#endif // WPA_SUPPLICANT_AIDL_AIDL_H