ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / chromeos / network / onc / onc_translation_tables.h
blobb737542ddc0db878a9349138a24dfe5001890242
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROMEOS_NETWORK_ONC_ONC_TRANSLATION_TABLES_H_
6 #define CHROMEOS_NETWORK_ONC_ONC_TRANSLATION_TABLES_H_
8 #include <string>
9 #include <vector>
11 #include "chromeos/chromeos_export.h"
12 #include "chromeos/network/onc/onc_signature.h"
14 namespace chromeos {
15 namespace onc {
17 struct FieldTranslationEntry {
18 const char* onc_field_name;
19 const char* shill_property_name;
22 struct StringTranslationEntry {
23 const char* onc_value;
24 const char* shill_value;
27 // These tables contain the mapping from ONC strings to Shill strings.
28 // These are NULL-terminated arrays.
29 CHROMEOS_EXPORT extern const StringTranslationEntry kNetworkTypeTable[];
30 CHROMEOS_EXPORT extern const StringTranslationEntry kVPNTypeTable[];
31 CHROMEOS_EXPORT extern const StringTranslationEntry kWiFiSecurityTable[];
32 CHROMEOS_EXPORT extern const StringTranslationEntry kEAPOuterTable[];
33 CHROMEOS_EXPORT extern const StringTranslationEntry kEAP_PEAP_InnerTable[];
34 CHROMEOS_EXPORT extern const StringTranslationEntry kEAP_TTLS_InnerTable[];
35 CHROMEOS_EXPORT extern const StringTranslationEntry kActivationStateTable[];
36 CHROMEOS_EXPORT extern const StringTranslationEntry kRoamingStateTable[];
38 // A separate translation table for cellular properties that are stored in a
39 // Shill Device instead of a Service. The |shill_property_name| entries
40 // reference Device properties, not Service properties.
41 extern const FieldTranslationEntry kCellularDeviceTable[];
43 const FieldTranslationEntry* GetFieldTranslationTable(
44 const OncValueSignature& onc_signature);
46 // Returns the path at which the translation of an ONC object will be stored in
47 // a Shill dictionary if its signature is |onc_signature|.
48 // The default is that values are stored directly in the top level of the Shill
49 // dictionary.
50 std::vector<std::string> GetPathToNestedShillDictionary(
51 const OncValueSignature& onc_signature);
53 bool GetShillPropertyName(const std::string& onc_field_name,
54 const FieldTranslationEntry table[],
55 std::string* shill_property_name);
57 // Translate individual strings to Shill using the above tables.
58 CHROMEOS_EXPORT bool TranslateStringToShill(
59 const StringTranslationEntry table[],
60 const std::string& onc_value,
61 std::string* shill_value);
63 // Translate individual strings to ONC using the above tables.
64 CHROMEOS_EXPORT bool TranslateStringToONC(const StringTranslationEntry table[],
65 const std::string& shill_value,
66 std::string* onc_value);
68 } // namespace onc
69 } // namespace chromeos
71 #endif // CHROMEOS_NETWORK_ONC_ONC_TRANSLATION_TABLES_H_