Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: chromeos/network/onc/onc_signature.cc

Issue 11962048: This adds Cellular to the Shill to ONC translation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing broken unit test Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/network/onc/onc_signature.h ('k') | chromeos/network/onc/onc_translation_tables.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/onc/onc_signature.cc
diff --git a/chromeos/network/onc/onc_signature.cc b/chromeos/network/onc/onc_signature.cc
index 1603c578b6766bd47815dc2f342850aaf9374938..a8766aaf073c52b107fc2d8b184506e5a3a89436 100644
--- a/chromeos/network/onc/onc_signature.cc
+++ b/chromeos/network/onc/onc_signature.cc
@@ -169,9 +169,9 @@ const OncFieldSignature ethernet_fields[] = {
const OncFieldSignature ipconfig_fields[] = {
{ ipconfig::kGateway, NULL, &kStringSignature },
{ ipconfig::kIPAddress, NULL, &kStringSignature },
- { kNameServers, NULL, &kStringSignature },
+ { network_config::kNameServers, NULL, &kStringSignature },
{ ipconfig::kRoutingPrefix, NULL, &kIntegerSignature },
- { kSearchDomains, NULL, &kStringListSignature },
+ { network_config::kSearchDomains, NULL, &kStringListSignature },
{ ipconfig::kType, NULL, &kStringSignature },
{ NULL }
};
@@ -204,6 +204,8 @@ const OncFieldSignature proxy_settings_fields[] = {
const OncFieldSignature wifi_fields[] = {
{ kRecommended, NULL, &kRecommendedSignature },
{ wifi::kAutoConnect, flimflam::kAutoConnectProperty, &kBoolSignature },
+ // This field is read only, and only converted if translating from Shill->ONC.
+ { wifi::kBSSID, NULL, &kStringSignature },
{ wifi::kEAP, NULL, &kEAPSignature },
{ wifi::kHiddenSSID, flimflam::kWifiHiddenSsid, &kBoolSignature },
{ wifi::kPassphrase, flimflam::kPassphraseProperty, &kStringSignature },
@@ -213,31 +215,89 @@ const OncFieldSignature wifi_fields[] = {
{ NULL }
};
+const OncFieldSignature cellular_fields[] = {
+ { kRecommended, NULL, &kRecommendedSignature },
+ { cellular::kActivateOverNonCellularNetwork,
+ shill::kActivateOverNonCellularNetworkProperty, &kStringSignature },
+ { cellular::kActivationState,
+ flimflam::kActivationStateProperty, &kStringSignature },
+ { cellular::kAllowRoaming,
+ flimflam::kCellularAllowRoamingProperty, &kStringSignature },
+ { cellular::kAPN, flimflam::kApnProperty, &kStringSignature },
+ { cellular::kCarrier, flimflam::kCarrierProperty, &kStringSignature },
+ { cellular::kESN, flimflam::kEsnProperty, &kStringSignature },
+ { cellular::kFamily, flimflam::kTechnologyFamilyProperty, &kStringSignature },
+ { cellular::kFirmwareRevision,
+ flimflam::kFirmwareRevisionProperty, &kStringSignature },
+ { cellular::kFoundNetworks,
+ flimflam::kFoundNetworksProperty, &kStringSignature },
+ { cellular::kHardwareRevision,
+ flimflam::kHardwareRevisionProperty, &kStringSignature },
+ { cellular::kHomeProvider,
+ flimflam::kHomeProviderProperty, &kStringSignature },
+ { cellular::kICCID, flimflam::kIccidProperty, &kStringSignature },
+ { cellular::kIMEI, flimflam::kImeiProperty, &kStringSignature },
+ { cellular::kIMSI, flimflam::kImsiProperty, &kStringSignature },
+ { cellular::kManufacturer,
+ flimflam::kManufacturerProperty, &kStringSignature },
+ { cellular::kMDN, flimflam::kMdnProperty, &kStringSignature },
+ { cellular::kMEID, flimflam::kMeidProperty, &kStringSignature },
+ { cellular::kMIN, flimflam::kMinProperty, &kStringSignature },
+ { cellular::kModelID, flimflam::kModelIDProperty, &kStringSignature },
+ { cellular::kNetworkTechnology,
+ flimflam::kNetworkTechnologyProperty, &kStringSignature },
+ { cellular::kOperatorCode,
+ flimflam::kOperatorCodeProperty, &kStringSignature },
+ { cellular::kOperatorName,
+ flimflam::kOperatorNameProperty, &kStringSignature },
+ { cellular::kPRLVersion, flimflam::kPRLVersionProperty, &kStringSignature },
+ { cellular::kProviderRequiresRoaming,
+ shill::kProviderRequiresRoamingProperty, &kStringSignature },
+ { cellular::kRoamingState,
+ flimflam::kRoamingStateProperty, &kStringSignature },
+ { cellular::kSelectedNetwork,
+ flimflam::kSelectedNetworkProperty, &kStringSignature },
+ { cellular::kServingOperator,
+ flimflam::kServingOperatorProperty, &kStringSignature },
+ { cellular::kSIMLockStatus,
+ flimflam::kSIMLockStatusProperty, &kStringSignature },
+ { cellular::kSIMPresent, shill::kSIMPresentProperty, &kStringSignature },
+ { cellular::kSupportedCarriers,
+ shill::kSupportedCarriersProperty, &kStringSignature },
+ { cellular::kSupportNetworkScan,
+ flimflam::kSupportNetworkScanProperty, &kStringSignature },
+ { NULL }
+};
+
const OncFieldSignature network_configuration_fields[] = {
{ kRecommended, NULL, &kRecommendedSignature },
- { kEthernet, NULL, &kEthernetSignature },
- { kGUID, flimflam::kGuidProperty, &kStringSignature },
- { kIPConfigs, NULL, &kIPConfigListSignature },
+ { network_config::kEthernet, NULL, &kEthernetSignature },
+ { network_config::kGUID, flimflam::kGuidProperty, &kStringSignature },
+ { network_config::kIPConfigs, NULL, &kIPConfigListSignature },
// Shill doesn't allow setting the name for non-VPN networks.
// This field is conditionally translated, see onc_translator_*.
- { kName, NULL, &kStringSignature },
+ { network_config::kName, NULL, &kStringSignature },
// Not supported, yet.
- { kNameServers, NULL, &kStringListSignature },
- { kProxySettings, NULL, &kProxySettingsSignature },
+ { network_config::kNameServers, NULL, &kStringListSignature },
+ { network_config::kProxySettings, NULL, &kProxySettingsSignature },
// No need to translate.
{ kRemove, NULL, &kBoolSignature },
// Not supported, yet.
- { kSearchDomains, NULL, &kStringListSignature },
+ { network_config::kSearchDomains, NULL, &kStringListSignature },
+ // This field is converted during translation, see onc_translator_*.
+ { network_config::kType, NULL, &kStringSignature },
+ { network_config::kVPN, NULL, &kVPNSignature },
+ { network_config::kWiFi, NULL, &kWiFiSignature },
+ { network_config::kCellular, NULL, &kCellularSignature },
// This field is converted during translation, see onc_translator_*.
- { kType, NULL, &kStringSignature },
- { kVPN, NULL, &kVPNSignature },
- { kWiFi, NULL, &kWiFiSignature },
+ // It is only converted when going from Shill->ONC, and ignored otherwise.
+ { network_config::kConnectionState, NULL, &kStringSignature},
{ NULL }
};
// Certificates are not translated to Shill.
const OncFieldSignature certificate_fields[] = {
- { kGUID, NULL, &kStringSignature },
+ { certificate::kGUID, NULL, &kStringSignature },
{ certificate::kPKCS12, NULL, &kStringSignature },
{ kRemove, NULL, &kBoolSignature },
{ certificate::kTrust, NULL, &kStringListSignature },
@@ -247,9 +307,10 @@ const OncFieldSignature certificate_fields[] = {
};
const OncFieldSignature toplevel_configuration_fields[] = {
- { kCertificates, NULL, &kCertificateListSignature },
- { kNetworkConfigurations, NULL, &kNetworkConfigurationListSignature },
- { kType, NULL, &kStringSignature },
+ { toplevel_config::kCertificates, NULL, &kCertificateListSignature },
+ { toplevel_config::kNetworkConfigurations, NULL,
+ &kNetworkConfigurationListSignature },
+ { toplevel_config::kType, NULL, &kStringSignature },
{ encrypted::kCipher, NULL, &kStringSignature },
{ encrypted::kCiphertext, NULL, &kStringSignature },
{ encrypted::kHMAC, NULL, &kStringSignature },
@@ -305,6 +366,9 @@ const OncValueSignature kProxySettingsSignature = {
const OncValueSignature kWiFiSignature = {
Value::TYPE_DICTIONARY, wifi_fields, NULL
};
+const OncValueSignature kCellularSignature = {
+ Value::TYPE_DICTIONARY, cellular_fields, NULL
+};
const OncValueSignature kCertificateSignature = {
Value::TYPE_DICTIONARY, certificate_fields, NULL
};
« no previous file with comments | « chromeos/network/onc/onc_signature.h ('k') | chromeos/network/onc/onc_translation_tables.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698