xref: /aosp_15_r20/external/wpa_supplicant_8/wpa_supplicant/aidl/vendor/aidl_manager.h (revision 03f9172ca588f91df233974f4258bab95191f931)
1 /*
2  * WPA Supplicant - Manager for Aidl interface objects
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_MANAGER_H
10 #define WPA_SUPPLICANT_AIDL_AIDL_MANAGER_H
11 
12 #include <map>
13 #include <string>
14 
15 #include <aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.h>
16 #include <aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.h>
17 #include <aidl/android/hardware/wifi/supplicant/ISupplicantStaNetworkCallback.h>
18 
19 #include "certificate_utils.h"
20 #include "p2p_iface.h"
21 #include "p2p_network.h"
22 #include "rsn_supp/pmksa_cache.h"
23 #include "sta_iface.h"
24 #include "sta_network.h"
25 #include "supplicant.h"
26 
27 extern "C"
28 {
29 #include "utils/common.h"
30 #include "utils/includes.h"
31 #include "wpa_supplicant_i.h"
32 #include "driver_i.h"
33 }
34 
35 namespace aidl {
36 namespace android {
37 namespace hardware {
38 namespace wifi {
39 namespace supplicant {
40 
41 /**
42  * AidlManager is responsible for managing the lifetime of all
43  * aidl objects created by wpa_supplicant. This is a singleton
44  * class which is created by the supplicant core and can be used
45  * to get references to the aidl objects.
46  */
47 class AidlManager
48 {
49 public:
50 	static AidlManager *getInstance();
51 	static void destroyInstance();
52 
53 	// Methods called from wpa_supplicant core.
54 	int registerAidlService(struct wpa_global *global);
55 	int registerInterface(struct wpa_supplicant *wpa_s);
56 	int unregisterInterface(struct wpa_supplicant *wpa_s);
57 	int registerNetwork(
58 		struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
59 	int unregisterNetwork(
60 		struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
61 	int notifyStateChange(struct wpa_supplicant *wpa_s);
62 	int notifyNetworkRequest(
63 		struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, int type,
64 		const char *param);
65 	void notifyPermanentIdReqDenied(
66 		struct wpa_supplicant *wpa_s);
67 	void notifyAnqpQueryDone(
68 		struct wpa_supplicant *wpa_s, const u8 *bssid, const char *result,
69 		const struct wpa_bss_anqp *anqp);
70 	void notifyHs20IconQueryDone(
71 		struct wpa_supplicant *wpa_s, const u8 *bssid,
72 		const char *file_name, const u8 *image, u32 image_length);
73 	void notifyHs20RxSubscriptionRemediation(
74 		struct wpa_supplicant *wpa_s, const char *url, u8 osu_method);
75 	void notifyHs20RxDeauthImminentNotice(
76 		struct wpa_supplicant *wpa_s, u8 code, u16 reauth_delay,
77 		const char *url);
78 	void notifyHs20RxTermsAndConditionsAcceptance(
79 			struct wpa_supplicant *wpa_s, const char *url);
80 	void notifyDisconnectReason(struct wpa_supplicant *wpa_s);
81 	void notifyAssocReject(struct wpa_supplicant *wpa_s, const u8 *bssid,
82 		u8 timed_out, const u8 *assoc_resp_ie, size_t assoc_resp_ie_len);
83 	void notifyAuthTimeout(struct wpa_supplicant *wpa_s);
84 	void notifyBssidChanged(struct wpa_supplicant *wpa_s);
85 	void notifyWpsEventFail(
86 		struct wpa_supplicant *wpa_s, uint8_t *peer_macaddr,
87 		uint16_t config_error, uint16_t error_indication);
88 	void notifyWpsEventSuccess(struct wpa_supplicant *wpa_s);
89 	void notifyWpsEventPbcOverlap(struct wpa_supplicant *wpa_s);
90 	void notifyP2pDeviceFound(
91 		struct wpa_supplicant *wpa_s, const u8 *addr,
92 		const struct p2p_peer_info *info, const u8 *peer_wfd_device_info,
93 		u8 peer_wfd_device_info_len, const u8 *peer_wfd_r2_device_info,
94 		u8 peer_wfd_r2_device_info_len);
95 	void notifyP2pDeviceLost(
96 		struct wpa_supplicant *wpa_s, const u8 *p2p_device_addr);
97 	void notifyP2pFindStopped(struct wpa_supplicant *wpa_s);
98 	void notifyP2pGoNegReq(
99 		struct wpa_supplicant *wpa_s, const u8 *src_addr, u16 dev_passwd_id,
100 		u8 go_intent);
101 	void notifyP2pGoNegCompleted(
102 		struct wpa_supplicant *wpa_s, const struct p2p_go_neg_results *res);
103 	void notifyP2pGroupFormationFailure(
104 		struct wpa_supplicant *wpa_s, const char *reason);
105 	void notifyP2pGroupStarted(
106 		struct wpa_supplicant *wpa_group_s, const struct wpa_ssid *ssid,
107 		int persistent, int client, const u8 *ip);
108 	void notifyP2pGroupRemoved(
109 		struct wpa_supplicant *wpa_group_s, const struct wpa_ssid *ssid,
110 		const char *role);
111 	void notifyP2pInvitationReceived(
112 		struct wpa_supplicant *wpa_s, const u8 *sa, const u8 *go_dev_addr,
113 		const u8 *bssid, int id, int op_freq);
114 	void notifyP2pInvitationResult(
115 		struct wpa_supplicant *wpa_s, int status, const u8 *bssid);
116 	void notifyP2pProvisionDiscovery(
117 		struct wpa_supplicant *wpa_s, const u8 *dev_addr, int request,
118 		enum p2p_prov_disc_status status, u16 config_methods,
119 		unsigned int generated_pin, const char *group_ifname);
120 	void notifyP2pSdResponse(
121 		struct wpa_supplicant *wpa_s, const u8 *sa, u16 update_indic,
122 		const u8 *tlvs, size_t tlvs_len);
123 	void notifyUsdBasedServiceDiscoveryResult(
124 		struct wpa_supplicant *wpa_s, const u8 *peer_addr, int subscribe_id,
125 		int peer_publish_id, int srv_proto_type, const u8 *ssi, size_t ssi_len);
126 	void notifyUsdBasedServiceDiscoveryTerminated(
127 		struct wpa_supplicant *wpa_s, int subscribe_id,
128 		int reason);
129 	void notifyUsdBasedServiceAdvertisementTerminated(
130 		struct wpa_supplicant *wpa_s, int publish_id,
131 		int reason);
132 	void notifyApStaAuthorized(
133 		struct wpa_supplicant *wpa_s, const u8 *sta,
134 		const u8 *p2p_dev_addr, const u8 *ip);
135 	void notifyApStaDeauthorized(
136 		struct wpa_supplicant *wpa_s, const u8 *sta,
137 		const u8 *p2p_dev_addr);
138 	void notifyEapError(struct wpa_supplicant *wpa_s, int error_code);
139 	void notifyDppConfigReceived(struct wpa_supplicant *wpa_s,
140 		struct wpa_ssid *config,
141 		bool conn_status_requested);
142 	void notifyDppConfigSent(struct wpa_supplicant *wpa_s);
143 	void notifyDppConnectionStatusSent(struct wpa_supplicant *wpa_s,
144 		enum dpp_status_error result);
145 	void notifyDppSuccess(struct wpa_supplicant *wpa_s, DppEventType code);
146 	void notifyDppFailure(struct wpa_supplicant *wpa_s,
147 			DppFailureCode code);
148 	void notifyDppFailure(struct wpa_supplicant *wpa_s,
149 			DppFailureCode code,
150 			const char *ssid, const char *channel_list, unsigned short band_list[],
151 			int size);
152 	void notifyDppProgress(struct wpa_supplicant *wpa_s,
153 			DppProgressCode code);
154 	void notifyPmkCacheAdded(struct wpa_supplicant *wpa_s,
155 			struct rsn_pmksa_cache_entry *pmksa_entry);
156 	void notifyBssTmStatus(struct wpa_supplicant *wpa_s);
157 	void notifyTransitionDisable(struct wpa_supplicant *wpa_s,
158 			struct wpa_ssid *ssid,
159 			u8 bitmap);
160 	void notifyNetworkNotFound(struct wpa_supplicant *wpa_s);
161 	void notifyFrequencyChanged(struct wpa_supplicant *wpa_s, int frequency);
162 	void notifyCertification(struct wpa_supplicant *wpa_s,
163 			int depth, const char *subject,
164 			const char *altsubject[],
165 			int num_altsubject,
166 			const char *cert_hash,
167 			const struct wpabuf *cert);
168 	void notifyAuxiliaryEvent(struct wpa_supplicant *wpa_s,
169 			AuxiliarySupplicantEventCode event_code,
170 			const char *reason_string);
171 	void notifyQosPolicyReset(struct wpa_supplicant *wpa_s);
172 	void notifyQosPolicyRequest(struct wpa_supplicant *wpa_s,
173 			struct dscp_policy_data *policies,
174 			int num_policies);
175 	ssize_t getCertificate(const char* alias, uint8_t** value);
176 	ssize_t listAliases(const char *prefix, char ***aliases);
177 	void notifyQosPolicyScsResponse(struct wpa_supplicant *wpa_s,
178 			unsigned int count, int **scs_resp);
179 	void notifyMloLinksInfoChanged(struct wpa_supplicant *wpa_s,
180 				       enum mlo_info_change_reason reason);
181 
182 	// Methods called from aidl objects.
183 	int32_t isAidlServiceVersionAtLeast(int32_t expected_version);
184 	int32_t isAidlClientVersionAtLeast(int32_t expected_version);
185 	int32_t areAidlServiceAndClientAtLeastVersion(int32_t expected_version);
186 	void notifyExtRadioWorkStart(struct wpa_supplicant *wpa_s, uint32_t id);
187 	void notifyExtRadioWorkTimeout(
188 		struct wpa_supplicant *wpa_s, uint32_t id);
189 
190 	int getP2pIfaceAidlObjectByIfname(
191 		const std::string &ifname,
192 		std::shared_ptr<ISupplicantP2pIface> *iface_object);
193 	int getStaIfaceAidlObjectByIfname(
194 		const std::string &ifname,
195 		std::shared_ptr<ISupplicantStaIface> *iface_object);
196 	int getP2pNetworkAidlObjectByIfnameAndNetworkId(
197 		const std::string &ifname, int network_id,
198 		std::shared_ptr<ISupplicantP2pNetwork> *network_object);
199 	int getStaNetworkAidlObjectByIfnameAndNetworkId(
200 		const std::string &ifname, int network_id,
201 		std::shared_ptr<ISupplicantStaNetwork> *network_object);
202 	int addSupplicantCallbackAidlObject(
203 		const std::shared_ptr<ISupplicantCallback> &callback);
204 	int addP2pIfaceCallbackAidlObject(
205 		const std::string &ifname,
206 		const std::shared_ptr<ISupplicantP2pIfaceCallback> &callback);
207 	int addStaIfaceCallbackAidlObject(
208 		const std::string &ifname,
209 		const std::shared_ptr<ISupplicantStaIfaceCallback> &callback);
210 	int addStaNetworkCallbackAidlObject(
211 		const std::string &ifname, int network_id,
212 		const std::shared_ptr<ISupplicantStaNetworkCallback> &callback);
213 	int registerNonStandardCertCallbackAidlObject(
214 		const std::shared_ptr<INonStandardCertCallback> &callback);
215 
216 private:
217 	AidlManager() = default;
218 	~AidlManager() = default;
219 	AidlManager(const AidlManager &) = default;
220 	AidlManager &operator=(const AidlManager &) = default;
221 
222 	struct wpa_supplicant *getTargetP2pIfaceForGroup(
223 		struct wpa_supplicant *wpa_s);
224 	void removeSupplicantCallbackAidlObject(
225 		const std::shared_ptr<ISupplicantCallback> &callback);
226 	void removeP2pIfaceCallbackAidlObject(
227 		const std::string &ifname,
228 		const std::shared_ptr<ISupplicantP2pIfaceCallback> &callback);
229 	void removeStaIfaceCallbackAidlObject(
230 		const std::string &ifname,
231 		const std::shared_ptr<ISupplicantStaIfaceCallback> &callback);
232 	void removeStaNetworkCallbackAidlObject(
233 		const std::string &ifname, int network_id,
234 		const std::shared_ptr<ISupplicantStaNetworkCallback> &callback);
235 
236 	void callWithEachSupplicantCallback(
237 		const std::function<ndk::ScopedAStatus(
238 		std::shared_ptr<ISupplicantCallback>)> &method);
239 	void callWithEachP2pIfaceCallback(
240 		const std::string &ifname,
241 		const std::function<ndk::ScopedAStatus(
242 		std::shared_ptr<ISupplicantP2pIfaceCallback>)> &method);
243 	void callWithEachStaIfaceCallback(
244 		const std::string &ifname,
245 		const std::function<ndk::ScopedAStatus(
246 		std::shared_ptr<ISupplicantStaIfaceCallback>)> &method);
247 	void callWithEachStaNetworkCallback(
248 		const std::string &ifname, int network_id,
249 		const std::function<::ndk::ScopedAStatus(
250 		std::shared_ptr<ISupplicantStaNetworkCallback>)> &method);
251 
252 	// Singleton instance of this class.
253 	static AidlManager *instance_;
254 	// Death notifier.
255 	AIBinder_DeathRecipient* death_notifier_;
256 	// The main aidl service object.
257 	std::shared_ptr<Supplicant> supplicant_object_;
258 	// Map of all the P2P interface specific aidl objects controlled by
259 	// wpa_supplicant. This map is keyed in by the corresponding
260 	// |ifname|.
261 	std::map<const std::string, std::shared_ptr<P2pIface>>
262 		p2p_iface_object_map_;
263 	// Map of all the STA interface specific aidl objects controlled by
264 	// wpa_supplicant. This map is keyed in by the corresponding
265 	// |ifname|.
266 	std::map<const std::string, std::shared_ptr<StaIface>>
267 		sta_iface_object_map_;
268 	// Map of all the P2P network specific aidl objects controlled by
269 	// wpa_supplicant. This map is keyed in by the corresponding
270 	// |ifname| & |network_id|.
271 	std::map<const std::string, std::shared_ptr<P2pNetwork>>
272 		p2p_network_object_map_;
273 	// Map of all the STA network specific aidl objects controlled by
274 	// wpa_supplicant. This map is keyed in by the corresponding
275 	// |ifname| & |network_id|.
276 	std::map<const std::string, std::shared_ptr<StaNetwork>>
277 		sta_network_object_map_;
278 
279 	// Callbacks registered for the main aidl service object.
280 	std::vector<std::shared_ptr<ISupplicantCallback>> supplicant_callbacks_;
281 	// Map of all the callbacks registered for P2P interface specific
282 	// aidl objects controlled by wpa_supplicant.  This map is keyed in by
283 	// the corresponding |ifname|.
284 	std::map<
285 		const std::string,
286 		std::vector<std::shared_ptr<ISupplicantP2pIfaceCallback>>>
287 		p2p_iface_callbacks_map_;
288 	// Map of all the callbacks registered for STA interface specific
289 	// aidl objects controlled by wpa_supplicant.  This map is keyed in by
290 	// the corresponding |ifname|.
291 	std::map<
292 		const std::string,
293 		std::vector<std::shared_ptr<ISupplicantStaIfaceCallback>>>
294 		sta_iface_callbacks_map_;
295 	// Map of all the callbacks registered for STA network specific
296 	// aidl objects controlled by wpa_supplicant.  This map is keyed in by
297 	// the corresponding |ifname| & |network_id|.
298 	std::map<
299 		const std::string,
300 		std::vector<std::shared_ptr<ISupplicantStaNetworkCallback>>>
301 		sta_network_callbacks_map_;
302 	// NonStandardCertCallback registered by the client.
303 	std::shared_ptr<INonStandardCertCallback> non_standard_cert_callback_;
304 };
305 
306 // The aidl interface uses some values which are the same as internal ones to
307 // avoid nasty runtime conversion functions. So, adding compile time asserts
308 // to guard against any internal changes breaking the aidl interface.
309 static_assert(
310 	static_cast<uint32_t>(DebugLevel::EXCESSIVE) == MSG_EXCESSIVE,
311 	"Debug level value mismatch");
312 static_assert(
313 	static_cast<uint32_t>(DebugLevel::ERROR) == MSG_ERROR,
314 	"Debug level value mismatch");
315 
316 static_assert(
317 	static_cast<uint32_t>(KeyMgmtMask::NONE) ==
318 	WPA_KEY_MGMT_NONE,
319 	"KeyMgmt value mismatch");
320 static_assert(
321 	static_cast<uint32_t>(KeyMgmtMask::WPA_PSK) ==
322 	WPA_KEY_MGMT_PSK,
323 	"KeyMgmt value mismatch");
324 static_assert(
325 	static_cast<uint32_t>(KeyMgmtMask::WPA_EAP) ==
326 	WPA_KEY_MGMT_IEEE8021X,
327 	"KeyMgmt value mismatch");
328 static_assert(
329 	static_cast<uint32_t>(KeyMgmtMask::IEEE8021X) ==
330 	WPA_KEY_MGMT_IEEE8021X_NO_WPA,
331 	"KeyMgmt value mismatch");
332 static_assert(
333 	static_cast<uint32_t>(KeyMgmtMask::FT_EAP) ==
334 	WPA_KEY_MGMT_FT_IEEE8021X,
335 	"KeyMgmt value mismatch");
336 static_assert(
337 	static_cast<uint32_t>(KeyMgmtMask::FT_PSK) ==
338 	WPA_KEY_MGMT_FT_PSK,
339 	"KeyMgmt value mismatch");
340 static_assert(
341 	static_cast<uint32_t>(KeyMgmtMask::OSEN) ==
342 	WPA_KEY_MGMT_OSEN,
343 	"KeyMgmt value mismatch");
344 static_assert(
345 	static_cast<uint32_t>(KeyMgmtMask::SAE) ==
346 	WPA_KEY_MGMT_SAE,
347 	"KeyMgmt value mismatch");
348 static_assert(
349 	static_cast<uint32_t>(KeyMgmtMask::SUITE_B_192) ==
350 	WPA_KEY_MGMT_IEEE8021X_SUITE_B_192,
351 	"KeyMgmt value mismatch");
352 static_assert(
353 	static_cast<uint32_t>(KeyMgmtMask::OWE) ==
354 	WPA_KEY_MGMT_OWE,
355 	"KeyMgmt value mismatch");
356 static_assert(
357 	static_cast<uint32_t>(KeyMgmtMask::WPA_PSK_SHA256) ==
358 	WPA_KEY_MGMT_PSK_SHA256,
359 	"KeyMgmt value mismatch");
360 static_assert(
361 	static_cast<uint32_t>(KeyMgmtMask::WPA_EAP_SHA256) ==
362 	WPA_KEY_MGMT_IEEE8021X_SHA256,
363 	"KeyMgmt value mismatch");
364 static_assert(
365 	static_cast<uint32_t>(KeyMgmtMask::WAPI_PSK) ==
366 	WPA_KEY_MGMT_WAPI_PSK,
367 	"KeyMgmt value mismatch");
368 static_assert(
369 	static_cast<uint32_t>(KeyMgmtMask::WAPI_CERT) ==
370 	WPA_KEY_MGMT_WAPI_CERT,
371 	"KeyMgmt value mismatch");
372 static_assert(
373 	static_cast<uint32_t>(ProtoMask::WPA) ==
374 	WPA_PROTO_WPA,
375 	"Proto value mismatch");
376 static_assert(
377 	static_cast<uint32_t>(ProtoMask::RSN) ==
378 	WPA_PROTO_RSN,
379 	"Proto value mismatch");
380 static_assert(
381 	static_cast<uint32_t>(ProtoMask::OSEN) ==
382 	WPA_PROTO_OSEN,
383 	"Proto value mismatch");
384 static_assert(
385 	static_cast<uint32_t>(ProtoMask::WAPI) ==
386 	WPA_PROTO_WAPI,
387 	"Proto value mismatch");
388 static_assert(
389 	static_cast<uint32_t>(AuthAlgMask::OPEN) ==
390 	WPA_AUTH_ALG_OPEN,
391 	"AuthAlg value mismatch");
392 static_assert(
393 	static_cast<uint32_t>(AuthAlgMask::SHARED) ==
394 	WPA_AUTH_ALG_SHARED,
395 	"AuthAlg value mismatch");
396 static_assert(
397 	static_cast<uint32_t>(AuthAlgMask::LEAP) ==
398 	WPA_AUTH_ALG_LEAP,
399 	"AuthAlg value mismatch");
400 static_assert(
401 	static_cast<uint32_t>(GroupCipherMask::WEP40) ==
402 	WPA_CIPHER_WEP40,
403 	"GroupCipher value mismatch");
404 static_assert(
405 	static_cast<uint32_t>(GroupCipherMask::WEP104) ==
406 	WPA_CIPHER_WEP104,
407 	"GroupCipher value mismatch");
408 static_assert(
409 	static_cast<uint32_t>(GroupCipherMask::TKIP) ==
410 	WPA_CIPHER_TKIP,
411 	"GroupCipher value mismatch");
412 static_assert(
413 	static_cast<uint32_t>(GroupCipherMask::CCMP) ==
414 	WPA_CIPHER_CCMP,
415 	"GroupCipher value mismatch");
416 static_assert(
417 	static_cast<uint32_t>(GroupCipherMask::GCMP_256) ==
418 	WPA_CIPHER_GCMP_256,
419 	"GroupCipher value mismatch");
420 static_assert(
421 	static_cast<uint32_t>(GroupCipherMask::SMS4) ==
422 	WPA_CIPHER_SMS4,
423 	"GroupCipher value mismatch");
424 static_assert(
425 	static_cast<uint32_t>(
426 	GroupCipherMask::GTK_NOT_USED) ==
427 	WPA_CIPHER_GTK_NOT_USED,
428 	"GroupCipher value mismatch");
429 static_assert(
430 	static_cast<uint32_t>(PairwiseCipherMask::NONE) ==
431 	WPA_CIPHER_NONE,
432 	"PairwiseCipher value mismatch");
433 static_assert(
434 	static_cast<uint32_t>(PairwiseCipherMask::TKIP) ==
435 	WPA_CIPHER_TKIP,
436 	"PairwiseCipher value mismatch");
437 static_assert(
438 	static_cast<uint32_t>(PairwiseCipherMask::CCMP) ==
439 	WPA_CIPHER_CCMP,
440 	"PairwiseCipher value mismatch");
441 static_assert(
442 	static_cast<uint32_t>(
443 	PairwiseCipherMask::GCMP_256) ==
444 	WPA_CIPHER_GCMP_256,
445 	"PairwiseCipher value mismatch");
446 static_assert(
447 	static_cast<uint32_t>(
448 	PairwiseCipherMask::SMS4) ==
449 	WPA_CIPHER_SMS4,
450 	"PairwiseCipher value mismatch");
451 static_assert(
452 	static_cast<uint32_t>(StaIfaceCallbackState::DISCONNECTED) ==
453 	WPA_DISCONNECTED,
454 	"State value mismatch");
455 static_assert(
456 	static_cast<uint32_t>(StaIfaceCallbackState::COMPLETED) ==
457 	WPA_COMPLETED,
458 	"State value mismatch");
459 
460 static_assert(
461 	static_cast<uint32_t>(AnqpInfoId::VENUE_NAME) ==
462 	ANQP_VENUE_NAME,
463 	"ANQP ID value mismatch");
464 static_assert(
465 	static_cast<uint32_t>(
466 	AnqpInfoId::ROAMING_CONSORTIUM) ==
467 	ANQP_ROAMING_CONSORTIUM,
468 	"ANQP ID value mismatch");
469 static_assert(
470 	static_cast<uint32_t>(AnqpInfoId::NAI_REALM) ==
471 	ANQP_NAI_REALM,
472 	"ANQP ID value mismatch");
473 static_assert(
474 	static_cast<uint32_t>(
475 	AnqpInfoId::IP_ADDR_TYPE_AVAILABILITY) ==
476 	ANQP_IP_ADDR_TYPE_AVAILABILITY,
477 	"ANQP ID value mismatch");
478 static_assert(
479 	static_cast<uint32_t>(
480 	AnqpInfoId::ANQP_3GPP_CELLULAR_NETWORK) ==
481 	ANQP_3GPP_CELLULAR_NETWORK,
482 	"ANQP ID value mismatch");
483 static_assert(
484 	static_cast<uint32_t>(AnqpInfoId::DOMAIN_NAME) ==
485 	ANQP_DOMAIN_NAME,
486 	"ANQP ID value mismatch");
487 static_assert(
488 	static_cast<uint32_t>(
489 	Hs20AnqpSubtypes::OPERATOR_FRIENDLY_NAME) ==
490 	HS20_STYPE_OPERATOR_FRIENDLY_NAME,
491 	"HS Subtype value mismatch");
492 static_assert(
493 	static_cast<uint32_t>(Hs20AnqpSubtypes::WAN_METRICS) ==
494 	HS20_STYPE_WAN_METRICS,
495 	"HS Subtype value mismatch");
496 static_assert(
497 	static_cast<uint32_t>(
498 	Hs20AnqpSubtypes::CONNECTION_CAPABILITY) ==
499 	HS20_STYPE_CONNECTION_CAPABILITY,
500 	"HS Subtype value mismatch");
501 static_assert(
502 	static_cast<uint32_t>(
503 	Hs20AnqpSubtypes::OSU_PROVIDERS_LIST) ==
504 	HS20_STYPE_OSU_PROVIDERS_LIST,
505 	"HS Subtype value mismatch");
506 
507 static_assert(
508 	static_cast<uint16_t>(
509 	WpsConfigError::NO_ERROR) ==
510 	WPS_CFG_NO_ERROR,
511 	"Wps config error value mismatch");
512 static_assert(
513 	static_cast<uint16_t>(WpsConfigError::
514 				  PUBLIC_KEY_HASH_MISMATCH) ==
515 	WPS_CFG_PUBLIC_KEY_HASH_MISMATCH,
516 	"Wps config error value mismatch");
517 static_assert(
518 	static_cast<uint16_t>(
519 	WpsErrorIndication::NO_ERROR) ==
520 	WPS_EI_NO_ERROR,
521 	"Wps error indication value mismatch");
522 static_assert(
523 	static_cast<uint16_t>(
524 	WpsErrorIndication::AUTH_FAILURE) ==
525 	WPS_EI_AUTH_FAILURE,
526 	"Wps error indication value mismatch");
527 
528 static_assert(
529 	static_cast<uint32_t>(WpsConfigMethods::USBA) == WPS_CONFIG_USBA,
530 	"Wps config value mismatch");
531 static_assert(
532 	static_cast<uint32_t>(WpsConfigMethods::ETHERNET) == WPS_CONFIG_ETHERNET,
533 	"Wps config value mismatch");
534 static_assert(
535 	static_cast<uint32_t>(WpsConfigMethods::LABEL) == WPS_CONFIG_LABEL,
536 	"Wps config value mismatch");
537 static_assert(
538 	static_cast<uint32_t>(WpsConfigMethods::DISPLAY) == WPS_CONFIG_DISPLAY,
539 	"Wps config value mismatch");
540 static_assert(
541 	static_cast<uint32_t>(WpsConfigMethods::INT_NFC_TOKEN) ==
542 	WPS_CONFIG_INT_NFC_TOKEN,
543 	"Wps config value mismatch");
544 static_assert(
545 	static_cast<uint32_t>(WpsConfigMethods::EXT_NFC_TOKEN) ==
546 	WPS_CONFIG_EXT_NFC_TOKEN,
547 	"Wps config value mismatch");
548 static_assert(
549 	static_cast<uint32_t>(WpsConfigMethods::NFC_INTERFACE) ==
550 	WPS_CONFIG_NFC_INTERFACE,
551 	"Wps config value mismatch");
552 static_assert(
553 	static_cast<uint32_t>(WpsConfigMethods::PUSHBUTTON) ==
554 	WPS_CONFIG_PUSHBUTTON,
555 	"Wps config value mismatch");
556 static_assert(
557 	static_cast<uint32_t>(WpsConfigMethods::KEYPAD) == WPS_CONFIG_KEYPAD,
558 	"Wps config value mismatch");
559 static_assert(
560 	static_cast<uint32_t>(WpsConfigMethods::VIRT_PUSHBUTTON) ==
561 	WPS_CONFIG_VIRT_PUSHBUTTON,
562 	"Wps config value mismatch");
563 static_assert(
564 	static_cast<uint32_t>(WpsConfigMethods::PHY_PUSHBUTTON) ==
565 	WPS_CONFIG_PHY_PUSHBUTTON,
566 	"Wps config value mismatch");
567 static_assert(
568 	static_cast<uint32_t>(WpsConfigMethods::P2PS) == WPS_CONFIG_P2PS,
569 	"Wps config value mismatch");
570 static_assert(
571 	static_cast<uint32_t>(WpsConfigMethods::VIRT_DISPLAY) ==
572 	WPS_CONFIG_VIRT_DISPLAY,
573 	"Wps config value mismatch");
574 static_assert(
575 	static_cast<uint32_t>(WpsConfigMethods::PHY_DISPLAY) ==
576 	WPS_CONFIG_PHY_DISPLAY,
577 	"Wps config value mismatch");
578 
579 static_assert(
580 	static_cast<uint32_t>(P2pGroupCapabilityMask::GROUP_OWNER) ==
581 	P2P_GROUP_CAPAB_GROUP_OWNER,
582 	"P2P capability value mismatch");
583 static_assert(
584 	static_cast<uint32_t>(P2pGroupCapabilityMask::PERSISTENT_GROUP) ==
585 	P2P_GROUP_CAPAB_PERSISTENT_GROUP,
586 	"P2P capability value mismatch");
587 static_assert(
588 	static_cast<uint32_t>(P2pGroupCapabilityMask::GROUP_LIMIT) ==
589 	P2P_GROUP_CAPAB_GROUP_LIMIT,
590 	"P2P capability value mismatch");
591 static_assert(
592 	static_cast<uint32_t>(P2pGroupCapabilityMask::INTRA_BSS_DIST) ==
593 	P2P_GROUP_CAPAB_INTRA_BSS_DIST,
594 	"P2P capability value mismatch");
595 static_assert(
596 	static_cast<uint32_t>(P2pGroupCapabilityMask::CROSS_CONN) ==
597 	P2P_GROUP_CAPAB_CROSS_CONN,
598 	"P2P capability value mismatch");
599 static_assert(
600 	static_cast<uint32_t>(P2pGroupCapabilityMask::PERSISTENT_RECONN) ==
601 	P2P_GROUP_CAPAB_PERSISTENT_RECONN,
602 	"P2P capability value mismatch");
603 static_assert(
604 	static_cast<uint32_t>(P2pGroupCapabilityMask::GROUP_FORMATION) ==
605 	P2P_GROUP_CAPAB_GROUP_FORMATION,
606 	"P2P capability value mismatch");
607 
608 static_assert(
609 	static_cast<uint16_t>(
610 	WpsDevPasswordId::DEFAULT) ==
611 	DEV_PW_DEFAULT,
612 	"Wps dev password id value mismatch");
613 static_assert(
614 	static_cast<uint16_t>(
615 	WpsDevPasswordId::USER_SPECIFIED) ==
616 	DEV_PW_USER_SPECIFIED,
617 	"Wps dev password id value mismatch");
618 static_assert(
619 	static_cast<uint16_t>(
620 	WpsDevPasswordId::MACHINE_SPECIFIED) ==
621 	DEV_PW_MACHINE_SPECIFIED,
622 	"Wps dev password id value mismatch");
623 static_assert(
624 	static_cast<uint16_t>(
625 	WpsDevPasswordId::REKEY) == DEV_PW_REKEY,
626 	"Wps dev password id value mismatch");
627 static_assert(
628 	static_cast<uint16_t>(
629 	WpsDevPasswordId::PUSHBUTTON) ==
630 	DEV_PW_PUSHBUTTON,
631 	"Wps dev password id value mismatch");
632 static_assert(
633 	static_cast<uint16_t>(
634 	WpsDevPasswordId::REGISTRAR_SPECIFIED) ==
635 	DEV_PW_REGISTRAR_SPECIFIED,
636 	"Wps dev password id value mismatch");
637 static_assert(
638 	static_cast<uint16_t>(WpsDevPasswordId::
639 				  NFC_CONNECTION_HANDOVER) ==
640 	DEV_PW_NFC_CONNECTION_HANDOVER,
641 	"Wps dev password id value mismatch");
642 static_assert(
643 	static_cast<uint16_t>(
644 	WpsDevPasswordId::P2PS_DEFAULT) ==
645 	DEV_PW_P2PS_DEFAULT,
646 	"Wps dev password id value mismatch");
647 
648 static_assert(
649 	static_cast<uint16_t>(
650 	P2pStatusCode::SUCCESS) == P2P_SC_SUCCESS,
651 	"P2P status code value mismatch");
652 static_assert(
653 	static_cast<uint16_t>(P2pStatusCode::
654 				  FAIL_INFO_CURRENTLY_UNAVAILABLE) ==
655 	P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE,
656 	"P2P status code value mismatch");
657 static_assert(
658 	static_cast<uint16_t>(
659 	P2pStatusCode::FAIL_INCOMPATIBLE_PARAMS) ==
660 	P2P_SC_FAIL_INCOMPATIBLE_PARAMS,
661 	"P2P status code value mismatch");
662 static_assert(
663 	static_cast<uint16_t>(
664 	P2pStatusCode::FAIL_LIMIT_REACHED) ==
665 	P2P_SC_FAIL_LIMIT_REACHED,
666 	"P2P status code value mismatch");
667 static_assert(
668 	static_cast<uint16_t>(
669 	P2pStatusCode::FAIL_INVALID_PARAMS) ==
670 	P2P_SC_FAIL_INVALID_PARAMS,
671 	"P2P status code value mismatch");
672 static_assert(
673 	static_cast<uint16_t>(P2pStatusCode::
674 				  FAIL_UNABLE_TO_ACCOMMODATE) ==
675 	P2P_SC_FAIL_UNABLE_TO_ACCOMMODATE,
676 	"P2P status code value mismatch");
677 static_assert(
678 	static_cast<uint16_t>(
679 	P2pStatusCode::FAIL_PREV_PROTOCOL_ERROR) ==
680 	P2P_SC_FAIL_PREV_PROTOCOL_ERROR,
681 	"P2P status code value mismatch");
682 static_assert(
683 	static_cast<uint16_t>(
684 	P2pStatusCode::FAIL_NO_COMMON_CHANNELS) ==
685 	P2P_SC_FAIL_NO_COMMON_CHANNELS,
686 	"P2P status code value mismatch");
687 static_assert(
688 	static_cast<uint16_t>(
689 	P2pStatusCode::FAIL_UNKNOWN_GROUP) ==
690 	P2P_SC_FAIL_UNKNOWN_GROUP,
691 	"P2P status code value mismatch");
692 static_assert(
693 	static_cast<uint16_t>(
694 	P2pStatusCode::FAIL_BOTH_GO_INTENT_15) ==
695 	P2P_SC_FAIL_BOTH_GO_INTENT_15,
696 	"P2P status code value mismatch");
697 static_assert(
698 	static_cast<uint16_t>(P2pStatusCode::
699 				  FAIL_INCOMPATIBLE_PROV_METHOD) ==
700 	P2P_SC_FAIL_INCOMPATIBLE_PROV_METHOD,
701 	"P2P status code value mismatch");
702 static_assert(
703 	static_cast<uint16_t>(
704 	P2pStatusCode::FAIL_REJECTED_BY_USER) ==
705 	P2P_SC_FAIL_REJECTED_BY_USER,
706 	"P2P status code value mismatch");
707 static_assert(
708 	static_cast<uint16_t>(
709 	P2pStatusCode::SUCCESS_DEFERRED) ==
710 	P2P_SC_SUCCESS_DEFERRED,
711 	"P2P status code value mismatch");
712 
713 static_assert(
714 	static_cast<uint16_t>(
715 	P2pProvDiscStatusCode::SUCCESS) ==
716 	P2P_PROV_DISC_SUCCESS,
717 	"P2P status code value mismatch");
718 static_assert(
719 	static_cast<uint16_t>(
720 	P2pProvDiscStatusCode::TIMEOUT) ==
721 	P2P_PROV_DISC_TIMEOUT,
722 	"P2P status code value mismatch");
723 static_assert(
724 	static_cast<uint16_t>(
725 	P2pProvDiscStatusCode::REJECTED) ==
726 	P2P_PROV_DISC_REJECTED,
727 	"P2P status code value mismatch");
728 static_assert(
729 	static_cast<uint16_t>(
730 	P2pProvDiscStatusCode::TIMEOUT_JOIN) ==
731 	P2P_PROV_DISC_TIMEOUT_JOIN,
732 	"P2P status code value mismatch");
733 static_assert(
734 	static_cast<uint16_t>(
735 	P2pProvDiscStatusCode::INFO_UNAVAILABLE) ==
736 	P2P_PROV_DISC_INFO_UNAVAILABLE,
737 	"P2P status code value mismatch");
738 }  // namespace supplicant
739 }  // namespace wifi
740 }  // namespace hardware
741 }  // namespace android
742 }  // namespace aidl
743 #endif  // WPA_SUPPLICANT_AIDL_AIDL_MANAGER_H
744