| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 {NULL}}; | 171 {NULL}}; |
| 172 | 172 |
| 173 // Not supported for policy but for reading network state. | 173 // Not supported for policy but for reading network state. |
| 174 const OncFieldSignature ipconfig_fields[] = { | 174 const OncFieldSignature ipconfig_fields[] = { |
| 175 { ::onc::ipconfig::kGateway, &kStringSignature}, | 175 { ::onc::ipconfig::kGateway, &kStringSignature}, |
| 176 { ::onc::ipconfig::kIPAddress, &kStringSignature}, | 176 { ::onc::ipconfig::kIPAddress, &kStringSignature}, |
| 177 { ::onc::ipconfig::kNameServers, &kStringListSignature}, | 177 { ::onc::ipconfig::kNameServers, &kStringListSignature}, |
| 178 { ::onc::ipconfig::kRoutingPrefix, &kIntegerSignature}, | 178 { ::onc::ipconfig::kRoutingPrefix, &kIntegerSignature}, |
| 179 { ::onc::network_config::kSearchDomains, &kStringListSignature}, | 179 { ::onc::network_config::kSearchDomains, &kStringListSignature}, |
| 180 { ::onc::ipconfig::kType, &kStringSignature}, | 180 { ::onc::ipconfig::kType, &kStringSignature}, |
| 181 { ::onc::ipconfig::kWebProxyAutoDiscoveryUrl, &kStringSignature}, |
| 181 {NULL}}; | 182 {NULL}}; |
| 182 | 183 |
| 183 const OncFieldSignature proxy_location_fields[] = { | 184 const OncFieldSignature proxy_location_fields[] = { |
| 184 { ::onc::proxy::kHost, &kStringSignature}, | 185 { ::onc::proxy::kHost, &kStringSignature}, |
| 185 { ::onc::proxy::kPort, &kIntegerSignature}, {NULL}}; | 186 { ::onc::proxy::kPort, &kIntegerSignature}, {NULL}}; |
| 186 | 187 |
| 187 const OncFieldSignature proxy_manual_fields[] = { | 188 const OncFieldSignature proxy_manual_fields[] = { |
| 188 { ::onc::proxy::kFtp, &kProxyLocationSignature}, | 189 { ::onc::proxy::kFtp, &kProxyLocationSignature}, |
| 189 { ::onc::proxy::kHttp, &kProxyLocationSignature}, | 190 { ::onc::proxy::kHttp, &kProxyLocationSignature}, |
| 190 { ::onc::proxy::kHttps, &kProxyLocationSignature}, | 191 { ::onc::proxy::kHttps, &kProxyLocationSignature}, |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 { ::onc::cellular::kRoamingState, &kStringSignature}, | 278 { ::onc::cellular::kRoamingState, &kStringSignature}, |
| 278 { ::onc::cellular::kSelectedNetwork, &kStringSignature}, | 279 { ::onc::cellular::kSelectedNetwork, &kStringSignature}, |
| 279 { ::onc::cellular::kServingOperator, &kCellularProviderSignature}, | 280 { ::onc::cellular::kServingOperator, &kCellularProviderSignature}, |
| 280 { ::onc::cellular::kSIMLockStatus, &kSIMLockStatusSignature}, | 281 { ::onc::cellular::kSIMLockStatus, &kSIMLockStatusSignature}, |
| 281 { ::onc::cellular::kSIMPresent, &kBoolSignature}, | 282 { ::onc::cellular::kSIMPresent, &kBoolSignature}, |
| 282 { ::onc::cellular::kSupportNetworkScan, &kBoolSignature}, | 283 { ::onc::cellular::kSupportNetworkScan, &kBoolSignature}, |
| 283 { ::onc::cellular::kSupportedCarriers, &kStringListSignature}, | 284 { ::onc::cellular::kSupportedCarriers, &kStringListSignature}, |
| 284 {NULL}}; | 285 {NULL}}; |
| 285 | 286 |
| 286 const OncFieldSignature network_configuration_fields[] = { | 287 const OncFieldSignature network_configuration_fields[] = { |
| 287 { ::onc::kRecommended, &kRecommendedSignature}, | 288 { ::onc::network_config::kCellular, &kCellularSignature}, |
| 288 { ::onc::network_config::kEthernet, &kEthernetSignature}, | 289 { ::onc::network_config::kEthernet, &kEthernetSignature}, |
| 289 { ::onc::network_config::kGUID, &kStringSignature}, | 290 { ::onc::network_config::kGUID, &kStringSignature}, |
| 291 |
| 290 // Not supported for policy but for reading network state. | 292 // Not supported for policy but for reading network state. |
| 293 // TODO(pneubeck@): Resolve IPConfigs vs. StaticIPConfig, crbug.com/410877 |
| 291 { ::onc::network_config::kIPConfigs, &kIPConfigListSignature}, | 294 { ::onc::network_config::kIPConfigs, &kIPConfigListSignature}, |
| 295 |
| 292 { ::onc::network_config::kName, &kStringSignature}, | 296 { ::onc::network_config::kName, &kStringSignature}, |
| 297 |
| 293 // Not supported, yet. | 298 // Not supported, yet. |
| 294 { ::onc::network_config::kNameServers, &kStringListSignature}, | 299 { ::onc::network_config::kNameServers, &kStringListSignature}, |
| 300 |
| 295 { ::onc::network_config::kPriority, &kIntegerSignature}, | 301 { ::onc::network_config::kPriority, &kIntegerSignature}, |
| 296 { ::onc::network_config::kProxySettings, &kProxySettingsSignature}, | 302 { ::onc::network_config::kProxySettings, &kProxySettingsSignature}, |
| 303 { ::onc::kRecommended, &kRecommendedSignature}, |
| 297 { ::onc::kRemove, &kBoolSignature}, | 304 { ::onc::kRemove, &kBoolSignature}, |
| 305 |
| 298 // Not supported, yet. | 306 // Not supported, yet. |
| 299 { ::onc::network_config::kSearchDomains, &kStringListSignature}, | 307 { ::onc::network_config::kSearchDomains, &kStringListSignature}, |
| 308 |
| 309 { ::onc::network_config::kSavedIPConfig, &kSavedIPConfigSignature}, |
| 310 { ::onc::network_config::kStaticIPConfig, &kStaticIPConfigSignature}, |
| 300 { ::onc::network_config::kType, &kStringSignature}, | 311 { ::onc::network_config::kType, &kStringSignature}, |
| 301 { ::onc::network_config::kVPN, &kVPNSignature}, | 312 { ::onc::network_config::kVPN, &kVPNSignature}, |
| 302 { ::onc::network_config::kWiFi, &kWiFiSignature}, | 313 { ::onc::network_config::kWiFi, &kWiFiSignature}, |
| 303 { ::onc::network_config::kCellular, &kCellularSignature}, | |
| 304 {NULL}}; | 314 {NULL}}; |
| 305 | 315 |
| 306 const OncFieldSignature network_with_state_fields[] = { | 316 const OncFieldSignature network_with_state_fields[] = { |
| 307 { ::onc::network_config::kCellular, &kCellularWithStateSignature}, | 317 { ::onc::network_config::kCellular, &kCellularWithStateSignature}, |
| 308 { ::onc::network_config::kConnectionState, &kStringSignature}, | 318 { ::onc::network_config::kConnectionState, &kStringSignature}, |
| 309 { ::onc::network_config::kConnectable, &kBoolSignature}, | 319 { ::onc::network_config::kConnectable, &kBoolSignature}, |
| 310 { ::onc::network_config::kErrorState, &kStringSignature}, | 320 { ::onc::network_config::kErrorState, &kStringSignature}, |
| 311 { ::onc::network_config::kMacAddress, &kStringSignature}, | 321 { ::onc::network_config::kMacAddress, &kStringSignature}, |
| 312 { ::onc::network_config::kWiFi, &kWiFiWithStateSignature}, | 322 { ::onc::network_config::kWiFi, &kWiFiWithStateSignature}, |
| 313 {NULL}}; | 323 {NULL}}; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 }; | 383 }; |
| 374 const OncValueSignature kVPNSignature = { | 384 const OncValueSignature kVPNSignature = { |
| 375 base::Value::TYPE_DICTIONARY, vpn_fields, NULL | 385 base::Value::TYPE_DICTIONARY, vpn_fields, NULL |
| 376 }; | 386 }; |
| 377 const OncValueSignature kEthernetSignature = { | 387 const OncValueSignature kEthernetSignature = { |
| 378 base::Value::TYPE_DICTIONARY, ethernet_fields, NULL | 388 base::Value::TYPE_DICTIONARY, ethernet_fields, NULL |
| 379 }; | 389 }; |
| 380 const OncValueSignature kIPConfigSignature = { | 390 const OncValueSignature kIPConfigSignature = { |
| 381 base::Value::TYPE_DICTIONARY, ipconfig_fields, NULL | 391 base::Value::TYPE_DICTIONARY, ipconfig_fields, NULL |
| 382 }; | 392 }; |
| 393 const OncValueSignature kSavedIPConfigSignature = { |
| 394 base::Value::TYPE_DICTIONARY, ipconfig_fields, NULL |
| 395 }; |
| 396 const OncValueSignature kStaticIPConfigSignature = { |
| 397 base::Value::TYPE_DICTIONARY, ipconfig_fields, NULL |
| 398 }; |
| 383 const OncValueSignature kProxyLocationSignature = { | 399 const OncValueSignature kProxyLocationSignature = { |
| 384 base::Value::TYPE_DICTIONARY, proxy_location_fields, NULL | 400 base::Value::TYPE_DICTIONARY, proxy_location_fields, NULL |
| 385 }; | 401 }; |
| 386 const OncValueSignature kProxyManualSignature = { | 402 const OncValueSignature kProxyManualSignature = { |
| 387 base::Value::TYPE_DICTIONARY, proxy_manual_fields, NULL | 403 base::Value::TYPE_DICTIONARY, proxy_manual_fields, NULL |
| 388 }; | 404 }; |
| 389 const OncValueSignature kProxySettingsSignature = { | 405 const OncValueSignature kProxySettingsSignature = { |
| 390 base::Value::TYPE_DICTIONARY, proxy_settings_fields, NULL | 406 base::Value::TYPE_DICTIONARY, proxy_settings_fields, NULL |
| 391 }; | 407 }; |
| 392 const OncValueSignature kWiFiSignature = { | 408 const OncValueSignature kWiFiSignature = { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 if (&signature == entry->value_signature && | 496 if (&signature == entry->value_signature && |
| 481 onc_field_name == entry->field_name) { | 497 onc_field_name == entry->field_name) { |
| 482 return true; | 498 return true; |
| 483 } | 499 } |
| 484 } | 500 } |
| 485 return false; | 501 return false; |
| 486 } | 502 } |
| 487 | 503 |
| 488 } // namespace onc | 504 } // namespace onc |
| 489 } // namespace chromeos | 505 } // namespace chromeos |
| OLD | NEW |