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 | #include "shill/supplicant_interface_proxy.h" |
| 6 | |
| 7 | #include <map> |
| 8 | #include <string> |
| 9 | |
| 10 | #include <base/logging.h> |
| 11 | #include <dbus-c++/dbus.h> |
| 12 | |
| 13 | #include "shill/wifi.h" |
| 14 | |
| 15 | using std::map; |
| 16 | using std::string; |
| 17 | |
| 18 | namespace shill { |
| 19 | |
| 20 | SupplicantInterfaceProxy::SupplicantInterfaceProxy( |
| 21 | const WiFiRefPtr &wifi, |
Darin Petkov | aceede3 | 2011-07-18 15:32:38 -0700 | [diff] [blame] | 22 | DBus::Connection *bus, |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 23 | const ::DBus::Path &object_path, |
| 24 | const char *dbus_addr) |
Darin Petkov | aceede3 | 2011-07-18 15:32:38 -0700 | [diff] [blame] | 25 | : proxy_(wifi, bus, object_path, dbus_addr) {} |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 26 | |
| 27 | SupplicantInterfaceProxy::~SupplicantInterfaceProxy() {} |
| 28 | |
| 29 | ::DBus::Path SupplicantInterfaceProxy::AddNetwork( |
| 30 | const std::map<std::string, ::DBus::Variant> &args) { |
| 31 | return proxy_.AddNetwork(args); |
| 32 | } |
| 33 | |
| 34 | void SupplicantInterfaceProxy::FlushBSS(const uint32_t &age) { |
| 35 | return proxy_.FlushBSS(age); |
| 36 | } |
| 37 | |
| 38 | void SupplicantInterfaceProxy::RemoveAllNetworks() { |
| 39 | return proxy_.RemoveAllNetworks(); |
| 40 | } |
| 41 | |
mukesh agrawal | 1590839 | 2011-11-16 18:29:25 +0000 | [diff] [blame] | 42 | void SupplicantInterfaceProxy::RemoveNetwork(const ::DBus::Path &network) { |
| 43 | return proxy_.RemoveNetwork(network); |
| 44 | } |
| 45 | |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 46 | void SupplicantInterfaceProxy::Scan( |
| 47 | const std::map<std::string, ::DBus::Variant> &args) { |
| 48 | return proxy_.Scan(args); |
| 49 | } |
| 50 | |
| 51 | void SupplicantInterfaceProxy::SelectNetwork(const ::DBus::Path &network) { |
| 52 | return proxy_.SelectNetwork(network); |
| 53 | } |
| 54 | |
| 55 | // definitions for private class SupplicantInterfaceProxy::Proxy |
| 56 | |
| 57 | SupplicantInterfaceProxy::Proxy::Proxy( |
| 58 | const WiFiRefPtr &wifi, DBus::Connection *bus, |
| 59 | const DBus::Path &dbus_path, const char *dbus_addr) |
| 60 | : DBus::ObjectProxy(*bus, dbus_path, dbus_addr), |
| 61 | wifi_(wifi) {} |
| 62 | |
| 63 | SupplicantInterfaceProxy::Proxy::~Proxy() {} |
| 64 | |
mukesh agrawal | 1830fa1 | 2011-09-26 14:31:40 -0700 | [diff] [blame] | 65 | void SupplicantInterfaceProxy::Proxy::BlobAdded(const string &/*blobname*/) { |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 66 | LOG(INFO) << __func__; |
| 67 | // XXX |
| 68 | } |
| 69 | |
mukesh agrawal | 1830fa1 | 2011-09-26 14:31:40 -0700 | [diff] [blame] | 70 | void SupplicantInterfaceProxy::Proxy::BlobRemoved(const string &/*blobname*/) { |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 71 | LOG(INFO) << __func__; |
| 72 | // XXX |
| 73 | } |
| 74 | |
| 75 | void SupplicantInterfaceProxy::Proxy::BSSAdded( |
| 76 | const ::DBus::Path &BSS, |
| 77 | const std::map<string, ::DBus::Variant> &properties) { |
| 78 | LOG(INFO) << __func__; |
| 79 | wifi_->BSSAdded(BSS, properties); |
| 80 | } |
| 81 | |
mukesh agrawal | 1830fa1 | 2011-09-26 14:31:40 -0700 | [diff] [blame] | 82 | void SupplicantInterfaceProxy::Proxy::BSSRemoved(const ::DBus::Path &/*BSS*/) { |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 83 | LOG(INFO) << __func__; |
| 84 | // XXX |
| 85 | } |
| 86 | |
| 87 | void SupplicantInterfaceProxy::Proxy::NetworkAdded( |
mukesh agrawal | 1830fa1 | 2011-09-26 14:31:40 -0700 | [diff] [blame] | 88 | const ::DBus::Path &/*network*/, |
| 89 | const std::map<string, ::DBus::Variant> &/*properties*/) { |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 90 | LOG(INFO) << __func__; |
| 91 | // XXX |
| 92 | } |
| 93 | |
| 94 | void SupplicantInterfaceProxy::Proxy::NetworkRemoved( |
mukesh agrawal | 1830fa1 | 2011-09-26 14:31:40 -0700 | [diff] [blame] | 95 | const ::DBus::Path &/*network*/) { |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 96 | LOG(INFO) << __func__; |
| 97 | // XXX |
| 98 | } |
| 99 | |
| 100 | void SupplicantInterfaceProxy::Proxy::NetworkSelected( |
mukesh agrawal | 1830fa1 | 2011-09-26 14:31:40 -0700 | [diff] [blame] | 101 | const ::DBus::Path &/*network*/) { |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 102 | LOG(INFO) << __func__; |
| 103 | // XXX |
| 104 | } |
| 105 | |
| 106 | void SupplicantInterfaceProxy::Proxy::PropertiesChanged( |
mukesh agrawal | 7ec7131 | 2011-11-10 02:08:26 +0000 | [diff] [blame] | 107 | const std::map<string, ::DBus::Variant> &properties) { |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 108 | LOG(INFO) << __func__; |
mukesh agrawal | 7ec7131 | 2011-11-10 02:08:26 +0000 | [diff] [blame] | 109 | wifi_->PropertiesChanged(properties); |
mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | void SupplicantInterfaceProxy::Proxy::ScanDone(const bool& success) { |
| 113 | LOG(INFO) << __func__ << " " << success; |
| 114 | if (success) { |
| 115 | wifi_->ScanDone(); |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | } // namespace shill |