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