| 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_signature.h" | 5 #include "chromeos/network/onc/onc_signature.h" |
| 6 | 6 |
| 7 #include "components/onc/onc_constants.h" | 7 #include "components/onc/onc_constants.h" |
| 8 #include "third_party/cros_system_api/dbus/service_constants.h" | 8 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 9 | 9 |
| 10 using base::Value; | 10 using base::Value; |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 { ::onc::network_config::kWiFi, &kWiFiSignature}, | 256 { ::onc::network_config::kWiFi, &kWiFiSignature}, |
| 257 { ::onc::network_config::kCellular, &kCellularSignature}, | 257 { ::onc::network_config::kCellular, &kCellularSignature}, |
| 258 {NULL}}; | 258 {NULL}}; |
| 259 | 259 |
| 260 const OncFieldSignature network_with_state_fields[] = { | 260 const OncFieldSignature network_with_state_fields[] = { |
| 261 { ::onc::network_config::kCellular, &kCellularWithStateSignature}, | 261 { ::onc::network_config::kCellular, &kCellularWithStateSignature}, |
| 262 { ::onc::network_config::kConnectionState, &kStringSignature}, | 262 { ::onc::network_config::kConnectionState, &kStringSignature}, |
| 263 { ::onc::network_config::kWiFi, &kWiFiWithStateSignature}, | 263 { ::onc::network_config::kWiFi, &kWiFiWithStateSignature}, |
| 264 {NULL}}; | 264 {NULL}}; |
| 265 | 265 |
| 266 const OncFieldSignature global_network_configuration_fields[] = { |
| 267 { ::onc::global_network_config::kAllowAutoconnect, &kBoolSignature}, {NULL} |
| 268 }; |
| 269 |
| 266 const OncFieldSignature certificate_fields[] = { | 270 const OncFieldSignature certificate_fields[] = { |
| 267 { ::onc::certificate::kGUID, &kStringSignature}, | 271 { ::onc::certificate::kGUID, &kStringSignature}, |
| 268 { ::onc::certificate::kPKCS12, &kStringSignature}, | 272 { ::onc::certificate::kPKCS12, &kStringSignature}, |
| 269 { ::onc::kRemove, &kBoolSignature}, | 273 { ::onc::kRemove, &kBoolSignature}, |
| 270 { ::onc::certificate::kTrustBits, &kStringListSignature}, | 274 { ::onc::certificate::kTrustBits, &kStringListSignature}, |
| 271 { ::onc::certificate::kType, &kStringSignature}, | 275 { ::onc::certificate::kType, &kStringSignature}, |
| 272 { ::onc::certificate::kX509, &kStringSignature}, | 276 { ::onc::certificate::kX509, &kStringSignature}, |
| 273 {NULL}}; | 277 {NULL}}; |
| 274 | 278 |
| 275 const OncFieldSignature toplevel_configuration_fields[] = { | 279 const OncFieldSignature toplevel_configuration_fields[] = { |
| 276 { ::onc::toplevel_config::kCertificates, &kCertificateListSignature}, | 280 { ::onc::toplevel_config::kCertificates, &kCertificateListSignature}, |
| 277 { ::onc::toplevel_config::kNetworkConfigurations, | 281 { ::onc::toplevel_config::kNetworkConfigurations, |
| 278 &kNetworkConfigurationListSignature}, | 282 &kNetworkConfigurationListSignature}, |
| 283 { ::onc::toplevel_config::kGlobalNetworkConfiguration, |
| 284 &kGlobalNetworkConfigurationSignature}, |
| 279 { ::onc::toplevel_config::kType, &kStringSignature}, | 285 { ::onc::toplevel_config::kType, &kStringSignature}, |
| 280 { ::onc::encrypted::kCipher, &kStringSignature}, | 286 { ::onc::encrypted::kCipher, &kStringSignature}, |
| 281 { ::onc::encrypted::kCiphertext, &kStringSignature}, | 287 { ::onc::encrypted::kCiphertext, &kStringSignature}, |
| 282 { ::onc::encrypted::kHMAC, &kStringSignature}, | 288 { ::onc::encrypted::kHMAC, &kStringSignature}, |
| 283 { ::onc::encrypted::kHMACMethod, &kStringSignature}, | 289 { ::onc::encrypted::kHMACMethod, &kStringSignature}, |
| 284 { ::onc::encrypted::kIV, &kStringSignature}, | 290 { ::onc::encrypted::kIV, &kStringSignature}, |
| 285 { ::onc::encrypted::kIterations, &kIntegerSignature}, | 291 { ::onc::encrypted::kIterations, &kIntegerSignature}, |
| 286 { ::onc::encrypted::kSalt, &kStringSignature}, | 292 { ::onc::encrypted::kSalt, &kStringSignature}, |
| 287 { ::onc::encrypted::kStretch, &kStringSignature}, {NULL}}; | 293 { ::onc::encrypted::kStretch, &kStringSignature}, {NULL}}; |
| 288 | 294 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 }; | 335 }; |
| 330 const OncValueSignature kWiFiSignature = { | 336 const OncValueSignature kWiFiSignature = { |
| 331 Value::TYPE_DICTIONARY, wifi_fields, NULL | 337 Value::TYPE_DICTIONARY, wifi_fields, NULL |
| 332 }; | 338 }; |
| 333 const OncValueSignature kCertificateSignature = { | 339 const OncValueSignature kCertificateSignature = { |
| 334 Value::TYPE_DICTIONARY, certificate_fields, NULL | 340 Value::TYPE_DICTIONARY, certificate_fields, NULL |
| 335 }; | 341 }; |
| 336 const OncValueSignature kNetworkConfigurationSignature = { | 342 const OncValueSignature kNetworkConfigurationSignature = { |
| 337 Value::TYPE_DICTIONARY, network_configuration_fields, NULL | 343 Value::TYPE_DICTIONARY, network_configuration_fields, NULL |
| 338 }; | 344 }; |
| 345 const OncValueSignature kGlobalNetworkConfigurationSignature = { |
| 346 Value::TYPE_DICTIONARY, global_network_configuration_fields, NULL |
| 347 }; |
| 339 const OncValueSignature kCertificateListSignature = { | 348 const OncValueSignature kCertificateListSignature = { |
| 340 Value::TYPE_LIST, NULL, &kCertificateSignature | 349 Value::TYPE_LIST, NULL, &kCertificateSignature |
| 341 }; | 350 }; |
| 342 const OncValueSignature kNetworkConfigurationListSignature = { | 351 const OncValueSignature kNetworkConfigurationListSignature = { |
| 343 Value::TYPE_LIST, NULL, &kNetworkConfigurationSignature | 352 Value::TYPE_LIST, NULL, &kNetworkConfigurationSignature |
| 344 }; | 353 }; |
| 345 const OncValueSignature kToplevelConfigurationSignature = { | 354 const OncValueSignature kToplevelConfigurationSignature = { |
| 346 Value::TYPE_DICTIONARY, toplevel_configuration_fields, NULL | 355 Value::TYPE_DICTIONARY, toplevel_configuration_fields, NULL |
| 347 }; | 356 }; |
| 348 | 357 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 if (&signature == entry->value_signature && | 416 if (&signature == entry->value_signature && |
| 408 onc_field_name == entry->field_name) { | 417 onc_field_name == entry->field_name) { |
| 409 return true; | 418 return true; |
| 410 } | 419 } |
| 411 } | 420 } |
| 412 return false; | 421 return false; |
| 413 } | 422 } |
| 414 | 423 |
| 415 } // namespace onc | 424 } // namespace onc |
| 416 } // namespace chromeos | 425 } // namespace chromeos |
| OLD | NEW |