Commit 419f2d3d authored by stevenjb's avatar stevenjb Committed by Commit bot

Format ONC translation files

BUG=None

Review URL: https://codereview.chromium.org/1031253002

Cr-Commit-Position: refs/heads/master@{#322338}
parent 1eeacc84
...@@ -13,469 +13,478 @@ namespace chromeos { ...@@ -13,469 +13,478 @@ namespace chromeos {
namespace onc { namespace onc {
namespace { namespace {
const OncValueSignature kBoolSignature = { const OncValueSignature kBoolSignature = {base::Value::TYPE_BOOLEAN, NULL};
base::Value::TYPE_BOOLEAN, NULL const OncValueSignature kStringSignature = {base::Value::TYPE_STRING, NULL};
}; const OncValueSignature kIntegerSignature = {base::Value::TYPE_INTEGER, NULL};
const OncValueSignature kStringSignature = { const OncValueSignature kDoubleSignature = {base::Value::TYPE_DOUBLE, NULL};
base::Value::TYPE_STRING, NULL const OncValueSignature kStringListSignature = {base::Value::TYPE_LIST,
}; NULL,
const OncValueSignature kIntegerSignature = { &kStringSignature};
base::Value::TYPE_INTEGER, NULL const OncValueSignature kIntegerListSignature = {base::Value::TYPE_LIST,
}; NULL,
const OncValueSignature kDoubleSignature = { &kIntegerSignature};
base::Value::TYPE_DOUBLE, NULL const OncValueSignature kIPConfigListSignature = {base::Value::TYPE_LIST,
}; NULL,
const OncValueSignature kStringListSignature = { &kIPConfigSignature};
base::Value::TYPE_LIST, NULL, &kStringSignature const OncValueSignature kCellularApnListSignature = {base::Value::TYPE_LIST,
}; NULL,
const OncValueSignature kIntegerListSignature = { &kCellularApnSignature};
base::Value::TYPE_LIST, NULL, &kIntegerSignature
};
const OncValueSignature kIPConfigListSignature = {
base::Value::TYPE_LIST, NULL, &kIPConfigSignature
};
const OncValueSignature kCellularApnListSignature = {
base::Value::TYPE_LIST, NULL, &kCellularApnSignature
};
const OncValueSignature kCellularFoundNetworkListSignature = { const OncValueSignature kCellularFoundNetworkListSignature = {
base::Value::TYPE_LIST, NULL, &kCellularFoundNetworkSignature base::Value::TYPE_LIST,
}; NULL,
&kCellularFoundNetworkSignature};
const OncFieldSignature issuer_subject_pattern_fields[] = { const OncFieldSignature issuer_subject_pattern_fields[] = {
{ ::onc::client_cert::kCommonName, &kStringSignature}, {::onc::client_cert::kCommonName, &kStringSignature},
{ ::onc::client_cert::kLocality, &kStringSignature}, {::onc::client_cert::kLocality, &kStringSignature},
{ ::onc::client_cert::kOrganization, &kStringSignature}, {::onc::client_cert::kOrganization, &kStringSignature},
{ ::onc::client_cert::kOrganizationalUnit, &kStringSignature}, {::onc::client_cert::kOrganizationalUnit, &kStringSignature},
{NULL}}; {NULL}};
const OncFieldSignature certificate_pattern_fields[] = { const OncFieldSignature certificate_pattern_fields[] = {
{ ::onc::kRecommended, &kRecommendedSignature}, {::onc::kRecommended, &kRecommendedSignature},
{ ::onc::client_cert::kEnrollmentURI, &kStringListSignature}, {::onc::client_cert::kEnrollmentURI, &kStringListSignature},
{ ::onc::client_cert::kIssuer, &kIssuerSubjectPatternSignature}, {::onc::client_cert::kIssuer, &kIssuerSubjectPatternSignature},
{ ::onc::client_cert::kIssuerCARef, &kStringListSignature}, {::onc::client_cert::kIssuerCARef, &kStringListSignature},
// Used internally. Not officially supported. // Used internally. Not officially supported.
{ ::onc::client_cert::kIssuerCAPEMs, &kStringListSignature}, {::onc::client_cert::kIssuerCAPEMs, &kStringListSignature},
{ ::onc::client_cert::kSubject, &kIssuerSubjectPatternSignature}, {::onc::client_cert::kSubject, &kIssuerSubjectPatternSignature},
{NULL}}; {NULL}};
const OncFieldSignature eap_fields[] = { const OncFieldSignature eap_fields[] = {
{ ::onc::kRecommended, &kRecommendedSignature}, {::onc::kRecommended, &kRecommendedSignature},
{ ::onc::eap::kAnonymousIdentity, &kStringSignature}, {::onc::eap::kAnonymousIdentity, &kStringSignature},
{ ::onc::client_cert::kClientCertPattern, &kCertificatePatternSignature}, {::onc::client_cert::kClientCertPattern, &kCertificatePatternSignature},
{ ::onc::client_cert::kClientCertRef, &kStringSignature}, {::onc::client_cert::kClientCertRef, &kStringSignature},
{ ::onc::client_cert::kClientCertType, &kStringSignature}, {::onc::client_cert::kClientCertType, &kStringSignature},
{ ::onc::eap::kIdentity, &kStringSignature}, {::onc::eap::kIdentity, &kStringSignature},
{ ::onc::eap::kInner, &kStringSignature}, {::onc::eap::kInner, &kStringSignature},
{ ::onc::eap::kOuter, &kStringSignature}, {::onc::eap::kOuter, &kStringSignature},
{ ::onc::eap::kPassword, &kStringSignature}, {::onc::eap::kPassword, &kStringSignature},
{ ::onc::eap::kSaveCredentials, &kBoolSignature}, {::onc::eap::kSaveCredentials, &kBoolSignature},
// Used internally. Not officially supported. // Used internally. Not officially supported.
{ ::onc::eap::kServerCAPEMs, &kStringListSignature}, {::onc::eap::kServerCAPEMs, &kStringListSignature},
{ ::onc::eap::kServerCARef, &kStringSignature}, {::onc::eap::kServerCARef, &kStringSignature},
{ ::onc::eap::kServerCARefs, &kStringListSignature}, {::onc::eap::kServerCARefs, &kStringListSignature},
{ ::onc::eap::kUseSystemCAs, &kBoolSignature}, {::onc::eap::kUseSystemCAs, &kBoolSignature},
{NULL}}; {NULL}};
const OncFieldSignature ipsec_fields[] = { const OncFieldSignature ipsec_fields[] = {
{ ::onc::kRecommended, &kRecommendedSignature}, {::onc::kRecommended, &kRecommendedSignature},
{ ::onc::ipsec::kAuthenticationType, &kStringSignature}, {::onc::ipsec::kAuthenticationType, &kStringSignature},
{ ::onc::client_cert::kClientCertPattern, &kCertificatePatternSignature}, {::onc::client_cert::kClientCertPattern, &kCertificatePatternSignature},
{ ::onc::client_cert::kClientCertRef, &kStringSignature}, {::onc::client_cert::kClientCertRef, &kStringSignature},
{ ::onc::client_cert::kClientCertType, &kStringSignature}, {::onc::client_cert::kClientCertType, &kStringSignature},
{ ::onc::ipsec::kGroup, &kStringSignature}, {::onc::ipsec::kGroup, &kStringSignature},
{ ::onc::ipsec::kIKEVersion, &kIntegerSignature}, {::onc::ipsec::kIKEVersion, &kIntegerSignature},
{ ::onc::ipsec::kPSK, &kStringSignature}, {::onc::ipsec::kPSK, &kStringSignature},
{ ::onc::vpn::kSaveCredentials, &kBoolSignature}, {::onc::vpn::kSaveCredentials, &kBoolSignature},
// Used internally. Not officially supported. // Used internally. Not officially supported.
{ ::onc::ipsec::kServerCAPEMs, &kStringListSignature}, {::onc::ipsec::kServerCAPEMs, &kStringListSignature},
{ ::onc::ipsec::kServerCARef, &kStringSignature}, {::onc::ipsec::kServerCARef, &kStringSignature},
{ ::onc::ipsec::kServerCARefs, &kStringListSignature}, {::onc::ipsec::kServerCARefs, &kStringListSignature},
{ ::onc::ipsec::kXAUTH, &kXAUTHSignature}, {::onc::ipsec::kXAUTH, &kXAUTHSignature},
// Not yet supported. // Not yet supported.
// { ipsec::kEAP, &kEAPSignature }, // { ipsec::kEAP, &kEAPSignature },
{NULL}}; {NULL}};
const OncFieldSignature xauth_fields[] = { const OncFieldSignature xauth_fields[] = {
{ ::onc::vpn::kPassword, &kStringSignature}, {::onc::vpn::kPassword, &kStringSignature},
{ ::onc::vpn::kUsername, &kStringSignature}, {::onc::vpn::kUsername, &kStringSignature},
{NULL}}; {NULL}};
const OncFieldSignature l2tp_fields[] = { const OncFieldSignature l2tp_fields[] = {
{ ::onc::kRecommended, &kRecommendedSignature}, {::onc::kRecommended, &kRecommendedSignature},
{ ::onc::vpn::kPassword, &kStringSignature}, {::onc::vpn::kPassword, &kStringSignature},
{ ::onc::vpn::kSaveCredentials, &kBoolSignature}, {::onc::vpn::kSaveCredentials, &kBoolSignature},
{ ::onc::vpn::kUsername, &kStringSignature}, {::onc::vpn::kUsername, &kStringSignature},
{NULL}}; {NULL}};
const OncFieldSignature openvpn_fields[] = { const OncFieldSignature openvpn_fields[] = {
{ ::onc::kRecommended, &kRecommendedSignature}, {::onc::kRecommended, &kRecommendedSignature},
{ ::onc::openvpn::kAuth, &kStringSignature}, {::onc::openvpn::kAuth, &kStringSignature},
{ ::onc::openvpn::kAuthNoCache, &kBoolSignature}, {::onc::openvpn::kAuthNoCache, &kBoolSignature},
{ ::onc::openvpn::kAuthRetry, &kStringSignature}, {::onc::openvpn::kAuthRetry, &kStringSignature},
{ ::onc::openvpn::kCipher, &kStringSignature}, {::onc::openvpn::kCipher, &kStringSignature},
{ ::onc::client_cert::kClientCertPattern, &kCertificatePatternSignature}, {::onc::client_cert::kClientCertPattern, &kCertificatePatternSignature},
{ ::onc::client_cert::kClientCertRef, &kStringSignature}, {::onc::client_cert::kClientCertRef, &kStringSignature},
{ ::onc::client_cert::kClientCertType, &kStringSignature}, {::onc::client_cert::kClientCertType, &kStringSignature},
{ ::onc::openvpn::kCompLZO, &kStringSignature}, {::onc::openvpn::kCompLZO, &kStringSignature},
{ ::onc::openvpn::kCompNoAdapt, &kBoolSignature}, {::onc::openvpn::kCompNoAdapt, &kBoolSignature},
{ ::onc::openvpn::kIgnoreDefaultRoute, &kBoolSignature}, {::onc::openvpn::kIgnoreDefaultRoute, &kBoolSignature},
{ ::onc::openvpn::kKeyDirection, &kStringSignature}, {::onc::openvpn::kKeyDirection, &kStringSignature},
{ ::onc::openvpn::kNsCertType, &kStringSignature}, {::onc::openvpn::kNsCertType, &kStringSignature},
{ ::onc::openvpn::kOTP, &kStringSignature}, {::onc::openvpn::kOTP, &kStringSignature},
{ ::onc::openvpn::kPassword, &kStringSignature}, {::onc::openvpn::kPassword, &kStringSignature},
{ ::onc::openvpn::kPort, &kIntegerSignature}, {::onc::openvpn::kPort, &kIntegerSignature},
{ ::onc::openvpn::kProto, &kStringSignature}, {::onc::openvpn::kProto, &kStringSignature},
{ ::onc::openvpn::kPushPeerInfo, &kBoolSignature}, {::onc::openvpn::kPushPeerInfo, &kBoolSignature},
{ ::onc::openvpn::kRemoteCertEKU, &kStringSignature}, {::onc::openvpn::kRemoteCertEKU, &kStringSignature},
{ ::onc::openvpn::kRemoteCertKU, &kStringListSignature}, {::onc::openvpn::kRemoteCertKU, &kStringListSignature},
{ ::onc::openvpn::kRemoteCertTLS, &kStringSignature}, {::onc::openvpn::kRemoteCertTLS, &kStringSignature},
{ ::onc::openvpn::kRenegSec, &kIntegerSignature}, {::onc::openvpn::kRenegSec, &kIntegerSignature},
{ ::onc::vpn::kSaveCredentials, &kBoolSignature}, {::onc::vpn::kSaveCredentials, &kBoolSignature},
// Used internally. Not officially supported. // Used internally. Not officially supported.
{ ::onc::openvpn::kServerCAPEMs, &kStringListSignature}, {::onc::openvpn::kServerCAPEMs, &kStringListSignature},
{ ::onc::openvpn::kServerCARef, &kStringSignature}, {::onc::openvpn::kServerCARef, &kStringSignature},
{ ::onc::openvpn::kServerCARefs, &kStringListSignature}, {::onc::openvpn::kServerCARefs, &kStringListSignature},
// Not supported, yet. // Not supported, yet.
{ ::onc::openvpn::kServerCertPEM, &kStringSignature}, {::onc::openvpn::kServerCertPEM, &kStringSignature},
{ ::onc::openvpn::kServerCertRef, &kStringSignature}, {::onc::openvpn::kServerCertRef, &kStringSignature},
{ ::onc::openvpn::kServerPollTimeout, &kIntegerSignature}, {::onc::openvpn::kServerPollTimeout, &kIntegerSignature},
{ ::onc::openvpn::kShaper, &kIntegerSignature}, {::onc::openvpn::kShaper, &kIntegerSignature},
{ ::onc::openvpn::kStaticChallenge, &kStringSignature}, {::onc::openvpn::kStaticChallenge, &kStringSignature},
{ ::onc::openvpn::kTLSAuthContents, &kStringSignature}, {::onc::openvpn::kTLSAuthContents, &kStringSignature},
{ ::onc::openvpn::kTLSRemote, &kStringSignature}, {::onc::openvpn::kTLSRemote, &kStringSignature},
{ ::onc::openvpn::kUserAuthenticationType, &kStringSignature}, {::onc::openvpn::kUserAuthenticationType, &kStringSignature},
{ ::onc::vpn::kUsername, &kStringSignature}, {::onc::vpn::kUsername, &kStringSignature},
// Not supported, yet. // Not supported, yet.
{ ::onc::openvpn::kVerb, &kStringSignature}, {::onc::openvpn::kVerb, &kStringSignature},
{ ::onc::openvpn::kVerifyHash, &kStringSignature}, {::onc::openvpn::kVerifyHash, &kStringSignature},
{ ::onc::openvpn::kVerifyX509, &kVerifyX509Signature}, {::onc::openvpn::kVerifyX509, &kVerifyX509Signature},
{NULL}}; {NULL}};
const OncFieldSignature third_party_vpn_fields[] = { const OncFieldSignature third_party_vpn_fields[] = {
{ ::onc::kRecommended, &kRecommendedSignature}, {::onc::kRecommended, &kRecommendedSignature},
{ ::onc::third_party_vpn::kExtensionID, &kStringSignature}, {::onc::third_party_vpn::kExtensionID, &kStringSignature},
{NULL}}; {NULL}};
const OncFieldSignature verify_x509_fields[] = { const OncFieldSignature verify_x509_fields[] = {
{ ::onc::verify_x509::kName, &kStringSignature}, {::onc::verify_x509::kName, &kStringSignature},
{ ::onc::verify_x509::kType, &kStringSignature}, {::onc::verify_x509::kType, &kStringSignature},
{NULL}}; {NULL}};
const OncFieldSignature vpn_fields[] = { const OncFieldSignature vpn_fields[] = {
{ ::onc::kRecommended, &kRecommendedSignature}, {::onc::kRecommended, &kRecommendedSignature},
{ ::onc::vpn::kAutoConnect, &kBoolSignature}, {::onc::vpn::kAutoConnect, &kBoolSignature},
{ ::onc::vpn::kHost, &kStringSignature}, {::onc::vpn::kHost, &kStringSignature},
{ ::onc::vpn::kIPsec, &kIPsecSignature}, {::onc::vpn::kIPsec, &kIPsecSignature},
{ ::onc::vpn::kL2TP, &kL2TPSignature}, {::onc::vpn::kL2TP, &kL2TPSignature},
{ ::onc::vpn::kOpenVPN, &kOpenVPNSignature}, {::onc::vpn::kOpenVPN, &kOpenVPNSignature},
{ ::onc::vpn::kThirdPartyVpn, &kThirdPartyVPNSignature}, {::onc::vpn::kThirdPartyVpn, &kThirdPartyVPNSignature},
{ ::onc::vpn::kType, &kStringSignature}, {::onc::vpn::kType, &kStringSignature},
{NULL}}; {NULL}};
const OncFieldSignature ethernet_fields[] = { const OncFieldSignature ethernet_fields[] = {
{ ::onc::kRecommended, &kRecommendedSignature}, {::onc::kRecommended, &kRecommendedSignature},
{ ::onc::ethernet::kAuthentication, &kStringSignature}, {::onc::ethernet::kAuthentication, &kStringSignature},
{ ::onc::ethernet::kEAP, &kEAPSignature}, {::onc::ethernet::kEAP, &kEAPSignature},
{NULL}}; {NULL}};
const OncFieldSignature ipconfig_fields[] = { const OncFieldSignature ipconfig_fields[] = {
{ ::onc::ipconfig::kGateway, &kStringSignature}, {::onc::ipconfig::kGateway, &kStringSignature},
{ ::onc::ipconfig::kIPAddress, &kStringSignature}, {::onc::ipconfig::kIPAddress, &kStringSignature},
{ ::onc::ipconfig::kNameServers, &kStringListSignature}, {::onc::ipconfig::kNameServers, &kStringListSignature},
{ ::onc::ipconfig::kRoutingPrefix, &kIntegerSignature}, {::onc::ipconfig::kRoutingPrefix, &kIntegerSignature},
{ ::onc::ipconfig::kSearchDomains, &kStringListSignature}, {::onc::ipconfig::kSearchDomains, &kStringListSignature},
{ ::onc::ipconfig::kType, &kStringSignature}, {::onc::ipconfig::kType, &kStringSignature},
{ ::onc::ipconfig::kWebProxyAutoDiscoveryUrl, &kStringSignature}, {::onc::ipconfig::kWebProxyAutoDiscoveryUrl, &kStringSignature},
{NULL}}; {NULL}};
const OncFieldSignature proxy_location_fields[] = { const OncFieldSignature proxy_location_fields[] = {
{ ::onc::proxy::kHost, &kStringSignature}, {::onc::proxy::kHost, &kStringSignature},
{ ::onc::proxy::kPort, &kIntegerSignature}, {NULL}}; {::onc::proxy::kPort, &kIntegerSignature},
{NULL}};
const OncFieldSignature proxy_manual_fields[] = { const OncFieldSignature proxy_manual_fields[] = {
{ ::onc::proxy::kFtp, &kProxyLocationSignature}, {::onc::proxy::kFtp, &kProxyLocationSignature},
{ ::onc::proxy::kHttp, &kProxyLocationSignature}, {::onc::proxy::kHttp, &kProxyLocationSignature},
{ ::onc::proxy::kHttps, &kProxyLocationSignature}, {::onc::proxy::kHttps, &kProxyLocationSignature},
{ ::onc::proxy::kSocks, &kProxyLocationSignature}, {::onc::proxy::kSocks, &kProxyLocationSignature},
{NULL}}; {NULL}};
const OncFieldSignature proxy_settings_fields[] = { const OncFieldSignature proxy_settings_fields[] = {
{ ::onc::kRecommended, &kRecommendedSignature}, {::onc::kRecommended, &kRecommendedSignature},
{ ::onc::proxy::kExcludeDomains, &kStringListSignature}, {::onc::proxy::kExcludeDomains, &kStringListSignature},
{ ::onc::proxy::kManual, &kProxyManualSignature}, {::onc::proxy::kManual, &kProxyManualSignature},
{ ::onc::proxy::kPAC, &kStringSignature}, {::onc::proxy::kPAC, &kStringSignature},
{ ::onc::proxy::kType, &kStringSignature}, {::onc::proxy::kType, &kStringSignature},
{NULL}}; {NULL}};
const OncFieldSignature wifi_fields[] = { const OncFieldSignature wifi_fields[] = {
{ ::onc::kRecommended, &kRecommendedSignature}, {::onc::kRecommended, &kRecommendedSignature},
{ ::onc::wifi::kAllowGatewayARPPolling, &kBoolSignature}, {::onc::wifi::kAllowGatewayARPPolling, &kBoolSignature},
{ ::onc::wifi::kAutoConnect, &kBoolSignature}, {::onc::wifi::kAutoConnect, &kBoolSignature},
{ ::onc::wifi::kEAP, &kEAPSignature}, {::onc::wifi::kEAP, &kEAPSignature},
{ ::onc::wifi::kHexSSID, &kStringSignature}, {::onc::wifi::kHexSSID, &kStringSignature},
{ ::onc::wifi::kHiddenSSID, &kBoolSignature}, {::onc::wifi::kHiddenSSID, &kBoolSignature},
{ ::onc::wifi::kPassphrase, &kStringSignature}, {::onc::wifi::kPassphrase, &kStringSignature},
{ ::onc::wifi::kSSID, &kStringSignature}, {::onc::wifi::kSSID, &kStringSignature},
{ ::onc::wifi::kSecurity, &kStringSignature}, {::onc::wifi::kSecurity, &kStringSignature},
{NULL}}; {NULL}};
const OncFieldSignature wifi_with_state_fields[] = { const OncFieldSignature wifi_with_state_fields[] = {
{ ::onc::wifi::kBSSID, &kStringSignature}, {::onc::wifi::kBSSID, &kStringSignature},
{ ::onc::wifi::kFrequency, &kIntegerSignature}, {::onc::wifi::kFrequency, &kIntegerSignature},
{ ::onc::wifi::kFrequencyList, &kIntegerListSignature}, {::onc::wifi::kFrequencyList, &kIntegerListSignature},
{ ::onc::wifi::kSignalStrength, &kIntegerSignature}, {::onc::wifi::kSignalStrength, &kIntegerSignature},
{NULL}}; {NULL}};
const OncFieldSignature wimax_fields[] = { const OncFieldSignature wimax_fields[] = {
{ ::onc::kRecommended, &kRecommendedSignature}, {::onc::kRecommended, &kRecommendedSignature},
{ ::onc::wimax::kAutoConnect, &kBoolSignature}, {::onc::wimax::kAutoConnect, &kBoolSignature},
{ ::onc::wimax::kEAP, &kEAPSignature}, {::onc::wimax::kEAP, &kEAPSignature},
{NULL}}; {NULL}};
const OncFieldSignature wimax_with_state_fields[] = { const OncFieldSignature wimax_with_state_fields[] = {
{ ::onc::wimax::kSignalStrength, &kIntegerSignature}, {::onc::wimax::kSignalStrength, &kIntegerSignature},
{NULL}}; {NULL}};
const OncFieldSignature cellular_provider_fields[] = { const OncFieldSignature cellular_provider_fields[] = {
{ ::onc::cellular_provider::kCode, &kStringSignature}, {::onc::cellular_provider::kCode, &kStringSignature},
{ ::onc::cellular_provider::kCountry, &kStringSignature}, {::onc::cellular_provider::kCountry, &kStringSignature},
{ ::onc::cellular_provider::kName, &kStringSignature}, {::onc::cellular_provider::kName, &kStringSignature},
{NULL}}; {NULL}};
const OncFieldSignature cellular_apn_fields[] = { const OncFieldSignature cellular_apn_fields[] = {
{ ::onc::cellular_apn::kAccessPointName, &kStringSignature}, {::onc::cellular_apn::kAccessPointName, &kStringSignature},
{ ::onc::cellular_apn::kName, &kStringSignature}, {::onc::cellular_apn::kName, &kStringSignature},
{ ::onc::cellular_apn::kUsername, &kStringSignature}, {::onc::cellular_apn::kUsername, &kStringSignature},
{ ::onc::cellular_apn::kPassword, &kStringSignature}, {::onc::cellular_apn::kPassword, &kStringSignature},
{ ::onc::cellular_apn::kLocalizedName, &kStringSignature}, {::onc::cellular_apn::kLocalizedName, &kStringSignature},
{ ::onc::cellular_apn::kLanguage, &kStringSignature}, {::onc::cellular_apn::kLanguage, &kStringSignature},
{NULL}}; {NULL}};
const OncFieldSignature cellular_found_network_fields[] = { const OncFieldSignature cellular_found_network_fields[] = {
{ ::onc::cellular_found_network::kStatus, &kStringSignature}, {::onc::cellular_found_network::kStatus, &kStringSignature},
{ ::onc::cellular_found_network::kNetworkId, &kStringSignature}, {::onc::cellular_found_network::kNetworkId, &kStringSignature},
{ ::onc::cellular_found_network::kShortName, &kStringSignature}, {::onc::cellular_found_network::kShortName, &kStringSignature},
{ ::onc::cellular_found_network::kLongName, &kStringSignature}, {::onc::cellular_found_network::kLongName, &kStringSignature},
{ ::onc::cellular_found_network::kTechnology, &kStringSignature}, {::onc::cellular_found_network::kTechnology, &kStringSignature},
{NULL}}; {NULL}};
const OncFieldSignature sim_lock_status_fields[] = { const OncFieldSignature sim_lock_status_fields[] = {
{ ::onc::sim_lock_status::kLockEnabled, &kBoolSignature}, {::onc::sim_lock_status::kLockEnabled, &kBoolSignature},
{ ::onc::sim_lock_status::kLockType, &kStringSignature}, {::onc::sim_lock_status::kLockType, &kStringSignature},
{ ::onc::sim_lock_status::kRetriesLeft, &kDoubleSignature}, {::onc::sim_lock_status::kRetriesLeft, &kDoubleSignature},
{NULL}}; {NULL}};
const OncFieldSignature cellular_fields[] = { const OncFieldSignature cellular_fields[] = {
{ ::onc::kRecommended, &kRecommendedSignature}, {::onc::kRecommended, &kRecommendedSignature},
{ ::onc::cellular::kAPN, &kCellularApnSignature }, {::onc::cellular::kAPN, &kCellularApnSignature},
{ ::onc::cellular::kAPNList, &kCellularApnListSignature}, {::onc::cellular::kAPNList, &kCellularApnListSignature},
{ ::onc::vpn::kAutoConnect, &kBoolSignature}, {::onc::vpn::kAutoConnect, &kBoolSignature},
{NULL}}; {NULL}};
const OncFieldSignature cellular_with_state_fields[] = { const OncFieldSignature cellular_with_state_fields[] = {
{ ::onc::cellular::kActivationType, &kStringSignature}, {::onc::cellular::kActivationType, &kStringSignature},
{ ::onc::cellular::kActivationState, &kStringSignature}, {::onc::cellular::kActivationState, &kStringSignature},
{ ::onc::cellular::kAllowRoaming, &kBoolSignature}, {::onc::cellular::kAllowRoaming, &kBoolSignature},
{ ::onc::cellular::kCarrier, &kStringSignature}, {::onc::cellular::kCarrier, &kStringSignature},
{ ::onc::cellular::kESN, &kStringSignature}, {::onc::cellular::kESN, &kStringSignature},
{ ::onc::cellular::kFamily, &kStringSignature}, {::onc::cellular::kFamily, &kStringSignature},
{ ::onc::cellular::kFirmwareRevision, &kStringSignature}, {::onc::cellular::kFirmwareRevision, &kStringSignature},
{ ::onc::cellular::kFoundNetworks, &kCellularFoundNetworkListSignature}, {::onc::cellular::kFoundNetworks, &kCellularFoundNetworkListSignature},
{ ::onc::cellular::kHardwareRevision, &kStringSignature}, {::onc::cellular::kHardwareRevision, &kStringSignature},
{ ::onc::cellular::kHomeProvider, &kCellularProviderSignature}, {::onc::cellular::kHomeProvider, &kCellularProviderSignature},
{ ::onc::cellular::kICCID, &kStringSignature}, {::onc::cellular::kICCID, &kStringSignature},
{ ::onc::cellular::kIMEI, &kStringSignature}, {::onc::cellular::kIMEI, &kStringSignature},
{ ::onc::cellular::kIMSI, &kStringSignature}, {::onc::cellular::kIMSI, &kStringSignature},
{ ::onc::cellular::kLastGoodAPN, &kCellularApnSignature }, {::onc::cellular::kLastGoodAPN, &kCellularApnSignature},
{ ::onc::cellular::kManufacturer, &kStringSignature}, {::onc::cellular::kManufacturer, &kStringSignature},
{ ::onc::cellular::kMDN, &kStringSignature}, {::onc::cellular::kMDN, &kStringSignature},
{ ::onc::cellular::kMEID, &kStringSignature}, {::onc::cellular::kMEID, &kStringSignature},
{ ::onc::cellular::kMIN, &kStringSignature}, {::onc::cellular::kMIN, &kStringSignature},
{ ::onc::cellular::kModelID, &kStringSignature}, {::onc::cellular::kModelID, &kStringSignature},
{ ::onc::cellular::kNetworkTechnology, &kStringSignature}, {::onc::cellular::kNetworkTechnology, &kStringSignature},
{ ::onc::cellular::kPRLVersion, &kIntegerSignature}, {::onc::cellular::kPRLVersion, &kIntegerSignature},
{ ::onc::cellular::kRoamingState, &kStringSignature}, {::onc::cellular::kRoamingState, &kStringSignature},
{ ::onc::cellular::kServingOperator, &kCellularProviderSignature}, {::onc::cellular::kServingOperator, &kCellularProviderSignature},
{ ::onc::cellular::kSignalStrength, &kIntegerSignature}, {::onc::cellular::kSignalStrength, &kIntegerSignature},
{ ::onc::cellular::kSIMLockStatus, &kSIMLockStatusSignature}, {::onc::cellular::kSIMLockStatus, &kSIMLockStatusSignature},
{ ::onc::cellular::kSIMPresent, &kBoolSignature}, {::onc::cellular::kSIMPresent, &kBoolSignature},
{ ::onc::cellular::kSupportNetworkScan, &kBoolSignature}, {::onc::cellular::kSupportNetworkScan, &kBoolSignature},
{ ::onc::cellular::kSupportedCarriers, &kStringListSignature}, {::onc::cellular::kSupportedCarriers, &kStringListSignature},
{NULL}}; {NULL}};
const OncFieldSignature network_configuration_fields[] = { const OncFieldSignature network_configuration_fields[] = {
{ ::onc::network_config::kCellular, &kCellularSignature}, {::onc::network_config::kCellular, &kCellularSignature},
{ ::onc::network_config::kEthernet, &kEthernetSignature}, {::onc::network_config::kEthernet, &kEthernetSignature},
{ ::onc::network_config::kGUID, &kStringSignature}, {::onc::network_config::kGUID, &kStringSignature},
{ ::onc::network_config::kIPAddressConfigType, &kStringSignature}, {::onc::network_config::kIPAddressConfigType, &kStringSignature},
{ ::onc::network_config::kName, &kStringSignature}, {::onc::network_config::kName, &kStringSignature},
{ ::onc::network_config::kNameServersConfigType, &kStringSignature}, {::onc::network_config::kNameServersConfigType, &kStringSignature},
{ ::onc::network_config::kPriority, &kIntegerSignature}, {::onc::network_config::kPriority, &kIntegerSignature},
{ ::onc::network_config::kProxySettings, &kProxySettingsSignature}, {::onc::network_config::kProxySettings, &kProxySettingsSignature},
{ ::onc::kRecommended, &kRecommendedSignature}, {::onc::kRecommended, &kRecommendedSignature},
{ ::onc::kRemove, &kBoolSignature}, {::onc::kRemove, &kBoolSignature},
{ ::onc::network_config::kStaticIPConfig, &kStaticIPConfigSignature}, {::onc::network_config::kStaticIPConfig, &kStaticIPConfigSignature},
{ ::onc::network_config::kType, &kStringSignature}, {::onc::network_config::kType, &kStringSignature},
{ ::onc::network_config::kVPN, &kVPNSignature}, {::onc::network_config::kVPN, &kVPNSignature},
{ ::onc::network_config::kWiFi, &kWiFiSignature}, {::onc::network_config::kWiFi, &kWiFiSignature},
{ ::onc::network_config::kWimax, &kWiMAXSignature}, {::onc::network_config::kWimax, &kWiMAXSignature},
{NULL}}; {NULL}};
const OncFieldSignature network_with_state_fields[] = { const OncFieldSignature network_with_state_fields[] = {
{ ::onc::network_config::kCellular, &kCellularWithStateSignature}, {::onc::network_config::kCellular, &kCellularWithStateSignature},
{ ::onc::network_config::kConnectionState, &kStringSignature}, {::onc::network_config::kConnectionState, &kStringSignature},
{ ::onc::network_config::kConnectable, &kBoolSignature}, {::onc::network_config::kConnectable, &kBoolSignature},
{ ::onc::network_config::kErrorState, &kStringSignature}, {::onc::network_config::kErrorState, &kStringSignature},
{ ::onc::network_config::kIPConfigs, &kIPConfigListSignature}, {::onc::network_config::kIPConfigs, &kIPConfigListSignature},
{ ::onc::network_config::kMacAddress, &kStringSignature}, {::onc::network_config::kMacAddress, &kStringSignature},
{ ::onc::network_config::kRestrictedConnectivity, &kBoolSignature}, {::onc::network_config::kRestrictedConnectivity, &kBoolSignature},
{ ::onc::network_config::kSavedIPConfig, &kSavedIPConfigSignature}, {::onc::network_config::kSavedIPConfig, &kSavedIPConfigSignature},
{ ::onc::network_config::kSource, &kStringSignature}, {::onc::network_config::kSource, &kStringSignature},
{ ::onc::network_config::kWiFi, &kWiFiWithStateSignature}, {::onc::network_config::kWiFi, &kWiFiWithStateSignature},
{ ::onc::network_config::kWimax, &kWiMAXWithStateSignature}, {::onc::network_config::kWimax, &kWiMAXWithStateSignature},
{NULL}}; {NULL}};
const OncFieldSignature global_network_configuration_fields[] = { const OncFieldSignature global_network_configuration_fields[] = {
{ ::onc::global_network_config::kAllowOnlyPolicyNetworksToAutoconnect, {::onc::global_network_config::kAllowOnlyPolicyNetworksToAutoconnect,
&kBoolSignature}, &kBoolSignature},
{NULL}}; {NULL}};
const OncFieldSignature certificate_fields[] = { const OncFieldSignature certificate_fields[] = {
{ ::onc::certificate::kGUID, &kStringSignature}, {::onc::certificate::kGUID, &kStringSignature},
{ ::onc::certificate::kPKCS12, &kStringSignature}, {::onc::certificate::kPKCS12, &kStringSignature},
{ ::onc::kRemove, &kBoolSignature}, {::onc::kRemove, &kBoolSignature},
{ ::onc::certificate::kTrustBits, &kStringListSignature}, {::onc::certificate::kTrustBits, &kStringListSignature},
{ ::onc::certificate::kType, &kStringSignature}, {::onc::certificate::kType, &kStringSignature},
{ ::onc::certificate::kX509, &kStringSignature}, {::onc::certificate::kX509, &kStringSignature},
{NULL}}; {NULL}};
const OncFieldSignature toplevel_configuration_fields[] = { const OncFieldSignature toplevel_configuration_fields[] = {
{ ::onc::toplevel_config::kCertificates, &kCertificateListSignature}, {::onc::toplevel_config::kCertificates, &kCertificateListSignature},
{ ::onc::toplevel_config::kNetworkConfigurations, {::onc::toplevel_config::kNetworkConfigurations,
&kNetworkConfigurationListSignature}, &kNetworkConfigurationListSignature},
{ ::onc::toplevel_config::kGlobalNetworkConfiguration, {::onc::toplevel_config::kGlobalNetworkConfiguration,
&kGlobalNetworkConfigurationSignature}, &kGlobalNetworkConfigurationSignature},
{ ::onc::toplevel_config::kType, &kStringSignature}, {::onc::toplevel_config::kType, &kStringSignature},
{ ::onc::encrypted::kCipher, &kStringSignature}, {::onc::encrypted::kCipher, &kStringSignature},
{ ::onc::encrypted::kCiphertext, &kStringSignature}, {::onc::encrypted::kCiphertext, &kStringSignature},
{ ::onc::encrypted::kHMAC, &kStringSignature}, {::onc::encrypted::kHMAC, &kStringSignature},
{ ::onc::encrypted::kHMACMethod, &kStringSignature}, {::onc::encrypted::kHMACMethod, &kStringSignature},
{ ::onc::encrypted::kIV, &kStringSignature}, {::onc::encrypted::kIV, &kStringSignature},
{ ::onc::encrypted::kIterations, &kIntegerSignature}, {::onc::encrypted::kIterations, &kIntegerSignature},
{ ::onc::encrypted::kSalt, &kStringSignature}, {::onc::encrypted::kSalt, &kStringSignature},
{ ::onc::encrypted::kStretch, &kStringSignature}, {NULL}}; {::onc::encrypted::kStretch, &kStringSignature},
{NULL}};
} // namespace } // namespace
const OncValueSignature kRecommendedSignature = { const OncValueSignature kRecommendedSignature = {base::Value::TYPE_LIST,
base::Value::TYPE_LIST, NULL, &kStringSignature NULL,
}; &kStringSignature};
const OncValueSignature kEAPSignature = { const OncValueSignature kEAPSignature = {base::Value::TYPE_DICTIONARY,
base::Value::TYPE_DICTIONARY, eap_fields, NULL eap_fields,
}; NULL};
const OncValueSignature kIssuerSubjectPatternSignature = { const OncValueSignature kIssuerSubjectPatternSignature = {
base::Value::TYPE_DICTIONARY, issuer_subject_pattern_fields, NULL base::Value::TYPE_DICTIONARY,
}; issuer_subject_pattern_fields,
NULL};
const OncValueSignature kCertificatePatternSignature = { const OncValueSignature kCertificatePatternSignature = {
base::Value::TYPE_DICTIONARY, certificate_pattern_fields, NULL base::Value::TYPE_DICTIONARY,
}; certificate_pattern_fields,
const OncValueSignature kIPsecSignature = { NULL};
base::Value::TYPE_DICTIONARY, ipsec_fields, NULL const OncValueSignature kIPsecSignature = {base::Value::TYPE_DICTIONARY,
}; ipsec_fields,
const OncValueSignature kXAUTHSignature = { NULL};
base::Value::TYPE_DICTIONARY, xauth_fields, NULL const OncValueSignature kXAUTHSignature = {base::Value::TYPE_DICTIONARY,
}; xauth_fields,
const OncValueSignature kL2TPSignature = { NULL};
base::Value::TYPE_DICTIONARY, l2tp_fields, NULL const OncValueSignature kL2TPSignature = {base::Value::TYPE_DICTIONARY,
}; l2tp_fields,
const OncValueSignature kOpenVPNSignature = { NULL};
base::Value::TYPE_DICTIONARY, openvpn_fields, NULL const OncValueSignature kOpenVPNSignature = {base::Value::TYPE_DICTIONARY,
}; openvpn_fields,
const OncValueSignature kThirdPartyVPNSignature = { NULL};
base::Value::TYPE_DICTIONARY, third_party_vpn_fields, NULL const OncValueSignature kThirdPartyVPNSignature = {base::Value::TYPE_DICTIONARY,
}; third_party_vpn_fields,
const OncValueSignature kVerifyX509Signature = { NULL};
base::Value::TYPE_DICTIONARY, verify_x509_fields, NULL const OncValueSignature kVerifyX509Signature = {base::Value::TYPE_DICTIONARY,
}; verify_x509_fields,
const OncValueSignature kVPNSignature = { NULL};
base::Value::TYPE_DICTIONARY, vpn_fields, NULL const OncValueSignature kVPNSignature = {base::Value::TYPE_DICTIONARY,
}; vpn_fields,
const OncValueSignature kEthernetSignature = { NULL};
base::Value::TYPE_DICTIONARY, ethernet_fields, NULL const OncValueSignature kEthernetSignature = {base::Value::TYPE_DICTIONARY,
}; ethernet_fields,
const OncValueSignature kIPConfigSignature = { NULL};
base::Value::TYPE_DICTIONARY, ipconfig_fields, NULL const OncValueSignature kIPConfigSignature = {base::Value::TYPE_DICTIONARY,
}; ipconfig_fields,
const OncValueSignature kSavedIPConfigSignature = { NULL};
base::Value::TYPE_DICTIONARY, ipconfig_fields, NULL const OncValueSignature kSavedIPConfigSignature = {base::Value::TYPE_DICTIONARY,
}; ipconfig_fields,
NULL};
const OncValueSignature kStaticIPConfigSignature = { const OncValueSignature kStaticIPConfigSignature = {
base::Value::TYPE_DICTIONARY, ipconfig_fields, NULL base::Value::TYPE_DICTIONARY,
}; ipconfig_fields,
const OncValueSignature kProxyLocationSignature = { NULL};
base::Value::TYPE_DICTIONARY, proxy_location_fields, NULL const OncValueSignature kProxyLocationSignature = {base::Value::TYPE_DICTIONARY,
}; proxy_location_fields,
const OncValueSignature kProxyManualSignature = { NULL};
base::Value::TYPE_DICTIONARY, proxy_manual_fields, NULL const OncValueSignature kProxyManualSignature = {base::Value::TYPE_DICTIONARY,
}; proxy_manual_fields,
const OncValueSignature kProxySettingsSignature = { NULL};
base::Value::TYPE_DICTIONARY, proxy_settings_fields, NULL const OncValueSignature kProxySettingsSignature = {base::Value::TYPE_DICTIONARY,
}; proxy_settings_fields,
const OncValueSignature kWiFiSignature = { NULL};
base::Value::TYPE_DICTIONARY, wifi_fields, NULL const OncValueSignature kWiFiSignature = {base::Value::TYPE_DICTIONARY,
}; wifi_fields,
const OncValueSignature kWiMAXSignature = { NULL};
base::Value::TYPE_DICTIONARY, wimax_fields, NULL const OncValueSignature kWiMAXSignature = {base::Value::TYPE_DICTIONARY,
}; wimax_fields,
const OncValueSignature kCertificateSignature = { NULL};
base::Value::TYPE_DICTIONARY, certificate_fields, NULL const OncValueSignature kCertificateSignature = {base::Value::TYPE_DICTIONARY,
}; certificate_fields,
NULL};
const OncValueSignature kNetworkConfigurationSignature = { const OncValueSignature kNetworkConfigurationSignature = {
base::Value::TYPE_DICTIONARY, network_configuration_fields, NULL base::Value::TYPE_DICTIONARY,
}; network_configuration_fields,
NULL};
const OncValueSignature kGlobalNetworkConfigurationSignature = { const OncValueSignature kGlobalNetworkConfigurationSignature = {
base::Value::TYPE_DICTIONARY, global_network_configuration_fields, NULL base::Value::TYPE_DICTIONARY,
}; global_network_configuration_fields,
const OncValueSignature kCertificateListSignature = { NULL};
base::Value::TYPE_LIST, NULL, &kCertificateSignature const OncValueSignature kCertificateListSignature = {base::Value::TYPE_LIST,
}; NULL,
&kCertificateSignature};
const OncValueSignature kNetworkConfigurationListSignature = { const OncValueSignature kNetworkConfigurationListSignature = {
base::Value::TYPE_LIST, NULL, &kNetworkConfigurationSignature base::Value::TYPE_LIST,
}; NULL,
&kNetworkConfigurationSignature};
const OncValueSignature kToplevelConfigurationSignature = { const OncValueSignature kToplevelConfigurationSignature = {
base::Value::TYPE_DICTIONARY, toplevel_configuration_fields, NULL base::Value::TYPE_DICTIONARY,
}; toplevel_configuration_fields,
NULL};
// Derived "ONC with State" signatures. // Derived "ONC with State" signatures.
const OncValueSignature kNetworkWithStateSignature = { const OncValueSignature kNetworkWithStateSignature = {
base::Value::TYPE_DICTIONARY, network_with_state_fields, NULL, base::Value::TYPE_DICTIONARY,
&kNetworkConfigurationSignature network_with_state_fields,
}; NULL,
const OncValueSignature kWiFiWithStateSignature = { &kNetworkConfigurationSignature};
base::Value::TYPE_DICTIONARY, wifi_with_state_fields, NULL, &kWiFiSignature const OncValueSignature kWiFiWithStateSignature = {base::Value::TYPE_DICTIONARY,
}; wifi_with_state_fields,
NULL,
&kWiFiSignature};
const OncValueSignature kWiMAXWithStateSignature = { const OncValueSignature kWiMAXWithStateSignature = {
base::Value::TYPE_DICTIONARY, wimax_with_state_fields, NULL, &kWiMAXSignature base::Value::TYPE_DICTIONARY,
}; wimax_with_state_fields,
const OncValueSignature kCellularSignature = { NULL,
base::Value::TYPE_DICTIONARY, cellular_fields, NULL &kWiMAXSignature};
}; const OncValueSignature kCellularSignature = {base::Value::TYPE_DICTIONARY,
cellular_fields,
NULL};
const OncValueSignature kCellularWithStateSignature = { const OncValueSignature kCellularWithStateSignature = {
base::Value::TYPE_DICTIONARY, cellular_with_state_fields, NULL, base::Value::TYPE_DICTIONARY,
&kCellularSignature cellular_with_state_fields,
}; NULL,
&kCellularSignature};
const OncValueSignature kCellularProviderSignature = { const OncValueSignature kCellularProviderSignature = {
base::Value::TYPE_DICTIONARY, cellular_provider_fields, NULL base::Value::TYPE_DICTIONARY,
}; cellular_provider_fields,
const OncValueSignature kCellularApnSignature = { NULL};
base::Value::TYPE_DICTIONARY, cellular_apn_fields, NULL const OncValueSignature kCellularApnSignature = {base::Value::TYPE_DICTIONARY,
}; cellular_apn_fields,
NULL};
const OncValueSignature kCellularFoundNetworkSignature = { const OncValueSignature kCellularFoundNetworkSignature = {
base::Value::TYPE_DICTIONARY, cellular_found_network_fields, NULL base::Value::TYPE_DICTIONARY,
}; cellular_found_network_fields,
const OncValueSignature kSIMLockStatusSignature = { NULL};
base::Value::TYPE_DICTIONARY, sim_lock_status_fields, NULL const OncValueSignature kSIMLockStatusSignature = {base::Value::TYPE_DICTIONARY,
}; sim_lock_status_fields,
NULL};
const OncFieldSignature* GetFieldSignature(const OncValueSignature& signature, const OncFieldSignature* GetFieldSignature(const OncValueSignature& signature,
const std::string& onc_field_name) { const std::string& onc_field_name) {
......
...@@ -31,8 +31,7 @@ CHROMEOS_EXPORT const OncFieldSignature* GetFieldSignature( ...@@ -31,8 +31,7 @@ CHROMEOS_EXPORT const OncFieldSignature* GetFieldSignature(
const OncValueSignature& signature, const OncValueSignature& signature,
const std::string& onc_field_name); const std::string& onc_field_name);
CHROMEOS_EXPORT bool FieldIsCredential( CHROMEOS_EXPORT bool FieldIsCredential(const OncValueSignature& signature,
const OncValueSignature& signature,
const std::string& onc_field_name); const std::string& onc_field_name);
CHROMEOS_EXPORT extern const OncValueSignature kRecommendedSignature; CHROMEOS_EXPORT extern const OncValueSignature kRecommendedSignature;
......
...@@ -22,161 +22,162 @@ namespace onc { ...@@ -22,161 +22,162 @@ namespace onc {
namespace { namespace {
const FieldTranslationEntry eap_fields[] = { const FieldTranslationEntry eap_fields[] = {
{ ::onc::eap::kAnonymousIdentity, shill::kEapAnonymousIdentityProperty}, {::onc::eap::kAnonymousIdentity, shill::kEapAnonymousIdentityProperty},
{ ::onc::eap::kIdentity, shill::kEapIdentityProperty}, {::onc::eap::kIdentity, shill::kEapIdentityProperty},
// This field is converted during translation, see onc_translator_*. // This field is converted during translation, see onc_translator_*.
// { ::onc::eap::kInner, shill::kEapPhase2AuthProperty }, // { ::onc::eap::kInner, shill::kEapPhase2AuthProperty },
// This field is converted during translation, see onc_translator_*. // This field is converted during translation, see onc_translator_*.
// { ::onc::eap::kOuter, shill::kEapMethodProperty }, // { ::onc::eap::kOuter, shill::kEapMethodProperty },
{ ::onc::eap::kPassword, shill::kEapPasswordProperty}, {::onc::eap::kPassword, shill::kEapPasswordProperty},
{ ::onc::eap::kSaveCredentials, shill::kSaveCredentialsProperty}, {::onc::eap::kSaveCredentials, shill::kSaveCredentialsProperty},
{ ::onc::eap::kServerCAPEMs, shill::kEapCaCertPemProperty}, {::onc::eap::kServerCAPEMs, shill::kEapCaCertPemProperty},
{ ::onc::eap::kUseSystemCAs, shill::kEapUseSystemCasProperty}, {::onc::eap::kUseSystemCAs, shill::kEapUseSystemCasProperty},
{NULL}}; {NULL}};
const FieldTranslationEntry ipsec_fields[] = { const FieldTranslationEntry ipsec_fields[] = {
// This field is converted during translation, see onc_translator_*. // This field is converted during translation, see onc_translator_*.
// { ::onc::ipsec::kAuthenticationType, shill::kL2tpIpsecAuthenticationType // { ::onc::ipsec::kAuthenticationType, shill::kL2tpIpsecAuthenticationType
// }, // },
{ ::onc::ipsec::kGroup, shill::kL2tpIpsecTunnelGroupProperty}, {::onc::ipsec::kGroup, shill::kL2tpIpsecTunnelGroupProperty},
// Ignored by Shill, not necessary to synchronize. // Ignored by Shill, not necessary to synchronize.
// { ::onc::ipsec::kIKEVersion, shill::kL2tpIpsecIkeVersion }, // { ::onc::ipsec::kIKEVersion, shill::kL2tpIpsecIkeVersion },
{ ::onc::ipsec::kPSK, shill::kL2tpIpsecPskProperty}, {::onc::ipsec::kPSK, shill::kL2tpIpsecPskProperty},
// This field is converted during translation, see onc_translator_*. // This field is converted during translation, see onc_translator_*.
// { ::onc::vpn::kSaveCredentials, shill::kSaveCredentialsProperty}, // { ::onc::vpn::kSaveCredentials, shill::kSaveCredentialsProperty},
{ ::onc::ipsec::kServerCAPEMs, shill::kL2tpIpsecCaCertPemProperty}, {::onc::ipsec::kServerCAPEMs, shill::kL2tpIpsecCaCertPemProperty},
{NULL}}; {NULL}};
const FieldTranslationEntry xauth_fields[] = { const FieldTranslationEntry xauth_fields[] = {
{ ::onc::vpn::kPassword, shill::kL2tpIpsecXauthPasswordProperty}, {::onc::vpn::kPassword, shill::kL2tpIpsecXauthPasswordProperty},
{ ::onc::vpn::kUsername, shill::kL2tpIpsecXauthUserProperty}, {::onc::vpn::kUsername, shill::kL2tpIpsecXauthUserProperty},
{NULL}}; {NULL}};
const FieldTranslationEntry l2tp_fields[] = { const FieldTranslationEntry l2tp_fields[] = {
{ ::onc::vpn::kPassword, shill::kL2tpIpsecPasswordProperty}, {::onc::vpn::kPassword, shill::kL2tpIpsecPasswordProperty},
// We don't synchronize l2tp's SaveCredentials field for now, as Shill // We don't synchronize l2tp's SaveCredentials field for now, as Shill
// doesn't support separate settings for ipsec and l2tp. // doesn't support separate settings for ipsec and l2tp.
// { ::onc::vpn::kSaveCredentials, &kBoolSignature }, // { ::onc::vpn::kSaveCredentials, &kBoolSignature },
{ ::onc::vpn::kUsername, shill::kL2tpIpsecUserProperty}, {NULL}}; {::onc::vpn::kUsername, shill::kL2tpIpsecUserProperty},
{NULL}};
const FieldTranslationEntry openvpn_fields[] = { const FieldTranslationEntry openvpn_fields[] = {
{ ::onc::openvpn::kAuth, shill::kOpenVPNAuthProperty}, {::onc::openvpn::kAuth, shill::kOpenVPNAuthProperty},
{ ::onc::openvpn::kAuthNoCache, shill::kOpenVPNAuthNoCacheProperty}, {::onc::openvpn::kAuthNoCache, shill::kOpenVPNAuthNoCacheProperty},
{ ::onc::openvpn::kAuthRetry, shill::kOpenVPNAuthRetryProperty}, {::onc::openvpn::kAuthRetry, shill::kOpenVPNAuthRetryProperty},
{ ::onc::openvpn::kCipher, shill::kOpenVPNCipherProperty}, {::onc::openvpn::kCipher, shill::kOpenVPNCipherProperty},
{ ::onc::openvpn::kCompLZO, shill::kOpenVPNCompLZOProperty}, {::onc::openvpn::kCompLZO, shill::kOpenVPNCompLZOProperty},
{ ::onc::openvpn::kCompNoAdapt, shill::kOpenVPNCompNoAdaptProperty}, {::onc::openvpn::kCompNoAdapt, shill::kOpenVPNCompNoAdaptProperty},
{ ::onc::openvpn::kIgnoreDefaultRoute, {::onc::openvpn::kIgnoreDefaultRoute,
shill::kOpenVPNIgnoreDefaultRouteProperty}, shill::kOpenVPNIgnoreDefaultRouteProperty},
{ ::onc::openvpn::kKeyDirection, shill::kOpenVPNKeyDirectionProperty}, {::onc::openvpn::kKeyDirection, shill::kOpenVPNKeyDirectionProperty},
{ ::onc::openvpn::kNsCertType, shill::kOpenVPNNsCertTypeProperty}, {::onc::openvpn::kNsCertType, shill::kOpenVPNNsCertTypeProperty},
// This field is converted during translation, see onc_translator_*. // This field is converted during translation, see onc_translator_*.
// { ::onc::vpn::kOTP, shill::kOpenVPNTokenProperty or kOpenVPNOTPProperty}, // { ::onc::vpn::kOTP, shill::kOpenVPNTokenProperty or kOpenVPNOTPProperty},
// This field is converted during translation, see onc_translator_*. // This field is converted during translation, see onc_translator_*.
// { ::onc::vpn::kPassword, shill::kOpenVPNPasswordProperty}, // { ::onc::vpn::kPassword, shill::kOpenVPNPasswordProperty},
{ ::onc::openvpn::kPort, shill::kOpenVPNPortProperty}, {::onc::openvpn::kPort, shill::kOpenVPNPortProperty},
{ ::onc::openvpn::kProto, shill::kOpenVPNProtoProperty}, {::onc::openvpn::kProto, shill::kOpenVPNProtoProperty},
{ ::onc::openvpn::kPushPeerInfo, shill::kOpenVPNPushPeerInfoProperty}, {::onc::openvpn::kPushPeerInfo, shill::kOpenVPNPushPeerInfoProperty},
{ ::onc::openvpn::kRemoteCertEKU, shill::kOpenVPNRemoteCertEKUProperty}, {::onc::openvpn::kRemoteCertEKU, shill::kOpenVPNRemoteCertEKUProperty},
// This field is converted during translation, see onc_translator_*. // This field is converted during translation, see onc_translator_*.
// { ::onc::openvpn::kRemoteCertKU, shill::kOpenVPNRemoteCertKUProperty }, // { ::onc::openvpn::kRemoteCertKU, shill::kOpenVPNRemoteCertKUProperty },
{ ::onc::openvpn::kRemoteCertTLS, shill::kOpenVPNRemoteCertTLSProperty}, {::onc::openvpn::kRemoteCertTLS, shill::kOpenVPNRemoteCertTLSProperty},
{ ::onc::openvpn::kRenegSec, shill::kOpenVPNRenegSecProperty}, {::onc::openvpn::kRenegSec, shill::kOpenVPNRenegSecProperty},
// This field is converted during translation, see onc_translator_*. // This field is converted during translation, see onc_translator_*.
// { ::onc::vpn::kSaveCredentials, shill::kSaveCredentialsProperty}, // { ::onc::vpn::kSaveCredentials, shill::kSaveCredentialsProperty},
{ ::onc::openvpn::kServerCAPEMs, shill::kOpenVPNCaCertPemProperty}, {::onc::openvpn::kServerCAPEMs, shill::kOpenVPNCaCertPemProperty},
{ ::onc::openvpn::kServerPollTimeout, {::onc::openvpn::kServerPollTimeout,
shill::kOpenVPNServerPollTimeoutProperty}, shill::kOpenVPNServerPollTimeoutProperty},
{ ::onc::openvpn::kShaper, shill::kOpenVPNShaperProperty}, {::onc::openvpn::kShaper, shill::kOpenVPNShaperProperty},
{ ::onc::openvpn::kStaticChallenge, shill::kOpenVPNStaticChallengeProperty}, {::onc::openvpn::kStaticChallenge, shill::kOpenVPNStaticChallengeProperty},
{ ::onc::openvpn::kTLSAuthContents, shill::kOpenVPNTLSAuthContentsProperty}, {::onc::openvpn::kTLSAuthContents, shill::kOpenVPNTLSAuthContentsProperty},
{ ::onc::openvpn::kTLSRemote, shill::kOpenVPNTLSRemoteProperty}, {::onc::openvpn::kTLSRemote, shill::kOpenVPNTLSRemoteProperty},
{ ::onc::vpn::kUsername, shill::kOpenVPNUserProperty}, {::onc::vpn::kUsername, shill::kOpenVPNUserProperty},
{ ::onc::openvpn::kVerifyHash, shill::kOpenVPNVerifyHashProperty}, {::onc::openvpn::kVerifyHash, shill::kOpenVPNVerifyHashProperty},
{NULL}}; {NULL}};
const FieldTranslationEntry verify_x509_fields[] = { const FieldTranslationEntry verify_x509_fields[] = {
{ ::onc::verify_x509::kName, shill::kOpenVPNVerifyX509NameProperty}, {::onc::verify_x509::kName, shill::kOpenVPNVerifyX509NameProperty},
{ ::onc::verify_x509::kType, shill::kOpenVPNVerifyX509TypeProperty}, {::onc::verify_x509::kType, shill::kOpenVPNVerifyX509TypeProperty},
{NULL}}; {NULL}};
const FieldTranslationEntry vpn_fields[] = { const FieldTranslationEntry vpn_fields[] = {
{ ::onc::vpn::kAutoConnect, shill::kAutoConnectProperty}, {::onc::vpn::kAutoConnect, shill::kAutoConnectProperty},
// These fields are converted during translation, see onc_translator_*. // These fields are converted during translation, see onc_translator_*.
// { ::onc::vpn::kHost, shill::kProviderHostProperty}, // { ::onc::vpn::kHost, shill::kProviderHostProperty},
// { ::onc::vpn::kType, shill::kProviderTypeProperty }, // { ::onc::vpn::kType, shill::kProviderTypeProperty },
{NULL}}; {NULL}};
const FieldTranslationEntry wifi_fields[] = { const FieldTranslationEntry wifi_fields[] = {
{ ::onc::wifi::kAutoConnect, shill::kAutoConnectProperty}, {::onc::wifi::kAutoConnect, shill::kAutoConnectProperty},
{ ::onc::wifi::kBSSID, shill::kWifiBSsid}, {::onc::wifi::kBSSID, shill::kWifiBSsid},
// This dictionary is converted during translation, see onc_translator_*. // This dictionary is converted during translation, see onc_translator_*.
// { ::onc::wifi::kEAP, shill::kEap*}, // { ::onc::wifi::kEAP, shill::kEap*},
{ ::onc::wifi::kFrequency, shill::kWifiFrequency}, {::onc::wifi::kFrequency, shill::kWifiFrequency},
{ ::onc::wifi::kFrequencyList, shill::kWifiFrequencyListProperty}, {::onc::wifi::kFrequencyList, shill::kWifiFrequencyListProperty},
{ ::onc::wifi::kHexSSID, shill::kWifiHexSsid}, {::onc::wifi::kHexSSID, shill::kWifiHexSsid},
{ ::onc::wifi::kHiddenSSID, shill::kWifiHiddenSsid}, {::onc::wifi::kHiddenSSID, shill::kWifiHiddenSsid},
{ ::onc::wifi::kPassphrase, shill::kPassphraseProperty}, {::onc::wifi::kPassphrase, shill::kPassphraseProperty},
// This field is converted during translation, see onc_translator_*. // This field is converted during translation, see onc_translator_*.
// { ::onc::wifi::kSecurity, shill::kSecurityClassProperty }, // { ::onc::wifi::kSecurity, shill::kSecurityClassProperty },
{ ::onc::wifi::kSignalStrength, shill::kSignalStrengthProperty}, {::onc::wifi::kSignalStrength, shill::kSignalStrengthProperty},
{NULL}}; {NULL}};
const FieldTranslationEntry wimax_fields[] = { const FieldTranslationEntry wimax_fields[] = {
{ ::onc::wimax::kAutoConnect, shill::kAutoConnectProperty}, {::onc::wimax::kAutoConnect, shill::kAutoConnectProperty},
// This dictionary is converted during translation, see onc_translator_*. // This dictionary is converted during translation, see onc_translator_*.
// { ::onc::wimax::kEAP, shill::kEap*}, // { ::onc::wimax::kEAP, shill::kEap*},
{ ::onc::wimax::kSignalStrength, shill::kSignalStrengthProperty}, {::onc::wimax::kSignalStrength, shill::kSignalStrengthProperty},
{NULL}}; {NULL}};
const FieldTranslationEntry cellular_apn_fields[] = { const FieldTranslationEntry cellular_apn_fields[] = {
{ ::onc::cellular_apn::kAccessPointName, shill::kApnProperty}, {::onc::cellular_apn::kAccessPointName, shill::kApnProperty},
{ ::onc::cellular_apn::kName, shill::kApnNameProperty}, {::onc::cellular_apn::kName, shill::kApnNameProperty},
{ ::onc::cellular_apn::kUsername, shill::kApnUsernameProperty}, {::onc::cellular_apn::kUsername, shill::kApnUsernameProperty},
{ ::onc::cellular_apn::kPassword, shill::kApnPasswordProperty}, {::onc::cellular_apn::kPassword, shill::kApnPasswordProperty},
{ ::onc::cellular_apn::kLocalizedName, shill::kApnLocalizedNameProperty}, {::onc::cellular_apn::kLocalizedName, shill::kApnLocalizedNameProperty},
{ ::onc::cellular_apn::kLanguage, shill::kApnLanguageProperty}, {::onc::cellular_apn::kLanguage, shill::kApnLanguageProperty},
{NULL}}; {NULL}};
const FieldTranslationEntry cellular_found_network_fields[] = { const FieldTranslationEntry cellular_found_network_fields[] = {
{ ::onc::cellular_found_network::kNetworkId, shill::kNetworkIdProperty}, {::onc::cellular_found_network::kNetworkId, shill::kNetworkIdProperty},
{ ::onc::cellular_found_network::kStatus, shill::kStatusProperty}, {::onc::cellular_found_network::kStatus, shill::kStatusProperty},
{ ::onc::cellular_found_network::kTechnology, shill::kTechnologyProperty}, {::onc::cellular_found_network::kTechnology, shill::kTechnologyProperty},
{ ::onc::cellular_found_network::kShortName, shill::kShortNameProperty}, {::onc::cellular_found_network::kShortName, shill::kShortNameProperty},
{ ::onc::cellular_found_network::kLongName, shill::kLongNameProperty}, {::onc::cellular_found_network::kLongName, shill::kLongNameProperty},
{NULL}}; {NULL}};
const FieldTranslationEntry cellular_provider_fields[] = { const FieldTranslationEntry cellular_provider_fields[] = {
{ ::onc::cellular_provider::kCode, shill::kOperatorCodeKey}, {::onc::cellular_provider::kCode, shill::kOperatorCodeKey},
{ ::onc::cellular_provider::kCountry, shill::kOperatorCountryKey}, {::onc::cellular_provider::kCountry, shill::kOperatorCountryKey},
{ ::onc::cellular_provider::kName, shill::kOperatorNameKey}, {::onc::cellular_provider::kName, shill::kOperatorNameKey},
{NULL}}; {NULL}};
const FieldTranslationEntry sim_lock_status_fields[] = { const FieldTranslationEntry sim_lock_status_fields[] = {
{ ::onc::sim_lock_status::kLockEnabled, shill::kSIMLockEnabledProperty}, {::onc::sim_lock_status::kLockEnabled, shill::kSIMLockEnabledProperty},
{ ::onc::sim_lock_status::kLockType, shill::kSIMLockTypeProperty}, {::onc::sim_lock_status::kLockType, shill::kSIMLockTypeProperty},
{ ::onc::sim_lock_status::kRetriesLeft, shill::kSIMLockRetriesLeftProperty}, {::onc::sim_lock_status::kRetriesLeft, shill::kSIMLockRetriesLeftProperty},
{NULL}}; {NULL}};
// This must only contain Service properties and not Device properties. // This must only contain Service properties and not Device properties.
// For Device properties see kCellularDeviceTable. // For Device properties see kCellularDeviceTable.
const FieldTranslationEntry cellular_fields[] = { const FieldTranslationEntry cellular_fields[] = {
{ ::onc::cellular::kActivationType, shill::kActivationTypeProperty}, {::onc::cellular::kActivationType, shill::kActivationTypeProperty},
// This field is converted during translation, see onc_translator_*. // This field is converted during translation, see onc_translator_*.
// { ::onc::cellular::kActivationState, shill::kActivationStateProperty}, // { ::onc::cellular::kActivationState, shill::kActivationStateProperty},
{ ::onc::vpn::kAutoConnect, shill::kAutoConnectProperty}, {::onc::vpn::kAutoConnect, shill::kAutoConnectProperty},
{ ::onc::cellular::kNetworkTechnology, shill::kNetworkTechnologyProperty}, {::onc::cellular::kNetworkTechnology, shill::kNetworkTechnologyProperty},
// This field is converted during translation, see onc_translator_*. // This field is converted during translation, see onc_translator_*.
// { ::onc::cellular::kRoamingState, shill::kRoamingStateProperty}, // { ::onc::cellular::kRoamingState, shill::kRoamingStateProperty},
{ ::onc::cellular::kSignalStrength, shill::kSignalStrengthProperty}, {::onc::cellular::kSignalStrength, shill::kSignalStrengthProperty},
{NULL}}; {NULL}};
const FieldTranslationEntry network_fields[] = { const FieldTranslationEntry network_fields[] = {
{ ::onc::network_config::kGUID, shill::kGuidProperty}, {::onc::network_config::kGUID, shill::kGuidProperty},
{ ::onc::network_config::kConnectable, shill::kConnectableProperty }, {::onc::network_config::kConnectable, shill::kConnectableProperty},
{ ::onc::network_config::kErrorState, shill::kErrorProperty }, {::onc::network_config::kErrorState, shill::kErrorProperty},
{ ::onc::network_config::kPriority, shill::kPriorityProperty }, {::onc::network_config::kPriority, shill::kPriorityProperty},
// Shill doesn't allow setting the name for non-VPN networks. // Shill doesn't allow setting the name for non-VPN networks.
// Name is conditionally translated, see onc_translator_*. // Name is conditionally translated, see onc_translator_*.
...@@ -196,22 +197,22 @@ const FieldTranslationEntry network_fields[] = { ...@@ -196,22 +197,22 @@ const FieldTranslationEntry network_fields[] = {
{NULL}}; {NULL}};
const FieldTranslationEntry ipconfig_fields[] = { const FieldTranslationEntry ipconfig_fields[] = {
{ ::onc::ipconfig::kIPAddress, shill::kAddressProperty}, {::onc::ipconfig::kIPAddress, shill::kAddressProperty},
{ ::onc::ipconfig::kGateway, shill::kGatewayProperty}, {::onc::ipconfig::kGateway, shill::kGatewayProperty},
{ ::onc::ipconfig::kRoutingPrefix, shill::kPrefixlenProperty}, {::onc::ipconfig::kRoutingPrefix, shill::kPrefixlenProperty},
{ ::onc::ipconfig::kNameServers, shill::kNameServersProperty}, {::onc::ipconfig::kNameServers, shill::kNameServersProperty},
// This field is converted during translation, see ShillToONCTranslator:: // This field is converted during translation, see ShillToONCTranslator::
// TranslateIPConfig. It is only converted from Shill->ONC. // TranslateIPConfig. It is only converted from Shill->ONC.
// { ::onc::ipconfig::kType, shill::kMethodProperty}, // { ::onc::ipconfig::kType, shill::kMethodProperty},
{ ::onc::ipconfig::kWebProxyAutoDiscoveryUrl, {::onc::ipconfig::kWebProxyAutoDiscoveryUrl,
shill::kWebProxyAutoDiscoveryUrlProperty}, shill::kWebProxyAutoDiscoveryUrlProperty},
{NULL}}; {NULL}};
const FieldTranslationEntry static_or_saved_ipconfig_fields[] = { const FieldTranslationEntry static_or_saved_ipconfig_fields[] = {
{ ::onc::ipconfig::kIPAddress, shill::kAddressProperty}, {::onc::ipconfig::kIPAddress, shill::kAddressProperty},
{ ::onc::ipconfig::kGateway, shill::kGatewayProperty}, {::onc::ipconfig::kGateway, shill::kGatewayProperty},
{ ::onc::ipconfig::kRoutingPrefix, shill::kPrefixlenProperty}, {::onc::ipconfig::kRoutingPrefix, shill::kPrefixlenProperty},
{ ::onc::ipconfig::kNameServers, shill::kNameServersProperty}, {::onc::ipconfig::kNameServers, shill::kNameServersProperty},
{NULL}}; {NULL}};
struct OncValueTranslationEntry { struct OncValueTranslationEntry {
...@@ -220,30 +221,29 @@ struct OncValueTranslationEntry { ...@@ -220,30 +221,29 @@ struct OncValueTranslationEntry {
}; };
const OncValueTranslationEntry onc_value_translation_table[] = { const OncValueTranslationEntry onc_value_translation_table[] = {
{ &kEAPSignature, eap_fields }, {&kEAPSignature, eap_fields},
{ &kIPsecSignature, ipsec_fields }, {&kIPsecSignature, ipsec_fields},
{ &kL2TPSignature, l2tp_fields }, {&kL2TPSignature, l2tp_fields},
{ &kXAUTHSignature, xauth_fields }, {&kXAUTHSignature, xauth_fields},
{ &kOpenVPNSignature, openvpn_fields }, {&kOpenVPNSignature, openvpn_fields},
{ &kVerifyX509Signature, verify_x509_fields }, {&kVerifyX509Signature, verify_x509_fields},
{ &kVPNSignature, vpn_fields }, {&kVPNSignature, vpn_fields},
{ &kWiFiSignature, wifi_fields }, {&kWiFiSignature, wifi_fields},
{ &kWiFiWithStateSignature, wifi_fields }, {&kWiFiWithStateSignature, wifi_fields},
{ &kWiMAXSignature, wimax_fields }, {&kWiMAXSignature, wimax_fields},
{ &kWiMAXWithStateSignature, wimax_fields }, {&kWiMAXWithStateSignature, wimax_fields},
{ &kCellularApnSignature, cellular_apn_fields }, {&kCellularApnSignature, cellular_apn_fields},
{ &kCellularFoundNetworkSignature, cellular_found_network_fields }, {&kCellularFoundNetworkSignature, cellular_found_network_fields},
{ &kCellularProviderSignature, cellular_provider_fields }, {&kCellularProviderSignature, cellular_provider_fields},
{ &kSIMLockStatusSignature, sim_lock_status_fields }, {&kSIMLockStatusSignature, sim_lock_status_fields},
{ &kCellularSignature, cellular_fields }, {&kCellularSignature, cellular_fields},
{ &kCellularWithStateSignature, cellular_fields }, {&kCellularWithStateSignature, cellular_fields},
{ &kNetworkWithStateSignature, network_fields }, {&kNetworkWithStateSignature, network_fields},
{ &kNetworkConfigurationSignature, network_fields }, {&kNetworkConfigurationSignature, network_fields},
{ &kIPConfigSignature, ipconfig_fields }, {&kIPConfigSignature, ipconfig_fields},
{ &kSavedIPConfigSignature, static_or_saved_ipconfig_fields }, {&kSavedIPConfigSignature, static_or_saved_ipconfig_fields},
{ &kStaticIPConfigSignature, static_or_saved_ipconfig_fields }, {&kStaticIPConfigSignature, static_or_saved_ipconfig_fields},
{ NULL } {NULL}};
};
struct NestedShillDictionaryEntry { struct NestedShillDictionaryEntry {
const OncValueSignature* onc_signature; const OncValueSignature* onc_signature;
...@@ -251,21 +251,15 @@ struct NestedShillDictionaryEntry { ...@@ -251,21 +251,15 @@ struct NestedShillDictionaryEntry {
const char* const* shill_property_path; const char* const* shill_property_path;
}; };
const char* cellular_apn_path_entries[] = { const char* cellular_apn_path_entries[] = {shill::kCellularApnProperty, NULL};
shill::kCellularApnProperty,
NULL
};
const char* static_ip_config_path_entries[] = { const char* static_ip_config_path_entries[] = {shill::kStaticIPConfigProperty,
shill::kStaticIPConfigProperty, NULL};
NULL
};
const NestedShillDictionaryEntry nested_shill_dictionaries[] = { const NestedShillDictionaryEntry nested_shill_dictionaries[] = {
{ &kCellularApnSignature, cellular_apn_path_entries }, {&kCellularApnSignature, cellular_apn_path_entries},
{ &kStaticIPConfigSignature, static_ip_config_path_entries }, {&kStaticIPConfigSignature, static_ip_config_path_entries},
{ NULL } {NULL}};
};
} // namespace } // namespace
...@@ -273,55 +267,56 @@ const StringTranslationEntry kNetworkTypeTable[] = { ...@@ -273,55 +267,56 @@ const StringTranslationEntry kNetworkTypeTable[] = {
// This mapping is ensured in the translation code. // This mapping is ensured in the translation code.
// { network_type::kEthernet, shill::kTypeEthernet }, // { network_type::kEthernet, shill::kTypeEthernet },
// { network_type::kEthernet, shill::kTypeEthernetEap }, // { network_type::kEthernet, shill::kTypeEthernetEap },
{ ::onc::network_type::kWiFi, shill::kTypeWifi}, {::onc::network_type::kWiFi, shill::kTypeWifi},
{ ::onc::network_type::kWimax, shill::kTypeWimax}, {::onc::network_type::kWimax, shill::kTypeWimax},
{ ::onc::network_type::kCellular, shill::kTypeCellular}, {::onc::network_type::kCellular, shill::kTypeCellular},
{ ::onc::network_type::kVPN, shill::kTypeVPN}, {::onc::network_type::kVPN, shill::kTypeVPN},
{NULL}}; {NULL}};
const StringTranslationEntry kVPNTypeTable[] = { const StringTranslationEntry kVPNTypeTable[] = {
{ ::onc::vpn::kTypeL2TP_IPsec, shill::kProviderL2tpIpsec}, {::onc::vpn::kTypeL2TP_IPsec, shill::kProviderL2tpIpsec},
{ ::onc::vpn::kOpenVPN, shill::kProviderOpenVpn}, {::onc::vpn::kOpenVPN, shill::kProviderOpenVpn},
{ ::onc::vpn::kThirdPartyVpn, shill::kProviderThirdPartyVpn}, {::onc::vpn::kThirdPartyVpn, shill::kProviderThirdPartyVpn},
{NULL}}; {NULL}};
const StringTranslationEntry kWiFiSecurityTable[] = { const StringTranslationEntry kWiFiSecurityTable[] = {
{ ::onc::wifi::kSecurityNone, shill::kSecurityNone}, {::onc::wifi::kSecurityNone, shill::kSecurityNone},
{ ::onc::wifi::kWEP_PSK, shill::kSecurityWep}, {::onc::wifi::kWEP_PSK, shill::kSecurityWep},
{ ::onc::wifi::kWPA_PSK, shill::kSecurityPsk}, {::onc::wifi::kWPA_PSK, shill::kSecurityPsk},
{ ::onc::wifi::kWPA_EAP, shill::kSecurity8021x}, {::onc::wifi::kWPA_EAP, shill::kSecurity8021x},
{NULL}}; {NULL}};
const StringTranslationEntry kEAPOuterTable[] = { const StringTranslationEntry kEAPOuterTable[] = {
{ ::onc::eap::kPEAP, shill::kEapMethodPEAP}, {::onc::eap::kPEAP, shill::kEapMethodPEAP},
{ ::onc::eap::kEAP_TLS, shill::kEapMethodTLS}, {::onc::eap::kEAP_TLS, shill::kEapMethodTLS},
{ ::onc::eap::kEAP_TTLS, shill::kEapMethodTTLS}, {::onc::eap::kEAP_TTLS, shill::kEapMethodTTLS},
{ ::onc::eap::kLEAP, shill::kEapMethodLEAP}, {::onc::eap::kLEAP, shill::kEapMethodLEAP},
{NULL}}; {NULL}};
// Translation of the EAP.Inner field in case of EAP.Outer == PEAP // Translation of the EAP.Inner field in case of EAP.Outer == PEAP
const StringTranslationEntry kEAP_PEAP_InnerTable[] = { const StringTranslationEntry kEAP_PEAP_InnerTable[] = {
{ ::onc::eap::kMD5, shill::kEapPhase2AuthPEAPMD5}, {::onc::eap::kMD5, shill::kEapPhase2AuthPEAPMD5},
{ ::onc::eap::kMSCHAPv2, shill::kEapPhase2AuthPEAPMSCHAPV2}, {NULL}}; {::onc::eap::kMSCHAPv2, shill::kEapPhase2AuthPEAPMSCHAPV2},
{NULL}};
// Translation of the EAP.Inner field in case of EAP.Outer == TTLS // Translation of the EAP.Inner field in case of EAP.Outer == TTLS
const StringTranslationEntry kEAP_TTLS_InnerTable[] = { const StringTranslationEntry kEAP_TTLS_InnerTable[] = {
{ ::onc::eap::kMD5, shill::kEapPhase2AuthTTLSMD5}, {::onc::eap::kMD5, shill::kEapPhase2AuthTTLSMD5},
{ ::onc::eap::kMSCHAPv2, shill::kEapPhase2AuthTTLSMSCHAPV2}, {::onc::eap::kMSCHAPv2, shill::kEapPhase2AuthTTLSMSCHAPV2},
{ ::onc::eap::kPAP, shill::kEapPhase2AuthTTLSPAP}, {::onc::eap::kPAP, shill::kEapPhase2AuthTTLSPAP},
{NULL}}; {NULL}};
const StringTranslationEntry kActivationStateTable[] = { const StringTranslationEntry kActivationStateTable[] = {
{ ::onc::cellular::kActivated, shill::kActivationStateActivated}, {::onc::cellular::kActivated, shill::kActivationStateActivated},
{ ::onc::cellular::kActivating, shill::kActivationStateActivating}, {::onc::cellular::kActivating, shill::kActivationStateActivating},
{ ::onc::cellular::kNotActivated, shill::kActivationStateNotActivated}, {::onc::cellular::kNotActivated, shill::kActivationStateNotActivated},
{ ::onc::cellular::kPartiallyActivated, {::onc::cellular::kPartiallyActivated,
shill::kActivationStatePartiallyActivated}, shill::kActivationStatePartiallyActivated},
{NULL}}; {NULL}};
const StringTranslationEntry kRoamingStateTable[] = { const StringTranslationEntry kRoamingStateTable[] = {
{ ::onc::cellular::kRoamingHome, shill::kRoamingStateHome}, {::onc::cellular::kRoamingHome, shill::kRoamingStateHome},
{ ::onc::cellular::kRoamingRoaming, shill::kRoamingStateRoaming}, {::onc::cellular::kRoamingRoaming, shill::kRoamingStateRoaming},
{NULL}}; {NULL}};
// This must contain only Shill Device properties and no Service properties. // This must contain only Shill Device properties and no Service properties.
...@@ -329,30 +324,30 @@ const StringTranslationEntry kRoamingStateTable[] = { ...@@ -329,30 +324,30 @@ const StringTranslationEntry kRoamingStateTable[] = {
const FieldTranslationEntry kCellularDeviceTable[] = { const FieldTranslationEntry kCellularDeviceTable[] = {
// This field is converted during translation, see onc_translator_*. // This field is converted during translation, see onc_translator_*.
// { ::onc::cellular::kAPNList, shill::kCellularApnListProperty}, // { ::onc::cellular::kAPNList, shill::kCellularApnListProperty},
{ ::onc::cellular::kAllowRoaming, shill::kCellularAllowRoamingProperty}, {::onc::cellular::kAllowRoaming, shill::kCellularAllowRoamingProperty},
{ ::onc::cellular::kCarrier, shill::kCarrierProperty}, {::onc::cellular::kCarrier, shill::kCarrierProperty},
{ ::onc::cellular::kESN, shill::kEsnProperty}, {::onc::cellular::kESN, shill::kEsnProperty},
{ ::onc::cellular::kFamily, shill::kTechnologyFamilyProperty}, {::onc::cellular::kFamily, shill::kTechnologyFamilyProperty},
{ ::onc::cellular::kFirmwareRevision, shill::kFirmwareRevisionProperty}, {::onc::cellular::kFirmwareRevision, shill::kFirmwareRevisionProperty},
// This field is converted during translation, see onc_translator_*. // This field is converted during translation, see onc_translator_*.
// { ::onc::cellular::kFoundNetworks, shill::kFoundNetworksProperty}, // { ::onc::cellular::kFoundNetworks, shill::kFoundNetworksProperty},
{ ::onc::cellular::kHardwareRevision, shill::kHardwareRevisionProperty}, {::onc::cellular::kHardwareRevision, shill::kHardwareRevisionProperty},
// This field is converted during translation, see onc_translator_*. // This field is converted during translation, see onc_translator_*.
// { ::onc::cellular::kHomeProvider, shill::kHomeProviderProperty}, // { ::onc::cellular::kHomeProvider, shill::kHomeProviderProperty},
{ ::onc::cellular::kICCID, shill::kIccidProperty}, {::onc::cellular::kICCID, shill::kIccidProperty},
{ ::onc::cellular::kIMEI, shill::kImeiProperty}, {::onc::cellular::kIMEI, shill::kImeiProperty},
{ ::onc::cellular::kIMSI, shill::kImsiProperty}, {::onc::cellular::kIMSI, shill::kImsiProperty},
{ ::onc::cellular::kManufacturer, shill::kManufacturerProperty}, {::onc::cellular::kManufacturer, shill::kManufacturerProperty},
{ ::onc::cellular::kMDN, shill::kMdnProperty}, {::onc::cellular::kMDN, shill::kMdnProperty},
{ ::onc::cellular::kMEID, shill::kMeidProperty}, {::onc::cellular::kMEID, shill::kMeidProperty},
{ ::onc::cellular::kMIN, shill::kMinProperty}, {::onc::cellular::kMIN, shill::kMinProperty},
{ ::onc::cellular::kModelID, shill::kModelIDProperty}, {::onc::cellular::kModelID, shill::kModelIDProperty},
{ ::onc::cellular::kPRLVersion, shill::kPRLVersionProperty}, {::onc::cellular::kPRLVersion, shill::kPRLVersionProperty},
// This field is converted during translation, see onc_translator_*. // This field is converted during translation, see onc_translator_*.
// { ::onc::cellular::kSIMLockStatus, shill::kSIMLockStatusProperty}, // { ::onc::cellular::kSIMLockStatus, shill::kSIMLockStatusProperty},
{ ::onc::cellular::kSIMPresent, shill::kSIMPresentProperty}, {::onc::cellular::kSIMPresent, shill::kSIMPresentProperty},
{ ::onc::cellular::kSupportedCarriers, shill::kSupportedCarriersProperty}, {::onc::cellular::kSupportedCarriers, shill::kSupportedCarriersProperty},
{ ::onc::cellular::kSupportNetworkScan, shill::kSupportNetworkScanProperty}, {::onc::cellular::kSupportNetworkScan, shill::kSupportNetworkScanProperty},
{NULL}}; {NULL}};
const FieldTranslationEntry* GetFieldTranslationTable( const FieldTranslationEntry* GetFieldTranslationTable(
...@@ -384,8 +379,8 @@ std::vector<std::string> GetPathToNestedShillDictionary( ...@@ -384,8 +379,8 @@ std::vector<std::string> GetPathToNestedShillDictionary(
bool GetShillPropertyName(const std::string& onc_field_name, bool GetShillPropertyName(const std::string& onc_field_name,
const FieldTranslationEntry table[], const FieldTranslationEntry table[],
std::string* shill_property_name) { std::string* shill_property_name) {
for (const FieldTranslationEntry* it = table; for (const FieldTranslationEntry* it = table; it->onc_field_name != NULL;
it->onc_field_name != NULL; ++it) { ++it) {
if (it->onc_field_name != onc_field_name) if (it->onc_field_name != onc_field_name)
continue; continue;
*shill_property_name = it->shill_property_name; *shill_property_name = it->shill_property_name;
......
...@@ -126,7 +126,6 @@ void LocalTranslator::TranslateEthernet() { ...@@ -126,7 +126,6 @@ void LocalTranslator::TranslateEthernet() {
CopyFieldsAccordingToSignature(); CopyFieldsAccordingToSignature();
} }
void LocalTranslator::TranslateOpenVPN() { void LocalTranslator::TranslateOpenVPN() {
// SaveCredentials needs special handling when translating from Shill -> ONC // SaveCredentials needs special handling when translating from Shill -> ONC
// so handle it explicitly here. // so handle it explicitly here.
...@@ -216,8 +215,8 @@ void LocalTranslator::TranslateVPN() { ...@@ -216,8 +215,8 @@ void LocalTranslator::TranslateVPN() {
void LocalTranslator::TranslateWiFi() { void LocalTranslator::TranslateWiFi() {
std::string security; std::string security;
if (onc_object_->GetStringWithoutPathExpansion( if (onc_object_->GetStringWithoutPathExpansion(::onc::wifi::kSecurity,
::onc::wifi::kSecurity, &security)) { &security)) {
TranslateWithTableAndSet(security, kWiFiSecurityTable, TranslateWithTableAndSet(security, kWiFiSecurityTable,
shill::kSecurityClassProperty); shill::kSecurityClassProperty);
} }
...@@ -249,9 +248,9 @@ void LocalTranslator::TranslateEAP() { ...@@ -249,9 +248,9 @@ void LocalTranslator::TranslateEAP() {
// Shill. // Shill.
onc_object_->GetStringWithoutPathExpansion(::onc::eap::kInner, &inner); onc_object_->GetStringWithoutPathExpansion(::onc::eap::kInner, &inner);
if (inner != ::onc::eap::kAutomatic) { if (inner != ::onc::eap::kAutomatic) {
const StringTranslationEntry* table = const StringTranslationEntry* table = outer == ::onc::eap::kPEAP
outer == ::onc::eap::kPEAP ? kEAP_PEAP_InnerTable : ? kEAP_PEAP_InnerTable
kEAP_TTLS_InnerTable; : kEAP_TTLS_InnerTable;
TranslateWithTableAndSet(inner, table, shill::kEapPhase2AuthProperty); TranslateWithTableAndSet(inner, table, shill::kEapPhase2AuthProperty);
} }
} }
...@@ -328,8 +327,8 @@ void LocalTranslator::AddValueAccordingToSignature( ...@@ -328,8 +327,8 @@ void LocalTranslator::AddValueAccordingToSignature(
if (!value || !field_translation_table_) if (!value || !field_translation_table_)
return; return;
std::string shill_property_name; std::string shill_property_name;
if (!GetShillPropertyName( if (!GetShillPropertyName(onc_name, field_translation_table_,
onc_name, field_translation_table_, &shill_property_name)) { &shill_property_name)) {
return; return;
} }
...@@ -366,8 +365,7 @@ void TranslateONCHierarchy(const OncValueSignature& signature, ...@@ -366,8 +365,7 @@ void TranslateONCHierarchy(const OncValueSignature& signature,
GetPathToNestedShillDictionary(signature); GetPathToNestedShillDictionary(signature);
for (std::vector<std::string>::const_iterator it = for (std::vector<std::string>::const_iterator it =
path_to_shill_dictionary.begin(); path_to_shill_dictionary.begin();
it != path_to_shill_dictionary.end(); it != path_to_shill_dictionary.end(); ++it) {
++it) {
base::DictionaryValue* nested_shill_dict = NULL; base::DictionaryValue* nested_shill_dict = NULL;
target_shill_dictionary->GetDictionaryWithoutPathExpansion( target_shill_dictionary->GetDictionaryWithoutPathExpansion(
*it, &nested_shill_dict); *it, &nested_shill_dict);
......
...@@ -66,8 +66,7 @@ class ShillToONCTranslator { ...@@ -66,8 +66,7 @@ class ShillToONCTranslator {
: shill_dictionary_(&shill_dictionary), : shill_dictionary_(&shill_dictionary),
onc_source_(onc_source), onc_source_(onc_source),
onc_signature_(&onc_signature), onc_signature_(&onc_signature),
field_translation_table_(field_translation_table) { field_translation_table_(field_translation_table) {}
}
// Translates the associated Shill dictionary and creates an ONC object of the // Translates the associated Shill dictionary and creates an ONC object of the
// given signature. // given signature.
...@@ -222,8 +221,7 @@ void ShillToONCTranslator::TranslateOpenVPN() { ...@@ -222,8 +221,7 @@ void ShillToONCTranslator::TranslateOpenVPN() {
const base::Value* shill_value = NULL; const base::Value* shill_value = NULL;
if (!field_translation_table_ || if (!field_translation_table_ ||
!GetShillPropertyName(field_signature->onc_field_name, !GetShillPropertyName(field_signature->onc_field_name,
field_translation_table_, field_translation_table_, &shill_property_name) ||
&shill_property_name) ||
!shill_dictionary_->GetWithoutPathExpansion(shill_property_name, !shill_dictionary_->GetWithoutPathExpansion(shill_property_name,
&shill_value)) { &shill_value)) {
continue; continue;
...@@ -235,23 +233,21 @@ void ShillToONCTranslator::TranslateOpenVPN() { ...@@ -235,23 +233,21 @@ void ShillToONCTranslator::TranslateOpenVPN() {
// Shill wants all Provider/VPN fields to be strings. Translates these // Shill wants all Provider/VPN fields to be strings. Translates these
// strings back to the correct ONC type. // strings back to the correct ONC type.
translated = ConvertStringToValue( translated = ConvertStringToValue(
shill_str, shill_str, field_signature->value_signature->onc_type);
field_signature->value_signature->onc_type);
if (translated.get() == NULL) { if (translated.get() == NULL) {
LOG(ERROR) << "Shill property '" << shill_property_name LOG(ERROR) << "Shill property '" << shill_property_name
<< "' with value " << *shill_value << "' with value " << *shill_value
<< " couldn't be converted to base::Value::Type " << " couldn't be converted to base::Value::Type "
<< field_signature->value_signature->onc_type << field_signature->value_signature->onc_type << ": "
<< ": " << GetName(); << GetName();
} else { } else {
onc_object_->SetWithoutPathExpansion(onc_field_name, onc_object_->SetWithoutPathExpansion(onc_field_name,
translated.release()); translated.release());
} }
} else { } else {
LOG(ERROR) << "Shill property '" << shill_property_name LOG(ERROR) << "Shill property '" << shill_property_name << "' has value "
<< "' has value " << *shill_value << *shill_value << ", but expected a string: " << GetName();
<< ", but expected a string: " << GetName();
} }
} }
} }
...@@ -294,8 +290,8 @@ void ShillToONCTranslator::TranslateVPN() { ...@@ -294,8 +290,8 @@ void ShillToONCTranslator::TranslateVPN() {
std::string shill_provider_type, onc_provider_type; std::string shill_provider_type, onc_provider_type;
provider->GetStringWithoutPathExpansion(shill::kTypeProperty, provider->GetStringWithoutPathExpansion(shill::kTypeProperty,
&shill_provider_type); &shill_provider_type);
if (!TranslateStringToONC( if (!TranslateStringToONC(kVPNTypeTable, shill_provider_type,
kVPNTypeTable, shill_provider_type, &onc_provider_type)) { &onc_provider_type)) {
return; return;
} }
onc_object_->SetStringWithoutPathExpansion(::onc::vpn::kType, onc_object_->SetStringWithoutPathExpansion(::onc::vpn::kType,
...@@ -323,15 +319,13 @@ void ShillToONCTranslator::TranslateVPN() { ...@@ -323,15 +319,13 @@ void ShillToONCTranslator::TranslateVPN() {
if (onc_provider_type != ::onc::vpn::kThirdPartyVpn && if (onc_provider_type != ::onc::vpn::kThirdPartyVpn &&
shill_dictionary_->GetBooleanWithoutPathExpansion( shill_dictionary_->GetBooleanWithoutPathExpansion(
shill::kSaveCredentialsProperty, &save_credentials)) { shill::kSaveCredentialsProperty, &save_credentials)) {
SetNestedOncValue(provider_type_dictionary, SetNestedOncValue(provider_type_dictionary, ::onc::vpn::kSaveCredentials,
::onc::vpn::kSaveCredentials,
base::FundamentalValue(save_credentials)); base::FundamentalValue(save_credentials));
} }
} }
void ShillToONCTranslator::TranslateWiFiWithState() { void ShillToONCTranslator::TranslateWiFiWithState() {
TranslateWithTableAndSet(shill::kSecurityClassProperty, TranslateWithTableAndSet(shill::kSecurityClassProperty, kWiFiSecurityTable,
kWiFiSecurityTable,
::onc::wifi::kSecurity); ::onc::wifi::kSecurity);
bool unknown_encoding = true; bool unknown_encoding = true;
std::string ssid = shill_property_util::GetSSIDFromProperties( std::string ssid = shill_property_util::GetSSIDFromProperties(
...@@ -436,8 +430,8 @@ void ShillToONCTranslator::TranslateNetworkWithState() { ...@@ -436,8 +430,8 @@ void ShillToONCTranslator::TranslateNetworkWithState() {
std::string onc_network_type = ::onc::network_type::kEthernet; std::string onc_network_type = ::onc::network_type::kEthernet;
if (shill_network_type != shill::kTypeEthernet && if (shill_network_type != shill::kTypeEthernet &&
shill_network_type != shill::kTypeEthernetEap) { shill_network_type != shill::kTypeEthernetEap) {
TranslateStringToONC( TranslateStringToONC(kNetworkTypeTable, shill_network_type,
kNetworkTypeTable, shill_network_type, &onc_network_type); &onc_network_type);
} }
// Translate nested Cellular, WiFi, etc. properties. // Translate nested Cellular, WiFi, etc. properties.
if (!onc_network_type.empty()) { if (!onc_network_type.empty()) {
...@@ -487,8 +481,8 @@ void ShillToONCTranslator::TranslateNetworkWithState() { ...@@ -487,8 +481,8 @@ void ShillToONCTranslator::TranslateNetworkWithState() {
source = ::onc::network_config::kSourceUser; source = ::onc::network_config::kSourceUser;
else else
source = ::onc::network_config::kSourceNone; source = ::onc::network_config::kSourceNone;
onc_object_->SetStringWithoutPathExpansion( onc_object_->SetStringWithoutPathExpansion(::onc::network_config::kSource,
::onc::network_config::kSource, source); source);
} }
// Use a human-readable aa:bb format for any hardware MAC address. Note: // Use a human-readable aa:bb format for any hardware MAC address. Note:
...@@ -598,8 +592,8 @@ void ShillToONCTranslator::TranslateAndAddNestedObject( ...@@ -598,8 +592,8 @@ void ShillToONCTranslator::TranslateAndAddNestedObject(
NOTREACHED() << "Unable to find signature for field: " << onc_field_name; NOTREACHED() << "Unable to find signature for field: " << onc_field_name;
return; return;
} }
ShillToONCTranslator nested_translator( ShillToONCTranslator nested_translator(dictionary, onc_source_,
dictionary, onc_source_, *field_signature->value_signature); *field_signature->value_signature);
scoped_ptr<base::DictionaryValue> nested_object = scoped_ptr<base::DictionaryValue> nested_object =
nested_translator.CreateTranslatedONCObject(); nested_translator.CreateTranslatedONCObject();
if (nested_object->empty()) if (nested_object->empty())
...@@ -612,8 +606,8 @@ void ShillToONCTranslator::SetNestedOncValue( ...@@ -612,8 +606,8 @@ void ShillToONCTranslator::SetNestedOncValue(
const std::string& onc_field_name, const std::string& onc_field_name,
const base::Value& value) { const base::Value& value) {
base::DictionaryValue* nested; base::DictionaryValue* nested;
if (!onc_object_->GetDictionaryWithoutPathExpansion( if (!onc_object_->GetDictionaryWithoutPathExpansion(onc_dictionary_name,
onc_dictionary_name, &nested)) { &nested)) {
nested = new base::DictionaryValue; nested = new base::DictionaryValue;
onc_object_->SetWithoutPathExpansion(onc_dictionary_name, nested); onc_object_->SetWithoutPathExpansion(onc_dictionary_name, nested);
} }
...@@ -633,14 +627,13 @@ void ShillToONCTranslator::TranslateAndAddListOfObjects( ...@@ -633,14 +627,13 @@ void ShillToONCTranslator::TranslateAndAddListOfObjects(
} }
DCHECK(field_signature->value_signature->onc_array_entry_signature); DCHECK(field_signature->value_signature->onc_array_entry_signature);
scoped_ptr<base::ListValue> result(new base::ListValue()); scoped_ptr<base::ListValue> result(new base::ListValue());
for (base::ListValue::const_iterator it = list.begin(); for (base::ListValue::const_iterator it = list.begin(); it != list.end();
it != list.end(); ++it) { ++it) {
const base::DictionaryValue* shill_value = NULL; const base::DictionaryValue* shill_value = NULL;
if (!(*it)->GetAsDictionary(&shill_value)) if (!(*it)->GetAsDictionary(&shill_value))
continue; continue;
ShillToONCTranslator nested_translator( ShillToONCTranslator nested_translator(
*shill_value, *shill_value, onc_source_,
onc_source_,
*field_signature->value_signature->onc_array_entry_signature); *field_signature->value_signature->onc_array_entry_signature);
scoped_ptr<base::DictionaryValue> nested_object = scoped_ptr<base::DictionaryValue> nested_object =
nested_translator.CreateTranslatedONCObject(); nested_translator.CreateTranslatedONCObject();
...@@ -677,21 +670,19 @@ void ShillToONCTranslator::CopyProperty( ...@@ -677,21 +670,19 @@ void ShillToONCTranslator::CopyProperty(
const base::Value* shill_value = NULL; const base::Value* shill_value = NULL;
if (!field_translation_table_ || if (!field_translation_table_ ||
!GetShillPropertyName(field_signature->onc_field_name, !GetShillPropertyName(field_signature->onc_field_name,
field_translation_table_, field_translation_table_, &shill_property_name) ||
&shill_property_name) ||
!shill_dictionary_->GetWithoutPathExpansion(shill_property_name, !shill_dictionary_->GetWithoutPathExpansion(shill_property_name,
&shill_value)) { &shill_value)) {
return; return;
} }
if (shill_value->GetType() != field_signature->value_signature->onc_type) { if (shill_value->GetType() != field_signature->value_signature->onc_type) {
LOG(ERROR) << "Shill property '" << shill_property_name LOG(ERROR) << "Shill property '" << shill_property_name << "' with value "
<< "' with value " << *shill_value << *shill_value << " has base::Value::Type "
<< " has base::Value::Type " << shill_value->GetType() << shill_value->GetType() << " but ONC field '"
<< " but ONC field '" << field_signature->onc_field_name << field_signature->onc_field_name << "' requires type "
<< "' requires type " << field_signature->value_signature->onc_type << ": "
<< field_signature->value_signature->onc_type << GetName();
<< ": " << GetName();
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment