Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: chromeos/network/onc/onc_translation_tables.cc

Issue 24348002: Migrate DBus service constants from flimflam namespace to shill namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased to ToT Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
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 // 18 //
19 // Proxy settings are converted to Shill by function 19 // Proxy settings are converted to Shill by function
20 // ConvertOncProxySettingsToProxyConfig(...). 20 // ConvertOncProxySettingsToProxyConfig(...).
21 // 21 //
22 // Translation of IPConfig objects is not supported, yet. 22 // Translation of IPConfig objects is not supported, yet.
23 23
24 namespace { 24 namespace {
25 25
26 const FieldTranslationEntry eap_fields[] = { 26 const FieldTranslationEntry eap_fields[] = {
27 { eap::kAnonymousIdentity, flimflam::kEapAnonymousIdentityProperty }, 27 { eap::kAnonymousIdentity, shill::kEapAnonymousIdentityProperty },
28 { eap::kIdentity, flimflam::kEapIdentityProperty }, 28 { eap::kIdentity, shill::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, shill::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, shill::kEapMethodProperty },
34 { eap::kPassword, flimflam::kEapPasswordProperty }, 34 { eap::kPassword, shill::kEapPasswordProperty },
35 { eap::kSaveCredentials, flimflam::kSaveCredentialsProperty }, 35 { eap::kSaveCredentials, shill::kSaveCredentialsProperty },
36 { eap::kServerCAPEMs, shill::kEapCaCertPemProperty }, 36 { eap::kServerCAPEMs, shill::kEapCaCertPemProperty },
37 { eap::kUseSystemCAs, flimflam::kEapUseSystemCasProperty }, 37 { eap::kUseSystemCAs, shill::kEapUseSystemCasProperty },
38 { NULL } 38 { NULL }
39 }; 39 };
40 40
41 const FieldTranslationEntry ipsec_fields[] = { 41 const FieldTranslationEntry ipsec_fields[] = {
42 // Ignored by Shill, not necessary to synchronize. 42 // Ignored by Shill, not necessary to synchronize.
43 // { ipsec::kAuthenticationType, flimflam::kL2tpIpsecAuthenticationType }, 43 // { ipsec::kAuthenticationType, shill::kL2tpIpsecAuthenticationType },
44 { ipsec::kGroup, shill::kL2tpIpsecTunnelGroupProperty }, 44 { ipsec::kGroup, shill::kL2tpIpsecTunnelGroupProperty },
45 // Ignored by Shill, not necessary to synchronize. 45 // Ignored by Shill, not necessary to synchronize.
46 // { ipsec::kIKEVersion, flimflam::kL2tpIpsecIkeVersion }, 46 // { ipsec::kIKEVersion, shill::kL2tpIpsecIkeVersion },
47 { ipsec::kPSK, flimflam::kL2tpIpsecPskProperty }, 47 { ipsec::kPSK, shill::kL2tpIpsecPskProperty },
48 { vpn::kSaveCredentials, flimflam::kSaveCredentialsProperty }, 48 { vpn::kSaveCredentials, shill::kSaveCredentialsProperty },
49 { ipsec::kServerCAPEMs, shill::kL2tpIpsecCaCertPemProperty }, 49 { ipsec::kServerCAPEMs, shill::kL2tpIpsecCaCertPemProperty },
50 { NULL } 50 { NULL }
51 }; 51 };
52 52
53 const FieldTranslationEntry l2tp_fields[] = { 53 const FieldTranslationEntry l2tp_fields[] = {
54 { vpn::kPassword, flimflam::kL2tpIpsecPasswordProperty }, 54 { vpn::kPassword, shill::kL2tpIpsecPasswordProperty },
55 // We don't synchronize l2tp's SaveCredentials field for now, as Shill doesn't 55 // We don't synchronize l2tp's SaveCredentials field for now, as Shill doesn't
56 // support separate settings for ipsec and l2tp. 56 // support separate settings for ipsec and l2tp.
57 // { vpn::kSaveCredentials, &kBoolSignature }, 57 // { vpn::kSaveCredentials, &kBoolSignature },
58 { vpn::kUsername, flimflam::kL2tpIpsecUserProperty }, 58 { vpn::kUsername, shill::kL2tpIpsecUserProperty },
59 { NULL } 59 { NULL }
60 }; 60 };
61 61
62 const FieldTranslationEntry openvpn_fields[] = { 62 const FieldTranslationEntry openvpn_fields[] = {
63 { openvpn::kAuth, flimflam::kOpenVPNAuthProperty }, 63 { openvpn::kAuth, shill::kOpenVPNAuthProperty },
64 { openvpn::kAuthNoCache, flimflam::kOpenVPNAuthNoCacheProperty }, 64 { openvpn::kAuthNoCache, shill::kOpenVPNAuthNoCacheProperty },
65 { openvpn::kAuthRetry, flimflam::kOpenVPNAuthRetryProperty }, 65 { openvpn::kAuthRetry, shill::kOpenVPNAuthRetryProperty },
66 { openvpn::kCipher, flimflam::kOpenVPNCipherProperty }, 66 { openvpn::kCipher, shill::kOpenVPNCipherProperty },
67 { openvpn::kCompLZO, flimflam::kOpenVPNCompLZOProperty }, 67 { openvpn::kCompLZO, shill::kOpenVPNCompLZOProperty },
68 { openvpn::kCompNoAdapt, flimflam::kOpenVPNCompNoAdaptProperty }, 68 { openvpn::kCompNoAdapt, shill::kOpenVPNCompNoAdaptProperty },
69 { openvpn::kKeyDirection, flimflam::kOpenVPNKeyDirectionProperty }, 69 { openvpn::kKeyDirection, shill::kOpenVPNKeyDirectionProperty },
70 { openvpn::kNsCertType, flimflam::kOpenVPNNsCertTypeProperty }, 70 { openvpn::kNsCertType, shill::kOpenVPNNsCertTypeProperty },
71 { vpn::kPassword, flimflam::kOpenVPNPasswordProperty }, 71 { vpn::kPassword, shill::kOpenVPNPasswordProperty },
72 { openvpn::kPort, flimflam::kOpenVPNPortProperty }, 72 { openvpn::kPort, shill::kOpenVPNPortProperty },
73 { openvpn::kProto, flimflam::kOpenVPNProtoProperty }, 73 { openvpn::kProto, shill::kOpenVPNProtoProperty },
74 { openvpn::kPushPeerInfo, flimflam::kOpenVPNPushPeerInfoProperty }, 74 { openvpn::kPushPeerInfo, shill::kOpenVPNPushPeerInfoProperty },
75 { openvpn::kRemoteCertEKU, flimflam::kOpenVPNRemoteCertEKUProperty }, 75 { openvpn::kRemoteCertEKU, shill::kOpenVPNRemoteCertEKUProperty },
76 // This field is converted during translation, see onc_translator_*. 76 // This field is converted during translation, see onc_translator_*.
77 // { openvpn::kRemoteCertKU, flimflam::kOpenVPNRemoteCertKUProperty }, 77 // { openvpn::kRemoteCertKU, shill::kOpenVPNRemoteCertKUProperty },
78 { openvpn::kRemoteCertTLS, flimflam::kOpenVPNRemoteCertTLSProperty }, 78 { openvpn::kRemoteCertTLS, shill::kOpenVPNRemoteCertTLSProperty },
79 { openvpn::kRenegSec, flimflam::kOpenVPNRenegSecProperty }, 79 { openvpn::kRenegSec, shill::kOpenVPNRenegSecProperty },
80 { vpn::kSaveCredentials, flimflam::kSaveCredentialsProperty }, 80 { vpn::kSaveCredentials, shill::kSaveCredentialsProperty },
81 { openvpn::kServerCAPEMs, shill::kOpenVPNCaCertPemProperty }, 81 { openvpn::kServerCAPEMs, shill::kOpenVPNCaCertPemProperty },
82 { openvpn::kServerPollTimeout, flimflam::kOpenVPNServerPollTimeoutProperty }, 82 { openvpn::kServerPollTimeout, shill::kOpenVPNServerPollTimeoutProperty },
83 { openvpn::kShaper, flimflam::kOpenVPNShaperProperty }, 83 { openvpn::kShaper, shill::kOpenVPNShaperProperty },
84 { openvpn::kStaticChallenge, flimflam::kOpenVPNStaticChallengeProperty }, 84 { openvpn::kStaticChallenge, shill::kOpenVPNStaticChallengeProperty },
85 { openvpn::kTLSAuthContents, flimflam::kOpenVPNTLSAuthContentsProperty }, 85 { openvpn::kTLSAuthContents, shill::kOpenVPNTLSAuthContentsProperty },
86 { openvpn::kTLSRemote, flimflam::kOpenVPNTLSRemoteProperty }, 86 { openvpn::kTLSRemote, shill::kOpenVPNTLSRemoteProperty },
87 { vpn::kUsername, flimflam::kOpenVPNUserProperty }, 87 { vpn::kUsername, shill::kOpenVPNUserProperty },
88 { NULL } 88 { NULL }
89 }; 89 };
90 90
91 const FieldTranslationEntry vpn_fields[] = { 91 const FieldTranslationEntry vpn_fields[] = {
92 { vpn::kAutoConnect, flimflam::kAutoConnectProperty }, 92 { vpn::kAutoConnect, shill::kAutoConnectProperty },
93 { vpn::kHost, flimflam::kProviderHostProperty }, 93 { vpn::kHost, shill::kProviderHostProperty },
94 // This field is converted during translation, see onc_translator_*. 94 // This field is converted during translation, see onc_translator_*.
95 // { vpn::kType, flimflam::kProviderTypeProperty }, 95 // { vpn::kType, shill::kProviderTypeProperty },
96 { NULL } 96 { NULL }
97 }; 97 };
98 98
99 const FieldTranslationEntry wifi_fields[] = { 99 const FieldTranslationEntry wifi_fields[] = {
100 { wifi::kAutoConnect, flimflam::kAutoConnectProperty }, 100 { wifi::kAutoConnect, shill::kAutoConnectProperty },
101 { wifi::kBSSID, flimflam::kWifiBSsid }, 101 { wifi::kBSSID, shill::kWifiBSsid },
102 { wifi::kFrequency, flimflam::kWifiFrequency }, 102 { wifi::kFrequency, shill::kWifiFrequency },
103 { wifi::kFrequencyList, shill::kWifiFrequencyListProperty }, 103 { wifi::kFrequencyList, shill::kWifiFrequencyListProperty },
104 { wifi::kHiddenSSID, flimflam::kWifiHiddenSsid }, 104 { wifi::kHiddenSSID, shill::kWifiHiddenSsid },
105 { wifi::kPassphrase, flimflam::kPassphraseProperty }, 105 { wifi::kPassphrase, shill::kPassphraseProperty },
106 { wifi::kSSID, flimflam::kSSIDProperty }, 106 { wifi::kSSID, shill::kSSIDProperty },
107 // This field is converted during translation, see onc_translator_*. 107 // This field is converted during translation, see onc_translator_*.
108 // { wifi::kSecurity, flimflam::kSecurityProperty }, 108 // { wifi::kSecurity, shill::kSecurityProperty },
109 { wifi::kSignalStrength, flimflam::kSignalStrengthProperty }, 109 { wifi::kSignalStrength, shill::kSignalStrengthProperty },
110 { NULL } 110 { NULL }
111 }; 111 };
112 112
113 const FieldTranslationEntry cellular_apn_fields[] = { 113 const FieldTranslationEntry cellular_apn_fields[] = {
114 { cellular_apn::kName, flimflam::kApnProperty }, 114 { cellular_apn::kName, shill::kApnProperty },
115 { cellular_apn::kUsername, flimflam::kApnUsernameProperty }, 115 { cellular_apn::kUsername, shill::kApnUsernameProperty },
116 { cellular_apn::kPassword, flimflam::kApnPasswordProperty }, 116 { cellular_apn::kPassword, shill::kApnPasswordProperty },
117 { NULL } 117 { NULL }
118 }; 118 };
119 119
120 const FieldTranslationEntry cellular_provider_fields[] = { 120 const FieldTranslationEntry cellular_provider_fields[] = {
121 { cellular_provider::kCode, flimflam::kOperatorCodeKey }, 121 { cellular_provider::kCode, shill::kOperatorCodeKey },
122 { cellular_provider::kCountry, flimflam::kOperatorCountryKey }, 122 { cellular_provider::kCountry, shill::kOperatorCountryKey },
123 { cellular_provider::kName, flimflam::kOperatorNameKey }, 123 { cellular_provider::kName, shill::kOperatorNameKey },
124 { NULL } 124 { NULL }
125 }; 125 };
126 126
127 const FieldTranslationEntry cellular_fields[] = { 127 const FieldTranslationEntry cellular_fields[] = {
128 { cellular::kActivateOverNonCellularNetwork, 128 { cellular::kActivateOverNonCellularNetwork,
129 shill::kActivateOverNonCellularNetworkProperty }, 129 shill::kActivateOverNonCellularNetworkProperty },
130 { cellular::kActivationState, flimflam::kActivationStateProperty }, 130 { cellular::kActivationState, shill::kActivationStateProperty },
131 { cellular::kAllowRoaming, flimflam::kCellularAllowRoamingProperty }, 131 { cellular::kAllowRoaming, shill::kCellularAllowRoamingProperty },
132 { cellular::kCarrier, flimflam::kCarrierProperty }, 132 { cellular::kCarrier, shill::kCarrierProperty },
133 { cellular::kESN, flimflam::kEsnProperty }, 133 { cellular::kESN, shill::kEsnProperty },
134 { cellular::kFamily, flimflam::kTechnologyFamilyProperty }, 134 { cellular::kFamily, shill::kTechnologyFamilyProperty },
135 { cellular::kFirmwareRevision, flimflam::kFirmwareRevisionProperty }, 135 { cellular::kFirmwareRevision, shill::kFirmwareRevisionProperty },
136 { cellular::kFoundNetworks, flimflam::kFoundNetworksProperty }, 136 { cellular::kFoundNetworks, shill::kFoundNetworksProperty },
137 { cellular::kHardwareRevision, flimflam::kHardwareRevisionProperty }, 137 { cellular::kHardwareRevision, shill::kHardwareRevisionProperty },
138 { cellular::kICCID, flimflam::kIccidProperty }, 138 { cellular::kICCID, shill::kIccidProperty },
139 { cellular::kIMEI, flimflam::kImeiProperty }, 139 { cellular::kIMEI, shill::kImeiProperty },
140 { cellular::kIMSI, flimflam::kImsiProperty }, 140 { cellular::kIMSI, shill::kImsiProperty },
141 { cellular::kManufacturer, flimflam::kManufacturerProperty }, 141 { cellular::kManufacturer, shill::kManufacturerProperty },
142 { cellular::kMDN, flimflam::kMdnProperty }, 142 { cellular::kMDN, shill::kMdnProperty },
143 { cellular::kMEID, flimflam::kMeidProperty }, 143 { cellular::kMEID, shill::kMeidProperty },
144 { cellular::kMIN, flimflam::kMinProperty }, 144 { cellular::kMIN, shill::kMinProperty },
145 { cellular::kModelID, flimflam::kModelIDProperty }, 145 { cellular::kModelID, shill::kModelIDProperty },
146 { cellular::kNetworkTechnology, flimflam::kNetworkTechnologyProperty }, 146 { cellular::kNetworkTechnology, shill::kNetworkTechnologyProperty },
147 { cellular::kPRLVersion, flimflam::kPRLVersionProperty }, 147 { cellular::kPRLVersion, shill::kPRLVersionProperty },
148 { cellular::kProviderRequiresRoaming, 148 { cellular::kProviderRequiresRoaming,
149 shill::kProviderRequiresRoamingProperty }, 149 shill::kProviderRequiresRoamingProperty },
150 { cellular::kRoamingState, flimflam::kRoamingStateProperty }, 150 { cellular::kRoamingState, shill::kRoamingStateProperty },
151 { cellular::kSelectedNetwork, flimflam::kSelectedNetworkProperty }, 151 { cellular::kSelectedNetwork, shill::kSelectedNetworkProperty },
152 { cellular::kSIMLockStatus, flimflam::kSIMLockStatusProperty }, 152 { cellular::kSIMLockStatus, shill::kSIMLockStatusProperty },
153 { cellular::kSIMPresent, shill::kSIMPresentProperty }, 153 { cellular::kSIMPresent, shill::kSIMPresentProperty },
154 { cellular::kSupportedCarriers, shill::kSupportedCarriersProperty }, 154 { cellular::kSupportedCarriers, shill::kSupportedCarriersProperty },
155 { cellular::kSupportNetworkScan, flimflam::kSupportNetworkScanProperty }, 155 { cellular::kSupportNetworkScan, shill::kSupportNetworkScanProperty },
156 { NULL } 156 { NULL }
157 }; 157 };
158 158
159 const FieldTranslationEntry network_fields[] = { 159 const FieldTranslationEntry network_fields[] = {
160 // Shill doesn't allow setting the name for non-VPN networks. 160 // Shill doesn't allow setting the name for non-VPN networks.
161 // This field is conditionally translated, see onc_translator_*. 161 // This field is conditionally translated, see onc_translator_*.
162 // { network_config::kName, flimflam::kNameProperty }, 162 // { network_config::kName, shill::kNameProperty },
163 { network_config::kGUID, flimflam::kGuidProperty }, 163 { network_config::kGUID, shill::kGuidProperty },
164 // This field is converted during translation, see onc_translator_*. 164 // This field is converted during translation, see onc_translator_*.
165 // { network_config::kType, flimflam::kTypeProperty }, 165 // { network_config::kType, shill::kTypeProperty },
166 166
167 // This field is converted during translation, see 167 // This field is converted during translation, see
168 // onc_translator_shill_to_onc.cc. It is only converted when going from 168 // onc_translator_shill_to_onc.cc. It is only converted when going from
169 // Shill->ONC, and ignored otherwise. 169 // Shill->ONC, and ignored otherwise.
170 // { network_config::kConnectionState, flimflam::kStateProperty }, 170 // { network_config::kConnectionState, shill::kStateProperty },
171 { NULL } 171 { NULL }
172 }; 172 };
173 173
174 struct OncValueTranslationEntry { 174 struct OncValueTranslationEntry {
175 const OncValueSignature* onc_signature; 175 const OncValueSignature* onc_signature;
176 const FieldTranslationEntry* field_translation_table; 176 const FieldTranslationEntry* field_translation_table;
177 }; 177 };
178 178
179 const OncValueTranslationEntry onc_value_translation_table[] = { 179 const OncValueTranslationEntry onc_value_translation_table[] = {
180 { &kEAPSignature, eap_fields }, 180 { &kEAPSignature, eap_fields },
(...skipping 12 matching lines...) Expand all
193 { NULL } 193 { NULL }
194 }; 194 };
195 195
196 struct NestedShillDictionaryEntry { 196 struct NestedShillDictionaryEntry {
197 const OncValueSignature* onc_signature; 197 const OncValueSignature* onc_signature;
198 // NULL terminated list of Shill property keys. 198 // NULL terminated list of Shill property keys.
199 const char* const* shill_property_path; 199 const char* const* shill_property_path;
200 }; 200 };
201 201
202 const char* cellular_apn_property_path_entries[] = { 202 const char* cellular_apn_property_path_entries[] = {
203 flimflam::kCellularApnProperty, 203 shill::kCellularApnProperty,
204 NULL 204 NULL
205 }; 205 };
206 206
207 const NestedShillDictionaryEntry nested_shill_dictionaries[] = { 207 const NestedShillDictionaryEntry nested_shill_dictionaries[] = {
208 { &kCellularApnSignature, cellular_apn_property_path_entries }, 208 { &kCellularApnSignature, cellular_apn_property_path_entries },
209 { NULL } 209 { NULL }
210 }; 210 };
211 211
212 } // namespace 212 } // namespace
213 213
214 const StringTranslationEntry kNetworkTypeTable[] = { 214 const StringTranslationEntry kNetworkTypeTable[] = {
215 // This mapping is ensured in the translation code. 215 // This mapping is ensured in the translation code.
216 // { network_type::kEthernet, flimflam::kTypeEthernet }, 216 // { network_type::kEthernet, shill::kTypeEthernet },
217 // { network_type::kEthernet, shill::kTypeEthernetEap }, 217 // { network_type::kEthernet, shill::kTypeEthernetEap },
218 { network_type::kWiFi, flimflam::kTypeWifi }, 218 { network_type::kWiFi, shill::kTypeWifi },
219 { network_type::kCellular, flimflam::kTypeCellular }, 219 { network_type::kCellular, shill::kTypeCellular },
220 { network_type::kVPN, flimflam::kTypeVPN }, 220 { network_type::kVPN, shill::kTypeVPN },
221 { NULL } 221 { NULL }
222 }; 222 };
223 223
224 const StringTranslationEntry kVPNTypeTable[] = { 224 const StringTranslationEntry kVPNTypeTable[] = {
225 { vpn::kTypeL2TP_IPsec, flimflam::kProviderL2tpIpsec }, 225 { vpn::kTypeL2TP_IPsec, shill::kProviderL2tpIpsec },
226 { vpn::kOpenVPN, flimflam::kProviderOpenVpn }, 226 { vpn::kOpenVPN, shill::kProviderOpenVpn },
227 { NULL } 227 { NULL }
228 }; 228 };
229 229
230 // The first matching line is chosen. 230 // The first matching line is chosen.
231 const StringTranslationEntry kWiFiSecurityTable[] = { 231 const StringTranslationEntry kWiFiSecurityTable[] = {
232 { wifi::kNone, flimflam::kSecurityNone }, 232 { wifi::kNone, shill::kSecurityNone },
233 { wifi::kWEP_PSK, flimflam::kSecurityWep }, 233 { wifi::kWEP_PSK, shill::kSecurityWep },
234 { wifi::kWPA_PSK, flimflam::kSecurityPsk }, 234 { wifi::kWPA_PSK, shill::kSecurityPsk },
235 { wifi::kWPA_EAP, flimflam::kSecurity8021x }, 235 { wifi::kWPA_EAP, shill::kSecurity8021x },
236 { wifi::kWPA_PSK, flimflam::kSecurityRsn }, 236 { wifi::kWPA_PSK, shill::kSecurityRsn },
237 { wifi::kWPA_PSK, flimflam::kSecurityWpa }, 237 { wifi::kWPA_PSK, shill::kSecurityWpa },
238 { NULL } 238 { NULL }
239 }; 239 };
240 240
241 const StringTranslationEntry kEAPOuterTable[] = { 241 const StringTranslationEntry kEAPOuterTable[] = {
242 { eap::kPEAP, flimflam::kEapMethodPEAP }, 242 { eap::kPEAP, shill::kEapMethodPEAP },
243 { eap::kEAP_TLS, flimflam::kEapMethodTLS }, 243 { eap::kEAP_TLS, shill::kEapMethodTLS },
244 { eap::kEAP_TTLS, flimflam::kEapMethodTTLS }, 244 { eap::kEAP_TTLS, shill::kEapMethodTTLS },
245 { eap::kLEAP, flimflam::kEapMethodLEAP }, 245 { eap::kLEAP, shill::kEapMethodLEAP },
246 { NULL } 246 { NULL }
247 }; 247 };
248 248
249 // Translation of the EAP.Inner field in case of EAP.Outer == PEAP 249 // Translation of the EAP.Inner field in case of EAP.Outer == PEAP
250 const StringTranslationEntry kEAP_PEAP_InnerTable[] = { 250 const StringTranslationEntry kEAP_PEAP_InnerTable[] = {
251 { eap::kMD5, flimflam::kEapPhase2AuthPEAPMD5 }, 251 { eap::kMD5, shill::kEapPhase2AuthPEAPMD5 },
252 { eap::kMSCHAPv2, flimflam::kEapPhase2AuthPEAPMSCHAPV2 }, 252 { eap::kMSCHAPv2, shill::kEapPhase2AuthPEAPMSCHAPV2 },
253 { NULL } 253 { NULL }
254 }; 254 };
255 255
256 // Translation of the EAP.Inner field in case of EAP.Outer == TTLS 256 // Translation of the EAP.Inner field in case of EAP.Outer == TTLS
257 const StringTranslationEntry kEAP_TTLS_InnerTable[] = { 257 const StringTranslationEntry kEAP_TTLS_InnerTable[] = {
258 { eap::kMD5, flimflam::kEapPhase2AuthTTLSMD5 }, 258 { eap::kMD5, shill::kEapPhase2AuthTTLSMD5 },
259 { eap::kMSCHAPv2, flimflam::kEapPhase2AuthTTLSMSCHAPV2 }, 259 { eap::kMSCHAPv2, shill::kEapPhase2AuthTTLSMSCHAPV2 },
260 { eap::kPAP, flimflam::kEapPhase2AuthTTLSPAP }, 260 { eap::kPAP, shill::kEapPhase2AuthTTLSPAP },
261 { NULL } 261 { NULL }
262 }; 262 };
263 263
264 const FieldTranslationEntry* GetFieldTranslationTable( 264 const FieldTranslationEntry* GetFieldTranslationTable(
265 const OncValueSignature& onc_signature) { 265 const OncValueSignature& onc_signature) {
266 for (const OncValueTranslationEntry* it = onc_value_translation_table; 266 for (const OncValueTranslationEntry* it = onc_value_translation_table;
267 it->onc_signature != NULL; ++it) { 267 it->onc_signature != NULL; ++it) {
268 if (it->onc_signature == &onc_signature) 268 if (it->onc_signature == &onc_signature)
269 return it->field_translation_table; 269 return it->field_translation_table;
270 } 270 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 continue; 321 continue;
322 *onc_value = table[i].onc_value; 322 *onc_value = table[i].onc_value;
323 return true; 323 return true;
324 } 324 }
325 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; 325 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC";
326 return false; 326 return false;
327 } 327 }
328 328
329 } // namespace onc 329 } // namespace onc
330 } // namespace chromeos 330 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/network_util_unittest.cc ('k') | chromeos/network/onc/onc_translator_onc_to_shill.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698