blob: ec3a301fa6e73d9d45d971d8bffd81ff411bd1be [file] [log] [blame]
Paul Stewart20088d82012-02-16 06:58:55 -08001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Paul Stewartfdd16072011-09-16 12:41:35 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef SHILL_TECHNOLOGY_
6#define SHILL_TECHNOLOGY_
7
8#include <string>
Paul Stewart20088d82012-02-16 06:58:55 -08009#include <vector>
Paul Stewartfdd16072011-09-16 12:41:35 -070010
11namespace shill {
12
Paul Stewart20088d82012-02-16 06:58:55 -080013class Error;
14
Paul Stewartfdd16072011-09-16 12:41:35 -070015class Technology {
16 public:
17 enum Identifier {
18 kEthernet,
19 kWifi,
Paul Stewart2001a422011-12-15 10:20:09 -080020 kWiFiMonitor,
Paul Stewartfdd16072011-09-16 12:41:35 -070021 kCellular,
Darin Petkov33af05c2012-02-28 10:10:30 +010022 kVPN,
Paul Stewartcba0f7f2012-02-29 16:33:05 -080023 kTunnel,
Paul Stewartfdd16072011-09-16 12:41:35 -070024 kBlacklisted,
25 kUnknown,
Paul Stewartfdd16072011-09-16 12:41:35 -070026 };
27
28 static Identifier IdentifierFromName(const std::string &name);
29 static std::string NameFromIdentifier(Identifier id);
Paul Stewart1b253142012-01-26 14:05:52 -080030 static Identifier IdentifierFromStorageGroup(const std::string &group);
Paul Stewartfdd16072011-09-16 12:41:35 -070031
Paul Stewart20088d82012-02-16 06:58:55 -080032 // Convert the comma-separated list of technology names in
33 // |technologies_string| into a vector of technology identifiers output in
34 // |technologies_vector|. Returns true if the |technologies_string| contains
35 // a valid set of technologies with no duplicate elements, false otherwise.
36 static bool GetTechnologyVectorFromString(
37 const std::string &technologies_string,
38 std::vector<Identifier> *technologies_vector,
39 Error *error);
40
Paul Stewartfdd16072011-09-16 12:41:35 -070041 private:
Paul Stewartcba0f7f2012-02-29 16:33:05 -080042 static const char kTunnelName[];
Paul Stewartfdd16072011-09-16 12:41:35 -070043 static const char kUnknownName[];
44};
45
46} // namespace shill
47
48#endif // SHILL_TECHNOLOGY_