| 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 { ::onc::network_type::kCellular, shill::kTypeCellular}, | 278 { ::onc::network_type::kCellular, shill::kTypeCellular}, |
| 279 { ::onc::network_type::kVPN, shill::kTypeVPN}, | 279 { ::onc::network_type::kVPN, shill::kTypeVPN}, |
| 280 {NULL}}; | 280 {NULL}}; |
| 281 | 281 |
| 282 const StringTranslationEntry kVPNTypeTable[] = { | 282 const StringTranslationEntry kVPNTypeTable[] = { |
| 283 { ::onc::vpn::kTypeL2TP_IPsec, shill::kProviderL2tpIpsec}, | 283 { ::onc::vpn::kTypeL2TP_IPsec, shill::kProviderL2tpIpsec}, |
| 284 { ::onc::vpn::kOpenVPN, shill::kProviderOpenVpn}, | 284 { ::onc::vpn::kOpenVPN, shill::kProviderOpenVpn}, |
| 285 { ::onc::vpn::kThirdPartyVpn, shill::kProviderThirdPartyVpn}, | 285 { ::onc::vpn::kThirdPartyVpn, shill::kProviderThirdPartyVpn}, |
| 286 {NULL}}; | 286 {NULL}}; |
| 287 | 287 |
| 288 // The first matching line is chosen. | |
| 289 const StringTranslationEntry kWiFiSecurityTable[] = { | 288 const StringTranslationEntry kWiFiSecurityTable[] = { |
| 290 { ::onc::wifi::kSecurityNone, shill::kSecurityNone}, | 289 { ::onc::wifi::kSecurityNone, shill::kSecurityNone}, |
| 291 { ::onc::wifi::kWEP_PSK, shill::kSecurityWep}, | 290 { ::onc::wifi::kWEP_PSK, shill::kSecurityWep}, |
| 292 { ::onc::wifi::kWPA_PSK, shill::kSecurityPsk}, | 291 { ::onc::wifi::kWPA_PSK, shill::kSecurityPsk}, |
| 293 { ::onc::wifi::kWPA_EAP, shill::kSecurity8021x}, | 292 { ::onc::wifi::kWPA_EAP, shill::kSecurity8021x}, |
| 294 { ::onc::wifi::kWPA_PSK, shill::kSecurityRsn}, | |
| 295 { ::onc::wifi::kWPA_PSK, shill::kSecurityWpa}, | |
| 296 {NULL}}; | 293 {NULL}}; |
| 297 | 294 |
| 298 const StringTranslationEntry kEAPOuterTable[] = { | 295 const StringTranslationEntry kEAPOuterTable[] = { |
| 299 { ::onc::eap::kPEAP, shill::kEapMethodPEAP}, | 296 { ::onc::eap::kPEAP, shill::kEapMethodPEAP}, |
| 300 { ::onc::eap::kEAP_TLS, shill::kEapMethodTLS}, | 297 { ::onc::eap::kEAP_TLS, shill::kEapMethodTLS}, |
| 301 { ::onc::eap::kEAP_TTLS, shill::kEapMethodTTLS}, | 298 { ::onc::eap::kEAP_TTLS, shill::kEapMethodTTLS}, |
| 302 { ::onc::eap::kLEAP, shill::kEapMethodLEAP}, | 299 { ::onc::eap::kLEAP, shill::kEapMethodLEAP}, |
| 303 {NULL}}; | 300 {NULL}}; |
| 304 | 301 |
| 305 // Translation of the EAP.Inner field in case of EAP.Outer == PEAP | 302 // Translation of the EAP.Inner field in case of EAP.Outer == PEAP |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 continue; | 416 continue; |
| 420 *onc_value = table[i].onc_value; | 417 *onc_value = table[i].onc_value; |
| 421 return true; | 418 return true; |
| 422 } | 419 } |
| 423 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; | 420 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; |
| 424 return false; | 421 return false; |
| 425 } | 422 } |
| 426 | 423 |
| 427 } // namespace onc | 424 } // namespace onc |
| 428 } // namespace chromeos | 425 } // namespace chromeos |
| OLD | NEW |