mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 1 | // Copyright (c) 2011 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_INTERFACE_PROXY_H_ |
| 6 | #define SUPPLICANT_INTERFACE_PROXY_H_ |
| 7 | |
| 8 | #include <map> |
| 9 | #include <string> |
| 10 | |
| 11 | #include <base/basictypes.h> |
| 12 | |
Darin Petkov | 4a09b6b | 2011-07-19 12:52:06 -0700 | [diff] [blame] | 13 | #include "shill/dbus_bindings/supplicant-interface.h" |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 14 | #include "shill/supplicant_interface_proxy_interface.h" |
| 15 | #include "shill/refptr_types.h" |
| 16 | |
| 17 | namespace shill { |
| 18 | |
| 19 | // SupplicantInterfaceProxy. provides access to wpa_supplicant's |
| 20 | // network-interface APIs via D-Bus. |
| 21 | class SupplicantInterfaceProxy |
| 22 | : public SupplicantInterfaceProxyInterface { |
| 23 | public: |
| 24 | SupplicantInterfaceProxy(const WiFiRefPtr &wifi, |
Darin Petkov | aceede3 | 2011-07-18 15:32:38 -0700 | [diff] [blame] | 25 | DBus::Connection *bus, |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 26 | const ::DBus::Path &object_path, |
| 27 | const char *dbus_addr); |
| 28 | virtual ~SupplicantInterfaceProxy(); |
| 29 | |
| 30 | virtual ::DBus::Path AddNetwork( |
| 31 | const std::map<std::string, ::DBus::Variant> &args); |
mukesh agrawal | 0ed0f2e | 2011-12-05 20:36:17 +0000 | [diff] [blame] | 32 | virtual void Disconnect(); |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 33 | virtual void FlushBSS(const uint32_t &age); |
| 34 | virtual void RemoveAllNetworks(); |
mukesh agrawal | 1590839 | 2011-11-16 18:29:25 +0000 | [diff] [blame] | 35 | virtual void RemoveNetwork(const ::DBus::Path &network); |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 36 | virtual void Scan( |
| 37 | const std::map<std::string, ::DBus::Variant> &args); |
| 38 | virtual void SelectNetwork(const ::DBus::Path &network); |
| 39 | |
| 40 | private: |
| 41 | class Proxy : public fi::w1::wpa_supplicant1::Interface_proxy, |
| 42 | public ::DBus::ObjectProxy { |
| 43 | public: |
Darin Petkov | aceede3 | 2011-07-18 15:32:38 -0700 | [diff] [blame] | 44 | Proxy(const WiFiRefPtr &wifi, |
| 45 | DBus::Connection *bus, |
| 46 | const ::DBus::Path &object_path, |
| 47 | const char *dbus_addr); |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 48 | virtual ~Proxy(); |
| 49 | |
| 50 | private: |
| 51 | // signal handlers called by dbus-c++, via |
| 52 | // fi::w1::wpa_supplicant1::Interface_proxy interface |
| 53 | virtual void BlobAdded(const std::string &blobname); |
| 54 | virtual void BlobRemoved(const std::string &blobname); |
| 55 | virtual void BSSAdded(const ::DBus::Path &BSS, |
| 56 | const std::map<std::string, ::DBus::Variant> |
| 57 | &properties); |
| 58 | virtual void BSSRemoved(const ::DBus::Path &BSS); |
| 59 | virtual void NetworkAdded(const ::DBus::Path &network, |
| 60 | const std::map<std::string, ::DBus::Variant> |
| 61 | &properties); |
| 62 | virtual void NetworkRemoved(const ::DBus::Path &network); |
| 63 | virtual void NetworkSelected(const ::DBus::Path &network); |
| 64 | virtual void PropertiesChanged(const std::map<std::string, ::DBus::Variant> |
| 65 | &properties); |
| 66 | virtual void ScanDone(const bool &success); |
| 67 | |
| 68 | WiFiRefPtr wifi_; |
| 69 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 70 | }; |
| 71 | |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 72 | Proxy proxy_; |
| 73 | |
| 74 | DISALLOW_COPY_AND_ASSIGN(SupplicantInterfaceProxy); |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 75 | }; |
| 76 | |
| 77 | } // namespace shill |
| 78 | |
| 79 | #endif // SUPPLICANT_INTERFACE_PROXY_H_ |