shill: wimax: Implement WiMAX Manager and Device proxies.

Also, add a WiMax logging scope.

BUG=chrome-os-partner:9697
TEST=build and run unit tests

Change-Id: I8516ff2b55e54feb5fcdab089d0fe279551b4317
Reviewed-on: https://gerrit.chromium.org/gerrit/22695
Commit-Ready: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
diff --git a/Makefile b/Makefile
index 6183466..833499b 100644
--- a/Makefile
+++ b/Makefile
@@ -52,6 +52,8 @@
 # Generates rules for copying SYSROOT XMLs locally and updates the proxy header
 # dependencies.
 DBUS_BINDINGS_XML_SYSROOT = \
+	org.chromium.WiMaxManager>wimax_manager \
+	org.chromium.WiMaxManager.Device>wimax_manager-device \
 	org.freedesktop.ModemManager>modem_manager \
 	org.freedesktop.ModemManager.Modem>modem \
 	org.freedesktop.ModemManager.Modem.Cdma>modem-cdma \
@@ -62,9 +64,7 @@
 	org.freedesktop.ModemManager1.Modem.Modem3gpp>mm1-modem-modem3gpp \
 	org.freedesktop.ModemManager1.Modem.ModemCdma>mm1-modem-modemcdma \
 	org.freedesktop.ModemManager1.Modem.Simple>mm1-modem-simple \
-	org.freedesktop.ModemManager1.Sim>mm1-sim \
-	org.chromium.WiMaxManager>wimax_manager \
-	org.chromium.WiMaxManager.Device>wimax_manager_device
+	org.freedesktop.ModemManager1.Sim>mm1-sim
 
 # Rename local XML files with the names required by DBus to XML files with the
 # names required by the style guide, which will then be turned into generated
@@ -208,6 +208,8 @@
 	wifi_endpoint.o \
 	wifi_service.o \
 	wimax.o \
+	wimax_device_proxy.o \
+	wimax_manager_proxy.o \
 	wimax_service.o \
 	wpa_supplicant.o \
 	)
@@ -310,6 +312,8 @@
 	mock_wifi.o \
 	mock_wifi_service.o \
 	mock_wimax.o \
+	mock_wimax_device_proxy.o \
+	mock_wimax_manager_proxy.o \
 	mock_wimax_service.o \
 	modem_1_unittest.o \
 	modem_info_unittest.o \
