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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 shill::kProviderRequiresRoamingProperty}, | 155 shill::kProviderRequiresRoamingProperty}, |
156 { ::onc::cellular::kRoamingState, shill::kRoamingStateProperty}, | 156 { ::onc::cellular::kRoamingState, shill::kRoamingStateProperty}, |
157 { ::onc::cellular::kSelectedNetwork, shill::kSelectedNetworkProperty}, | 157 { ::onc::cellular::kSelectedNetwork, shill::kSelectedNetworkProperty}, |
158 { ::onc::cellular::kSIMLockStatus, shill::kSIMLockStatusProperty}, | 158 { ::onc::cellular::kSIMLockStatus, shill::kSIMLockStatusProperty}, |
159 { ::onc::cellular::kSIMPresent, shill::kSIMPresentProperty}, | 159 { ::onc::cellular::kSIMPresent, shill::kSIMPresentProperty}, |
160 { ::onc::cellular::kSupportedCarriers, shill::kSupportedCarriersProperty}, | 160 { ::onc::cellular::kSupportedCarriers, shill::kSupportedCarriersProperty}, |
161 { ::onc::cellular::kSupportNetworkScan, shill::kSupportNetworkScanProperty}, | 161 { ::onc::cellular::kSupportNetworkScan, shill::kSupportNetworkScanProperty}, |
162 {NULL}}; | 162 {NULL}}; |
163 | 163 |
164 const FieldTranslationEntry network_fields[] = { | 164 const FieldTranslationEntry network_fields[] = { |
| 165 { ::onc::network_config::kGUID, shill::kGuidProperty}, |
| 166 { ::onc::network_config::kConnectable, shill::kConnectableProperty }, |
| 167 { ::onc::network_config::kErrorState, shill::kErrorProperty }, |
| 168 |
165 // Shill doesn't allow setting the name for non-VPN networks. | 169 // Shill doesn't allow setting the name for non-VPN networks. |
166 // This field is conditionally translated, see onc_translator_*. | 170 // Name is conditionally translated, see onc_translator_*. |
167 // { ::onc::network_config::kName, shill::kNameProperty }, | 171 // { ::onc::network_config::kName, shill::kNameProperty }, |
168 { ::onc::network_config::kGUID, shill::kGuidProperty}, | 172 |
169 // This field is converted during translation, see onc_translator_*. | 173 // Type is converted during translation, see onc_translator_*. |
170 // { ::onc::network_config::kType, shill::kTypeProperty }, | 174 // { ::onc::network_config::kType, shill::kTypeProperty }, |
171 | 175 |
172 // This field is converted during translation, see | 176 // These fields are converted during translation, see |
173 // onc_translator_shill_to_onc.cc. It is only converted when going from | 177 // onc_translator_shill_to_onc.cc. They are only converted when going from |
174 // Shill->ONC, and ignored otherwise. | 178 // Shill->ONC, and ignored otherwise. |
175 // { ::onc::network_config::kConnectionState, shill::kStateProperty }, | 179 // { ::onc::network_config::kConnectionState, shill::kStateProperty }, |
176 | 180 // { ::onc::network_config::kMacAddress, shill::kAddressProperty }, |
177 { ::onc::network_config::kConnectable, shill::kConnectableProperty }, | |
178 { ::onc::network_config::kErrorState, shill::kErrorProperty }, | |
179 {NULL}}; | 181 {NULL}}; |
180 | 182 |
181 const FieldTranslationEntry ipconfig_fields[] = { | 183 const FieldTranslationEntry ipconfig_fields[] = { |
182 { ::onc::ipconfig::kIPAddress, shill::kAddressProperty}, | 184 { ::onc::ipconfig::kIPAddress, shill::kAddressProperty}, |
183 { ::onc::ipconfig::kGateway, shill::kGatewayProperty}, | 185 { ::onc::ipconfig::kGateway, shill::kGatewayProperty}, |
184 { ::onc::ipconfig::kRoutingPrefix, shill::kPrefixlenProperty}, | 186 { ::onc::ipconfig::kRoutingPrefix, shill::kPrefixlenProperty}, |
185 { ::onc::ipconfig::kNameServers, shill::kNameServersProperty}, | 187 { ::onc::ipconfig::kNameServers, shill::kNameServersProperty}, |
186 // This field is converted during translation, see ShillToONCTranslator:: | 188 // This field is converted during translation, see ShillToONCTranslator:: |
187 // TranslateIPConfig. It is only converted from Shill->ONC. | 189 // TranslateIPConfig. It is only converted from Shill->ONC. |
188 // { ::onc::ipconfig::kType, shill::kMethodProperty}, | 190 // { ::onc::ipconfig::kType, shill::kMethodProperty}, |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 continue; | 335 continue; |
334 *onc_value = table[i].onc_value; | 336 *onc_value = table[i].onc_value; |
335 return true; | 337 return true; |
336 } | 338 } |
337 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; | 339 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; |
338 return false; | 340 return false; |
339 } | 341 } |
340 | 342 |
341 } // namespace onc | 343 } // namespace onc |
342 } // namespace chromeos | 344 } // namespace chromeos |
OLD | NEW |