shill: Perform Portal Detection in Device
When a connection completes, start a portal detection request, which
may change the state of the selected service. Bonus changes: removed
Service::kStateReady, since Service::kStateConnected maps directly
to flimflam::kStateReady. Also, move technology list parsing over
to technology.cc.
BUG=chromium-os:23318
TEST=New unit tests
Change-Id: I2fad724165af6914c8f83bc123f07db5af223a05
Reviewed-on: https://gerrit.chromium.org/gerrit/16117
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.h b/technology.h
index 2fa6c6c..adae2b9 100644
--- a/technology.h
+++ b/technology.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+// 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.
@@ -6,9 +6,12 @@
#define SHILL_TECHNOLOGY_
#include <string>
+#include <vector>
namespace shill {
+class Error;
+
class Technology {
public:
enum Identifier {
@@ -24,6 +27,15 @@
static std::string NameFromIdentifier(Identifier id);
static Identifier IdentifierFromStorageGroup(const std::string &group);
+ // Convert the comma-separated list of technology names in
+ // |technologies_string| into a vector of technology identifiers output in
+ // |technologies_vector|. Returns true if the |technologies_string| contains
+ // a valid set of technologies with no duplicate elements, false otherwise.
+ static bool GetTechnologyVectorFromString(
+ const std::string &technologies_string,
+ std::vector<Identifier> *technologies_vector,
+ Error *error);
+
private:
static const char kUnknownName[];
};