blob: f87f19f27aadf104aa6c16e7823ce080de5338be [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_IFACE_H
11#define WPA_SUPPLICANT_BINDER_IFACE_H
Dmitry Shmidte4663042016-04-04 10:07:49 -070012
13#include "fi/w1/wpa_supplicant/BnIface.h"
14
15extern "C" {
Dmitry Shmidte4663042016-04-04 10:07:49 -070016#include "utils/common.h"
Dmitry Shmidt7f2c7532016-08-15 09:48:12 -070017#include "utils/includes.h"
Dmitry Shmidte4663042016-04-04 10:07:49 -070018#include "../wpa_supplicant_i.h"
19}
20
21namespace wpa_supplicant_binder {
22
23/**
24 * Implementation of Iface binder object. Each unique binder
25 * object is used for control operations on a specific interface
26 * controlled by wpa_supplicant.
27 */
28class Iface : public fi::w1::wpa_supplicant::BnIface
29{
30public:
Roshan Pius54e763a2016-07-06 15:41:53 -070031 Iface(struct wpa_global *wpa_global, const char ifname[]);
Dmitry Shmidte4663042016-04-04 10:07:49 -070032 virtual ~Iface() = default;
33
Roshan Pius54e763a2016-07-06 15:41:53 -070034 // Binder methods exposed in aidl.
35 android::binder::Status GetName(std::string *iface_name_out) override;
36
Dmitry Shmidte4663042016-04-04 10:07:49 -070037private:
Roshan Pius54e763a2016-07-06 15:41:53 -070038 // Reference to the global wpa_struct. This is assumed to be valid for
39 // the lifetime of the process.
40 const struct wpa_global *wpa_global_;
41 // Name of the iface this binder object controls
42 const std::string ifname_;
43
44 struct wpa_supplicant *retrieveIfacePtr();
Dmitry Shmidte4663042016-04-04 10:07:49 -070045};
46
Roshan Pius54e763a2016-07-06 15:41:53 -070047} // namespace wpa_supplicant_binder
Dmitry Shmidte4663042016-04-04 10:07:49 -070048
Roshan Pius54e763a2016-07-06 15:41:53 -070049#endif // WPA_SUPPLICANT_BINDER_IFACE_H