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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 {::onc::vpn::kThirdPartyVpn, &kThirdPartyVPNSignature}, | 160 {::onc::vpn::kThirdPartyVpn, &kThirdPartyVPNSignature}, |
161 {::onc::vpn::kType, &kStringSignature}, | 161 {::onc::vpn::kType, &kStringSignature}, |
162 {NULL}}; | 162 {NULL}}; |
163 | 163 |
164 const OncFieldSignature ethernet_fields[] = { | 164 const OncFieldSignature ethernet_fields[] = { |
165 {::onc::kRecommended, &kRecommendedSignature}, | 165 {::onc::kRecommended, &kRecommendedSignature}, |
166 {::onc::ethernet::kAuthentication, &kStringSignature}, | 166 {::onc::ethernet::kAuthentication, &kStringSignature}, |
167 {::onc::ethernet::kEAP, &kEAPSignature}, | 167 {::onc::ethernet::kEAP, &kEAPSignature}, |
168 {NULL}}; | 168 {NULL}}; |
169 | 169 |
170 const OncFieldSignature tether_fields[] = { | 170 const OncFieldSignature tether_fields[] = {{NULL}}; |
| 171 |
| 172 const OncFieldSignature tether_with_state_fields[] = { |
171 {::onc::tether::kBatteryPercentage, &kIntegerSignature}, | 173 {::onc::tether::kBatteryPercentage, &kIntegerSignature}, |
172 {::onc::tether::kCarrier, &kStringSignature}, | 174 {::onc::tether::kCarrier, &kStringSignature}, |
173 {::onc::tether::kSignalStrength, &kIntegerSignature}, | 175 {::onc::tether::kSignalStrength, &kIntegerSignature}, |
174 {NULL}}; | 176 {NULL}}; |
175 | 177 |
176 const OncFieldSignature ipconfig_fields[] = { | 178 const OncFieldSignature ipconfig_fields[] = { |
177 {::onc::ipconfig::kGateway, &kStringSignature}, | 179 {::onc::ipconfig::kGateway, &kStringSignature}, |
178 {::onc::ipconfig::kIPAddress, &kStringSignature}, | 180 {::onc::ipconfig::kIPAddress, &kStringSignature}, |
179 {::onc::ipconfig::kNameServers, &kStringListSignature}, | 181 {::onc::ipconfig::kNameServers, &kStringListSignature}, |
180 {::onc::ipconfig::kRoutingPrefix, &kIntegerSignature}, | 182 {::onc::ipconfig::kRoutingPrefix, &kIntegerSignature}, |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 const OncFieldSignature network_with_state_fields[] = { | 331 const OncFieldSignature network_with_state_fields[] = { |
330 {::onc::network_config::kCellular, &kCellularWithStateSignature}, | 332 {::onc::network_config::kCellular, &kCellularWithStateSignature}, |
331 {::onc::network_config::kConnectionState, &kStringSignature}, | 333 {::onc::network_config::kConnectionState, &kStringSignature}, |
332 {::onc::network_config::kConnectable, &kBoolSignature}, | 334 {::onc::network_config::kConnectable, &kBoolSignature}, |
333 {::onc::network_config::kErrorState, &kStringSignature}, | 335 {::onc::network_config::kErrorState, &kStringSignature}, |
334 {::onc::network_config::kIPConfigs, &kIPConfigListSignature}, | 336 {::onc::network_config::kIPConfigs, &kIPConfigListSignature}, |
335 {::onc::network_config::kMacAddress, &kStringSignature}, | 337 {::onc::network_config::kMacAddress, &kStringSignature}, |
336 {::onc::network_config::kRestrictedConnectivity, &kBoolSignature}, | 338 {::onc::network_config::kRestrictedConnectivity, &kBoolSignature}, |
337 {::onc::network_config::kSavedIPConfig, &kSavedIPConfigSignature}, | 339 {::onc::network_config::kSavedIPConfig, &kSavedIPConfigSignature}, |
338 {::onc::network_config::kSource, &kStringSignature}, | 340 {::onc::network_config::kSource, &kStringSignature}, |
339 {::onc::network_config::kTether, &kTetherSignature}, | 341 {::onc::network_config::kTether, &kTetherWithStateSignature}, |
340 {::onc::network_config::kWiFi, &kWiFiWithStateSignature}, | 342 {::onc::network_config::kWiFi, &kWiFiWithStateSignature}, |
341 {::onc::network_config::kWimax, &kWiMAXWithStateSignature}, | 343 {::onc::network_config::kWimax, &kWiMAXWithStateSignature}, |
342 {NULL}}; | 344 {NULL}}; |
343 | 345 |
344 const OncFieldSignature global_network_configuration_fields[] = { | 346 const OncFieldSignature global_network_configuration_fields[] = { |
345 {::onc::global_network_config::kAllowOnlyPolicyNetworksToAutoconnect, | 347 {::onc::global_network_config::kAllowOnlyPolicyNetworksToAutoconnect, |
346 &kBoolSignature}, | 348 &kBoolSignature}, |
347 {::onc::global_network_config::kAllowOnlyPolicyNetworksToConnect, | 349 {::onc::global_network_config::kAllowOnlyPolicyNetworksToConnect, |
348 &kBoolSignature}, | 350 &kBoolSignature}, |
349 {::onc::global_network_config::kDisableNetworkTypes, &kStringListSignature}, | 351 {::onc::global_network_config::kDisableNetworkTypes, &kStringListSignature}, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 const OncValueSignature kOpenVPNSignature = {base::Value::Type::DICTIONARY, | 396 const OncValueSignature kOpenVPNSignature = {base::Value::Type::DICTIONARY, |
395 openvpn_fields, NULL}; | 397 openvpn_fields, NULL}; |
396 const OncValueSignature kThirdPartyVPNSignature = { | 398 const OncValueSignature kThirdPartyVPNSignature = { |
397 base::Value::Type::DICTIONARY, third_party_vpn_fields, NULL}; | 399 base::Value::Type::DICTIONARY, third_party_vpn_fields, NULL}; |
398 const OncValueSignature kVerifyX509Signature = {base::Value::Type::DICTIONARY, | 400 const OncValueSignature kVerifyX509Signature = {base::Value::Type::DICTIONARY, |
399 verify_x509_fields, NULL}; | 401 verify_x509_fields, NULL}; |
400 const OncValueSignature kVPNSignature = {base::Value::Type::DICTIONARY, | 402 const OncValueSignature kVPNSignature = {base::Value::Type::DICTIONARY, |
401 vpn_fields, NULL}; | 403 vpn_fields, NULL}; |
402 const OncValueSignature kEthernetSignature = {base::Value::Type::DICTIONARY, | 404 const OncValueSignature kEthernetSignature = {base::Value::Type::DICTIONARY, |
403 ethernet_fields, NULL}; | 405 ethernet_fields, NULL}; |
404 const OncValueSignature kTetherSignature = {base::Value::Type::DICTIONARY, | |
405 tether_fields, NULL}; | |
406 const OncValueSignature kIPConfigSignature = {base::Value::Type::DICTIONARY, | 406 const OncValueSignature kIPConfigSignature = {base::Value::Type::DICTIONARY, |
407 ipconfig_fields, NULL}; | 407 ipconfig_fields, NULL}; |
408 const OncValueSignature kSavedIPConfigSignature = { | 408 const OncValueSignature kSavedIPConfigSignature = { |
409 base::Value::Type::DICTIONARY, ipconfig_fields, NULL}; | 409 base::Value::Type::DICTIONARY, ipconfig_fields, NULL}; |
410 const OncValueSignature kStaticIPConfigSignature = { | 410 const OncValueSignature kStaticIPConfigSignature = { |
411 base::Value::Type::DICTIONARY, ipconfig_fields, NULL}; | 411 base::Value::Type::DICTIONARY, ipconfig_fields, NULL}; |
412 const OncValueSignature kProxyLocationSignature = { | 412 const OncValueSignature kProxyLocationSignature = { |
413 base::Value::Type::DICTIONARY, proxy_location_fields, NULL}; | 413 base::Value::Type::DICTIONARY, proxy_location_fields, NULL}; |
414 const OncValueSignature kProxyManualSignature = {base::Value::Type::DICTIONARY, | 414 const OncValueSignature kProxyManualSignature = {base::Value::Type::DICTIONARY, |
415 proxy_manual_fields, NULL}; | 415 proxy_manual_fields, NULL}; |
(...skipping 16 matching lines...) Expand all Loading... |
432 const OncValueSignature kToplevelConfigurationSignature = { | 432 const OncValueSignature kToplevelConfigurationSignature = { |
433 base::Value::Type::DICTIONARY, toplevel_configuration_fields, NULL}; | 433 base::Value::Type::DICTIONARY, toplevel_configuration_fields, NULL}; |
434 | 434 |
435 // Derived "ONC with State" signatures. | 435 // Derived "ONC with State" signatures. |
436 const OncValueSignature kNetworkWithStateSignature = { | 436 const OncValueSignature kNetworkWithStateSignature = { |
437 base::Value::Type::DICTIONARY, network_with_state_fields, NULL, | 437 base::Value::Type::DICTIONARY, network_with_state_fields, NULL, |
438 &kNetworkConfigurationSignature}; | 438 &kNetworkConfigurationSignature}; |
439 const OncValueSignature kWiFiWithStateSignature = { | 439 const OncValueSignature kWiFiWithStateSignature = { |
440 base::Value::Type::DICTIONARY, wifi_with_state_fields, NULL, | 440 base::Value::Type::DICTIONARY, wifi_with_state_fields, NULL, |
441 &kWiFiSignature}; | 441 &kWiFiSignature}; |
| 442 const OncValueSignature kTetherSignature = {base::Value::Type::DICTIONARY, |
| 443 tether_fields, NULL}; |
| 444 const OncValueSignature kTetherWithStateSignature = { |
| 445 base::Value::Type::DICTIONARY, tether_with_state_fields, NULL, |
| 446 &kTetherSignature}; |
442 const OncValueSignature kWiMAXWithStateSignature = { | 447 const OncValueSignature kWiMAXWithStateSignature = { |
443 base::Value::Type::DICTIONARY, wimax_with_state_fields, NULL, | 448 base::Value::Type::DICTIONARY, wimax_with_state_fields, NULL, |
444 &kWiMAXSignature}; | 449 &kWiMAXSignature}; |
445 const OncValueSignature kCellularSignature = {base::Value::Type::DICTIONARY, | 450 const OncValueSignature kCellularSignature = {base::Value::Type::DICTIONARY, |
446 cellular_fields, NULL}; | 451 cellular_fields, NULL}; |
447 const OncValueSignature kCellularWithStateSignature = { | 452 const OncValueSignature kCellularWithStateSignature = { |
448 base::Value::Type::DICTIONARY, cellular_with_state_fields, NULL, | 453 base::Value::Type::DICTIONARY, cellular_with_state_fields, NULL, |
449 &kCellularSignature}; | 454 &kCellularSignature}; |
450 const OncValueSignature kCellularPaymentPortalSignature = { | 455 const OncValueSignature kCellularPaymentPortalSignature = { |
451 base::Value::Type::DICTIONARY, cellular_payment_portal_fields, NULL}; | 456 base::Value::Type::DICTIONARY, cellular_payment_portal_fields, NULL}; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 if (&signature == entry->value_signature && | 504 if (&signature == entry->value_signature && |
500 onc_field_name == entry->field_name) { | 505 onc_field_name == entry->field_name) { |
501 return true; | 506 return true; |
502 } | 507 } |
503 } | 508 } |
504 return false; | 509 return false; |
505 } | 510 } |
506 | 511 |
507 } // namespace onc | 512 } // namespace onc |
508 } // namespace chromeos | 513 } // namespace chromeos |
OLD | NEW |