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