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 #include "chromeos/network/onc/onc_translation_tables.h" | 5 #include "chromeos/network/onc/onc_translation_tables.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "components/onc/onc_constants.h" | 10 #include "components/onc/onc_constants.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 { ::onc::wifi::kBSSID, shill::kWifiBSsid}, | 113 { ::onc::wifi::kBSSID, shill::kWifiBSsid}, |
114 // This dictionary is converted during translation, see onc_translator_*. | 114 // This dictionary is converted during translation, see onc_translator_*. |
115 // { ::onc::wifi::kEAP, shill::kEap*}, | 115 // { ::onc::wifi::kEAP, shill::kEap*}, |
116 { ::onc::wifi::kFrequency, shill::kWifiFrequency}, | 116 { ::onc::wifi::kFrequency, shill::kWifiFrequency}, |
117 { ::onc::wifi::kFrequencyList, shill::kWifiFrequencyListProperty}, | 117 { ::onc::wifi::kFrequencyList, shill::kWifiFrequencyListProperty}, |
118 { ::onc::wifi::kHiddenSSID, shill::kWifiHiddenSsid}, | 118 { ::onc::wifi::kHiddenSSID, shill::kWifiHiddenSsid}, |
119 { ::onc::wifi::kPassphrase, shill::kPassphraseProperty}, | 119 { ::onc::wifi::kPassphrase, shill::kPassphraseProperty}, |
120 // This field is converted during translation, see onc_translator_*. | 120 // This field is converted during translation, see onc_translator_*. |
121 // { ::onc::wifi::kSSID, shill::kWifiHexSsid}, | 121 // { ::onc::wifi::kSSID, shill::kWifiHexSsid}, |
122 // This field is converted during translation, see onc_translator_*. | 122 // This field is converted during translation, see onc_translator_*. |
123 // { ::onc::wifi::kSecurity, shill::kSecurityProperty }, | 123 // { ::onc::wifi::kSecurity, shill::kSecurityClassProperty }, |
124 { ::onc::wifi::kSignalStrength, shill::kSignalStrengthProperty}, | 124 { ::onc::wifi::kSignalStrength, shill::kSignalStrengthProperty}, |
125 {NULL}}; | 125 {NULL}}; |
126 | 126 |
127 const FieldTranslationEntry wimax_fields[] = { | 127 const FieldTranslationEntry wimax_fields[] = { |
128 { ::onc::wimax::kAutoConnect, shill::kAutoConnectProperty}, | 128 { ::onc::wimax::kAutoConnect, shill::kAutoConnectProperty}, |
129 // This dictionary is converted during translation, see onc_translator_*. | 129 // This dictionary is converted during translation, see onc_translator_*. |
130 // { ::onc::wimax::kEAP, shill::kEap*}, | 130 // { ::onc::wimax::kEAP, shill::kEap*}, |
131 { ::onc::wimax::kSignalStrength, shill::kSignalStrengthProperty}, | 131 { ::onc::wimax::kSignalStrength, shill::kSignalStrengthProperty}, |
132 {NULL}}; | 132 {NULL}}; |
133 | 133 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 { ::onc::network_type::kCellular, shill::kTypeCellular}, | 278 { ::onc::network_type::kCellular, shill::kTypeCellular}, |
279 { ::onc::network_type::kVPN, shill::kTypeVPN}, | 279 { ::onc::network_type::kVPN, shill::kTypeVPN}, |
280 {NULL}}; | 280 {NULL}}; |
281 | 281 |
282 const StringTranslationEntry kVPNTypeTable[] = { | 282 const StringTranslationEntry kVPNTypeTable[] = { |
283 { ::onc::vpn::kTypeL2TP_IPsec, shill::kProviderL2tpIpsec}, | 283 { ::onc::vpn::kTypeL2TP_IPsec, shill::kProviderL2tpIpsec}, |
284 { ::onc::vpn::kOpenVPN, shill::kProviderOpenVpn}, | 284 { ::onc::vpn::kOpenVPN, shill::kProviderOpenVpn}, |
285 { ::onc::vpn::kThirdPartyVpn, shill::kProviderThirdPartyVpn}, | 285 { ::onc::vpn::kThirdPartyVpn, shill::kProviderThirdPartyVpn}, |
286 {NULL}}; | 286 {NULL}}; |
287 | 287 |
288 // The first matching line is chosen. | |
289 const StringTranslationEntry kWiFiSecurityTable[] = { | 288 const StringTranslationEntry kWiFiSecurityTable[] = { |
290 { ::onc::wifi::kSecurityNone, shill::kSecurityNone}, | 289 { ::onc::wifi::kSecurityNone, shill::kSecurityNone}, |
291 { ::onc::wifi::kWEP_PSK, shill::kSecurityWep}, | 290 { ::onc::wifi::kWEP_PSK, shill::kSecurityWep}, |
292 { ::onc::wifi::kWPA_PSK, shill::kSecurityPsk}, | 291 { ::onc::wifi::kWPA_PSK, shill::kSecurityPsk}, |
293 { ::onc::wifi::kWPA_EAP, shill::kSecurity8021x}, | 292 { ::onc::wifi::kWPA_EAP, shill::kSecurity8021x}, |
294 { ::onc::wifi::kWPA_PSK, shill::kSecurityRsn}, | |
295 { ::onc::wifi::kWPA_PSK, shill::kSecurityWpa}, | |
296 {NULL}}; | 293 {NULL}}; |
297 | 294 |
298 const StringTranslationEntry kEAPOuterTable[] = { | 295 const StringTranslationEntry kEAPOuterTable[] = { |
299 { ::onc::eap::kPEAP, shill::kEapMethodPEAP}, | 296 { ::onc::eap::kPEAP, shill::kEapMethodPEAP}, |
300 { ::onc::eap::kEAP_TLS, shill::kEapMethodTLS}, | 297 { ::onc::eap::kEAP_TLS, shill::kEapMethodTLS}, |
301 { ::onc::eap::kEAP_TTLS, shill::kEapMethodTTLS}, | 298 { ::onc::eap::kEAP_TTLS, shill::kEapMethodTTLS}, |
302 { ::onc::eap::kLEAP, shill::kEapMethodLEAP}, | 299 { ::onc::eap::kLEAP, shill::kEapMethodLEAP}, |
303 {NULL}}; | 300 {NULL}}; |
304 | 301 |
305 // Translation of the EAP.Inner field in case of EAP.Outer == PEAP | 302 // Translation of the EAP.Inner field in case of EAP.Outer == PEAP |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 continue; | 416 continue; |
420 *onc_value = table[i].onc_value; | 417 *onc_value = table[i].onc_value; |
421 return true; | 418 return true; |
422 } | 419 } |
423 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; | 420 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; |
424 return false; | 421 return false; |
425 } | 422 } |
426 | 423 |
427 } // namespace onc | 424 } // namespace onc |
428 } // namespace chromeos | 425 } // namespace chromeos |
OLD | NEW |