2 * binder interface for wpa_supplicant daemon
3 * Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi>
4 * Copyright (c) 2004-2016, Roshan Pius <rpius@google.com>
6 * This software may be distributed under the terms of the BSD license.
7 * See README for more details.
10 #ifndef WPA_SUPPLICANT_BINDER_BINDER_MANAGER_H
11 #define WPA_SUPPLICANT_BINDER_BINDER_MANAGER_H
17 #include "supplicant.h"
20 struct wpa_supplicant;
22 namespace wpa_supplicant_binder {
25 * BinderManager is responsible for managing the lifetime of all
26 * binder objects created by wpa_supplicant. This is a singleton
27 * class which is created by the supplicant core and can be used
28 * to get references to the binder objects.
33 static BinderManager *getInstance();
34 static void destroyInstance();
35 int registerBinderService(struct wpa_global *global);
36 int registerInterface(struct wpa_supplicant *wpa_s);
37 int unregisterInterface(struct wpa_supplicant *wpa_s);
38 int getIfaceBinderObjectByKey(
39 const void *iface_object_key,
40 android::sp<fi::w1::wpa_supplicant::IIface> *iface_object);
43 BinderManager() = default;
44 ~BinderManager() = default;
46 /* Singleton instance of this class. */
47 static BinderManager *instance_;
48 /* The main binder service object. */
49 android::sp<Supplicant> supplicant_object_;
50 /* Map of all the interface specific binder objects controlled by
51 * wpa_supplicant. This map is keyed in by the corresponding
52 * wpa_supplicant structure pointer. */
53 std::map<const void *, android::sp<Iface>> iface_object_map_;
56 } /* namespace wpa_supplicant_binder */
58 #endif /* WPA_SUPPLICANT_BINDER_BINDER_MANAGER_H */