blob: d9f9b3b57e23c33f9959af1bedfcdf3d4475a18a [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
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
Paul Stewart2987dcf2012-01-30 15:47:42 -080059void SupplicantInterfaceProxy::SetFastReauth(bool enabled) {
60 return proxy_.FastReauth(enabled);
61}
62
mukesh agrawalaf571952011-07-14 14:31:12 -070063// definitions for private class SupplicantInterfaceProxy::Proxy
64
65SupplicantInterfaceProxy::Proxy::Proxy(
66 const WiFiRefPtr &wifi, DBus::Connection *bus,
67 const DBus::Path &dbus_path, const char *dbus_addr)
68 : DBus::ObjectProxy(*bus, dbus_path, dbus_addr),
69 wifi_(wifi) {}
70
71SupplicantInterfaceProxy::Proxy::~Proxy() {}
72
mukesh agrawal1830fa12011-09-26 14:31:40 -070073void SupplicantInterfaceProxy::Proxy::BlobAdded(const string &/*blobname*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070074 LOG(INFO) << __func__;
75 // XXX
76}
77
mukesh agrawal1830fa12011-09-26 14:31:40 -070078void SupplicantInterfaceProxy::Proxy::BlobRemoved(const string &/*blobname*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070079 LOG(INFO) << __func__;
80 // XXX
81}
82
83void SupplicantInterfaceProxy::Proxy::BSSAdded(
84 const ::DBus::Path &BSS,
85 const std::map<string, ::DBus::Variant> &properties) {
86 LOG(INFO) << __func__;
87 wifi_->BSSAdded(BSS, properties);
88}
89
mukesh agrawal261daca2011-12-02 18:56:56 +000090void SupplicantInterfaceProxy::Proxy::BSSRemoved(const ::DBus::Path &BSS) {
mukesh agrawalaf571952011-07-14 14:31:12 -070091 LOG(INFO) << __func__;
mukesh agrawal261daca2011-12-02 18:56:56 +000092 wifi_->BSSRemoved(BSS);
mukesh agrawalaf571952011-07-14 14:31:12 -070093}
94
95void SupplicantInterfaceProxy::Proxy::NetworkAdded(
mukesh agrawal1830fa12011-09-26 14:31:40 -070096 const ::DBus::Path &/*network*/,
97 const std::map<string, ::DBus::Variant> &/*properties*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070098 LOG(INFO) << __func__;
99 // XXX
100}
101
102void SupplicantInterfaceProxy::Proxy::NetworkRemoved(
mukesh agrawal1830fa12011-09-26 14:31:40 -0700103 const ::DBus::Path &/*network*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -0700104 LOG(INFO) << __func__;
mukesh agrawal8a3188d2011-12-01 20:56:44 +0000105 // TODO(quiche): Pass this up to WiFi, so that it can clean its
106 // rpcid_by_service_ map. crosbug.com/24699
mukesh agrawalaf571952011-07-14 14:31:12 -0700107}
108
109void SupplicantInterfaceProxy::Proxy::NetworkSelected(
mukesh agrawal1830fa12011-09-26 14:31:40 -0700110 const ::DBus::Path &/*network*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -0700111 LOG(INFO) << __func__;
112 // XXX
113}
114
115void SupplicantInterfaceProxy::Proxy::PropertiesChanged(
mukesh agrawal7ec71312011-11-10 02:08:26 +0000116 const std::map<string, ::DBus::Variant> &properties) {
mukesh agrawalaf571952011-07-14 14:31:12 -0700117 LOG(INFO) << __func__;
mukesh agrawal7ec71312011-11-10 02:08:26 +0000118 wifi_->PropertiesChanged(properties);
mukesh agrawalaf571952011-07-14 14:31:12 -0700119}
120
121void SupplicantInterfaceProxy::Proxy::ScanDone(const bool& success) {
122 LOG(INFO) << __func__ << " " << success;
123 if (success) {
124 wifi_->ScanDone();
125 }
126}
127
128} // namespace shill