| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 // onc_translator_shill_to_onc.cc. It is only converted when going from | 171 // onc_translator_shill_to_onc.cc. It is only converted when going from |
| 172 // Shill->ONC, and ignored otherwise. | 172 // Shill->ONC, and ignored otherwise. |
| 173 // { ::onc::network_config::kConnectionState, shill::kStateProperty }, | 173 // { ::onc::network_config::kConnectionState, shill::kStateProperty }, |
| 174 {NULL}}; | 174 {NULL}}; |
| 175 | 175 |
| 176 const FieldTranslationEntry ipconfig_fields[] = { | 176 const FieldTranslationEntry ipconfig_fields[] = { |
| 177 { ::onc::ipconfig::kIPAddress, shill::kAddressProperty}, | 177 { ::onc::ipconfig::kIPAddress, shill::kAddressProperty}, |
| 178 { ::onc::ipconfig::kGateway, shill::kGatewayProperty}, | 178 { ::onc::ipconfig::kGateway, shill::kGatewayProperty}, |
| 179 { ::onc::ipconfig::kRoutingPrefix, shill::kPrefixlenProperty}, | 179 { ::onc::ipconfig::kRoutingPrefix, shill::kPrefixlenProperty}, |
| 180 { ::onc::ipconfig::kNameServers, shill::kNameServersProperty}, | 180 { ::onc::ipconfig::kNameServers, shill::kNameServersProperty}, |
| 181 // This field is converted during translation, see ShillToONCTranslator:: |
| 182 // TranslateIPConfig It is only converted from Shill->ONC. |
| 183 // { ::onc::ipconfig::kType, shill::kMethodProperty}, |
| 181 {NULL}}; | 184 {NULL}}; |
| 182 | 185 |
| 183 struct OncValueTranslationEntry { | 186 struct OncValueTranslationEntry { |
| 184 const OncValueSignature* onc_signature; | 187 const OncValueSignature* onc_signature; |
| 185 const FieldTranslationEntry* field_translation_table; | 188 const FieldTranslationEntry* field_translation_table; |
| 186 }; | 189 }; |
| 187 | 190 |
| 188 const OncValueTranslationEntry onc_value_translation_table[] = { | 191 const OncValueTranslationEntry onc_value_translation_table[] = { |
| 189 { &kEAPSignature, eap_fields }, | 192 { &kEAPSignature, eap_fields }, |
| 190 { &kIPsecSignature, ipsec_fields }, | 193 { &kIPsecSignature, ipsec_fields }, |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 continue; | 328 continue; |
| 326 *onc_value = table[i].onc_value; | 329 *onc_value = table[i].onc_value; |
| 327 return true; | 330 return true; |
| 328 } | 331 } |
| 329 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; | 332 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; |
| 330 return false; | 333 return false; |
| 331 } | 334 } |
| 332 | 335 |
| 333 } // namespace onc | 336 } // namespace onc |
| 334 } // namespace chromeos | 337 } // namespace chromeos |
| OLD | NEW |