diff --git a/mock_wimax_device_proxy.cc b/mock_wimax_device_proxy.cc
new file mode 100644
index 0000000..5eb7025
--- /dev/null
+++ b/mock_wimax_device_proxy.cc
@@ -0,0 +1,13 @@
+// Copyright (c) 2012 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/mock_wimax_device_proxy.h"
+
+namespace shill {
+
+MockWiMaxDeviceProxy::MockWiMaxDeviceProxy() {}
+
+MockWiMaxDeviceProxy::~MockWiMaxDeviceProxy() {}
+
+}  // namespace shill
diff --git a/mock_wimax_device_proxy.h b/mock_wimax_device_proxy.h
new file mode 100644
index 0000000..d1824dd
--- /dev/null
+++ b/mock_wimax_device_proxy.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2012 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.
+
+#ifndef SHILL_WIMAX_DEVICE_PROXY_H_
+#define SHILL_WIMAX_DEVICE_PROXY_H_
+
+#include <base/basictypes.h>
+#include <gmock/gmock.h>
+
+#include "shill/wimax_device_proxy_interface.h"
+
+namespace shill {
+
+class MockWiMaxDeviceProxy : public WiMaxDeviceProxyInterface {
+ public:
+  MockWiMaxDeviceProxy();
+  virtual ~MockWiMaxDeviceProxy();
+
+  MOCK_METHOD3(Enable, void(Error *error,
+                            const ResultCallback &callback,
+                            int timeout));
+  MOCK_METHOD3(Disable, void(Error *error,
+                             const ResultCallback &callback,
+                             int timeout));
+  MOCK_METHOD3(Connect, void(Error *error,
+                             const ResultCallback &callback,
+                             int timeout));
+  MOCK_METHOD3(Disconnect, void(Error *error,
+                                const ResultCallback &callback,
+                                int timeout));
+  MOCK_METHOD1(Index, uint8(Error *error));
+  MOCK_METHOD1(Name, std::string(Error *error));
+
+  DISALLOW_COPY_AND_ASSIGN(MockWiMaxDeviceProxy);
+};
+
+}  // namespace shill
+
+#endif  // SHILL_WIMAX_DEVICE_PROXY_H_
diff --git a/mock_wimax_manager_proxy.cc b/mock_wimax_manager_proxy.cc
new file mode 100644
index 0000000..b2bceed
--- /dev/null
+++ b/mock_wimax_manager_proxy.cc
@@ -0,0 +1,13 @@
+// Copyright (c) 2012 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/mock_wimax_manager_proxy.h"
+
+namespace shill {
+
+MockWiMaxManagerProxy::MockWiMaxManagerProxy() {}
+
+MockWiMaxManagerProxy::~MockWiMaxManagerProxy() {}
+
+}  // namespace shill
diff --git a/mock_wimax_manager_proxy.h b/mock_wimax_manager_proxy.h
new file mode 100644
index 0000000..ad9919c
--- /dev/null
+++ b/mock_wimax_manager_proxy.h
@@ -0,0 +1,30 @@
+// Copyright (c) 2012 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.
+
+#ifndef SHILL_MOCK_WIMAX_MANAGER_PROXY_H_
+#define SHILL_MOCK_WIMAX_MANAGER_PROXY_H_
+
+#include <vector>
+
+#include <base/basictypes.h>
+#include <gmock/gmock.h>
+
+#include "shill/wimax_manager_proxy_interface.h"
+
+namespace shill {
+
+class MockWiMaxManagerProxy : public WiMaxManagerProxyInterface {
+ public:
+  MockWiMaxManagerProxy();
+  virtual ~MockWiMaxManagerProxy();
+
+  MOCK_METHOD1(Devices, std::vector<RpcIdentifier>(Error *error));
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(MockWiMaxManagerProxy);
+};
+
+}  // namespace shill
+
+#endif  // SHILL_MOCK_WIMAX_MANAGER_PROXY_H_
diff --git a/proxy_factory.cc b/proxy_factory.cc
index 8d6cba9..cec4fa7 100644
--- a/proxy_factory.cc
+++ b/proxy_factory.cc
@@ -24,6 +24,8 @@
 #include "shill/supplicant_bss_proxy.h"
 #include "shill/supplicant_interface_proxy.h"
 #include "shill/supplicant_process_proxy.h"
+#include "shill/wimax_device_proxy.h"
+#include "shill/wimax_manager_proxy.h"
 
 using std::string;
 
@@ -98,35 +100,44 @@
 
 // Proxies for ModemManager1 interfaces
 mm1::ModemModem3gppProxyInterface *ProxyFactory::CreateMM1ModemModem3gppProxy(
-      const std::string &path,
-      const std::string &service) {
+      const string &path,
+      const string &service) {
   return new mm1::ModemModem3gppProxy(connection(), path, service);
 }
 
 mm1::ModemModemCdmaProxyInterface *ProxyFactory::CreateMM1ModemModemCdmaProxy(
-      const std::string &path,
-      const std::string &service) {
+      const string &path,
+      const string &service) {
   return new mm1::ModemModemCdmaProxy(connection(), path, service);
 }
 
 mm1::ModemProxyInterface *ProxyFactory::CreateMM1ModemProxy(
-      const std::string &path,
-      const std::string &service) {
+      const string &path,
+      const string &service) {
   return new mm1::ModemProxy(connection(), path, service);
 }
 
 mm1::ModemSimpleProxyInterface *ProxyFactory::CreateMM1ModemSimpleProxy(
-      const std::string &path,
-      const std::string &service) {
+      const string &path,
+      const string &service) {
   return new mm1::ModemSimpleProxy(connection(), path, service);
 }
 
 mm1::SimProxyInterface *ProxyFactory::CreateSimProxy(
-      const std::string &path,
-      const std::string &service) {
+      const string &path,
+      const string &service) {
   return new mm1::SimProxy(connection(), path, service);
 }
 
