blob: ac182cf34eee4e49a76392ba72484449217132d3 [file] [log] [blame]
mukesh agrawalaf571952011-07-14 14:31:12 -07001// 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
15using std::map;
16using std::string;
17
18namespace shill {
19
20SupplicantInterfaceProxy::SupplicantInterfaceProxy(
21 const WiFiRefPtr &wifi,
Darin Petkovaceede32011-07-18 15:32:38 -070022 DBus::Connection *bus,
mukesh agrawalaf571952011-07-14 14:31:12 -070023 const ::DBus::Path &object_path,
24 const char *dbus_addr)
Darin Petkovaceede32011-07-18 15:32:38 -070025 : proxy_(wifi, bus, object_path, dbus_addr) {}
mukesh agrawalaf571952011-07-14 14:31:12 -070026
27SupplicantInterfaceProxy::~SupplicantInterfaceProxy() {}
28
29::DBus::Path SupplicantInterfaceProxy::AddNetwork(
30 const std::map<std::string, ::DBus::Variant> &args) {
31 return proxy_.AddNetwork(args);
32}
33
mukesh agrawal0ed0f2e2011-12-05 20:36:17 +000034void SupplicantInterfaceProxy::Disconnect() {
35 return proxy_.Disconnect();
36}
37
mukesh agrawalaf571952011-07-14 14:31:12 -070038void SupplicantInterfaceProxy::FlushBSS(const uint32_t &age) {
39 return proxy_.FlushBSS(age);
40}
41
42void SupplicantInterfaceProxy::RemoveAllNetworks() {
43 return proxy_.RemoveAllNetworks();
44}
45
mukesh agrawal15908392011-11-16 18:29:25 +000046void SupplicantInterfaceProxy::RemoveNetwork(const ::DBus::Path &network) {
47 return proxy_.RemoveNetwork(network);
48}
49
mukesh agrawalaf571952011-07-14 14:31:12 -070050void SupplicantInterfaceProxy::Scan(
51 const std::map<std::string, ::DBus::Variant> &args) {
52 return proxy_.Scan(args);
53}
54
55void SupplicantInterfaceProxy::SelectNetwork(const ::DBus::Path &network) {
56 return proxy_.SelectNetwork(network);
57}
58
59// definitions for private class SupplicantInterfaceProxy::Proxy
60
61SupplicantInterfaceProxy::Proxy::Proxy(
62 const WiFiRefPtr &wifi, DBus::Connection *bus,
63 const DBus::Path &dbus_path, const char *dbus_addr)
64 : DBus::ObjectProxy(*bus, dbus_path, dbus_addr),
65 wifi_(wifi) {}
66
67SupplicantInterfaceProxy::Proxy::~Proxy() {}
68
mukesh agrawal1830fa12011-09-26 14:31:40 -070069void SupplicantInterfaceProxy::Proxy::BlobAdded(const string &/*blobname*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070070 LOG(INFO) << __func__;
71 // XXX
72}
73
mukesh agrawal1830fa12011-09-26 14:31:40 -070074void SupplicantInterfaceProxy::Proxy::BlobRemoved(const string &/*blobname*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070075 LOG(INFO) << __func__;
76 // XXX
77}
78
79void SupplicantInterfaceProxy::Proxy::BSSAdded(
80 const ::DBus::Path &BSS,
81 const std::map<string, ::DBus::Variant> &properties) {
82 LOG(INFO) << __func__;
83 wifi_->BSSAdded(BSS, properties);
84}
85
mukesh agrawal261daca2011-12-02 18:56:56 +000086void SupplicantInterfaceProxy::Proxy::BSSRemoved(const ::DBus::Path &BSS) {
mukesh agrawalaf571952011-07-14 14:31:12 -070087 LOG(INFO) << __func__;
mukesh agrawal261daca2011-12-02 18:56:56 +000088 wifi_->BSSRemoved(BSS);
mukesh agrawalaf571952011-07-14 14:31:12 -070089}
90
91void SupplicantInterfaceProxy::Proxy::NetworkAdded(
mukesh agrawal1830fa12011-09-26 14:31:40 -070092 const ::DBus::Path &/*network*/,
93 const std::map<string, ::DBus::Variant> &/*properties*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070094 LOG(INFO) << __func__;
95 // XXX
96}
97
98void SupplicantInterfaceProxy::Proxy::NetworkRemoved(
mukesh agrawal1830fa12011-09-26 14:31:40 -070099 const ::DBus::Path &/*network*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -0700100 LOG(INFO) << __func__;
101 // XXX
102}
103
104void SupplicantInterfaceProxy::Proxy::NetworkSelected(
mukesh agrawal1830fa12011-09-26 14:31:40 -0700105 const ::DBus::Path &/*network*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -0700106 LOG(INFO) << __func__;
107 // XXX
108}
109
110void SupplicantInterfaceProxy::Proxy::PropertiesChanged(
mukesh agrawal7ec71312011-11-10 02:08:26 +0000111 const std::map<string, ::DBus::Variant> &properties) {
mukesh agrawalaf571952011-07-14 14:31:12 -0700112 LOG(INFO) << __func__;
mukesh agrawal7ec71312011-11-10 02:08:26 +0000113 wifi_->PropertiesChanged(properties);
mukesh agrawalaf571952011-07-14 14:31:12 -0700114}
115
116void SupplicantInterfaceProxy::Proxy::ScanDone(const bool& success) {
117 LOG(INFO) << __func__ << " " << success;
118 if (success) {
119 wifi_->ScanDone();
120 }
121}
122
123} // namespace shill