Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 1 | /* |
| 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 Shmidt | 7f2c753 | 2016-08-15 09:48:12 -0700 | [diff] [blame] | 10 | #ifndef WPA_SUPPLICANT_BINDER_IFACE_H |
| 11 | #define WPA_SUPPLICANT_BINDER_IFACE_H |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 12 | |
| 13 | #include "fi/w1/wpa_supplicant/BnIface.h" |
| 14 | |
| 15 | extern "C" { |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 16 | #include "utils/common.h" |
Dmitry Shmidt | 7f2c753 | 2016-08-15 09:48:12 -0700 | [diff] [blame] | 17 | #include "utils/includes.h" |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 18 | #include "../wpa_supplicant_i.h" |
| 19 | } |
| 20 | |
| 21 | namespace 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 | */ |
| 28 | class Iface : public fi::w1::wpa_supplicant::BnIface |
| 29 | { |
| 30 | public: |
Roshan Pius | 54e763a | 2016-07-06 15:41:53 -0700 | [diff] [blame] | 31 | Iface(struct wpa_global *wpa_global, const char ifname[]); |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 32 | virtual ~Iface() = default; |
| 33 | |
Roshan Pius | 54e763a | 2016-07-06 15:41:53 -0700 | [diff] [blame] | 34 | // Binder methods exposed in aidl. |
| 35 | android::binder::Status GetName(std::string *iface_name_out) override; |
| 36 | |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 37 | private: |
Roshan Pius | 54e763a | 2016-07-06 15:41:53 -0700 | [diff] [blame] | 38 | // 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 Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 45 | }; |
| 46 | |
Roshan Pius | 54e763a | 2016-07-06 15:41:53 -0700 | [diff] [blame] | 47 | } // namespace wpa_supplicant_binder |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 48 | |
Roshan Pius | 54e763a | 2016-07-06 15:41:53 -0700 | [diff] [blame] | 49 | #endif // WPA_SUPPLICANT_BINDER_IFACE_H |