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 BINDER_MANAGER_H
11 #define BINDER_MANAGER_H
16 #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.
32 static BinderManager * getInstance();
33 static void destroyInstance();
34 int registerBinderService(struct wpa_global *global);
35 int registerInterface(struct wpa_supplicant *wpa_s);
36 int unregisterInterface(struct wpa_supplicant *wpa_s);
37 int getIfaceBinderObjectByKey(
38 const void *iface_object_key,
39 android::sp<fi::w1::wpa_supplicant::IIface> *iface_object);
42 BinderManager() = default;
43 ~BinderManager() = default;
45 /* Singleton instance of this class. */
46 static BinderManager *instance_;
47 /* The main binder service object. */
48 android::sp<Supplicant> supplicant_object_;
49 /* Map of all the interface specific binder objects controlled by
50 * wpa_supplicant. This map is keyed in by the corresponding
51 * wpa_supplicant structure pointer. */
52 std::map<const void *, android::sp<Iface>> iface_object_map_;
55 } /* namespace wpa_supplicant_binder */
57 #endif /* BINDER_MANAGER_H */