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

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

Issue 267433005: Provide IPConfigs in networkingPrivate.GetProperties (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 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 | Annotate | Revision Log
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // This field is conditionally translated, see onc_translator_*. 164 // This field is conditionally translated, see onc_translator_*.
165 // { ::onc::network_config::kName, shill::kNameProperty }, 165 // { ::onc::network_config::kName, shill::kNameProperty },
166 { ::onc::network_config::kGUID, shill::kGuidProperty}, 166 { ::onc::network_config::kGUID, shill::kGuidProperty},
167 // This field is converted during translation, see onc_translator_*. 167 // This field is converted during translation, see onc_translator_*.
168 // { ::onc::network_config::kType, shill::kTypeProperty }, 168 // { ::onc::network_config::kType, shill::kTypeProperty },
169 169
170 // This field is converted during translation, see 170 // This field is converted during translation, see
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
175 { ::onc::network_config::kConnectable, shill::kConnectableProperty },
176 { ::onc::network_config::kErrorState, shill::kErrorProperty },
174 {NULL}}; 177 {NULL}};
175 178
176 const FieldTranslationEntry ipconfig_fields[] = { 179 const FieldTranslationEntry ipconfig_fields[] = {
177 { ::onc::ipconfig::kIPAddress, shill::kAddressProperty}, 180 { ::onc::ipconfig::kIPAddress, shill::kAddressProperty},
178 { ::onc::ipconfig::kGateway, shill::kGatewayProperty}, 181 { ::onc::ipconfig::kGateway, shill::kGatewayProperty},
179 { ::onc::ipconfig::kRoutingPrefix, shill::kPrefixlenProperty}, 182 { ::onc::ipconfig::kRoutingPrefix, shill::kPrefixlenProperty},
180 { ::onc::ipconfig::kNameServers, shill::kNameServersProperty}, 183 { ::onc::ipconfig::kNameServers, shill::kNameServersProperty},
184 // This field is converted during translation, see ShillToONCTranslator::
185 // TranslateIPConfig. It is only converted from Shill->ONC.
186 // { ::onc::ipconfig::kType, shill::kMethodProperty},
181 {NULL}}; 187 {NULL}};
182 188
183 struct OncValueTranslationEntry { 189 struct OncValueTranslationEntry {
184 const OncValueSignature* onc_signature; 190 const OncValueSignature* onc_signature;
185 const FieldTranslationEntry* field_translation_table; 191 const FieldTranslationEntry* field_translation_table;
186 }; 192 };
187 193
188 const OncValueTranslationEntry onc_value_translation_table[] = { 194 const OncValueTranslationEntry onc_value_translation_table[] = {
189 { &kEAPSignature, eap_fields }, 195 { &kEAPSignature, eap_fields },
190 { &kIPsecSignature, ipsec_fields }, 196 { &kIPsecSignature, ipsec_fields },
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 continue; 331 continue;
326 *onc_value = table[i].onc_value; 332 *onc_value = table[i].onc_value;
327 return true; 333 return true;
328 } 334 }
329 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; 335 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC";
330 return false; 336 return false;
331 } 337 }
332 338
333 } // namespace onc 339 } // namespace onc
334 } // namespace chromeos 340 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/onc/onc_signature.cc ('k') | chromeos/network/onc/onc_translator_shill_to_onc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698