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::kAllowOnlyPolicyNetworksToAutoconnect, |
| 268 &kBoolSignature}, |
| 269 {NULL}}; |
| 270 |
266 const OncFieldSignature certificate_fields[] = { | 271 const OncFieldSignature certificate_fields[] = { |
267 { ::onc::certificate::kGUID, &kStringSignature}, | 272 { ::onc::certificate::kGUID, &kStringSignature}, |
268 { ::onc::certificate::kPKCS12, &kStringSignature}, | 273 { ::onc::certificate::kPKCS12, &kStringSignature}, |
269 { ::onc::kRemove, &kBoolSignature}, | 274 { ::onc::kRemove, &kBoolSignature}, |
270 { ::onc::certificate::kTrustBits, &kStringListSignature}, | 275 { ::onc::certificate::kTrustBits, &kStringListSignature}, |
271 { ::onc::certificate::kType, &kStringSignature}, | 276 { ::onc::certificate::kType, &kStringSignature}, |
272 { ::onc::certificate::kX509, &kStringSignature}, | 277 { ::onc::certificate::kX509, &kStringSignature}, |
273 {NULL}}; | 278 {NULL}}; |
274 | 279 |
275 const OncFieldSignature toplevel_configuration_fields[] = { | 280 const OncFieldSignature toplevel_configuration_fields[] = { |
276 { ::onc::toplevel_config::kCertificates, &kCertificateListSignature}, | 281 { ::onc::toplevel_config::kCertificates, &kCertificateListSignature}, |
277 { ::onc::toplevel_config::kNetworkConfigurations, | 282 { ::onc::toplevel_config::kNetworkConfigurations, |
278 &kNetworkConfigurationListSignature}, | 283 &kNetworkConfigurationListSignature}, |
| 284 { ::onc::toplevel_config::kGlobalNetworkConfiguration, |
| 285 &kGlobalNetworkConfigurationSignature}, |
279 { ::onc::toplevel_config::kType, &kStringSignature}, | 286 { ::onc::toplevel_config::kType, &kStringSignature}, |
280 { ::onc::encrypted::kCipher, &kStringSignature}, | 287 { ::onc::encrypted::kCipher, &kStringSignature}, |
281 { ::onc::encrypted::kCiphertext, &kStringSignature}, | 288 { ::onc::encrypted::kCiphertext, &kStringSignature}, |
282 { ::onc::encrypted::kHMAC, &kStringSignature}, | 289 { ::onc::encrypted::kHMAC, &kStringSignature}, |
283 { ::onc::encrypted::kHMACMethod, &kStringSignature}, | 290 { ::onc::encrypted::kHMACMethod, &kStringSignature}, |
284 { ::onc::encrypted::kIV, &kStringSignature}, | 291 { ::onc::encrypted::kIV, &kStringSignature}, |
285 { ::onc::encrypted::kIterations, &kIntegerSignature}, | 292 { ::onc::encrypted::kIterations, &kIntegerSignature}, |
286 { ::onc::encrypted::kSalt, &kStringSignature}, | 293 { ::onc::encrypted::kSalt, &kStringSignature}, |
287 { ::onc::encrypted::kStretch, &kStringSignature}, {NULL}}; | 294 { ::onc::encrypted::kStretch, &kStringSignature}, {NULL}}; |
288 | 295 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 }; | 336 }; |
330 const OncValueSignature kWiFiSignature = { | 337 const OncValueSignature kWiFiSignature = { |
331 Value::TYPE_DICTIONARY, wifi_fields, NULL | 338 Value::TYPE_DICTIONARY, wifi_fields, NULL |
332 }; | 339 }; |
333 const OncValueSignature kCertificateSignature = { | 340 const OncValueSignature kCertificateSignature = { |
334 Value::TYPE_DICTIONARY, certificate_fields, NULL | 341 Value::TYPE_DICTIONARY, certificate_fields, NULL |
335 }; | 342 }; |
336 const OncValueSignature kNetworkConfigurationSignature = { | 343 const OncValueSignature kNetworkConfigurationSignature = { |
337 Value::TYPE_DICTIONARY, network_configuration_fields, NULL | 344 Value::TYPE_DICTIONARY, network_configuration_fields, NULL |
338 }; | 345 }; |
| 346 const OncValueSignature kGlobalNetworkConfigurationSignature = { |
| 347 Value::TYPE_DICTIONARY, global_network_configuration_fields, NULL |
| 348 }; |
339 const OncValueSignature kCertificateListSignature = { | 349 const OncValueSignature kCertificateListSignature = { |
340 Value::TYPE_LIST, NULL, &kCertificateSignature | 350 Value::TYPE_LIST, NULL, &kCertificateSignature |
341 }; | 351 }; |
342 const OncValueSignature kNetworkConfigurationListSignature = { | 352 const OncValueSignature kNetworkConfigurationListSignature = { |
343 Value::TYPE_LIST, NULL, &kNetworkConfigurationSignature | 353 Value::TYPE_LIST, NULL, &kNetworkConfigurationSignature |
344 }; | 354 }; |
345 const OncValueSignature kToplevelConfigurationSignature = { | 355 const OncValueSignature kToplevelConfigurationSignature = { |
346 Value::TYPE_DICTIONARY, toplevel_configuration_fields, NULL | 356 Value::TYPE_DICTIONARY, toplevel_configuration_fields, NULL |
347 }; | 357 }; |
348 | 358 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 if (&signature == entry->value_signature && | 417 if (&signature == entry->value_signature && |
408 onc_field_name == entry->field_name) { | 418 onc_field_name == entry->field_name) { |
409 return true; | 419 return true; |
410 } | 420 } |
411 } | 421 } |
412 return false; | 422 return false; |
413 } | 423 } |
414 | 424 |
415 } // namespace onc | 425 } // namespace onc |
416 } // namespace chromeos | 426 } // namespace chromeos |
OLD | NEW |