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

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

Issue 776603002: Revert of Change to Shill's IPConfig objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 "components/onc/onc_constants.h" 10 #include "components/onc/onc_constants.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 { ::onc::ipconfig::kGateway, shill::kGatewayProperty}, 200 { ::onc::ipconfig::kGateway, shill::kGatewayProperty},
201 { ::onc::ipconfig::kRoutingPrefix, shill::kPrefixlenProperty}, 201 { ::onc::ipconfig::kRoutingPrefix, shill::kPrefixlenProperty},
202 { ::onc::ipconfig::kNameServers, shill::kNameServersProperty}, 202 { ::onc::ipconfig::kNameServers, shill::kNameServersProperty},
203 // This field is converted during translation, see ShillToONCTranslator:: 203 // This field is converted during translation, see ShillToONCTranslator::
204 // TranslateIPConfig. It is only converted from Shill->ONC. 204 // TranslateIPConfig. It is only converted from Shill->ONC.
205 // { ::onc::ipconfig::kType, shill::kMethodProperty}, 205 // { ::onc::ipconfig::kType, shill::kMethodProperty},
206 { ::onc::ipconfig::kWebProxyAutoDiscoveryUrl, 206 { ::onc::ipconfig::kWebProxyAutoDiscoveryUrl,
207 shill::kWebProxyAutoDiscoveryUrlProperty}, 207 shill::kWebProxyAutoDiscoveryUrlProperty},
208 {NULL}}; 208 {NULL}};
209 209
210 const FieldTranslationEntry static_or_saved_ipconfig_fields[] = { 210 const FieldTranslationEntry saved_ipconfig_fields[] = {
211 { ::onc::ipconfig::kIPAddress, shill::kAddressProperty}, 211 { ::onc::ipconfig::kIPAddress, shill::kSavedIPAddressProperty},
212 { ::onc::ipconfig::kGateway, shill::kGatewayProperty}, 212 { ::onc::ipconfig::kGateway, shill::kSavedIPGatewayProperty},
213 { ::onc::ipconfig::kRoutingPrefix, shill::kPrefixlenProperty}, 213 { ::onc::ipconfig::kRoutingPrefix, shill::kSavedIPPrefixlenProperty},
214 { ::onc::ipconfig::kNameServers, shill::kNameServersProperty}, 214 // NameServers are converted during translation, see onc_translator_*.
215 // { ::onc::ipconfig::kNameServers, shill::kSavedIPNameServersProperty},
216 {NULL}};
217
218 const FieldTranslationEntry static_ipconfig_fields[] = {
219 { ::onc::ipconfig::kIPAddress, shill::kStaticIPAddressProperty},
220 { ::onc::ipconfig::kGateway, shill::kStaticIPGatewayProperty},
221 { ::onc::ipconfig::kRoutingPrefix, shill::kStaticIPPrefixlenProperty},
222 // NameServers are converted during translation, see onc_translator_*.
223 // { ::onc::ipconfig::kNameServers, shill::kStaticIPNameServersProperty},
215 {NULL}}; 224 {NULL}};
216 225
217 struct OncValueTranslationEntry { 226 struct OncValueTranslationEntry {
218 const OncValueSignature* onc_signature; 227 const OncValueSignature* onc_signature;
219 const FieldTranslationEntry* field_translation_table; 228 const FieldTranslationEntry* field_translation_table;
220 }; 229 };
221 230
222 const OncValueTranslationEntry onc_value_translation_table[] = { 231 const OncValueTranslationEntry onc_value_translation_table[] = {
223 { &kEAPSignature, eap_fields }, 232 { &kEAPSignature, eap_fields },
224 { &kIPsecSignature, ipsec_fields }, 233 { &kIPsecSignature, ipsec_fields },
225 { &kL2TPSignature, l2tp_fields }, 234 { &kL2TPSignature, l2tp_fields },
226 { &kXAUTHSignature, xauth_fields }, 235 { &kXAUTHSignature, xauth_fields },
227 { &kOpenVPNSignature, openvpn_fields }, 236 { &kOpenVPNSignature, openvpn_fields },
228 { &kVerifyX509Signature, verify_x509_fields }, 237 { &kVerifyX509Signature, verify_x509_fields },
229 { &kVPNSignature, vpn_fields }, 238 { &kVPNSignature, vpn_fields },
230 { &kWiFiSignature, wifi_fields }, 239 { &kWiFiSignature, wifi_fields },
231 { &kWiFiWithStateSignature, wifi_fields }, 240 { &kWiFiWithStateSignature, wifi_fields },
232 { &kWiMAXSignature, wimax_fields }, 241 { &kWiMAXSignature, wimax_fields },
233 { &kWiMAXWithStateSignature, wimax_fields }, 242 { &kWiMAXWithStateSignature, wimax_fields },
234 { &kCellularApnSignature, cellular_apn_fields }, 243 { &kCellularApnSignature, cellular_apn_fields },
235 { &kCellularFoundNetworkSignature, cellular_found_network_fields }, 244 { &kCellularFoundNetworkSignature, cellular_found_network_fields },
236 { &kCellularProviderSignature, cellular_provider_fields }, 245 { &kCellularProviderSignature, cellular_provider_fields },
237 { &kSIMLockStatusSignature, sim_lock_status_fields }, 246 { &kSIMLockStatusSignature, sim_lock_status_fields },
238 { &kCellularSignature, cellular_fields }, 247 { &kCellularSignature, cellular_fields },
239 { &kCellularWithStateSignature, cellular_fields }, 248 { &kCellularWithStateSignature, cellular_fields },
240 { &kNetworkWithStateSignature, network_fields }, 249 { &kNetworkWithStateSignature, network_fields },
241 { &kNetworkConfigurationSignature, network_fields }, 250 { &kNetworkConfigurationSignature, network_fields },
242 { &kIPConfigSignature, ipconfig_fields }, 251 { &kIPConfigSignature, ipconfig_fields },
243 { &kSavedIPConfigSignature, static_or_saved_ipconfig_fields }, 252 { &kSavedIPConfigSignature, saved_ipconfig_fields },
244 { &kStaticIPConfigSignature, static_or_saved_ipconfig_fields }, 253 { &kStaticIPConfigSignature, static_ipconfig_fields },
245 { NULL } 254 { NULL }
246 }; 255 };
247 256
248 struct NestedShillDictionaryEntry { 257 struct NestedShillDictionaryEntry {
249 const OncValueSignature* onc_signature; 258 const OncValueSignature* onc_signature;
250 // NULL terminated list of Shill property keys. 259 // NULL terminated list of Shill property keys.
251 const char* const* shill_property_path; 260 const char* const* shill_property_path;
252 }; 261 };
253 262
254 const char* cellular_apn_path_entries[] = { 263 const char* cellular_apn_property_path_entries[] = {
255 shill::kCellularApnProperty, 264 shill::kCellularApnProperty,
256 NULL 265 NULL
257 }; 266 };
258 267
259 const char* static_ip_config_path_entries[] = {
260 shill::kStaticIPConfigProperty,
261 NULL
262 };
263
264 const NestedShillDictionaryEntry nested_shill_dictionaries[] = { 268 const NestedShillDictionaryEntry nested_shill_dictionaries[] = {
265 { &kCellularApnSignature, cellular_apn_path_entries }, 269 { &kCellularApnSignature, cellular_apn_property_path_entries },
266 { &kStaticIPConfigSignature, static_ip_config_path_entries },
267 { NULL } 270 { NULL }
268 }; 271 };
269 272
270 } // namespace 273 } // namespace
271 274
272 const StringTranslationEntry kNetworkTypeTable[] = { 275 const StringTranslationEntry kNetworkTypeTable[] = {
273 // This mapping is ensured in the translation code. 276 // This mapping is ensured in the translation code.
274 // { network_type::kEthernet, shill::kTypeEthernet }, 277 // { network_type::kEthernet, shill::kTypeEthernet },
275 // { network_type::kEthernet, shill::kTypeEthernetEap }, 278 // { network_type::kEthernet, shill::kTypeEthernetEap },
276 { ::onc::network_type::kWiFi, shill::kTypeWifi}, 279 { ::onc::network_type::kWiFi, shill::kTypeWifi},
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 continue; 420 continue;
418 *onc_value = table[i].onc_value; 421 *onc_value = table[i].onc_value;
419 return true; 422 return true;
420 } 423 }
421 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; 424 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC";
422 return false; 425 return false;
423 } 426 }
424 427
425 } // namespace onc 428 } // namespace onc
426 } // namespace chromeos 429 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/onc/onc_translation_tables.h ('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