+WiMaxDeviceProxyInterface *ProxyFactory::CreateWiMaxDeviceProxy(
+    const string &path) {
+  return new WiMaxDeviceProxy(connection(), path);
+}
+
+WiMaxManagerProxyInterface *ProxyFactory::CreateWiMaxManagerProxy() {
+  return new WiMaxManagerProxy(connection());
+}
+
 PowerManagerProxyInterface *ProxyFactory::CreatePowerManagerProxy(
     PowerManagerProxyDelegate *delegate) {
   return new PowerManagerProxy(delegate, connection());
diff --git a/proxy_factory.h b/proxy_factory.h
index 7a0eb15..2c1d375 100644
--- a/proxy_factory.h
+++ b/proxy_factory.h
@@ -31,6 +31,8 @@
 class SupplicantBSSProxyInterface;
 class SupplicantInterfaceProxyInterface;
 class SupplicantProcessProxyInterface;
+class WiMaxDeviceProxyInterface;
+class WiMaxManagerProxyInterface;
 
 namespace mm1 {
 
@@ -105,6 +107,10 @@
       const std::string &path,
       const std::string &service);
 
+  virtual WiMaxDeviceProxyInterface *CreateWiMaxDeviceProxy(
+      const std::string &path);
+  virtual WiMaxManagerProxyInterface *CreateWiMaxManagerProxy();
+
   // The caller retains ownership of 'delegate'.  It must not be deleted before
   // the proxy.
   virtual PowerManagerProxyInterface *CreatePowerManagerProxy(
diff --git a/scope_logger.cc b/scope_logger.cc
index 8da0b3f..24a5d12 100644
--- a/scope_logger.cc
+++ b/scope_logger.cc
@@ -47,6 +47,7 @@
   "task",
   "vpn",
   "wifi",
+  "wimax",
 };
 
 COMPILE_ASSERT(arraysize(kScopeNames) == ScopeLogger::kNumScopes,
diff --git a/scope_logger.h b/scope_logger.h
index 8689081..f46a8bd 100644
--- a/scope_logger.h
+++ b/scope_logger.h
@@ -97,6 +97,7 @@
     kTask,
     kVPN,
     kWiFi,
+    kWiMax,
     kNumScopes
   };
 
diff --git a/scope_logger_unittest.cc b/scope_logger_unittest.cc
index 0d8bf60..9384090 100644
--- a/scope_logger_unittest.cc
+++ b/scope_logger_unittest.cc
@@ -59,7 +59,8 @@
             "storage+"
             "task+"
             "vpn+"
-            "wifi",
+            "wifi+"
+            "wimax",
       logger_->GetAllScopeNames());
 }
 
