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 "components/onc/onc_constants.h" | 10 #include "components/onc/onc_constants.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 {::onc::sim_lock_status::kRetriesLeft, shill::kSIMLockRetriesLeftProperty}, | 160 {::onc::sim_lock_status::kRetriesLeft, shill::kSIMLockRetriesLeftProperty}, |
161 {NULL}}; | 161 {NULL}}; |
162 | 162 |
163 // This must only contain Service properties and not Device properties. | 163 // This must only contain Service properties and not Device properties. |
164 // For Device properties see kCellularDeviceTable. | 164 // For Device properties see kCellularDeviceTable. |
165 const FieldTranslationEntry cellular_fields[] = { | 165 const FieldTranslationEntry cellular_fields[] = { |
166 {::onc::cellular::kActivationType, shill::kActivationTypeProperty}, | 166 {::onc::cellular::kActivationType, shill::kActivationTypeProperty}, |
167 // This field is converted during translation, see onc_translator_*. | 167 // This field is converted during translation, see onc_translator_*. |
168 // { ::onc::cellular::kActivationState, shill::kActivationStateProperty}, | 168 // { ::onc::cellular::kActivationState, shill::kActivationStateProperty}, |
169 {::onc::vpn::kAutoConnect, shill::kAutoConnectProperty}, | 169 {::onc::vpn::kAutoConnect, shill::kAutoConnectProperty}, |
170 {::onc::cellular::kNetworkTechnology, shill::kNetworkTechnologyProperty}, | 170 // This field is converted during translation, see onc_translator_*. |
| 171 // { ::onc::cellular::kNetworkTechnology, |
| 172 // shill::kNetworkTechnologyProperty}, |
171 // This field is converted during translation, see onc_translator_*. | 173 // This field is converted during translation, see onc_translator_*. |
172 // { ::onc::cellular::kRoamingState, shill::kRoamingStateProperty}, | 174 // { ::onc::cellular::kRoamingState, shill::kRoamingStateProperty}, |
173 {::onc::cellular::kSignalStrength, shill::kSignalStrengthProperty}, | 175 {::onc::cellular::kSignalStrength, shill::kSignalStrengthProperty}, |
174 {NULL}}; | 176 {NULL}}; |
175 | 177 |
176 const FieldTranslationEntry network_fields[] = { | 178 const FieldTranslationEntry network_fields[] = { |
177 {::onc::network_config::kGUID, shill::kGuidProperty}, | 179 {::onc::network_config::kGUID, shill::kGuidProperty}, |
178 {::onc::network_config::kConnectable, shill::kConnectableProperty}, | 180 {::onc::network_config::kConnectable, shill::kConnectableProperty}, |
179 {::onc::network_config::kErrorState, shill::kErrorProperty}, | 181 {::onc::network_config::kErrorState, shill::kErrorProperty}, |
180 {::onc::network_config::kPriority, shill::kPriorityProperty}, | 182 {::onc::network_config::kPriority, shill::kPriorityProperty}, |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 {NULL}}; | 309 {NULL}}; |
308 | 310 |
309 const StringTranslationEntry kActivationStateTable[] = { | 311 const StringTranslationEntry kActivationStateTable[] = { |
310 {::onc::cellular::kActivated, shill::kActivationStateActivated}, | 312 {::onc::cellular::kActivated, shill::kActivationStateActivated}, |
311 {::onc::cellular::kActivating, shill::kActivationStateActivating}, | 313 {::onc::cellular::kActivating, shill::kActivationStateActivating}, |
312 {::onc::cellular::kNotActivated, shill::kActivationStateNotActivated}, | 314 {::onc::cellular::kNotActivated, shill::kActivationStateNotActivated}, |
313 {::onc::cellular::kPartiallyActivated, | 315 {::onc::cellular::kPartiallyActivated, |
314 shill::kActivationStatePartiallyActivated}, | 316 shill::kActivationStatePartiallyActivated}, |
315 {NULL}}; | 317 {NULL}}; |
316 | 318 |
| 319 const StringTranslationEntry kNetworkTechnologyTable[] = { |
| 320 {::onc::cellular::kTechnologyCdma1Xrtt, shill::kNetworkTechnology1Xrtt}, |
| 321 {::onc::cellular::kTechnologyGsm, shill::kNetworkTechnologyGsm}, |
| 322 {::onc::cellular::kTechnologyEdge, shill::kNetworkTechnologyEdge}, |
| 323 {::onc::cellular::kTechnologyEvdo, shill::kNetworkTechnologyEvdo}, |
| 324 {::onc::cellular::kTechnologyGprs, shill::kNetworkTechnologyGprs}, |
| 325 {::onc::cellular::kTechnologyHspa, shill::kNetworkTechnologyHspa}, |
| 326 {::onc::cellular::kTechnologyHspaPlus, shill::kNetworkTechnologyHspaPlus}, |
| 327 {::onc::cellular::kTechnologyLte, shill::kNetworkTechnologyLte}, |
| 328 {::onc::cellular::kTechnologyLteAdvanced, |
| 329 shill::kNetworkTechnologyLteAdvanced}, |
| 330 {::onc::cellular::kTechnologyUmts, shill::kNetworkTechnologyUmts}, |
| 331 {NULL}}; |
| 332 |
317 const StringTranslationEntry kRoamingStateTable[] = { | 333 const StringTranslationEntry kRoamingStateTable[] = { |
318 {::onc::cellular::kRoamingHome, shill::kRoamingStateHome}, | 334 {::onc::cellular::kRoamingHome, shill::kRoamingStateHome}, |
319 {::onc::cellular::kRoamingRoaming, shill::kRoamingStateRoaming}, | 335 {::onc::cellular::kRoamingRoaming, shill::kRoamingStateRoaming}, |
320 {NULL}}; | 336 {NULL}}; |
321 | 337 |
322 // This must contain only Shill Device properties and no Service properties. | 338 // This must contain only Shill Device properties and no Service properties. |
323 // For Service properties see cellular_fields. | 339 // For Service properties see cellular_fields. |
324 const FieldTranslationEntry kCellularDeviceTable[] = { | 340 const FieldTranslationEntry kCellularDeviceTable[] = { |
325 // This field is converted during translation, see onc_translator_*. | 341 // This field is converted during translation, see onc_translator_*. |
326 // { ::onc::cellular::kAPNList, shill::kCellularApnListProperty}, | 342 // { ::onc::cellular::kAPNList, shill::kCellularApnListProperty}, |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 continue; | 426 continue; |
411 *onc_value = table[i].onc_value; | 427 *onc_value = table[i].onc_value; |
412 return true; | 428 return true; |
413 } | 429 } |
414 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; | 430 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; |
415 return false; | 431 return false; |
416 } | 432 } |
417 | 433 |
418 } // namespace onc | 434 } // namespace onc |
419 } // namespace chromeos | 435 } // namespace chromeos |
OLD | NEW |