blob: e0b1fbc731af2392649dd0e5d1e6a3708912793e [file] [log] [blame]
mukesh agrawal8a3188d2011-12-01 20:56:44 +00001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
mukesh agrawalaf571952011-07-14 14:31:12 -07002// 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
Paul Stewart66c86002012-01-30 18:00:52 -080034void SupplicantInterfaceProxy::ClearCachedCredentials() {
35 return proxy_.ClearCachedCredentials();
36}
37
mukesh agrawal0ed0f2e2011-12-05 20:36:17 +000038void SupplicantInterfaceProxy::Disconnect() {
39 return proxy_.Disconnect();
40}
41
mukesh agrawalaf571952011-07-14 14:31:12 -070042void SupplicantInterfaceProxy::FlushBSS(const uint32_t &age) {
43 return proxy_.FlushBSS(age);
44}
45
46void SupplicantInterfaceProxy::RemoveAllNetworks() {
47 return proxy_.RemoveAllNetworks();
48}
49
mukesh agrawal15908392011-11-16 18:29:25 +000050void SupplicantInterfaceProxy::RemoveNetwork(const ::DBus::Path &network) {
51 return proxy_.RemoveNetwork(network);
52}
53
mukesh agrawalaf571952011-07-14 14:31:12 -070054void SupplicantInterfaceProxy::Scan(
55 const std::map<std::string, ::DBus::Variant> &args) {
56 return proxy_.Scan(args);
57}
58
59void SupplicantInterfaceProxy::SelectNetwork(const ::DBus::Path &network) {
60 return proxy_.SelectNetwork(network);
61}
62
Paul Stewart2987dcf2012-01-30 15:47:42 -080063void SupplicantInterfaceProxy::SetFastReauth(bool enabled) {
64 return proxy_.FastReauth(enabled);
65}
66
mukesh agrawalaf571952011-07-14 14:31:12 -070067// definitions for private class SupplicantInterfaceProxy::Proxy
68
69SupplicantInterfaceProxy::Proxy::Proxy(
70 const WiFiRefPtr &wifi, DBus::Connection *bus,
71 const DBus::Path &dbus_path, const char *dbus_addr)
72 : DBus::ObjectProxy(*bus, dbus_path, dbus_addr),
73 wifi_(wifi) {}
74
75SupplicantInterfaceProxy::Proxy::~Proxy() {}
76
mukesh agrawal1830fa12011-09-26 14:31:40 -070077void SupplicantInterfaceProxy::Proxy::BlobAdded(const string &/*blobname*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070078 LOG(INFO) << __func__;
79 // XXX
80}
81
mukesh agrawal1830fa12011-09-26 14:31:40 -070082void SupplicantInterfaceProxy::Proxy::BlobRemoved(const string &/*blobname*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070083 LOG(INFO) << __func__;
84 // XXX
85}
86
87void SupplicantInterfaceProxy::Proxy::BSSAdded(
88 const ::DBus::Path &BSS,
89 const std::map<string, ::DBus::Variant> &properties) {
90 LOG(INFO) << __func__;
91 wifi_->BSSAdded(BSS, properties);
92}
93
mukesh agrawal261daca2011-12-02 18:56:56 +000094void SupplicantInterfaceProxy::Proxy::BSSRemoved(const ::DBus::Path &BSS) {
mukesh agrawalaf571952011-07-14 14:31:12 -070095 LOG(INFO) << __func__;
mukesh agrawal261daca2011-12-02 18:56:56 +000096 wifi_->BSSRemoved(BSS);
mukesh agrawalaf571952011-07-14 14:31:12 -070097}
98
99void SupplicantInterfaceProxy::Proxy::NetworkAdded(
mukesh agrawal1830fa12011-09-26 14:31:40 -0700100 const ::DBus::Path &/*network*/,
101 const std::map<string, ::DBus::Variant> &/*properties*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -0700102 LOG(INFO) << __func__;
103 // XXX
104}
105
106void SupplicantInterfaceProxy::Proxy::NetworkRemoved(
mukesh agrawal1830fa12011-09-26 14:31:40 -0700107 const ::DBus::Path &/*network*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -0700108 LOG(INFO) << __func__;
mukesh agrawal8a3188d2011-12-01 20:56:44 +0000109 // TODO(quiche): Pass this up to WiFi, so that it can clean its
110 // rpcid_by_service_ map. crosbug.com/24699
mukesh agrawalaf571952011-07-14 14:31:12 -0700111}
112
113void SupplicantInterfaceProxy::Proxy::NetworkSelected(
mukesh agrawal1830fa12011-09-26 14:31:40 -0700114 const ::DBus::Path &/*network*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -0700115 LOG(INFO) << __func__;
116 // XXX
117}
118
119void SupplicantInterfaceProxy::Proxy::PropertiesChanged(
mukesh agrawal7ec71312011-11-10 02:08:26 +0000120 const std::map<string, ::DBus::Variant> &properties) {
mukesh agrawalaf571952011-07-14 14:31:12 -0700121 LOG(INFO) << __func__;
mukesh agrawal7ec71312011-11-10 02:08:26 +0000122 wifi_->PropertiesChanged(properties);
mukesh agrawalaf571952011-07-14 14:31:12 -0700123}
124
125void SupplicantInterfaceProxy::Proxy::ScanDone(const bool& success) {
126 LOG(INFO) << __func__ << " " << success;
127 if (success) {
128 wifi_->ScanDone();
129 }
130}
131
132} // namespace shill