| 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" |
| 11 #include "third_party/cros_system_api/dbus/service_constants.h" | 11 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 12 | 12 |
| 13 namespace chromeos { | 13 namespace chromeos { |
| 14 namespace onc { | 14 namespace onc { |
| 15 | 15 |
| 16 // CertificatePattern is converted with function CreateUIData(...) to UIData | 16 // CertificatePattern is converted with function CreateUIData(...) to UIData |
| 17 // stored in Shill. | 17 // stored in Shill. |
| 18 // | |
| 19 // Proxy settings are converted to Shill by function | |
| 20 // ConvertOncProxySettingsToProxyConfig(...). | |
| 21 | 18 |
| 22 namespace { | 19 namespace { |
| 23 | 20 |
| 24 const FieldTranslationEntry eap_fields[] = { | 21 const FieldTranslationEntry eap_fields[] = { |
| 25 {::onc::eap::kAnonymousIdentity, shill::kEapAnonymousIdentityProperty}, | 22 {::onc::eap::kAnonymousIdentity, shill::kEapAnonymousIdentityProperty}, |
| 26 {::onc::eap::kIdentity, shill::kEapIdentityProperty}, | 23 {::onc::eap::kIdentity, shill::kEapIdentityProperty}, |
| 27 // This field is converted during translation, see onc_translator_*. | 24 // This field is converted during translation, see onc_translator_*. |
| 28 // { ::onc::eap::kInner, shill::kEapPhase2AuthProperty }, | 25 // { ::onc::eap::kInner, shill::kEapPhase2AuthProperty }, |
| 29 | 26 |
| 30 // This field is converted during translation, see onc_translator_*. | 27 // This field is converted during translation, see onc_translator_*. |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 {::onc::network_config::kGUID, shill::kGuidProperty}, | 188 {::onc::network_config::kGUID, shill::kGuidProperty}, |
| 192 {::onc::network_config::kConnectable, shill::kConnectableProperty}, | 189 {::onc::network_config::kConnectable, shill::kConnectableProperty}, |
| 193 {::onc::network_config::kPriority, shill::kPriorityProperty}, | 190 {::onc::network_config::kPriority, shill::kPriorityProperty}, |
| 194 | 191 |
| 195 // Shill doesn't allow setting the name for non-VPN networks. | 192 // Shill doesn't allow setting the name for non-VPN networks. |
| 196 // Name is conditionally translated, see onc_translator_*. | 193 // Name is conditionally translated, see onc_translator_*. |
| 197 // {::onc::network_config::kName, shill::kNameProperty }, | 194 // {::onc::network_config::kName, shill::kNameProperty }, |
| 198 | 195 |
| 199 // Type is converted during translation, see onc_translator_*. | 196 // Type is converted during translation, see onc_translator_*. |
| 200 // {::onc::network_config::kType, shill::kTypeProperty }, | 197 // {::onc::network_config::kType, shill::kTypeProperty }, |
| 198 // {::onc::network_config::kProxySettings, shill::ProxyConfig}, |
| 201 | 199 |
| 202 // These fields are converted during translation, see | 200 // These fields are converted during translation, see |
| 203 // onc_translator_shill_to_onc.cc. They are only converted when going from | 201 // onc_translator_shill_to_onc.cc. They are only converted when going from |
| 204 // Shill->ONC, and ignored otherwise. | 202 // Shill->ONC, and ignored otherwise. |
| 205 // {::onc::network_config::kConnectionState, shill::kStateProperty }, | 203 // {::onc::network_config::kConnectionState, shill::kStateProperty }, |
| 206 // {::onc::network_config::kErrorState, shill::kErrorProperty}, | 204 // {::onc::network_config::kErrorState, shill::kErrorProperty}, |
| 207 // {::onc::network_config::kRestrictedConnectivity, shill::kStateProperty }, | 205 // {::onc::network_config::kRestrictedConnectivity, shill::kStateProperty }, |
| 208 // {::onc::network_config::kSource, shill::kProfileProperty }, | 206 // {::onc::network_config::kSource, shill::kProfileProperty }, |
| 209 // {::onc::network_config::kMacAddress, shill::kAddressProperty }, | 207 // {::onc::network_config::kMacAddress, shill::kAddressProperty }, |
| 210 {NULL}}; | 208 {NULL}}; |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 continue; | 438 continue; |
| 441 *onc_value = table[i].onc_value; | 439 *onc_value = table[i].onc_value; |
| 442 return true; | 440 return true; |
| 443 } | 441 } |
| 444 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; | 442 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; |
| 445 return false; | 443 return false; |
| 446 } | 444 } |
| 447 | 445 |
| 448 } // namespace onc | 446 } // namespace onc |
| 449 } // namespace chromeos | 447 } // namespace chromeos |
| OLD | NEW |