diff --git a/wimax_device_proxy.cc b/wimax_device_proxy.cc
new file mode 100644
index 0000000..d3c1e7f
--- /dev/null
+++ b/wimax_device_proxy.cc
@@ -0,0 +1,152 @@
+// Copyright (c) 2012 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/wimax_device_proxy.h"
+
+#include <base/bind.h>
+#include <base/logging.h>
+
+#include "shill/error.h"
+#include "shill/scope_logger.h"
+
+using base::Bind;
+using base::Callback;
+using base::Unretained;
+using std::string;
+
+namespace shill {
+
+namespace {
+// TODO(petkov): Declare this in chromeos/dbus/service_constants.h.
+const char kWiMaxManagerServiceName[] = "org.chromium.WiMaxManager";
+}  // namespace
+
+WiMaxDeviceProxy::WiMaxDeviceProxy(DBus::Connection *connection,
+                                   const DBus::Path &path)
+    : proxy_(connection, path) {}
+
+WiMaxDeviceProxy::~WiMaxDeviceProxy() {}
+
+void WiMaxDeviceProxy::Enable(Error *error,
+                              const ResultCallback &callback,
+                              int timeout) {
+  SLOG(DBus, 2) << __func__ << "(" << timeout << ")";
+  Invoke(Bind((void (Proxy::*)(void *, int))&Proxy::Enable,
+              Unretained(&proxy_)),
+         error, callback, timeout);
+}
+
+void WiMaxDeviceProxy::Disable(Error *error,
+                               const ResultCallback &callback,
+                               int timeout) {
+  SLOG(DBus, 2) << __func__ << "(" << timeout << ")";
+  Invoke(Bind((void (Proxy::*)(void *, int))&Proxy::Disable,
+              Unretained(&proxy_)),
+         error, callback, timeout);
+}
+
+void WiMaxDeviceProxy::Connect(Error *error,
+                               const ResultCallback &callback,
+                               int timeout) {
+  SLOG(DBus, 2) << __func__ << "(" << timeout << ")";
+  Invoke(Bind((void (Proxy::*)(void *, int))&Proxy::Connect,
+              Unretained(&proxy_)),
+         error, callback, timeout);
+}
+
+void WiMaxDeviceProxy::Disconnect(Error *error,
+                                  const ResultCallback &callback,
+                                  int timeout) {
+  SLOG(DBus, 2) << __func__ << "(" << timeout << ")";
+  Invoke(Bind((void (Proxy::*)(void *, int))&Proxy::Disconnect,
+              Unretained(&proxy_)),
+         error, callback, timeout);
+}
+
+uint8 WiMaxDeviceProxy::Index(Error *error) {
+  SLOG(DBus, 2) << __func__;
+  try {
+    return proxy_.Index();
+  } catch (const DBus::Error &e) {
+    FromDBusError(e, error);
+  }
+  return 0;
+}
+
+string WiMaxDeviceProxy::Name(Error *error) {
+  SLOG(DBus, 2) << __func__;
+  try {
+    return proxy_.Name();
+  } catch (const DBus::Error &e) {
+    FromDBusError(e, error);
+  }
+  return string();
+}
+
+void WiMaxDeviceProxy::Invoke(const Callback<void(void *, int)> &method,
+                              Error *error,
+                              const ResultCallback &callback,
+                              int timeout) {
+  scoped_ptr<ResultCallback> cb(new ResultCallback(callback));
+  try {
+    method.Run(cb.get(), timeout);
+    cb.release();
+  } catch (const DBus::Error &e) {
+    FromDBusError(e, error);
+  }
+}
+
+// static
+void WiMaxDeviceProxy::FromDBusError(const DBus::Error &dbus_error,
+                                     Error *error) {
+  if (!error) {
+    return;
+  }
+  if (!dbus_error.is_set()) {
+    error->Reset();
+    return;
+  }
+  Error::PopulateAndLog(error, Error::kOperationFailed, dbus_error.what());
+}
+
+WiMaxDeviceProxy::Proxy::Proxy(DBus::Connection *connection,
+                               const DBus::Path &path)
+    : DBus::ObjectProxy(*connection, path, kWiMaxManagerServiceName) {}
+
+WiMaxDeviceProxy::Proxy::~Proxy() {}
+
+void WiMaxDeviceProxy::Proxy::EnableCallback(const DBus::Error &error,
+                                             void *data) {
+  SLOG(DBus, 2) << __func__;
+  HandleCallback(error, data);
+}
+
+void WiMaxDeviceProxy::Proxy::DisableCallback(const DBus::Error &error,
+                                              void *data) {
+  SLOG(DBus, 2) << __func__;
+  HandleCallback(error, data);
+}
+
+void WiMaxDeviceProxy::Proxy::ConnectCallback(const DBus::Error &error,
+                                              void *data) {
+  SLOG(DBus, 2) << __func__;
+  HandleCallback(error, data);
+}
+
+void WiMaxDeviceProxy::Proxy::DisconnectCallback(const DBus::Error &error,
+                                                 void *data) {
+  SLOG(DBus, 2) << __func__;
+  HandleCallback(error, data);
+}
+
+// static
+void WiMaxDeviceProxy::Proxy::HandleCallback(const DBus::Error &error,
+                                             void *data) {
+  scoped_ptr<ResultCallback> callback(reinterpret_cast<ResultCallback *>(data));
+  Error e;
+  FromDBusError(error, &e);
+  callback->Run(e);
+}
+
+}  // namespace shill
diff --git a/wimax_device_proxy.h b/wimax_device_proxy.h
new file mode 100644
index 0000000..43baae7
--- /dev/null
+++ b/wimax_device_proxy.h
@@ -0,0 +1,75 @@
+// Copyright (c) 2012 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.
+
+#ifndef SHILL_WIMAX_DEVICE_PROXY_H_
+#define SHILL_WIMAX_DEVICE_PROXY_H_
+
+#include <base/callback.h>
+
+#include "shill/dbus_bindings/wimax_manager-device.h"
+#include "shill/wimax_device_proxy_interface.h"
+
+namespace shill {
+
+class WiMaxDeviceProxy : public WiMaxDeviceProxyInterface {
+ public:
+  // Constructs a WiMaxManager.Device DBus object proxy at |path|.
+  WiMaxDeviceProxy(DBus::Connection *connection,
+                   const DBus::Path &path);
+  virtual ~WiMaxDeviceProxy();
+
+  // Inherited from WiMaxDeviceProxyInterface.
+  virtual void Enable(Error *error,
+                      const ResultCallback &callback,
+                      int timeout);
+  virtual void Disable(Error *error,
+                       const ResultCallback &callback,
+                       int timeout);
+  virtual void Connect(Error *error,
+                       const ResultCallback &callback,
+                       int timeout);
+  virtual void Disconnect(Error *error,
+                          const ResultCallback &callback,
+                          int timeout);
+  virtual uint8 Index(Error *error);
+  virtual std::string Name(Error *error);
+
+ private:
+  class Proxy : public org::chromium::WiMaxManager::Device_proxy,
+                public DBus::ObjectProxy {
+   public:
+    Proxy(DBus::Connection *connection,
+          const DBus::Path &path);
+    virtual ~Proxy();
+
+   private:
+    // Signal callbacks inherited from WiMaxManager::Device_proxy.
+    // [None]
+
+    // Method callbacks inherited from WiMaxManager::Device_proxy.
+    virtual void EnableCallback(const DBus::Error &error, void *data);
+    virtual void DisableCallback(const DBus::Error &error, void *data);
+    virtual void ConnectCallback(const DBus::Error &error, void *data);
+    virtual void DisconnectCallback(const DBus::Error &error, void *data);
+
+    static void HandleCallback(const DBus::Error &error, void *data);
+
+    DISALLOW_COPY_AND_ASSIGN(Proxy);
+  };
+
+  void Invoke(const base::Callback<void(void *, int)> &method,
+              Error *error,
+              const ResultCallback &callback,
+              int timeout);
+
+  static void FromDBusError(const DBus::Error &dbus_error, Error *error);
+
+  Proxy proxy_;
+
+  DISALLOW_COPY_AND_ASSIGN(WiMaxDeviceProxy);
+};
+
+}  // namespace shill
+
+#endif  // SHILL_WIMAX_DEVICE_PROXY_H_
diff --git a/wimax_device_proxy_interface.h b/wimax_device_proxy_interface.h
new file mode 100644
index 0000000..0098978
--- /dev/null
+++ b/wimax_device_proxy_interface.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2012 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.
+
+#ifndef SHILL_WIMAX_DEVICE_PROXY_INTERFACE_
+#define SHILL_WIMAX_DEVICE_PROXY_INTERFACE_
+
+#include <string>
+
+#include <base/basictypes.h>
+
+#include "shill/callbacks.h"
+
+namespace shill {
+
+class Error;
+
+// These are the methods that a WiMaxManager.Device proxy must support. The
+// interface is provided so that it can be mocked in tests.
+class WiMaxDeviceProxyInterface {
+ public:
+  virtual ~WiMaxDeviceProxyInterface() {}
+
+  virtual void Enable(Error *error,
+                      const ResultCallback &callback,
+                      int timeout) = 0;
+  virtual void Disable(Error *error,
+                       const ResultCallback &callback,
+                       int timeout) = 0;
+  virtual void Connect(Error *error,
+                       const ResultCallback &callback,
+                       int timeout) = 0;
+  virtual void Disconnect(Error *error,
+                          const ResultCallback &callback,
+                          int timeout) = 0;
+
+  // Properties.
+  virtual uint8 Index(Error *error) = 0;
+  virtual std::string Name(Error *error) = 0;
+};
+
+}  // namespace shill
+
+#endif  // SHILL_WIMAX_DEVICE_PROXY_INTERFACE_H_
diff --git a/wimax_manager_proxy.cc b/wimax_manager_proxy.cc
new file mode 100644
index 0000000..8a035d4
--- /dev/null
+++ b/wimax_manager_proxy.cc
@@ -0,0 +1,50 @@
+// Copyright (c) 2012 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/wimax_manager_proxy.h"
+
+#include <base/logging.h>
+
+#include "shill/error.h"
+#include "shill/scope_logger.h"
+
+using std::vector;
+
+namespace shill {
+
+namespace {
+// TODO(petkov): Declare these in chromeos/dbus/service_constants.h.
+const char kWiMaxManagerServicePath[] = "/org/chromium/WiMaxManager";
+const char kWiMaxManagerServiceName[] = "org.chromium.WiMaxManager";
+}  // namespace
+
+WiMaxManagerProxy::WiMaxManagerProxy(DBus::Connection *connection)
+    : proxy_(connection) {}
+
+WiMaxManagerProxy::~WiMaxManagerProxy() {}
+
+vector<RpcIdentifier> WiMaxManagerProxy::Devices(Error *error) {
+  SLOG(DBus, 2) << __func__;
+  vector<DBus::Path> dbus_devices;
+  try {
+    dbus_devices = proxy_.Devices();
+  } catch (const DBus::Error &e) {
+    Error::PopulateAndLog(error, Error::kOperationFailed, e.what());
+  }
+  vector<RpcIdentifier> devices;
+  for (vector<DBus::Path>::const_iterator it = dbus_devices.begin();
+       it != dbus_devices.end(); ++it) {
+    devices.push_back(*it);
+  }
+  return devices;
+}
+
+WiMaxManagerProxy::Proxy::Proxy(DBus::Connection *connection)
+    : DBus::ObjectProxy(*connection,
+                        kWiMaxManagerServicePath,
+                        kWiMaxManagerServiceName) {}
+
+WiMaxManagerProxy::Proxy::~Proxy() {}
+
+}  // namespace shill
diff --git a/wimax_manager_proxy.h b/wimax_manager_proxy.h
new file mode 100644
index 0000000..121426e
--- /dev/null
+++ b/wimax_manager_proxy.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2012 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.
+
+#ifndef SHILL_WIMAX_MANAGER_PROXY_H_
+#define SHILL_WIMAX_MANAGER_PROXY_H_
+
+#include <vector>
+
+#include <base/basictypes.h>
+
+#include "shill/dbus_bindings/wimax_manager.h"
+#include "shill/wimax_manager_proxy_interface.h"
+
+namespace shill {
+
+class WiMaxManagerProxy : public WiMaxManagerProxyInterface {
+ public:
+  WiMaxManagerProxy(DBus::Connection *connection);
+  virtual ~WiMaxManagerProxy();
+
+  // Inherited from WiMaxManagerProxyInterface.
+  virtual std::vector<RpcIdentifier> Devices(Error *error);
+
+ private:
+  class Proxy : public org::chromium::WiMaxManager_proxy,
+                public DBus::ObjectProxy {
+   public:
+    Proxy(DBus::Connection *connection);
+    virtual ~Proxy();
+
+   private:
+    // Signal callbacks inherited from WiMaxManager_proxy.
+    // [None]
+
+    // Method callbacks inherited from WiMaxManager_proxy.
+    // [None]
+
+    DISALLOW_COPY_AND_ASSIGN(Proxy);
+  };
+
+  Proxy proxy_;
+
+  DISALLOW_COPY_AND_ASSIGN(WiMaxManagerProxy);
+};
+
+}  // namespace shill
+
+#endif  // SHILL_WIMAX_MANAGER_PROXY_H_
diff --git a/wimax_manager_proxy_interface.h b/wimax_manager_proxy_interface.h
new file mode 100644
index 0000000..cab9384
--- /dev/null
+++ b/wimax_manager_proxy_interface.h
@@ -0,0 +1,28 @@
+// Copyright (c) 2012 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.
+
+#ifndef SHILL_WIMAX_MANAGER_PROXY_INTERFACE_H_
+#define SHILL_WIMAX_MANAGER_PROXY_INTERFACE_H_
+
+#include <vector>
+
+#include "shill/accessor_interface.h"
+
+namespace shill {
+
+class Error;
+
+// These are the methods that a WiMaxManager proxy must support. The interface
+// is provided so that it can be mocked in tests.
+class WiMaxManagerProxyInterface {
+ public:
+  virtual ~WiMaxManagerProxyInterface() {}
+
+  // Properties.
+  virtual std::vector<RpcIdentifier> Devices(Error *error) = 0;
+};
+
+}  // namespace shill
+
+#endif  // SHILL_WIMAX_MANAGER_PROXY_INTERFACE_H_