1324714Scy/*
2324714Scy * binder interface for wpa_supplicant daemon
3324714Scy * Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi>
4324714Scy * Copyright (c) 2004-2016, Roshan Pius <rpius@google.com>
5324714Scy *
6324714Scy * This software may be distributed under the terms of the BSD license.
7324714Scy * See README for more details.
8324714Scy */
9324714Scy
10324714Scy#ifndef WPA_SUPPLICANT_BINDER_SUPPLICANT_H
11324714Scy#define WPA_SUPPLICANT_BINDER_SUPPLICANT_H
12324714Scy
13324714Scy#include "fi/w1/wpa_supplicant/BnSupplicant.h"
14324714Scy#include "fi/w1/wpa_supplicant/IIface.h"
15324714Scy#include "fi/w1/wpa_supplicant/ISupplicantCallbacks.h"
16324714Scy
17324714Scyextern "C" {
18324714Scy#include "utils/common.h"
19324714Scy#include "utils/includes.h"
20324714Scy#include "../wpa_supplicant_i.h"
21324714Scy}
22324714Scy
23324714Scynamespace wpa_supplicant_binder {
24324714Scy
25324714Scy/**
26324714Scy * Implementation of the supplicant binder object. This binder
27324714Scy * object is used core for global control operations on
28324714Scy * wpa_supplicant.
29324714Scy */
30324714Scyclass Supplicant : public fi::w1::wpa_supplicant::BnSupplicant
31324714Scy{
32324714Scypublic:
33324714Scy	Supplicant(struct wpa_global *global);
34324714Scy	virtual ~Supplicant() = default;
35324714Scy
36324714Scy	android::binder::Status CreateInterface(
37324714Scy	    const android::os::PersistableBundle &params,
38324714Scy	    android::sp<fi::w1::wpa_supplicant::IIface> *aidl_return) override;
39324714Scy	android::binder::Status
40324714Scy	RemoveInterface(const std::string &ifname) override;
41324714Scy	android::binder::Status GetInterface(
42324714Scy	    const std::string &ifname,
43324714Scy	    android::sp<fi::w1::wpa_supplicant::IIface> *aidl_return) override;
44324714Scy
45324714Scyprivate:
46324714Scy	/* Raw pointer to the global structure maintained by the core. */
47324714Scy	struct wpa_global *wpa_global_;
48324714Scy	/* All the callback objects registered by the clients. */
49324714Scy	std::vector<android::sp<fi::w1::wpa_supplicant::ISupplicantCallbacks>>
50324714Scy	    callbacks_;
51324714Scy};
52324714Scy
53324714Scy} /* namespace wpa_supplicant_binder */
54324714Scy
55324714Scy#endif /* WPA_SUPPLICANT_BINDER_SUPPLICANT_H */
56