| 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 "chromeos/network/onc/onc_constants.h" | 10 #include "chromeos/network/onc/onc_constants.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 const FieldTranslationEntry eap_fields[] = { | 26 const FieldTranslationEntry eap_fields[] = { |
| 27 { eap::kAnonymousIdentity, flimflam::kEapAnonymousIdentityProperty }, | 27 { eap::kAnonymousIdentity, flimflam::kEapAnonymousIdentityProperty }, |
| 28 { eap::kIdentity, flimflam::kEapIdentityProperty }, | 28 { eap::kIdentity, flimflam::kEapIdentityProperty }, |
| 29 // This field is converted during translation, see onc_translator_*. | 29 // This field is converted during translation, see onc_translator_*. |
| 30 // { eap::kInner, flimflam::kEapPhase2AuthProperty }, | 30 // { eap::kInner, flimflam::kEapPhase2AuthProperty }, |
| 31 | 31 |
| 32 // This field is converted during translation, see onc_translator_*. | 32 // This field is converted during translation, see onc_translator_*. |
| 33 // { eap::kOuter, flimflam::kEapMethodProperty }, | 33 // { eap::kOuter, flimflam::kEapMethodProperty }, |
| 34 { eap::kPassword, flimflam::kEapPasswordProperty }, | 34 { eap::kPassword, flimflam::kEapPasswordProperty }, |
| 35 { eap::kSaveCredentials, flimflam::kSaveCredentialsProperty }, | 35 { eap::kSaveCredentials, flimflam::kSaveCredentialsProperty }, |
| 36 { eap::kServerCARef, flimflam::kEapCaCertNssProperty }, | 36 // This field is converted during translation, see onc_translator_*. |
| 37 // { eap::kServerCAFingerprint, shill::kEapCaCertPemProperty }, |
| 37 { eap::kUseSystemCAs, flimflam::kEapUseSystemCasProperty }, | 38 { eap::kUseSystemCAs, flimflam::kEapUseSystemCasProperty }, |
| 38 { NULL } | 39 { NULL } |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 const FieldTranslationEntry ipsec_fields[] = { | 42 const FieldTranslationEntry ipsec_fields[] = { |
| 42 // Ignored by Shill, not necessary to synchronize. | 43 // Ignored by Shill, not necessary to synchronize. |
| 43 // { vpn::kAuthenticationType, flimflam::kL2tpIpsecAuthenticationType }, | 44 // { vpn::kAuthenticationType, flimflam::kL2tpIpsecAuthenticationType }, |
| 44 { vpn::kGroup, shill::kL2tpIpsecTunnelGroupProperty }, | 45 { vpn::kGroup, shill::kL2tpIpsecTunnelGroupProperty }, |
| 45 // Ignored by Shill, not necessary to synchronize. | 46 // Ignored by Shill, not necessary to synchronize. |
| 46 // { vpn::kIKEVersion, flimflam::kL2tpIpsecIkeVersion }, | 47 // { vpn::kIKEVersion, flimflam::kL2tpIpsecIkeVersion }, |
| 47 { vpn::kPSK, flimflam::kL2tpIpsecPskProperty }, | 48 { vpn::kPSK, flimflam::kL2tpIpsecPskProperty }, |
| 48 { vpn::kSaveCredentials, flimflam::kSaveCredentialsProperty }, | 49 { vpn::kSaveCredentials, flimflam::kSaveCredentialsProperty }, |
| 49 { vpn::kServerCARef, flimflam::kL2tpIpsecCaCertNssProperty }, | 50 // This field is converted during translation, see onc_translator_*. |
| 51 // { vpn::kServerCAFingerprint, shill::kL2tpIpsecCaCertPemProperty }, |
| 50 { NULL } | 52 { NULL } |
| 51 }; | 53 }; |
| 52 | 54 |
| 53 const FieldTranslationEntry l2tp_fields[] = { | 55 const FieldTranslationEntry l2tp_fields[] = { |
| 54 { vpn::kPassword, flimflam::kL2tpIpsecPasswordProperty }, | 56 { vpn::kPassword, flimflam::kL2tpIpsecPasswordProperty }, |
| 55 // We don't synchronize l2tp's SaveCredentials field for now, as Shill doesn't | 57 // We don't synchronize l2tp's SaveCredentials field for now, as Shill doesn't |
| 56 // support separate settings for ipsec and l2tp. | 58 // support separate settings for ipsec and l2tp. |
| 57 // { vpn::kSaveCredentials, &kBoolSignature }, | 59 // { vpn::kSaveCredentials, &kBoolSignature }, |
| 58 { vpn::kUsername, flimflam::kL2tpIpsecUserProperty }, | 60 { vpn::kUsername, flimflam::kL2tpIpsecUserProperty }, |
| 59 { NULL } | 61 { NULL } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 71 { vpn::kPassword, flimflam::kOpenVPNPasswordProperty }, | 73 { vpn::kPassword, flimflam::kOpenVPNPasswordProperty }, |
| 72 { vpn::kPort, flimflam::kOpenVPNPortProperty }, | 74 { vpn::kPort, flimflam::kOpenVPNPortProperty }, |
| 73 { vpn::kProto, flimflam::kOpenVPNProtoProperty }, | 75 { vpn::kProto, flimflam::kOpenVPNProtoProperty }, |
| 74 { vpn::kPushPeerInfo, flimflam::kOpenVPNPushPeerInfoProperty }, | 76 { vpn::kPushPeerInfo, flimflam::kOpenVPNPushPeerInfoProperty }, |
| 75 { vpn::kRemoteCertEKU, flimflam::kOpenVPNRemoteCertEKUProperty }, | 77 { vpn::kRemoteCertEKU, flimflam::kOpenVPNRemoteCertEKUProperty }, |
| 76 // This field is converted during translation, see onc_translator_*. | 78 // This field is converted during translation, see onc_translator_*. |
| 77 // { vpn::kRemoteCertKU, flimflam::kOpenVPNRemoteCertKUProperty }, | 79 // { vpn::kRemoteCertKU, flimflam::kOpenVPNRemoteCertKUProperty }, |
| 78 { vpn::kRemoteCertTLS, flimflam::kOpenVPNRemoteCertTLSProperty }, | 80 { vpn::kRemoteCertTLS, flimflam::kOpenVPNRemoteCertTLSProperty }, |
| 79 { vpn::kRenegSec, flimflam::kOpenVPNRenegSecProperty }, | 81 { vpn::kRenegSec, flimflam::kOpenVPNRenegSecProperty }, |
| 80 { vpn::kSaveCredentials, flimflam::kSaveCredentialsProperty }, | 82 { vpn::kSaveCredentials, flimflam::kSaveCredentialsProperty }, |
| 81 { vpn::kServerCARef, flimflam::kOpenVPNCaCertNSSProperty }, | 83 // This field is converted during translation, see onc_translator_*. |
| 84 // { vpn::kServerCAFingerprint, shill::kOpenVPNCaCertPemProperty }, |
| 82 { vpn::kServerPollTimeout, flimflam::kOpenVPNServerPollTimeoutProperty }, | 85 { vpn::kServerPollTimeout, flimflam::kOpenVPNServerPollTimeoutProperty }, |
| 83 { vpn::kShaper, flimflam::kOpenVPNShaperProperty }, | 86 { vpn::kShaper, flimflam::kOpenVPNShaperProperty }, |
| 84 { vpn::kStaticChallenge, flimflam::kOpenVPNStaticChallengeProperty }, | 87 { vpn::kStaticChallenge, flimflam::kOpenVPNStaticChallengeProperty }, |
| 85 { vpn::kTLSAuthContents, flimflam::kOpenVPNTLSAuthContentsProperty }, | 88 { vpn::kTLSAuthContents, flimflam::kOpenVPNTLSAuthContentsProperty }, |
| 86 { vpn::kTLSRemote, flimflam::kOpenVPNTLSRemoteProperty }, | 89 { vpn::kTLSRemote, flimflam::kOpenVPNTLSRemoteProperty }, |
| 87 { vpn::kUsername, flimflam::kOpenVPNUserProperty }, | 90 { vpn::kUsername, flimflam::kOpenVPNUserProperty }, |
| 88 { NULL } | 91 { NULL } |
| 89 }; | 92 }; |
| 90 | 93 |
| 91 const FieldTranslationEntry vpn_fields[] = { | 94 const FieldTranslationEntry vpn_fields[] = { |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 continue; | 271 continue; |
| 269 *onc_value = table[i].onc_value; | 272 *onc_value = table[i].onc_value; |
| 270 return true; | 273 return true; |
| 271 } | 274 } |
| 272 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; | 275 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; |
| 273 return false; | 276 return false; |
| 274 } | 277 } |
| 275 | 278 |
| 276 } // namespace onc | 279 } // namespace onc |
| 277 } // namespace chromeos | 280 } // namespace chromeos |
| OLD | NEW |