blob: 136b99b1432749d08edd4fbe22852da74e8a3109 [file] [log] [blame]
Dmitry Shmidte4663042016-04-04 10:07:49 -07001/*
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>
5 *
6 * This software may be distributed under the terms of the BSD license.
7 * See README for more details.
8 */
9
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -070010#ifndef WPA_SUPPLICANT_BINDER_SUPPLICANT_H
11#define WPA_SUPPLICANT_BINDER_SUPPLICANT_H
Dmitry Shmidte4663042016-04-04 10:07:49 -070012
13#include "fi/w1/wpa_supplicant/BnSupplicant.h"
14#include "fi/w1/wpa_supplicant/IIface.h"
15#include "fi/w1/wpa_supplicant/ISupplicantCallbacks.h"
16
17extern "C" {
Dmitry Shmidte4663042016-04-04 10:07:49 -070018#include "utils/common.h"
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -070019#include "utils/includes.h"
Dmitry Shmidte4663042016-04-04 10:07:49 -070020#include "../wpa_supplicant_i.h"
21}
22
23namespace wpa_supplicant_binder {
24
25/**
26 * Implementation of the supplicant binder object. This binder
27 * object is used core for global control operations on
28 * wpa_supplicant.
29 */
30class Supplicant : public fi::w1::wpa_supplicant::BnSupplicant
31{
32public:
33 Supplicant(struct wpa_global *global);
34 virtual ~Supplicant() = default;
35
36 android::binder::Status CreateInterface(
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -070037 const android::os::PersistableBundle &params,
38 android::sp<fi::w1::wpa_supplicant::IIface> *aidl_return) override;
39 android::binder::Status
40 RemoveInterface(const std::string &ifname) override;
Dmitry Shmidte4663042016-04-04 10:07:49 -070041 android::binder::Status GetInterface(
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -070042 const std::string &ifname,
43 android::sp<fi::w1::wpa_supplicant::IIface> *aidl_return) override;
Dmitry Shmidte4663042016-04-04 10:07:49 -070044
45private:
46 /* Raw pointer to the global structure maintained by the core. */
47 struct wpa_global *wpa_global_;
48 /* All the callback objects registered by the clients. */
49 std::vector<android::sp<fi::w1::wpa_supplicant::ISupplicantCallbacks>>
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -070050 callbacks_;
Dmitry Shmidte4663042016-04-04 10:07:49 -070051};
52
53} /* namespace wpa_supplicant_binder */
54
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -070055#endif /* WPA_SUPPLICANT_BINDER_SUPPLICANT_H */