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 // The implementation of TranslateONCObjectToShill is structured in two parts: | 5 // The implementation of TranslateONCObjectToShill is structured in two parts: |
6 // - The recursion through the existing ONC hierarchy | 6 // - The recursion through the existing ONC hierarchy |
7 // see TranslateONCHierarchy | 7 // see TranslateONCHierarchy |
8 // - The local translation of an object depending on the associated signature | 8 // - The local translation of an object depending on the associated signature |
9 // see LocalTranslator::TranslateFields | 9 // see LocalTranslator::TranslateFields |
10 | 10 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 | 213 |
214 CopyFieldsAccordingToSignature(); | 214 CopyFieldsAccordingToSignature(); |
215 } | 215 } |
216 | 216 |
217 void LocalTranslator::TranslateWiFi() { | 217 void LocalTranslator::TranslateWiFi() { |
218 std::string security; | 218 std::string security; |
219 if (onc_object_->GetStringWithoutPathExpansion(::onc::wifi::kSecurity, | 219 if (onc_object_->GetStringWithoutPathExpansion(::onc::wifi::kSecurity, |
220 &security)) { | 220 &security)) { |
221 TranslateWithTableAndSet(security, kWiFiSecurityTable, | 221 TranslateWithTableAndSet(security, kWiFiSecurityTable, |
222 shill::kSecurityClassProperty); | 222 shill::kSecurityClassProperty); |
| 223 if (security == ::onc::wifi::kWEP_8021X) { |
| 224 shill_dictionary_->SetStringWithoutPathExpansion( |
| 225 shill::kEapKeyMgmtProperty, ::onc::wifi::kKeyMgmtIEEE8021X); |
| 226 } |
223 } | 227 } |
224 | 228 |
225 // We currently only support managed and no adhoc networks. | 229 // We currently only support managed and no adhoc networks. |
226 shill_dictionary_->SetStringWithoutPathExpansion(shill::kModeProperty, | 230 shill_dictionary_->SetStringWithoutPathExpansion(shill::kModeProperty, |
227 shill::kModeManaged); | 231 shill::kModeManaged); |
228 | 232 |
229 bool allow_gateway_arp_polling; | 233 bool allow_gateway_arp_polling; |
230 if (onc_object_->GetBooleanWithoutPathExpansion( | 234 if (onc_object_->GetBooleanWithoutPathExpansion( |
231 ::onc::wifi::kAllowGatewayARPPolling, &allow_gateway_arp_polling)) { | 235 ::onc::wifi::kAllowGatewayARPPolling, &allow_gateway_arp_polling)) { |
232 shill_dictionary_->SetBooleanWithoutPathExpansion( | 236 shill_dictionary_->SetBooleanWithoutPathExpansion( |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 const OncValueSignature* onc_signature, | 418 const OncValueSignature* onc_signature, |
415 const base::DictionaryValue& onc_object) { | 419 const base::DictionaryValue& onc_object) { |
416 CHECK(onc_signature != NULL); | 420 CHECK(onc_signature != NULL); |
417 scoped_ptr<base::DictionaryValue> shill_dictionary(new base::DictionaryValue); | 421 scoped_ptr<base::DictionaryValue> shill_dictionary(new base::DictionaryValue); |
418 TranslateONCHierarchy(*onc_signature, onc_object, shill_dictionary.get()); | 422 TranslateONCHierarchy(*onc_signature, onc_object, shill_dictionary.get()); |
419 return shill_dictionary.Pass(); | 423 return shill_dictionary.Pass(); |
420 } | 424 } |
421 | 425 |
422 } // namespace onc | 426 } // namespace onc |
423 } // namespace chromeos | 427 } // namespace chromeos |
OLD | NEW |