Gabriel Biren | 57ededa | 2021-09-03 16:08:50 +0000 | [diff] [blame] | 1 | /* |
| 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 |
| 13 | extern "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 Ravi | 23087aa | 2021-12-08 19:01:44 -0800 | [diff] [blame^] | 129 | void wpas_aidl_notify_bss_freq_changed(struct wpa_supplicant *wpa_s); |
Gabriel Biren | 57ededa | 2021-09-03 16:08:50 +0000 | [diff] [blame] | 130 | #else // CONFIG_CTRL_IFACE_AIDL |
| 131 | static inline int wpas_aidl_register_interface(struct wpa_supplicant *wpa_s) |
| 132 | { |
| 133 | return 0; |
| 134 | } |
| 135 | static inline int wpas_aidl_unregister_interface(struct wpa_supplicant *wpa_s) |
| 136 | { |
| 137 | return 0; |
| 138 | } |
| 139 | static inline int wpas_aidl_register_network( |
| 140 | struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) |
| 141 | { |
| 142 | return 0; |
| 143 | } |
| 144 | static inline int wpas_aidl_unregister_network( |
| 145 | struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) |
| 146 | { |
| 147 | return 0; |
| 148 | } |
| 149 | static inline int wpas_aidl_notify_state_changed(struct wpa_supplicant *wpa_s) |
| 150 | { |
| 151 | return 0; |
| 152 | } |
| 153 | static inline int wpas_aidl_notify_network_request( |
| 154 | struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, |
| 155 | enum wpa_ctrl_req_type rtype, const char *default_txt) |
| 156 | { |
| 157 | return 0; |
| 158 | } |
| 159 | static void wpas_aidl_notify_anqp_query_done( |
| 160 | struct wpa_supplicant *wpa_s, const u8 *bssid, const char *result, |
| 161 | const struct wpa_bss_anqp *anqp) |
| 162 | {} |
| 163 | static void wpas_aidl_notify_hs20_icon_query_done( |
| 164 | struct wpa_supplicant *wpa_s, const u8 *bssid, const char *file_name, |
| 165 | const u8 *image, u32 image_length) |
| 166 | {} |
| 167 | static void wpas_aidl_notify_hs20_rx_subscription_remediation( |
| 168 | struct wpa_supplicant *wpa_s, const char *url, u8 osu_method) |
| 169 | {} |
| 170 | static void wpas_aidl_notify_hs20_rx_deauth_imminent_notice( |
| 171 | struct wpa_supplicant *wpa_s, u8 code, u16 reauth_delay, const char *url) |
| 172 | {} |
| 173 | void wpas_aidl_notify_hs20_rx_terms_and_conditions_acceptance( |
| 174 | struct wpa_supplicant *wpa_s, const char *url) |
| 175 | {} |
| 176 | static void wpas_aidl_notify_disconnect_reason(struct wpa_supplicant *wpa_s) {} |
| 177 | static void wpas_aidl_notify_assoc_reject(struct wpa_supplicant *wpa_s, const u8 *bssid, |
| 178 | u8 timed_out, const u8 *assoc_resp_ie, size_t assoc_resp_ie_len) {} |
| 179 | static void wpas_aidl_notify_auth_timeout(struct wpa_supplicant *wpa_s) {} |
| 180 | static void wpas_aidl_notify_wps_event_fail( |
| 181 | struct wpa_supplicant *wpa_s, uint8_t *peer_macaddr, uint16_t config_error, |
| 182 | uint16_t error_indication) |
| 183 | {} |
| 184 | static void wpas_aidl_notify_bssid_changed(struct wpa_supplicant *wpa_s) {} |
| 185 | static void wpas_aidl_notify_wps_event_success(struct wpa_supplicant *wpa_s) {} |
| 186 | static void wpas_aidl_notify_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s) |
| 187 | {} |
| 188 | static void wpas_aidl_notify_p2p_device_found( |
| 189 | struct wpa_supplicant *wpa_s, const u8 *addr, |
| 190 | const struct p2p_peer_info *info, const u8 *peer_wfd_device_info, |
| 191 | u8 peer_wfd_device_info_len) |
| 192 | {} |
| 193 | static void wpas_aidl_notify_p2p_device_lost( |
| 194 | struct wpa_supplicant *wpa_s, const u8 *p2p_device_addr) |
| 195 | {} |
| 196 | static void wpas_aidl_notify_p2p_find_stopped(struct wpa_supplicant *wpa_s) {} |
| 197 | static void wpas_aidl_notify_p2p_go_neg_req( |
| 198 | struct wpa_supplicant *wpa_s, const u8 *src_addr, u16 dev_passwd_id, |
| 199 | u8 go_intent) |
| 200 | {} |
| 201 | static void wpas_aidl_notify_p2p_go_neg_completed( |
| 202 | struct wpa_supplicant *wpa_s, const struct p2p_go_neg_results *res) |
| 203 | {} |
| 204 | static void wpas_aidl_notify_p2p_group_formation_failure( |
| 205 | struct wpa_supplicant *wpa_s, const char *reason) |
| 206 | {} |
| 207 | static void wpas_aidl_notify_p2p_group_started( |
| 208 | struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, int persistent, |
| 209 | int client) |
| 210 | {} |
| 211 | static void wpas_aidl_notify_p2p_group_removed( |
| 212 | struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, const char *role) |
| 213 | {} |
| 214 | static void wpas_aidl_notify_p2p_invitation_received( |
| 215 | struct wpa_supplicant *wpa_s, const u8 *sa, const u8 *go_dev_addr, |
| 216 | const u8 *bssid, int id, int op_freq) |
| 217 | {} |
| 218 | static void wpas_aidl_notify_p2p_invitation_result( |
| 219 | struct wpa_supplicant *wpa_s, int status, const u8 *bssid) |
| 220 | {} |
| 221 | static void wpas_aidl_notify_p2p_provision_discovery( |
| 222 | struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request, |
| 223 | enum p2p_prov_disc_status status, u16 config_methods, |
| 224 | unsigned int generated_pin) |
| 225 | {} |
| 226 | static void wpas_aidl_notify_p2p_sd_response( |
| 227 | struct wpa_supplicant *wpa_s, const u8 *sa, u16 update_indic, |
| 228 | const u8 *tlvs, size_t tlvs_len) |
| 229 | {} |
| 230 | static void wpas_aidl_notify_ap_sta_authorized( |
| 231 | struct wpa_supplicant *wpa_s, const u8 *sta, const u8 *p2p_dev_addr) |
| 232 | {} |
| 233 | static void wpas_aidl_notify_ap_sta_deauthorized( |
| 234 | struct wpa_supplicant *wpa_s, const u8 *sta, const u8 *p2p_dev_addr) |
| 235 | {} |
| 236 | static void wpas_aidl_notify_eap_error( |
| 237 | struct wpa_supplicant *wpa_s, int error_code) |
| 238 | {} |
| 239 | static void wpas_aidl_notify_dpp_config_received(struct wpa_supplicant *wpa_s, |
| 240 | struct wpa_ssid *ssid) |
| 241 | {} |
| 242 | static void wpas_aidl_notify_dpp_config_received(struct wpa_supplicant *wpa_s, |
| 243 | struct wpa_ssid *ssid); |
| 244 | static void wpas_aidl_notify_dpp_config_sent(struct wpa_supplicant *wpa_s) |
| 245 | {} |
| 246 | static void wpas_aidl_notify_dpp_auth_success(struct wpa_supplicant *wpa_s) |
| 247 | {} |
| 248 | static void wpas_aidl_notify_dpp_resp_pending(struct wpa_supplicant *wpa_s) |
| 249 | {} |
| 250 | static void wpas_aidl_notify_dpp_not_compatible(struct wpa_supplicant *wpa_s) |
| 251 | {} |
| 252 | static void wpas_aidl_notify_dpp_missing_auth(struct wpa_supplicant *wpa_s) |
| 253 | {} |
| 254 | static void wpas_aidl_notify_dpp_configuration_failure(struct wpa_supplicant *wpa_s) |
| 255 | {} |
| 256 | static void wpas_aidl_notify_dpp_invalid_uri(struct wpa_supplicant *wpa_s) |
| 257 | {} |
| 258 | static void wpas_aidl_notify_dpp_timeout(struct wpa_supplicant *wpa_s) |
| 259 | {} |
| 260 | static void wpas_aidl_notify_dpp_failure(struct wpa_supplicant *wpa_s) |
| 261 | {} |
| 262 | void wpas_aidl_notify_dpp_config_sent_wait_response(struct wpa_supplicant *wpa_s) |
| 263 | {} |
| 264 | void wpas_aidl_notify_dpp_config_accepted(struct wpa_supplicant *wpa_s) |
| 265 | {} |
| 266 | void wpas_aidl_notify_dpp_config_applied(struct wpa_supplicant *wpa_s) |
| 267 | {} |
| 268 | void wpas_aidl_notify_dpp_config_rejected(struct wpa_supplicant *wpa_s) |
| 269 | {} |
| 270 | static void wpas_aidl_notify_pmk_cache_added(struct wpa_supplicant *wpas, |
| 271 | struct rsn_pmksa_cache_entry *pmksa_entry) |
| 272 | {} |
| 273 | void wpas_aidl_notify_bss_tm_status(struct wpa_supplicant *wpa_s) |
| 274 | {} |
| 275 | static void wpas_aidl_notify_transition_disable(struct wpa_supplicant *wpa_s, |
| 276 | struct wpa_ssid *ssid, |
| 277 | u8 bitmap) |
| 278 | {} |
| 279 | static void wpas_aidl_notify_network_not_found(struct wpa_supplicant *wpa_s) |
| 280 | {} |
Sunil Ravi | 23087aa | 2021-12-08 19:01:44 -0800 | [diff] [blame^] | 281 | void wpas_aidl_notify_bss_freq_changed(struct wpa_supplicant *wpa_s) |
| 282 | {} |
Gabriel Biren | 57ededa | 2021-09-03 16:08:50 +0000 | [diff] [blame] | 283 | #endif // CONFIG_CTRL_IFACE_AIDL |
| 284 | |
| 285 | #ifdef _cplusplus |
| 286 | } |
| 287 | #endif // _cplusplus |
| 288 | |
| 289 | #endif // WPA_SUPPLICANT_AIDL_AIDL_H |