shill: Implement more of Profile DBus interface

Return a DBus path from Manager.GetActiveProfile().
Implement the "Profiles" property on the manager Manager.
Fix the "Entries" property on the Profile to only report group
identifiers that correspond to technologies (not ipconfig,
devices, etc).
Fix the "Services" Profile property, to only appear as a property
of the active profile.

BUG=chromium-os:25538, chromium-os:23702
TEST=Manual: Running "list-profiles" from the flimflam test suite now
works correctly.

Change-Id: I3120fe54f02662822186ac033fab0b3566449705
Reviewed-on: https://gerrit.chromium.org/gerrit/14904
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/technology.cc b/technology.cc
index 9e42618..9a87d85 100644
--- a/technology.cc
+++ b/technology.cc
@@ -5,17 +5,20 @@
 #include "shill/technology.h"
 
 #include <string>
+#include <vector>
 
+#include <base/string_split.h>
 #include <chromeos/dbus/service_constants.h>
 
 namespace shill {
 
 using std::string;
+using std::vector;
 
 const char Technology::kUnknownName[] = "Unknown";
 
 // static
-Technology::Identifier Technology::IdentifierFromName(const std::string &name) {
+Technology::Identifier Technology::IdentifierFromName(const string &name) {
   if (name == flimflam::kTypeEthernet) {
     return kEthernet;
   } else if (name == flimflam::kTypeWifi) {
@@ -28,7 +31,7 @@
 }
 
 // static
-std::string Technology::NameFromIdentifier(Technology::Identifier id) {
+string Technology::NameFromIdentifier(Technology::Identifier id) {
   if (id == kEthernet) {
     return flimflam::kTypeEthernet;
   } else if (id == kWifi) {
@@ -40,4 +43,15 @@
   }
 }
 
+// static
+Technology::Identifier Technology::IdentifierFromStorageGroup(
+    const string &group) {
+  vector<string> group_parts;
+  base::SplitString(group, '_', &group_parts);
+  if (group_parts.empty()) {
+    return kUnknown;
+  }
+  return IdentifierFromName(group_parts[0]);
+}
+
 }  // namespace shill