xref: /aosp_15_r20/external/wpa_supplicant_8/wpa_supplicant/notify.h (revision 03f9172ca588f91df233974f4258bab95191f931)
1 /*
2  * wpa_supplicant - Event notifications
3  * Copyright (c) 2009-2010, Jouni Malinen <[email protected]>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef NOTIFY_H
10 #define NOTIFY_H
11 
12 #include "p2p/p2p.h"
13 #include "bss.h"
14 #include "rsn_supp/pmksa_cache.h"
15 #include "dpp.h"
16 
17 struct wps_credential;
18 struct wps_event_m2d;
19 struct wps_event_fail;
20 struct tls_cert_data;
21 struct wpa_cred;
22 struct rsn_pmksa_cache_entry;
23 enum nan_de_reason;
24 enum nan_service_protocol_type;
25 
26 int wpas_notify_supplicant_initialized(struct wpa_global *global);
27 void wpas_notify_supplicant_deinitialized(struct wpa_global *global);
28 int wpas_notify_iface_added(struct wpa_supplicant *wpa_s);
29 void wpas_notify_iface_removed(struct wpa_supplicant *wpa_s);
30 void wpas_notify_state_changed(struct wpa_supplicant *wpa_s,
31 			       enum wpa_states new_state,
32 			       enum wpa_states old_state);
33 void wpas_notify_disconnect_reason(struct wpa_supplicant *wpa_s);
34 void wpas_notify_auth_status_code(struct wpa_supplicant *wpa_s);
35 void wpas_notify_assoc_status_code(struct wpa_supplicant *wpa_s, const u8 *bssid, u8 timed_out,
36 				   const u8 *assoc_resp_ie, size_t assoc_resp_ie_len);
37 void wpas_notify_auth_timeout(struct wpa_supplicant *wpa_s);
38 void wpas_notify_roam_time(struct wpa_supplicant *wpa_s);
39 void wpas_notify_roam_complete(struct wpa_supplicant *wpa_s);
40 void wpas_notify_scan_in_progress_6ghz(struct wpa_supplicant *wpa_s);
41 void wpas_notify_session_length(struct wpa_supplicant *wpa_s);
42 void wpas_notify_bss_tm_status(struct wpa_supplicant *wpa_s);
43 void wpas_notify_network_changed(struct wpa_supplicant *wpa_s);
44 void wpas_notify_ap_scan_changed(struct wpa_supplicant *wpa_s);
45 void wpas_notify_bssid_changed(struct wpa_supplicant *wpa_s);
46 void wpas_notify_mac_address_changed(struct wpa_supplicant *wpa_s);
47 void wpas_notify_auth_changed(struct wpa_supplicant *wpa_s);
48 void wpas_notify_network_enabled_changed(struct wpa_supplicant *wpa_s,
49 					 struct wpa_ssid *ssid);
50 void wpas_notify_network_selected(struct wpa_supplicant *wpa_s,
51 				  struct wpa_ssid *ssid);
52 void wpas_notify_network_request(struct wpa_supplicant *wpa_s,
53 				 struct wpa_ssid *ssid,
54 				 enum wpa_ctrl_req_type rtype,
55 				 const char *default_txt);
56 void wpas_notify_permanent_id_req_denied(struct wpa_supplicant *wpa_s);
57 void wpas_notify_scanning(struct wpa_supplicant *wpa_s);
58 void wpas_notify_scan_done(struct wpa_supplicant *wpa_s, int success);
59 void wpas_notify_scan_results(struct wpa_supplicant *wpa_s);
60 void wpas_notify_wps_credential(struct wpa_supplicant *wpa_s,
61 				const struct wps_credential *cred);
62 void wpas_notify_wps_event_m2d(struct wpa_supplicant *wpa_s,
63 			       struct wps_event_m2d *m2d);
64 void wpas_notify_wps_event_fail(struct wpa_supplicant *wpa_s,
65 				struct wps_event_fail *fail);
66 void wpas_notify_wps_event_success(struct wpa_supplicant *wpa_s);
67 void wpas_notify_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s);
68 void wpas_notify_network_added(struct wpa_supplicant *wpa_s,
69 			       struct wpa_ssid *ssid);
70 void wpas_notify_network_removed(struct wpa_supplicant *wpa_s,
71 				 struct wpa_ssid *ssid);
72 void wpas_notify_bss_added(struct wpa_supplicant *wpa_s, u8 bssid[],
73 			   unsigned int id);
74 void wpas_notify_bss_removed(struct wpa_supplicant *wpa_s, u8 bssid[],
75 			     unsigned int id);
76 void wpas_notify_bss_freq_changed(struct wpa_supplicant *wpa_s,
77 				  unsigned int id);
78 void wpas_notify_bss_signal_changed(struct wpa_supplicant *wpa_s,
79 				    unsigned int id);
80 void wpas_notify_bss_privacy_changed(struct wpa_supplicant *wpa_s,
81 				     unsigned int id);
82 void wpas_notify_bss_mode_changed(struct wpa_supplicant *wpa_s,
83 				  unsigned int id);
84 void wpas_notify_bss_wpaie_changed(struct wpa_supplicant *wpa_s,
85 				   unsigned int id);
86 void wpas_notify_bss_rsnie_changed(struct wpa_supplicant *wpa_s,
87 				   unsigned int id);
88 void wpas_notify_bss_wps_changed(struct wpa_supplicant *wpa_s,
89 				 unsigned int id);
90 void wpas_notify_bss_ies_changed(struct wpa_supplicant *wpa_s,
91 				 unsigned int id);
92 void wpas_notify_bss_rates_changed(struct wpa_supplicant *wpa_s,
93 				   unsigned int id);
94 void wpas_notify_bss_seen(struct wpa_supplicant *wpa_s, unsigned int id);
95 void wpas_notify_bss_anqp_changed(struct wpa_supplicant *wpa_s,
96 				  unsigned int id);
97 void wpas_notify_blob_added(struct wpa_supplicant *wpa_s, const char *name);
98 void wpas_notify_blob_removed(struct wpa_supplicant *wpa_s, const char *name);
99 
100 void wpas_notify_debug_level_changed(struct wpa_global *global);
101 void wpas_notify_debug_timestamp_changed(struct wpa_global *global);
102 void wpas_notify_debug_show_keys_changed(struct wpa_global *global);
103 void wpas_notify_suspend(struct wpa_global *global);
104 void wpas_notify_resume(struct wpa_global *global);
105 
106 void wpas_notify_sta_authorized(struct wpa_supplicant *wpa_s,
107 				const u8 *mac_addr, int authorized,
108 				const u8 *p2p_dev_addr, const u8 *ip);
109 void wpas_notify_p2p_find_stopped(struct wpa_supplicant *wpa_s);
110 void wpas_notify_p2p_device_found(struct wpa_supplicant *wpa_s,
111 				 const u8 *addr, const struct p2p_peer_info *info,
112 				 const u8* peer_wfd_device_info, u8 peer_wfd_device_info_len,
113 				 const u8* peer_wfd_r2_device_info, u8 peer_wfd_r2_device_info_len,
114 				 int new_device);
115 void wpas_notify_p2p_device_lost(struct wpa_supplicant *wpa_s,
116 				 const u8 *dev_addr);
117 void wpas_notify_p2p_group_removed(struct wpa_supplicant *wpa_s,
118 				   const struct wpa_ssid *ssid,
119 				   const char *role);
120 void wpas_notify_p2p_go_neg_req(struct wpa_supplicant *wpa_s,
121 				const u8 *src, u16 dev_passwd_id, u8 go_intent);
122 void wpas_notify_p2p_go_neg_completed(struct wpa_supplicant *wpa_s,
123 				      struct p2p_go_neg_results *res);
124 void wpas_notify_p2p_invitation_result(struct wpa_supplicant *wpa_s,
125 				       int status, const u8 *bssid);
126 void wpas_notify_p2p_sd_request(struct wpa_supplicant *wpa_s,
127 				int freq, const u8 *sa, u8 dialog_token,
128 				u16 update_indic, const u8 *tlvs,
129 				size_t tlvs_len);
130 void wpas_notify_p2p_sd_response(struct wpa_supplicant *wpa_s,
131 				 const u8 *sa, u16 update_indic,
132 				 const u8 *tlvs, size_t tlvs_len);
133 void wpas_notify_p2p_provision_discovery(struct wpa_supplicant *wpa_s,
134 					 const u8 *dev_addr, int request,
135 					 enum p2p_prov_disc_status status,
136 					 u16 config_methods,
137 					 unsigned int generated_pin,
138 					 const char *group_ifname);
139 void wpas_notify_p2p_group_started(struct wpa_supplicant *wpa_s,
140 				   struct wpa_ssid *ssid, int persistent,
141 				   int client, const u8 *ip);
142 void wpas_notify_p2p_group_formation_failure(struct wpa_supplicant *wpa_s,
143 					     const char *reason);
144 void wpas_notify_persistent_group_added(struct wpa_supplicant *wpa_s,
145 					struct wpa_ssid *ssid);
146 void wpas_notify_persistent_group_removed(struct wpa_supplicant *wpa_s,
147 					  struct wpa_ssid *ssid);
148 
149 void wpas_notify_p2p_wps_failed(struct wpa_supplicant *wpa_s,
150 				struct wps_event_fail *fail);
151 
152 void wpas_notify_certification(struct wpa_supplicant *wpa_s,
153 			       struct tls_cert_data *cert,
154 			       const char *cert_hash);
155 void wpas_notify_preq(struct wpa_supplicant *wpa_s,
156 		      const u8 *addr, const u8 *dst, const u8 *bssid,
157 		      const u8 *ie, size_t ie_len, u32 ssi_signal);
158 void wpas_notify_eap_status(struct wpa_supplicant *wpa_s, const char *status,
159 			    const char *parameter);
160 void wpas_notify_eap_error(struct wpa_supplicant *wpa_s, int error_code);
161 void wpas_notify_psk_mismatch(struct wpa_supplicant *wpa_s);
162 void wpas_notify_network_bssid_set_changed(struct wpa_supplicant *wpa_s,
163 					   struct wpa_ssid *ssid);
164 void wpas_notify_network_type_changed(struct wpa_supplicant *wpa_s,
165 				      struct wpa_ssid *ssid);
166 void wpas_notify_p2p_invitation_received(struct wpa_supplicant *wpa_s,
167 					 const u8 *sa, const u8 *go_dev_addr,
168 					 const u8 *bssid, int id, int op_freq);
169 void wpas_notify_mesh_group_started(struct wpa_supplicant *wpa_s,
170 				    struct wpa_ssid *ssid);
171 void wpas_notify_mesh_group_removed(struct wpa_supplicant *wpa_s,
172 				    const u8 *meshid, u8 meshid_len,
173 				    u16 reason_code);
174 void wpas_notify_mesh_peer_connected(struct wpa_supplicant *wpa_s,
175 				     const u8 *peer_addr);
176 void wpas_notify_mesh_peer_disconnected(struct wpa_supplicant *wpa_s,
177 					const u8 *peer_addr, u16 reason_code);
178 void wpas_notify_anqp_query_done(struct wpa_supplicant *wpa_s, const u8* bssid,
179 				 const char* result,
180 				 const struct wpa_bss_anqp *anqp);
181 void wpas_notify_hs20_icon_query_done(struct wpa_supplicant *wpa_s, const u8* bssid,
182 				      const char* file_name, const u8* image,
183 				      u32 image_length);
184 void wpas_notify_hs20_rx_subscription_remediation(struct wpa_supplicant *wpa_s,
185 						  const char* url,
186 						  u8 osu_method);
187 void wpas_notify_hs20_rx_deauth_imminent_notice(struct wpa_supplicant *wpa_s,
188 						u8 code, u16 reauth_delay,
189 						const char *url);
190 void wpas_notify_dpp_config_received(struct wpa_supplicant *wpa_s,
191 		struct wpa_ssid *ssid, bool conn_status_requested);
192 void wpas_notify_dpp_config_sent(struct wpa_supplicant *wpa_s);
193 #ifdef CONFIG_DPP
194 void wpas_notify_dpp_connection_status_sent(struct wpa_supplicant *wpa_s,
195 		enum dpp_status_error result);
196 #endif /* CONFIG_DPP */
197 void wpas_notify_dpp_auth_success(struct wpa_supplicant *wpa_s);
198 void wpas_notify_dpp_resp_pending(struct wpa_supplicant *wpa_s);
199 void wpas_notify_dpp_not_compatible(struct wpa_supplicant *wpa_s);
200 void wpas_notify_dpp_missing_auth(struct wpa_supplicant *wpa_s);
201 void wpas_notify_dpp_configuration_failure(struct wpa_supplicant *wpa_s);
202 void wpas_notify_dpp_timeout(struct wpa_supplicant *wpa_s);
203 void wpas_notify_dpp_auth_failure(struct wpa_supplicant *wpa_s);
204 void wpas_notify_dpp_failure(struct wpa_supplicant *wpa_s);
205 void wpas_notify_dpp_config_sent_wait_response(struct wpa_supplicant *wpa_s);
206 #ifdef CONFIG_DPP
207 void wpas_notify_dpp_conn_status(struct wpa_supplicant *wpa_s,
208 		enum dpp_status_error status, const char *ssid,
209 		const char *channel_list, unsigned short band_list[], int size);
210 #endif /* CONFIG_DPP */
211 void wpas_notify_dpp_config_accepted(struct wpa_supplicant *wpa_s);
212 void wpas_notify_dpp_config_rejected(struct wpa_supplicant *wpa_s);
213 void wpas_notify_transition_disable(struct wpa_supplicant *wpa_s,
214 				    struct wpa_ssid *ssid,
215 				    u8 bitmap);
216 void wpas_notify_network_not_found(struct wpa_supplicant *wpa_s);
217 void wpas_notify_interworking_ap_added(struct wpa_supplicant *wpa_s,
218 				       struct wpa_bss *bss,
219 				       struct wpa_cred *cred, int excluded,
220 				       const char *type, int bh, int bss_load,
221 				       int conn_capab);
222 void wpas_notify_interworking_select_done(struct wpa_supplicant *wpa_s);
223 void wpas_notify_eap_method_selected(struct wpa_supplicant *wpa_s,
224 		const char* reason_string);
225 void wpas_notify_ssid_temp_disabled(struct wpa_supplicant *wpa_s,
226 		const char *reason_string);
227 void wpas_notify_open_ssl_failure(struct wpa_supplicant *wpa_s,
228 		const char *reason_string);
229 void wpas_notify_qos_policy_reset(struct wpa_supplicant *wpa_s);
230 void wpas_notify_qos_policy_request(struct wpa_supplicant *wpa_s,
231 		struct dscp_policy_data *policies, int num_policies);
232 void wpas_notify_frequency_changed(struct wpa_supplicant *wpa_s, int frequency);
233 ssize_t wpas_get_certificate(const char *alias, uint8_t** value);
234 ssize_t wpas_list_aliases(const char *prefix, char ***aliases);
235 void wpas_notify_pmk_cache_added(struct wpa_supplicant *wpa_s,
236 				 struct rsn_pmksa_cache_entry *entry);
237 void wpas_notify_signal_change(struct wpa_supplicant *wpa_s);
238 void wpas_notify_qos_policy_scs_response(struct wpa_supplicant *wpa_s,
239 		unsigned int num_scs_resp, int **scs_resp);
240 void wpas_notify_mlo_info_change_reason(struct wpa_supplicant *wpa_s,
241 					enum mlo_info_change_reason reason);
242 void wpas_notify_hs20_t_c_acceptance(struct wpa_supplicant *wpa_s,
243 				     const char *url);
244 void wpas_notify_nan_discovery_result(struct wpa_supplicant *wpa_s,
245 				      enum nan_service_protocol_type
246 				      srv_proto_type,
247 				      int subscribe_id, int peer_publish_id,
248 				      const u8 *peer_addr,
249 				      bool fsd, bool fsd_gas,
250 				      const u8 *ssi, size_t ssi_len);
251 void wpas_notify_nan_replied(struct wpa_supplicant *wpa_s,
252 			     enum nan_service_protocol_type srv_proto_type,
253 			     int publish_id, int peer_subscribe_id,
254 			     const u8 *peer_addr,
255 			     const u8 *ssi, size_t ssi_len);
256 void wpas_notify_nan_receive(struct wpa_supplicant *wpa_s, int id,
257 			     int peer_instance_id, const u8 *peer_addr,
258 			     const u8 *ssi, size_t ssi_len);
259 void wpas_notify_nan_publish_terminated(struct wpa_supplicant *wpa_s,
260 					int publish_id,
261 					enum nan_de_reason reason);
262 void wpas_notify_nan_subscribe_terminated(struct wpa_supplicant *wpa_s,
263 					  int subscribe_id,
264 					  enum nan_de_reason reason);
265 
266 #endif /* NOTIFY_H */
267