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

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

Issue 535283002: Translate activation/romaing state, restricted pool (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_279351_internet_options_7b
Patch Set: Rebase Created 6 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 "components/onc/onc_constants.h" 10 #include "components/onc/onc_constants.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 const FieldTranslationEntry sim_lock_status_fields[] = { 145 const FieldTranslationEntry sim_lock_status_fields[] = {
146 { ::onc::sim_lock_status::kLockEnabled, shill::kSIMLockEnabledProperty}, 146 { ::onc::sim_lock_status::kLockEnabled, shill::kSIMLockEnabledProperty},
147 { ::onc::sim_lock_status::kLockType, shill::kSIMLockTypeProperty}, 147 { ::onc::sim_lock_status::kLockType, shill::kSIMLockTypeProperty},
148 { ::onc::sim_lock_status::kRetriesLeft, shill::kSIMLockRetriesLeftProperty}, 148 { ::onc::sim_lock_status::kRetriesLeft, shill::kSIMLockRetriesLeftProperty},
149 {NULL}}; 149 {NULL}};
150 150
151 // This must only contain Service properties and not Device properties. 151 // This must only contain Service properties and not Device properties.
152 // For Device properties see kCellularDeviceTable. 152 // For Device properties see kCellularDeviceTable.
153 const FieldTranslationEntry cellular_fields[] = { 153 const FieldTranslationEntry cellular_fields[] = {
154 { ::onc::cellular::kActivationType, shill::kActivationTypeProperty}, 154 { ::onc::cellular::kActivationType, shill::kActivationTypeProperty},
155 { ::onc::cellular::kActivationState, shill::kActivationStateProperty}, 155 // This field is converted during translation, see onc_translator_*.
156 // { ::onc::cellular::kActivationState, shill::kActivationStateProperty},
156 { ::onc::cellular::kNetworkTechnology, shill::kNetworkTechnologyProperty}, 157 { ::onc::cellular::kNetworkTechnology, shill::kNetworkTechnologyProperty},
157 { ::onc::cellular::kRoamingState, shill::kRoamingStateProperty}, 158 // This field is converted during translation, see onc_translator_*.
159 // { ::onc::cellular::kRoamingState, shill::kRoamingStateProperty},
158 {NULL}}; 160 {NULL}};
159 161
160 const FieldTranslationEntry network_fields[] = { 162 const FieldTranslationEntry network_fields[] = {
161 { ::onc::network_config::kGUID, shill::kGuidProperty}, 163 { ::onc::network_config::kGUID, shill::kGuidProperty},
162 { ::onc::network_config::kConnectable, shill::kConnectableProperty }, 164 { ::onc::network_config::kConnectable, shill::kConnectableProperty },
163 { ::onc::network_config::kErrorState, shill::kErrorProperty }, 165 { ::onc::network_config::kErrorState, shill::kErrorProperty },
164 { ::onc::network_config::kPriority, shill::kPriorityProperty }, 166 { ::onc::network_config::kPriority, shill::kPriorityProperty },
165 167
166 // Shill doesn't allow setting the name for non-VPN networks. 168 // Shill doesn't allow setting the name for non-VPN networks.
167 // Name is conditionally translated, see onc_translator_*. 169 // Name is conditionally translated, see onc_translator_*.
168 // { ::onc::network_config::kName, shill::kNameProperty }, 170 // { ::onc::network_config::kName, shill::kNameProperty },
169 171
170 // Type is converted during translation, see onc_translator_*. 172 // Type is converted during translation, see onc_translator_*.
171 // { ::onc::network_config::kType, shill::kTypeProperty }, 173 // { ::onc::network_config::kType, shill::kTypeProperty },
172 174
173 // These fields are converted during translation, see 175 // These fields are converted during translation, see
174 // onc_translator_shill_to_onc.cc. They are only converted when going from 176 // onc_translator_shill_to_onc.cc. They are only converted when going from
175 // Shill->ONC, and ignored otherwise. 177 // Shill->ONC, and ignored otherwise.
176 // { ::onc::network_config::kConnectionState, shill::kStateProperty }, 178 // { ::onc::network_config::kConnectionState, shill::kStateProperty },
179 // { ::onc::network_config::kRestricted, shill::kStateProperty },
177 // { ::onc::network_config::kMacAddress, shill::kAddressProperty }, 180 // { ::onc::network_config::kMacAddress, shill::kAddressProperty },
178 {NULL}}; 181 {NULL}};
179 182
180 const FieldTranslationEntry ipconfig_fields[] = { 183 const FieldTranslationEntry ipconfig_fields[] = {
181 { ::onc::ipconfig::kIPAddress, shill::kAddressProperty}, 184 { ::onc::ipconfig::kIPAddress, shill::kAddressProperty},
182 { ::onc::ipconfig::kGateway, shill::kGatewayProperty}, 185 { ::onc::ipconfig::kGateway, shill::kGatewayProperty},
183 { ::onc::ipconfig::kRoutingPrefix, shill::kPrefixlenProperty}, 186 { ::onc::ipconfig::kRoutingPrefix, shill::kPrefixlenProperty},
184 { ::onc::ipconfig::kNameServers, shill::kNameServersProperty}, 187 { ::onc::ipconfig::kNameServers, shill::kNameServersProperty},
185 // This field is converted during translation, see ShillToONCTranslator:: 188 // This field is converted during translation, see ShillToONCTranslator::
186 // TranslateIPConfig. It is only converted from Shill->ONC. 189 // TranslateIPConfig. It is only converted from Shill->ONC.
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 { ::onc::eap::kMD5, shill::kEapPhase2AuthPEAPMD5}, 291 { ::onc::eap::kMD5, shill::kEapPhase2AuthPEAPMD5},
289 { ::onc::eap::kMSCHAPv2, shill::kEapPhase2AuthPEAPMSCHAPV2}, {NULL}}; 292 { ::onc::eap::kMSCHAPv2, shill::kEapPhase2AuthPEAPMSCHAPV2}, {NULL}};
290 293
291 // Translation of the EAP.Inner field in case of EAP.Outer == TTLS 294 // Translation of the EAP.Inner field in case of EAP.Outer == TTLS
292 const StringTranslationEntry kEAP_TTLS_InnerTable[] = { 295 const StringTranslationEntry kEAP_TTLS_InnerTable[] = {
293 { ::onc::eap::kMD5, shill::kEapPhase2AuthTTLSMD5}, 296 { ::onc::eap::kMD5, shill::kEapPhase2AuthTTLSMD5},
294 { ::onc::eap::kMSCHAPv2, shill::kEapPhase2AuthTTLSMSCHAPV2}, 297 { ::onc::eap::kMSCHAPv2, shill::kEapPhase2AuthTTLSMSCHAPV2},
295 { ::onc::eap::kPAP, shill::kEapPhase2AuthTTLSPAP}, 298 { ::onc::eap::kPAP, shill::kEapPhase2AuthTTLSPAP},
296 {NULL}}; 299 {NULL}};
297 300
301 const StringTranslationEntry kActivationStateTable[] = {
302 { ::onc::cellular::kActivated, shill::kActivationStateActivated},
303 { ::onc::cellular::kActivating, shill::kActivationStateActivating},
304 { ::onc::cellular::kNotActivated, shill::kActivationStateNotActivated},
305 { ::onc::cellular::kPartiallyActivated,
306 shill::kActivationStatePartiallyActivated},
307 {NULL}};
308
309 const StringTranslationEntry kRoamingStateTable[] = {
310 { ::onc::cellular::kHome, shill::kRoamingStateHome},
311 { ::onc::cellular::kRoaming, shill::kRoamingStateRoaming},
312 {NULL}};
313
298 // This must contain only Shill Device properties and no Service properties. 314 // This must contain only Shill Device properties and no Service properties.
299 // For Service properties see cellular_fields. 315 // For Service properties see cellular_fields.
300 const FieldTranslationEntry kCellularDeviceTable[] = { 316 const FieldTranslationEntry kCellularDeviceTable[] = {
301 // This field is converted during translation, see onc_translator_*. 317 // This field is converted during translation, see onc_translator_*.
302 // { ::onc::cellular::kAPNList, shill::kCellularApnListProperty}, 318 // { ::onc::cellular::kAPNList, shill::kCellularApnListProperty},
303 { ::onc::cellular::kAllowRoaming, shill::kCellularAllowRoamingProperty}, 319 { ::onc::cellular::kAllowRoaming, shill::kCellularAllowRoamingProperty},
304 { ::onc::cellular::kCarrier, shill::kCarrierProperty}, 320 { ::onc::cellular::kCarrier, shill::kCarrierProperty},
305 { ::onc::cellular::kESN, shill::kEsnProperty}, 321 { ::onc::cellular::kESN, shill::kEsnProperty},
306 { ::onc::cellular::kFamily, shill::kTechnologyFamilyProperty}, 322 { ::onc::cellular::kFamily, shill::kTechnologyFamilyProperty},
307 { ::onc::cellular::kFirmwareRevision, shill::kFirmwareRevisionProperty}, 323 { ::onc::cellular::kFirmwareRevision, shill::kFirmwareRevisionProperty},
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 continue; 404 continue;
389 *onc_value = table[i].onc_value; 405 *onc_value = table[i].onc_value;
390 return true; 406 return true;
391 } 407 }
392 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; 408 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC";
393 return false; 409 return false;
394 } 410 }
395 411
396 } // namespace onc 412 } // namespace onc
397 } // namespace chromeos 413 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698