shill: refactor supplicant_process_proxy and supplicant_interface_proxy

move these to separate files, and add a layer of indirection. this is
a step towards adding more unittests for wifi. (after breaking out these
classes, we can define mocks of them.)

BUG=chromium-os:16785
TEST=FEATURES="test nostrip noclean" emerge-x86-generic shill

Change-Id: I18570d47514bac0493d053f1a82b4d79a1565ad2
Reviewed-on: http://gerrit.chromium.org/gerrit/4117
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
diff --git a/supplicant_interface_proxy.cc b/supplicant_interface_proxy.cc
new file mode 100644
index 0000000..e9e2a78
--- /dev/null
+++ b/supplicant_interface_proxy.cc
@@ -0,0 +1,115 @@
+// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "shill/supplicant_interface_proxy.h"
+
+#include <map>
+#include <string>
+
+#include <base/logging.h>
+#include <dbus-c++/dbus.h>
+
+#include "shill/wifi.h"
+
+using std::map;
+using std::string;
+
+namespace shill {
+
+SupplicantInterfaceProxy::SupplicantInterfaceProxy(
+    const WiFiRefPtr &wifi,
+    const ::DBus::Path &object_path,
+    const char *dbus_addr)
+    : connection_(DBus::Connection::SystemBus()),
+      proxy_(wifi, &connection_, object_path, dbus_addr) {}
+
+SupplicantInterfaceProxy::~SupplicantInterfaceProxy() {}
+
+::DBus::Path SupplicantInterfaceProxy::AddNetwork(
+    const std::map<std::string, ::DBus::Variant> &args) {
+  return proxy_.AddNetwork(args);
+}
+
+void SupplicantInterfaceProxy::FlushBSS(const uint32_t &age) {
+  return proxy_.FlushBSS(age);
+}
+
+void SupplicantInterfaceProxy::RemoveAllNetworks() {
+  return proxy_.RemoveAllNetworks();
+}
+
+void SupplicantInterfaceProxy::Scan(
+    const std::map<std::string, ::DBus::Variant> &args) {
+  return proxy_.Scan(args);
+}
+
+void SupplicantInterfaceProxy::SelectNetwork(const ::DBus::Path &network) {
+  return proxy_.SelectNetwork(network);
+}
+
+// definitions for private class SupplicantInterfaceProxy::Proxy
+
+SupplicantInterfaceProxy::Proxy::Proxy(
+    const WiFiRefPtr &wifi, DBus::Connection *bus,
+    const DBus::Path &dbus_path, const char *dbus_addr)
+    : DBus::ObjectProxy(*bus, dbus_path, dbus_addr),
+      wifi_(wifi) {}
+
+SupplicantInterfaceProxy::Proxy::~Proxy() {}
+
+void SupplicantInterfaceProxy::Proxy::BlobAdded(const string &blobname) {
+  LOG(INFO) << __func__;
+  // XXX
+}
+
+void SupplicantInterfaceProxy::Proxy::BlobRemoved(const string &blobname) {
+  LOG(INFO) << __func__;
+  // XXX
+}
+
+void SupplicantInterfaceProxy::Proxy::BSSAdded(
+    const ::DBus::Path &BSS,
+    const std::map<string, ::DBus::Variant> &properties) {
+  LOG(INFO) << __func__;
+  wifi_->BSSAdded(BSS, properties);
+}
+
+void SupplicantInterfaceProxy::Proxy::BSSRemoved(const ::DBus::Path &BSS) {
+  LOG(INFO) << __func__;
+  // XXX
+}
+
+void SupplicantInterfaceProxy::Proxy::NetworkAdded(
+    const ::DBus::Path &network,
+    const std::map<string, ::DBus::Variant> &properties) {
+  LOG(INFO) << __func__;
+  // XXX
+}
+
+void SupplicantInterfaceProxy::Proxy::NetworkRemoved(
+    const ::DBus::Path &network) {
+  LOG(INFO) << __func__;
+  // XXX
+}
+
+void SupplicantInterfaceProxy::Proxy::NetworkSelected(
+    const ::DBus::Path &network) {
+  LOG(INFO) << __func__;
+  // XXX
+}
+
+void SupplicantInterfaceProxy::Proxy::PropertiesChanged(
+    const std::map<string, ::DBus::Variant> &properties) {
+  LOG(INFO) << __func__;
+  // XXX
+}
+
+void SupplicantInterfaceProxy::Proxy::ScanDone(const bool& success) {
+  LOG(INFO) << __func__ << " " << success;
+  if (success) {
+    wifi_->ScanDone();
+  }
+}
+
+}  // namespace shill