blob: bfeb9b9d7a00c6a4226c507473ded30c9832279e [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
34void SupplicantInterfaceProxy::FlushBSS(const uint32_t &age) {
35 return proxy_.FlushBSS(age);
36}
37
38void SupplicantInterfaceProxy::RemoveAllNetworks() {
39 return proxy_.RemoveAllNetworks();
40}
41
mukesh agrawal15908392011-11-16 18:29:25 +000042void SupplicantInterfaceProxy::RemoveNetwork(const ::DBus::Path &network) {
43 return proxy_.RemoveNetwork(network);
44}
45
mukesh agrawalaf571952011-07-14 14:31:12 -070046void SupplicantInterfaceProxy::Scan(
47 const std::map<std::string, ::DBus::Variant> &args) {
48 return proxy_.Scan(args);
49}
50
51void SupplicantInterfaceProxy::SelectNetwork(const ::DBus::Path &network) {
52 return proxy_.SelectNetwork(network);
53}
54
55// definitions for private class SupplicantInterfaceProxy::Proxy
56
57SupplicantInterfaceProxy::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
63SupplicantInterfaceProxy::Proxy::~Proxy() {}
64
mukesh agrawal1830fa12011-09-26 14:31:40 -070065void SupplicantInterfaceProxy::Proxy::BlobAdded(const string &/*blobname*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070066 LOG(INFO) << __func__;
67 // XXX
68}
69
mukesh agrawal1830fa12011-09-26 14:31:40 -070070void SupplicantInterfaceProxy::Proxy::BlobRemoved(const string &/*blobname*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070071 LOG(INFO) << __func__;
72 // XXX
73}
74
75void 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 agrawal261daca2011-12-02 18:56:56 +000082void SupplicantInterfaceProxy::Proxy::BSSRemoved(const ::DBus::Path &BSS) {
mukesh agrawalaf571952011-07-14 14:31:12 -070083 LOG(INFO) << __func__;
mukesh agrawal261daca2011-12-02 18:56:56 +000084 wifi_->BSSRemoved(BSS);
mukesh agrawalaf571952011-07-14 14:31:12 -070085}
86
87void SupplicantInterfaceProxy::Proxy::NetworkAdded(
mukesh agrawal1830fa12011-09-26 14:31:40 -070088 const ::DBus::Path &/*network*/,
89 const std::map<string, ::DBus::Variant> &/*properties*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070090 LOG(INFO) << __func__;
91 // XXX
92}
93
94void SupplicantInterfaceProxy::Proxy::NetworkRemoved(
mukesh agrawal1830fa12011-09-26 14:31:40 -070095 const ::DBus::Path &/*network*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070096 LOG(INFO) << __func__;
97 // XXX
98}
99
100void SupplicantInterfaceProxy::Proxy::NetworkSelected(
mukesh agrawal1830fa12011-09-26 14:31:40 -0700101 const ::DBus::Path &/*network*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -0700102 LOG(INFO) << __func__;
103 // XXX
104}
105
106void SupplicantInterfaceProxy::Proxy::PropertiesChanged(
mukesh agrawal7ec71312011-11-10 02:08:26 +0000107 const std::map<string, ::DBus::Variant> &properties) {
mukesh agrawalaf571952011-07-14 14:31:12 -0700108 LOG(INFO) << __func__;
mukesh agrawal7ec71312011-11-10 02:08:26 +0000109 wifi_->PropertiesChanged(properties);
mukesh agrawalaf571952011-07-14 14:31:12 -0700110}
111
112void SupplicantInterfaceProxy::Proxy::ScanDone(const bool& success) {
113 LOG(INFO) << __func__ << " " << success;
114 if (success) {
115 wifi_->ScanDone();
116 }
117}
118
119} // namespace shill