| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 { ::onc::openvpn::kRemoteCertTLS, shill::kOpenVPNRemoteCertTLSProperty}, | 76 { ::onc::openvpn::kRemoteCertTLS, shill::kOpenVPNRemoteCertTLSProperty}, |
| 77 { ::onc::openvpn::kRenegSec, shill::kOpenVPNRenegSecProperty}, | 77 { ::onc::openvpn::kRenegSec, shill::kOpenVPNRenegSecProperty}, |
| 78 { ::onc::vpn::kSaveCredentials, shill::kSaveCredentialsProperty}, | 78 { ::onc::vpn::kSaveCredentials, shill::kSaveCredentialsProperty}, |
| 79 { ::onc::openvpn::kServerCAPEMs, shill::kOpenVPNCaCertPemProperty}, | 79 { ::onc::openvpn::kServerCAPEMs, shill::kOpenVPNCaCertPemProperty}, |
| 80 { ::onc::openvpn::kServerPollTimeout, | 80 { ::onc::openvpn::kServerPollTimeout, |
| 81 shill::kOpenVPNServerPollTimeoutProperty}, | 81 shill::kOpenVPNServerPollTimeoutProperty}, |
| 82 { ::onc::openvpn::kShaper, shill::kOpenVPNShaperProperty}, | 82 { ::onc::openvpn::kShaper, shill::kOpenVPNShaperProperty}, |
| 83 { ::onc::openvpn::kStaticChallenge, shill::kOpenVPNStaticChallengeProperty}, | 83 { ::onc::openvpn::kStaticChallenge, shill::kOpenVPNStaticChallengeProperty}, |
| 84 { ::onc::openvpn::kTLSAuthContents, shill::kOpenVPNTLSAuthContentsProperty}, | 84 { ::onc::openvpn::kTLSAuthContents, shill::kOpenVPNTLSAuthContentsProperty}, |
| 85 { ::onc::openvpn::kTLSRemote, shill::kOpenVPNTLSRemoteProperty}, | 85 { ::onc::openvpn::kTLSRemote, shill::kOpenVPNTLSRemoteProperty}, |
| 86 { ::onc::vpn::kUsername, shill::kOpenVPNUserProperty}, {NULL}}; | 86 { ::onc::vpn::kUsername, shill::kOpenVPNUserProperty}, |
| 87 { ::onc::openvpn::kVerifyHash, shill::kOpenVPNVerifyHashProperty}, |
| 88 {NULL}}; |
| 89 |
| 90 const FieldTranslationEntry verify_x509_fields[] = { |
| 91 { ::onc::verify_x509::kName, shill::kOpenVPNVerifyX509NameProperty}, |
| 92 { ::onc::verify_x509::kType, shill::kOpenVPNVerifyX509TypeProperty}, |
| 93 {NULL}}; |
| 87 | 94 |
| 88 const FieldTranslationEntry vpn_fields[] = { | 95 const FieldTranslationEntry vpn_fields[] = { |
| 89 { ::onc::vpn::kAutoConnect, shill::kAutoConnectProperty}, | 96 { ::onc::vpn::kAutoConnect, shill::kAutoConnectProperty}, |
| 90 { ::onc::vpn::kHost, shill::kProviderHostProperty}, | 97 { ::onc::vpn::kHost, shill::kProviderHostProperty}, |
| 91 // This field is converted during translation, see onc_translator_*. | 98 // This field is converted during translation, see onc_translator_*. |
| 92 // { ::onc::vpn::kType, shill::kProviderTypeProperty }, | 99 // { ::onc::vpn::kType, shill::kProviderTypeProperty }, |
| 93 {NULL}}; | 100 {NULL}}; |
| 94 | 101 |
| 95 const FieldTranslationEntry wifi_fields[] = { | 102 const FieldTranslationEntry wifi_fields[] = { |
| 96 { ::onc::wifi::kAutoConnect, shill::kAutoConnectProperty}, | 103 { ::onc::wifi::kAutoConnect, shill::kAutoConnectProperty}, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 struct OncValueTranslationEntry { | 173 struct OncValueTranslationEntry { |
| 167 const OncValueSignature* onc_signature; | 174 const OncValueSignature* onc_signature; |
| 168 const FieldTranslationEntry* field_translation_table; | 175 const FieldTranslationEntry* field_translation_table; |
| 169 }; | 176 }; |
| 170 | 177 |
| 171 const OncValueTranslationEntry onc_value_translation_table[] = { | 178 const OncValueTranslationEntry onc_value_translation_table[] = { |
| 172 { &kEAPSignature, eap_fields }, | 179 { &kEAPSignature, eap_fields }, |
| 173 { &kIPsecSignature, ipsec_fields }, | 180 { &kIPsecSignature, ipsec_fields }, |
| 174 { &kL2TPSignature, l2tp_fields }, | 181 { &kL2TPSignature, l2tp_fields }, |
| 175 { &kOpenVPNSignature, openvpn_fields }, | 182 { &kOpenVPNSignature, openvpn_fields }, |
| 183 { &kVerifyX509Signature, verify_x509_fields }, |
| 176 { &kVPNSignature, vpn_fields }, | 184 { &kVPNSignature, vpn_fields }, |
| 177 { &kWiFiSignature, wifi_fields }, | 185 { &kWiFiSignature, wifi_fields }, |
| 178 { &kWiFiWithStateSignature, wifi_fields }, | 186 { &kWiFiWithStateSignature, wifi_fields }, |
| 179 { &kCellularApnSignature, cellular_apn_fields }, | 187 { &kCellularApnSignature, cellular_apn_fields }, |
| 180 { &kCellularProviderSignature, cellular_provider_fields }, | 188 { &kCellularProviderSignature, cellular_provider_fields }, |
| 181 { &kCellularSignature, cellular_fields }, | 189 { &kCellularSignature, cellular_fields }, |
| 182 { &kCellularWithStateSignature, cellular_fields }, | 190 { &kCellularWithStateSignature, cellular_fields }, |
| 183 { &kNetworkWithStateSignature, network_fields }, | 191 { &kNetworkWithStateSignature, network_fields }, |
| 184 { &kNetworkConfigurationSignature, network_fields }, | 192 { &kNetworkConfigurationSignature, network_fields }, |
| 185 { NULL } | 193 { NULL } |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 continue; | 313 continue; |
| 306 *onc_value = table[i].onc_value; | 314 *onc_value = table[i].onc_value; |
| 307 return true; | 315 return true; |
| 308 } | 316 } |
| 309 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; | 317 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; |
| 310 return false; | 318 return false; |
| 311 } | 319 } |
| 312 | 320 |
| 313 } // namespace onc | 321 } // namespace onc |
| 314 } // namespace chromeos | 322 } // namespace chromeos |
| OLD | NEW |