mukesh agrawal | b20776f | 2012-02-10 16:00:36 -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_BSS_PROXY_H_ |
| 6 | #define SUPPLICANT_BSS_PROXY_H_ |
| 7 | |
| 8 | #include <map> |
| 9 | #include <string> |
| 10 | |
| 11 | #include <base/basictypes.h> |
| 12 | #include <dbus-c++/dbus.h> |
| 13 | |
| 14 | #include "shill/dbus_bindings/supplicant-bss.h" |
| 15 | #include "shill/supplicant_bss_proxy_interface.h" |
| 16 | |
| 17 | namespace shill { |
| 18 | |
| 19 | class WiFiEndpoint; |
| 20 | |
| 21 | class SupplicantBSSProxy : public SupplicantBSSProxyInterface { |
| 22 | public: |
| 23 | SupplicantBSSProxy(WiFiEndpoint *wifi_endpoint, |
| 24 | DBus::Connection *bus, |
| 25 | const ::DBus::Path &object_path, |
| 26 | const char *dbus_addr); |
| 27 | virtual ~SupplicantBSSProxy(); |
| 28 | |
| 29 | private: |
| 30 | class Proxy : public fi::w1::wpa_supplicant1::BSS_proxy, |
| 31 | public ::DBus::ObjectProxy { |
| 32 | public: |
| 33 | Proxy(WiFiEndpoint *wifi_endpoint, |
| 34 | DBus::Connection *bus, |
| 35 | const ::DBus::Path &object_path, |
| 36 | const char *dbus_addr); |
| 37 | virtual ~Proxy(); |
| 38 | |
| 39 | private: |
| 40 | // signal handlers called by dbus-c++, via |
| 41 | // wpa_supplicant1_proxy interface. |
| 42 | virtual void PropertiesChanged( |
| 43 | const std::map<std::string, ::DBus::Variant> &properties); |
| 44 | |
| 45 | // We use a bare pointer, because each SupplicantBSSProxy is owned |
| 46 | // (using a scoped_ptr) by a WiFiEndpoint. This means that if |
| 47 | // |wifi_endpoint_| is invalid, then so is |this|. |
| 48 | WiFiEndpoint *wifi_endpoint_; |
| 49 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 50 | }; |
| 51 | |
| 52 | Proxy proxy_; |
| 53 | |
| 54 | DISALLOW_COPY_AND_ASSIGN(SupplicantBSSProxy); |
| 55 | }; |
| 56 | |
| 57 | } // namespace shill |
| 58 | |
| 59 | #endif // SUPPLICANT_BSS_PROXY_H_ |