| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROMEOS_NETWORK_ONC_ONC_TRANSLATION_TABLES_H_ | 5 #ifndef CHROMEOS_NETWORK_ONC_ONC_TRANSLATION_TABLES_H_ |
| 6 #define CHROMEOS_NETWORK_ONC_ONC_TRANSLATION_TABLES_H_ | 6 #define CHROMEOS_NETWORK_ONC_ONC_TRANSLATION_TABLES_H_ |
| 7 | 7 |
| 8 #include <string> |
| 9 |
| 10 #include "chromeos/chromeos_export.h" |
| 11 |
| 8 namespace chromeos { | 12 namespace chromeos { |
| 9 namespace onc { | 13 namespace onc { |
| 10 | 14 |
| 11 struct StringTranslationEntry { | 15 struct StringTranslationEntry { |
| 12 const char* onc_value; | 16 const char* onc_value; |
| 13 const char* shill_value; | 17 const char* shill_value; |
| 14 }; | 18 }; |
| 15 | 19 |
| 16 // These tables contain the mapping from ONC strings to Shill strings. | 20 // These tables contain the mapping from ONC strings to Shill strings. |
| 17 // These are NULL-terminated arrays. | 21 // These are NULL-terminated arrays. |
| 18 extern const StringTranslationEntry kNetworkTypeTable[]; | 22 CHROMEOS_EXPORT extern const StringTranslationEntry kNetworkTypeTable[]; |
| 19 extern const StringTranslationEntry kVPNTypeTable[]; | 23 CHROMEOS_EXPORT extern const StringTranslationEntry kVPNTypeTable[]; |
| 20 extern const StringTranslationEntry kWiFiSecurityTable[]; | 24 CHROMEOS_EXPORT extern const StringTranslationEntry kWiFiSecurityTable[]; |
| 21 extern const StringTranslationEntry kEAPOuterTable[]; | 25 CHROMEOS_EXPORT extern const StringTranslationEntry kEAPOuterTable[]; |
| 22 extern const StringTranslationEntry kEAP_PEAP_InnerTable[]; | 26 CHROMEOS_EXPORT extern const StringTranslationEntry kEAP_PEAP_InnerTable[]; |
| 23 extern const StringTranslationEntry kEAP_TTLS_InnerTable[]; | 27 CHROMEOS_EXPORT extern const StringTranslationEntry kEAP_TTLS_InnerTable[]; |
| 28 |
| 29 // Translate individual strings to Shill using the above tables. |
| 30 CHROMEOS_EXPORT bool TranslateStringToShill( |
| 31 const StringTranslationEntry table[], |
| 32 const std::string& onc_value, |
| 33 std::string* shill_value); |
| 34 |
| 35 // Translate individual strings to ONC using the above tables. |
| 36 CHROMEOS_EXPORT bool TranslateStringToONC(const StringTranslationEntry table[], |
| 37 const std::string& shill_value, |
| 38 std::string* onc_value); |
| 24 | 39 |
| 25 } // namespace onc | 40 } // namespace onc |
| 26 } // namespace chromeos | 41 } // namespace chromeos |
| 27 | 42 |
| 28 #endif // CHROMEOS_NETWORK_ONC_ONC_TRANSLATION_TABLES_H_ | 43 #endif // CHROMEOS_NETWORK_ONC_ONC_TRANSLATION_TABLES_H_ |
| OLD | NEW |