blob: 68359ff48fcb566397b5aaa3b7cc8305203bce6b [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 agrawalf2028172012-03-13 14:20:22 -070067void SupplicantInterfaceProxy::SetScanInterval(int32 scan_interval) {
68 return proxy_.ScanInterval(scan_interval);
69}
70
mukesh agrawalaf571952011-07-14 14:31:12 -070071// definitions for private class SupplicantInterfaceProxy::Proxy
72
73SupplicantInterfaceProxy::Proxy::Proxy(
74 const WiFiRefPtr &wifi, DBus::Connection *bus,
75 const DBus::Path &dbus_path, const char *dbus_addr)
76 : DBus::ObjectProxy(*bus, dbus_path, dbus_addr),
77 wifi_(wifi) {}
78
79SupplicantInterfaceProxy::Proxy::~Proxy() {}
80
mukesh agrawal1830fa12011-09-26 14:31:40 -070081void SupplicantInterfaceProxy::Proxy::BlobAdded(const string &/*blobname*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070082 LOG(INFO) << __func__;
83 // XXX
84}
85
mukesh agrawal1830fa12011-09-26 14:31:40 -070086void SupplicantInterfaceProxy::Proxy::BlobRemoved(const string &/*blobname*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070087 LOG(INFO) << __func__;
88 // XXX
89}
90
91void SupplicantInterfaceProxy::Proxy::BSSAdded(
92 const ::DBus::Path &BSS,
93 const std::map<string, ::DBus::Variant> &properties) {
94 LOG(INFO) << __func__;
95 wifi_->BSSAdded(BSS, properties);
96}
97
mukesh agrawal261daca2011-12-02 18:56:56 +000098void SupplicantInterfaceProxy::Proxy::BSSRemoved(const ::DBus::Path &BSS) {
mukesh agrawalaf571952011-07-14 14:31:12 -070099 LOG(INFO) << __func__;
mukesh agrawal261daca2011-12-02 18:56:56 +0000100 wifi_->BSSRemoved(BSS);
mukesh agrawalaf571952011-07-14 14:31:12 -0700101}
102
103void SupplicantInterfaceProxy::Proxy::NetworkAdded(
mukesh agrawal1830fa12011-09-26 14:31:40 -0700104 const ::DBus::Path &/*network*/,
105 const std::map<string, ::DBus::Variant> &/*properties*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -0700106 LOG(INFO) << __func__;
107 // XXX
108}
109
110void SupplicantInterfaceProxy::Proxy::NetworkRemoved(
mukesh agrawal1830fa12011-09-26 14:31:40 -0700111 const ::DBus::Path &/*network*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -0700112 LOG(INFO) << __func__;
mukesh agrawal8a3188d2011-12-01 20:56:44 +0000113 // TODO(quiche): Pass this up to WiFi, so that it can clean its
114 // rpcid_by_service_ map. crosbug.com/24699
mukesh agrawalaf571952011-07-14 14:31:12 -0700115}
116
117void SupplicantInterfaceProxy::Proxy::NetworkSelected(
mukesh agrawal1830fa12011-09-26 14:31:40 -0700118 const ::DBus::Path &/*network*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -0700119 LOG(INFO) << __func__;
120 // XXX
121}
122
123void SupplicantInterfaceProxy::Proxy::PropertiesChanged(
mukesh agrawal7ec71312011-11-10 02:08:26 +0000124 const std::map<string, ::DBus::Variant> &properties) {
mukesh agrawalaf571952011-07-14 14:31:12 -0700125 LOG(INFO) << __func__;
mukesh agrawal7ec71312011-11-10 02:08:26 +0000126 wifi_->PropertiesChanged(properties);
mukesh agrawalaf571952011-07-14 14:31:12 -0700127}
128
129void SupplicantInterfaceProxy::Proxy::ScanDone(const bool& success) {
130 LOG(INFO) << __func__ << " " << success;
131 if (success) {
132 wifi_->ScanDone();
133 }
134}
135
136} // namespace shill