xref: /freebsd/contrib/wpa/wpa_supplicant/binder/supplicant.h (revision 780fb4a2fa9a9aee5ac48a60b790f567c0dc13e9)
1*780fb4a2SCy Schubert /*
2*780fb4a2SCy Schubert  * binder interface for wpa_supplicant daemon
3*780fb4a2SCy Schubert  * Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi>
4*780fb4a2SCy Schubert  * Copyright (c) 2004-2016, Roshan Pius <rpius@google.com>
5*780fb4a2SCy Schubert  *
6*780fb4a2SCy Schubert  * This software may be distributed under the terms of the BSD license.
7*780fb4a2SCy Schubert  * See README for more details.
8*780fb4a2SCy Schubert  */
9*780fb4a2SCy Schubert 
10*780fb4a2SCy Schubert #ifndef WPA_SUPPLICANT_BINDER_SUPPLICANT_H
11*780fb4a2SCy Schubert #define WPA_SUPPLICANT_BINDER_SUPPLICANT_H
12*780fb4a2SCy Schubert 
13*780fb4a2SCy Schubert #include "fi/w1/wpa_supplicant/BnSupplicant.h"
14*780fb4a2SCy Schubert #include "fi/w1/wpa_supplicant/IIface.h"
15*780fb4a2SCy Schubert #include "fi/w1/wpa_supplicant/ISupplicantCallbacks.h"
16*780fb4a2SCy Schubert 
17*780fb4a2SCy Schubert extern "C" {
18*780fb4a2SCy Schubert #include "utils/common.h"
19*780fb4a2SCy Schubert #include "utils/includes.h"
20*780fb4a2SCy Schubert #include "../wpa_supplicant_i.h"
21*780fb4a2SCy Schubert }
22*780fb4a2SCy Schubert 
23*780fb4a2SCy Schubert namespace wpa_supplicant_binder {
24*780fb4a2SCy Schubert 
25*780fb4a2SCy Schubert /**
26*780fb4a2SCy Schubert  * Implementation of the supplicant binder object. This binder
27*780fb4a2SCy Schubert  * object is used core for global control operations on
28*780fb4a2SCy Schubert  * wpa_supplicant.
29*780fb4a2SCy Schubert  */
30*780fb4a2SCy Schubert class Supplicant : public fi::w1::wpa_supplicant::BnSupplicant
31*780fb4a2SCy Schubert {
32*780fb4a2SCy Schubert public:
33*780fb4a2SCy Schubert 	Supplicant(struct wpa_global *global);
34*780fb4a2SCy Schubert 	virtual ~Supplicant() = default;
35*780fb4a2SCy Schubert 
36*780fb4a2SCy Schubert 	android::binder::Status CreateInterface(
37*780fb4a2SCy Schubert 	    const android::os::PersistableBundle &params,
38*780fb4a2SCy Schubert 	    android::sp<fi::w1::wpa_supplicant::IIface> *aidl_return) override;
39*780fb4a2SCy Schubert 	android::binder::Status
40*780fb4a2SCy Schubert 	RemoveInterface(const std::string &ifname) override;
41*780fb4a2SCy Schubert 	android::binder::Status GetInterface(
42*780fb4a2SCy Schubert 	    const std::string &ifname,
43*780fb4a2SCy Schubert 	    android::sp<fi::w1::wpa_supplicant::IIface> *aidl_return) override;
44*780fb4a2SCy Schubert 
45*780fb4a2SCy Schubert private:
46*780fb4a2SCy Schubert 	/* Raw pointer to the global structure maintained by the core. */
47*780fb4a2SCy Schubert 	struct wpa_global *wpa_global_;
48*780fb4a2SCy Schubert 	/* All the callback objects registered by the clients. */
49*780fb4a2SCy Schubert 	std::vector<android::sp<fi::w1::wpa_supplicant::ISupplicantCallbacks>>
50*780fb4a2SCy Schubert 	    callbacks_;
51*780fb4a2SCy Schubert };
52*780fb4a2SCy Schubert 
53*780fb4a2SCy Schubert } /* namespace wpa_supplicant_binder */
54*780fb4a2SCy Schubert 
55*780fb4a2SCy Schubert #endif /* WPA_SUPPLICANT_BINDER_SUPPLICANT_H */
56