Paul Stewart | 835934a | 2012-12-06 19:27:09 -0800 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef SUPPLICANT_NETWORK_PROXY_H_ |
| 6 | #define SUPPLICANT_NETWORK_PROXY_H_ |
| 7 | |
| 8 | #include <map> |
| 9 | #include <string> |
| 10 | |
| 11 | #include <base/basictypes.h> |
| 12 | |
| 13 | #include "shill/dbus_bindings/supplicant-network.h" |
| 14 | #include "shill/supplicant_network_proxy_interface.h" |
| 15 | #include "shill/refptr_types.h" |
| 16 | |
| 17 | namespace shill { |
| 18 | |
| 19 | // SupplicantNetworkProxy. provides access to wpa_supplicant's |
| 20 | // network-interface APIs via D-Bus. |
| 21 | class SupplicantNetworkProxy |
| 22 | : public SupplicantNetworkProxyInterface { |
| 23 | public: |
| 24 | SupplicantNetworkProxy(DBus::Connection *bus, |
| 25 | const ::DBus::Path &object_path, |
| 26 | const char *dbus_addr); |
| 27 | virtual ~SupplicantNetworkProxy(); |
| 28 | |
| 29 | virtual void SetEnabled(bool enabled); |
| 30 | |
| 31 | private: |
| 32 | class Proxy : public fi::w1::wpa_supplicant1::Network_proxy, |
| 33 | public ::DBus::ObjectProxy { |
| 34 | public: |
| 35 | Proxy(DBus::Connection *bus, |
| 36 | const ::DBus::Path &object_path, |
| 37 | const char *dbus_addr); |
| 38 | virtual ~Proxy(); |
| 39 | |
| 40 | private: |
| 41 | // signal handlers called by dbus-c++, via |
| 42 | // fi::w1::wpa_supplicant1::Network_proxy interface |
| 43 | virtual void PropertiesChanged(const std::map<std::string, ::DBus::Variant> |
| 44 | &properties); |
| 45 | |
| 46 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 47 | }; |
| 48 | |
| 49 | Proxy proxy_; |
| 50 | |
| 51 | DISALLOW_COPY_AND_ASSIGN(SupplicantNetworkProxy); |
| 52 | }; |
| 53 | |
| 54 | } // namespace shill |
| 55 | |
| 56 | #endif // SUPPLICANT_NETWORK_PROXY_H_ |