shill: Refactor Manager's Get*Service to support both VPN and WiFi types.
BUG=chromium-os:22063
TEST=unit tests
Change-Id: I1f9ae822af8a22a59dda0c159a5f3471dcda2a89
Reviewed-on: https://gerrit.chromium.org/gerrit/16479
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/manager.h b/manager.h
index f1ed565..92f3294 100644
--- a/manager.h
+++ b/manager.h
@@ -84,7 +84,7 @@
std::vector<std::string> EnumerateAvailableServices(Error *error);
// called via RPC (e.g., from ManagerDBusAdaptor)
- WiFiServiceRefPtr GetWifiService(const KeyValueStore &args, Error *error);
+ ServiceRefPtr GetService(const KeyValueStore &args, Error *error);
void RequestScan(const std::string &technology, Error *error);
std::string GetTechnologyOrder();
void SetTechnologyOrder(const std::string &order, Error *error);
@@ -148,7 +148,12 @@
FRIEND_TEST(ManagerTest, SortServices);
FRIEND_TEST(ManagerTest, SortServicesWithConnection);
- static const char kManagerErrorNoDevice[];
+ static const char kErrorNoDevice[];
+ static const char kErrorTypeRequired[];
+ static const char kErrorUnsupportedServiceType[];
+
+ WiFiServiceRefPtr GetWifiService(const KeyValueStore &args, Error *error);
+ ServiceRefPtr GetVPNService(const KeyValueStore &args, Error *error);
std::string CalculateState(Error *error);
void AutoConnect();