diff options
author | pneubeck <pneubeck@chromium.org> | 2014-09-09 03:46:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-09 10:48:00 +0000 |
commit | faf50c40335fd2055c8beed69c0f630bd442d880 (patch) | |
tree | 0dfdfbb72d3bb1b0f098122ebf92d08a538c8574 /chromeos | |
parent | 457b0a1c94129337a08d0efcc3fd016205a981b4 (diff) | |
download | chromium_src-faf50c40335fd2055c8beed69c0f630bd442d880.zip chromium_src-faf50c40335fd2055c8beed69c0f630bd442d880.tar.gz chromium_src-faf50c40335fd2055c8beed69c0f630bd442d880.tar.bz2 |
ONC: Fix Static-/Saved-/IPConfig.
Before commit 41ec57e48ebd467c7a3b169a5598fb8038f54232,
IPConfigs was the field in ONC meant for configuring ip configuration of a network.
This was changed to:
- IPConfigs is the set of currently active ip configurations (it can be more than one if IPv4 and IPv6 are coexisting in parallel) reported by ChromeOS
- StaticIPConfig (note that it's a single configuration, not multiple as before) is the writable field that the user or policy can set
- SavedIPConfig is the configuration received via DHCP and reported by ChromeOS.
This change updates the different ONC functions to these new field definitions.
Effectively this also allows setting the IPConfig of a network through ONC import, the networkingPrivate API, and through policy (there's no server support though).
BUG=410877
Review URL: https://codereview.chromium.org/540333002
Cr-Commit-Position: refs/heads/master@{#293915}
Diffstat (limited to 'chromeos')
21 files changed, 221 insertions, 87 deletions
diff --git a/chromeos/network/onc/onc_merger_unittest.cc b/chromeos/network/onc/onc_merger_unittest.cc index 64ba338..3c9b8f0 100644 --- a/chromeos/network/onc/onc_merger_unittest.cc +++ b/chromeos/network/onc/onc_merger_unittest.cc @@ -69,7 +69,7 @@ TEST_F(ONCMergerTest, MandatoryValueOverwritesUserValue) { scoped_ptr<base::DictionaryValue> merged(MergeSettingsAndPoliciesToEffective( policy_.get(), NULL, user_.get(), NULL)); EXPECT_TRUE(HaveSameValueAt(*merged, *policy_, "Type")); - EXPECT_TRUE(HaveSameValueAt(*merged, *policy_, "IPConfigs")); + EXPECT_TRUE(HaveSameValueAt(*merged, *policy_, "StaticIPConfig")); } TEST_F(ONCMergerTest, MandatoryValueAndNoUserValue) { diff --git a/chromeos/network/onc/onc_normalizer.cc b/chromeos/network/onc/onc_normalizer.cc index 61266f7..e2d869c 100644 --- a/chromeos/network/onc/onc_normalizer.cc +++ b/chromeos/network/onc/onc_normalizer.cc @@ -153,7 +153,7 @@ void Normalizer::NormalizeNetworkConfiguration(base::DictionaryValue* network) { bool remove = false; network->GetBooleanWithoutPathExpansion(::onc::kRemove, &remove); if (remove) { - network->RemoveWithoutPathExpansion(::onc::network_config::kIPConfigs, + network->RemoveWithoutPathExpansion(::onc::network_config::kStaticIPConfig, NULL); network->RemoveWithoutPathExpansion(::onc::network_config::kName, NULL); network->RemoveWithoutPathExpansion(::onc::network_config::kNameServers, diff --git a/chromeos/network/onc/onc_signature.cc b/chromeos/network/onc/onc_signature.cc index 71274df..0d82a7b 100644 --- a/chromeos/network/onc/onc_signature.cc +++ b/chromeos/network/onc/onc_signature.cc @@ -170,7 +170,6 @@ const OncFieldSignature ethernet_fields[] = { { ::onc::ethernet::kEAP, &kEAPSignature}, {NULL}}; -// Not supported for policy but for reading network state. const OncFieldSignature ipconfig_fields[] = { { ::onc::ipconfig::kGateway, &kStringSignature}, { ::onc::ipconfig::kIPAddress, &kStringSignature}, @@ -289,10 +288,6 @@ const OncFieldSignature network_configuration_fields[] = { { ::onc::network_config::kEthernet, &kEthernetSignature}, { ::onc::network_config::kGUID, &kStringSignature}, - // Not supported for policy but for reading network state. - // TODO(pneubeck@): Resolve IPConfigs vs. StaticIPConfig, crbug.com/410877 - { ::onc::network_config::kIPConfigs, &kIPConfigListSignature}, - { ::onc::network_config::kName, &kStringSignature}, // Not supported, yet. @@ -306,7 +301,6 @@ const OncFieldSignature network_configuration_fields[] = { // Not supported, yet. { ::onc::network_config::kSearchDomains, &kStringListSignature}, - { ::onc::network_config::kSavedIPConfig, &kSavedIPConfigSignature}, { ::onc::network_config::kStaticIPConfig, &kStaticIPConfigSignature}, { ::onc::network_config::kType, &kStringSignature}, { ::onc::network_config::kVPN, &kVPNSignature}, @@ -318,8 +312,10 @@ const OncFieldSignature network_with_state_fields[] = { { ::onc::network_config::kConnectionState, &kStringSignature}, { ::onc::network_config::kConnectable, &kBoolSignature}, { ::onc::network_config::kErrorState, &kStringSignature}, + { ::onc::network_config::kIPConfigs, &kIPConfigListSignature}, { ::onc::network_config::kMacAddress, &kStringSignature}, { ::onc::network_config::kRestrictedConnectivity, &kBoolSignature}, + { ::onc::network_config::kSavedIPConfig, &kSavedIPConfigSignature}, { ::onc::network_config::kWiFi, &kWiFiWithStateSignature}, {NULL}}; diff --git a/chromeos/network/onc/onc_translator_onc_to_shill.cc b/chromeos/network/onc/onc_translator_onc_to_shill.cc index e7e7782..6a3ce6bc 100644 --- a/chromeos/network/onc/onc_translator_onc_to_shill.cc +++ b/chromeos/network/onc/onc_translator_onc_to_shill.cc @@ -15,6 +15,7 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/logging.h" +#include "base/strings/string_util.h" #include "base/values.h" #include "chromeos/network/onc/onc_signature.h" #include "chromeos/network/onc/onc_translation_tables.h" @@ -27,6 +28,17 @@ namespace onc { namespace { +bool ConvertListValueToStringVector(const base::ListValue& string_list, + std::vector<std::string>* result) { + for (size_t i = 0; i < string_list.GetSize(); ++i) { + std::string str; + if (!string_list.GetString(i, &str)) + return false; + result->push_back(str); + } + return true; +} + scoped_ptr<base::StringValue> ConvertValueToString(const base::Value& value) { std::string str; if (!value.GetAsString(&str)) @@ -59,6 +71,7 @@ class LocalTranslator { void TranslateVPN(); void TranslateWiFi(); void TranslateEAP(); + void TranslateStaticIPConfig(); void TranslateNetworkConfiguration(); // Copies all entries from |onc_object_| to |shill_dictionary_| for which a @@ -89,6 +102,8 @@ class LocalTranslator { void LocalTranslator::TranslateFields() { if (onc_signature_ == &kNetworkConfigurationSignature) TranslateNetworkConfiguration(); + else if (onc_signature_ == &kStaticIPConfigSignature) + TranslateStaticIPConfig(); else if (onc_signature_ == &kEthernetSignature) TranslateEthernet(); else if (onc_signature_ == &kVPNSignature) @@ -119,6 +134,21 @@ void LocalTranslator::TranslateEthernet() { CopyFieldsAccordingToSignature(); } + +void LocalTranslator::TranslateStaticIPConfig() { + const base::ListValue* onc_nameservers = NULL; + if (onc_object_->GetListWithoutPathExpansion(::onc::ipconfig::kNameServers, + &onc_nameservers)) { + std::vector<std::string> onc_nameservers_vector; + ConvertListValueToStringVector(*onc_nameservers, &onc_nameservers_vector); + std::string shill_nameservers = JoinString(onc_nameservers_vector, ','); + shill_dictionary_->SetStringWithoutPathExpansion( + shill::kStaticIPNameServersProperty, shill_nameservers); + } + + CopyFieldsAccordingToSignature(); +} + void LocalTranslator::TranslateOpenVPN() { // SaveCredentials needs special handling when translating from Shill -> ONC // so handle it explicitly here. diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc index 168f0b1..900ec21 100644 --- a/chromeos/network/onc/onc_translator_shill_to_onc.cc +++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc @@ -477,6 +477,12 @@ void ShillToONCTranslator::TranslateSavedOrStaticIPConfig( onc_object_->SetWithoutPathExpansion(::onc::ipconfig::kNameServers, onc_nameservers.release()); } + // Static and Saved IPConfig in Shill are always of type IPv4. Set this type + // in ONC, but not if the object would be empty except the type. + if (!onc_object_->empty()) { + onc_object_->SetStringWithoutPathExpansion(::onc::ipconfig::kType, + ::onc::ipconfig::kIPv4); + } } void ShillToONCTranslator::TranslateSavedIPConfig() { diff --git a/chromeos/network/onc/onc_validator.cc b/chromeos/network/onc/onc_validator.cc index 5f7aa96..d02f8e0 100644 --- a/chromeos/network/onc/onc_validator.cc +++ b/chromeos/network/onc/onc_validator.cc @@ -103,34 +103,37 @@ scoped_ptr<base::DictionaryValue> Validator::MapObject( bool valid = ValidateObjectDefault(signature, onc_object, repaired.get()); if (valid) { - if (&signature == &kToplevelConfigurationSignature) + if (&signature == &kToplevelConfigurationSignature) { valid = ValidateToplevelConfiguration(repaired.get()); - else if (&signature == &kNetworkConfigurationSignature) + } else if (&signature == &kNetworkConfigurationSignature) { valid = ValidateNetworkConfiguration(repaired.get()); - else if (&signature == &kEthernetSignature) + } else if (&signature == &kEthernetSignature) { valid = ValidateEthernet(repaired.get()); - else if (&signature == &kIPConfigSignature) + } else if (&signature == &kIPConfigSignature || + &signature == &kSavedIPConfigSignature || + &signature == &kStaticIPConfigSignature) { valid = ValidateIPConfig(repaired.get()); - else if (&signature == &kWiFiSignature) + } else if (&signature == &kWiFiSignature) { valid = ValidateWiFi(repaired.get()); - else if (&signature == &kVPNSignature) + } else if (&signature == &kVPNSignature) { valid = ValidateVPN(repaired.get()); - else if (&signature == &kIPsecSignature) + } else if (&signature == &kIPsecSignature) { valid = ValidateIPsec(repaired.get()); - else if (&signature == &kOpenVPNSignature) + } else if (&signature == &kOpenVPNSignature) { valid = ValidateOpenVPN(repaired.get()); - else if (&signature == &kVerifyX509Signature) + } else if (&signature == &kVerifyX509Signature) { valid = ValidateVerifyX509(repaired.get()); - else if (&signature == &kCertificatePatternSignature) + } else if (&signature == &kCertificatePatternSignature) { valid = ValidateCertificatePattern(repaired.get()); - else if (&signature == &kProxySettingsSignature) + } else if (&signature == &kProxySettingsSignature) { valid = ValidateProxySettings(repaired.get()); - else if (&signature == &kProxyLocationSignature) + } else if (&signature == &kProxyLocationSignature) { valid = ValidateProxyLocation(repaired.get()); - else if (&signature == &kEAPSignature) + } else if (&signature == &kEAPSignature) { valid = ValidateEAP(repaired.get()); - else if (&signature == &kCertificateSignature) + } else if (&signature == &kCertificateSignature) { valid = ValidateCertificate(repaired.get()); + } } if (valid) { diff --git a/chromeos/network/onc/onc_validator_unittest.cc b/chromeos/network/onc/onc_validator_unittest.cc index 9594713..d404e8c 100644 --- a/chromeos/network/onc/onc_validator_unittest.cc +++ b/chromeos/network/onc/onc_validator_unittest.cc @@ -186,7 +186,7 @@ INSTANTIATE_TEST_CASE_P( &kNetworkConfigurationSignature, true), OncParams("translation_of_shill_ethernet_with_ipconfig.onc", - &kNetworkConfigurationSignature, + &kNetworkWithStateSignature, true), OncParams("translation_of_shill_wifi_with_state.onc", &kNetworkWithStateSignature, @@ -319,6 +319,10 @@ INSTANTIATE_TEST_CASE_P( &kNetworkConfigurationSignature, false), RepairParams("", "network-nested-state-field-repaired")), + std::make_pair(OncParams("network-with-ipconfigs", + &kNetworkConfigurationSignature, + false), + RepairParams("", "network-repaired")), std::make_pair(OncParams("openvpn-missing-verify-x509-name", &kNetworkConfigurationSignature, false), RepairParams("", "openvpn-missing-verify-x509-name")), diff --git a/chromeos/test/data/network/augmented_merge.json b/chromeos/test/data/network/augmented_merge.json index 6ebbf04..48322b2 100644 --- a/chromeos/test/data/network/augmented_merge.json +++ b/chromeos/test/data/network/augmented_merge.json @@ -5,24 +5,58 @@ }, "GUID": "123", "IPConfigs": { - "DevicePolicy": [ { - "IPAddress": "127.0.0.1", - "Type": "IPv4" + "Active": [ { + "Gateway": "2001:db8:85a3::7a2e:370:7331", + "IPAddress": "2001:0db8:85a3:0000:0000:8a2e:0370:7334", + "NameServers": [ ], + "RoutingPrefix": 12, + "Type": "IPv6" } ], - "Effective": "UserPolicy", - "UserPolicy": [ { - "IPAddress": "127.0.0.1", - "RoutingPrefix": 32, - "Type": "IPv4" - } ], - "UserSetting": [ { - "IPAddress": "127.0.0.1", - "SearchDomains": [ "acme.org" ], - "Type": "IPv4" - }, { - "IPAddress": "1.2.3.4", - "Type": "IPv4" - } ] + "Effective": "Unmanaged" + }, + "SavedIPConfig": { + "Gateway": { + "Active": "1.1.1.4", + "Effective": "Unmanaged" + }, + "IPAddress": { + "Active": "124.124.124.124", + "Effective": "Unmanaged" + }, + "NameServers": { + "Active": [ "1.1.1.5", "1.1.1.6" ], + "Effective": "Unmanaged" + }, + "RoutingPrefix": { + "Active": 25, + "Effective": "Unmanaged" + }, + "Type": { + "Active": "IPv4", + "Effective": "Unmanaged" + } + }, + "StaticIPConfig": { + "IPAddress": { + "DevicePolicy": "127.0.0.1", + "Effective": "UserPolicy", + "UserPolicy": "127.0.0.1", + "UserSetting": "1.2.3.4" + }, + "RoutingPrefix": { + "Effective": "UserPolicy", + "UserPolicy": 32 + }, + "SearchDomains": { + "Effective": "UserPolicy", + "UserSetting": [ "acme.org" ] + }, + "Type": { + "DevicePolicy": "IPv4", + "Effective": "UserPolicy", + "UserPolicy": "IPv4", + "UserSetting": "IPv4" + } }, "Name": { "Active": "testopenvpn", diff --git a/chromeos/test/data/network/device_policy.onc b/chromeos/test/data/network/device_policy.onc index 663af5b..afcedc5 100644 --- a/chromeos/test/data/network/device_policy.onc +++ b/chromeos/test/data/network/device_policy.onc @@ -1,10 +1,10 @@ { "GUID": "123", "Type": "VPN", "Name": "testopenvpn", - "IPConfigs": [ - { "Type": "IPv4", - "IPAddress": "127.0.0.1" } - ], + "StaticIPConfig": { + "Type": "IPv4", + "IPAddress": "127.0.0.1" + }, "VPN": { "Host": "device policys host", "Recommended": ["Host"], diff --git a/chromeos/test/data/network/ethernet.onc b/chromeos/test/data/network/ethernet.onc index 56828bc..b842999 100644 --- a/chromeos/test/data/network/ethernet.onc +++ b/chromeos/test/data/network/ethernet.onc @@ -3,5 +3,15 @@ "Name": "name", "Ethernet": { "Authentication": "None" + }, + "StaticIPConfig":{ + "Gateway":"1.1.1.7", + "IPAddress":"125.125.125.125", + "NameServers":[ + "1.1.1.8", + "125.1.1.3" + ], + "RoutingPrefix":26, + "Type":"IPv4" } } diff --git a/chromeos/test/data/network/invalid_settings_with_repairs.json b/chromeos/test/data/network/invalid_settings_with_repairs.json index e95c698..365bb25 100644 --- a/chromeos/test/data/network/invalid_settings_with_repairs.json +++ b/chromeos/test/data/network/invalid_settings_with_repairs.json @@ -89,11 +89,11 @@ "GUID": "guid", "Type": "Ethernet", "Name": "name", - "IPConfigs": [ - { "Type": "IPv4", - "IPAddress": "127.0.0.1", - "RoutingPrefix": 123 } - ], + "StaticIPConfig": { + "Type": "IPv4", + "IPAddress": "127.0.0.1", + "RoutingPrefix": 123 + }, "Ethernet": { "Authentication": "None" } @@ -170,11 +170,11 @@ "GUID": "guid", "Type": "Ethernet", "Name": "name", - "IPConfigs": [ - { "Type": "IPv4", - "IPAddress": "127.0.0.1", - "RoutingPrefix": 123 } - ], + "StaticIPConfig": { + "Type": "IPv4", + "IPAddress": "127.0.0.1", + "RoutingPrefix": 123 + }, "Ethernet": { "Authentication": "None" } @@ -224,6 +224,19 @@ "Authentication": "None" } }, + "network-with-ipconfigs": { + "GUID": "guid", + "Type": "Ethernet", + "Name": "name", + "Ethernet": { + "Authentication": "None" + }, + "IPConfigs": [ { + "Type": "IPv4", + "IPAddress": "127.0.0.1", + "RoutingPrefix": 123 + } ], + }, "network-with-client-cert-pattern": { "GUID": "guid", "Type": "WiFi", diff --git a/chromeos/test/data/network/managed_toplevel1.onc b/chromeos/test/data/network/managed_toplevel1.onc index 1f0d127..712877dd 100644 --- a/chromeos/test/data/network/managed_toplevel1.onc +++ b/chromeos/test/data/network/managed_toplevel1.onc @@ -3,11 +3,16 @@ [ { "GUID": "123", "Type": "VPN", "Name": "testopenvpn", - "IPConfigs": [ - { "Type": "IPv4", - "IPAddress": "127.0.0.1", - "RoutingPrefix": 32 } - ], + "StaticIPConfig": { + "Gateway":"1.1.1.1", + "IPAddress": "127.0.0.1", + "NameServers":[ + "1.1.1.2", + "1.1.1.3" + ], + "RoutingPrefix": 32, + "Type": "IPv4" + }, "VPN": { "Host": "policys host", "Recommended": ["Host"], diff --git a/chromeos/test/data/network/managed_vpn.onc b/chromeos/test/data/network/managed_vpn.onc index c12bfc9..d90338a 100644 --- a/chromeos/test/data/network/managed_vpn.onc +++ b/chromeos/test/data/network/managed_vpn.onc @@ -1,11 +1,11 @@ { "GUID": "123", "Type": "VPN", "Name": "testopenvpn", - "IPConfigs": [ - { "Type": "IPv4", - "IPAddress": "127.0.0.1", - "RoutingPrefix": 32 } - ], + "StaticIPConfig": { + "Type": "IPv4", + "IPAddress": "127.0.0.1", + "RoutingPrefix": 32 + }, "VPN": { "Host": "policys host", "Recommended": ["Host"], diff --git a/chromeos/test/data/network/managed_vpn_without_recommended.onc b/chromeos/test/data/network/managed_vpn_without_recommended.onc index 471ff23..eaa6795 100644 --- a/chromeos/test/data/network/managed_vpn_without_recommended.onc +++ b/chromeos/test/data/network/managed_vpn_without_recommended.onc @@ -1,11 +1,11 @@ { "GUID": "123", "Type": "VPN", "Name": "testopenvpn", - "IPConfigs": [ - { "Type": "IPv4", - "IPAddress": "127.0.0.1", - "RoutingPrefix": 32 } - ], + "StaticIPConfig": { + "Type": "IPv4", + "IPAddress": "127.0.0.1", + "RoutingPrefix": 32 + }, "VPN": { "Host": "policys host", "Type": "OpenVPN", diff --git a/chromeos/test/data/network/repaired_toplevel_partially_invalid.onc b/chromeos/test/data/network/repaired_toplevel_partially_invalid.onc index a2bce87..5c1c516 100644 --- a/chromeos/test/data/network/repaired_toplevel_partially_invalid.onc +++ b/chromeos/test/data/network/repaired_toplevel_partially_invalid.onc @@ -3,11 +3,11 @@ [ { "GUID": "123", "Type": "VPN", "Name": "testopenvpn", - "IPConfigs": [ - { "Type": "IPv4", - "IPAddress": "127.0.0.1", - "RoutingPrefix": 32 } - ], + "StaticIPConfig": { + "Type": "IPv4", + "IPAddress": "127.0.0.1", + "RoutingPrefix": 32 + }, "VPN": { "Host": "policys host", "Recommended": ["Host"], diff --git a/chromeos/test/data/network/shill_ethernet.json b/chromeos/test/data/network/shill_ethernet.json index 19e0cc4..e342d13 100644 --- a/chromeos/test/data/network/shill_ethernet.json +++ b/chromeos/test/data/network/shill_ethernet.json @@ -1,3 +1,7 @@ { "GUID": "guid", "Type": "ethernet", + "StaticIP.Address":"125.125.125.125", + "StaticIP.Gateway":"1.1.1.7", + "StaticIP.NameServers":"1.1.1.8,125.1.1.3", + "StaticIP.Prefixlen":26 } diff --git a/chromeos/test/data/network/toplevel_partially_invalid.onc b/chromeos/test/data/network/toplevel_partially_invalid.onc index f9c0f55..7bb1fb8 100644 --- a/chromeos/test/data/network/toplevel_partially_invalid.onc +++ b/chromeos/test/data/network/toplevel_partially_invalid.onc @@ -3,11 +3,11 @@ [ { "GUID": "123", "Type": "VPN", "Name": "testopenvpn", - "IPConfigs": [ - { "Type": "IPv4", - "IPAddress": "127.0.0.1", - "RoutingPrefix": 32 } - ], + "StaticIPConfig": { + "Type": "IPv4", + "IPAddress": "127.0.0.1", + "RoutingPrefix": 32 + }, "VPN": { "Host": "policys host", "Recommended": ["Host"], diff --git a/chromeos/test/data/network/translation_of_shill_ethernet.onc b/chromeos/test/data/network/translation_of_shill_ethernet.onc index 8b568bf..34507b0 100644 --- a/chromeos/test/data/network/translation_of_shill_ethernet.onc +++ b/chromeos/test/data/network/translation_of_shill_ethernet.onc @@ -4,5 +4,15 @@ }, "GUID":"guid", "Name":"", + "StaticIPConfig":{ + "Gateway":"1.1.1.7", + "IPAddress":"125.125.125.125", + "NameServers":[ + "1.1.1.8", + "125.1.1.3" + ], + "RoutingPrefix":26, + "Type":"IPv4" + }, "Type":"Ethernet" } diff --git a/chromeos/test/data/network/translation_of_shill_ethernet_with_ipconfig.onc b/chromeos/test/data/network/translation_of_shill_ethernet_with_ipconfig.onc index f65ca62..296ae45 100644 --- a/chromeos/test/data/network/translation_of_shill_ethernet_with_ipconfig.onc +++ b/chromeos/test/data/network/translation_of_shill_ethernet_with_ipconfig.onc @@ -32,6 +32,7 @@ "1.1.1.6" ], "RoutingPrefix":25, + "Type":"IPv4" }, "StaticIPConfig":{ "Gateway":"1.1.1.7", @@ -40,6 +41,7 @@ "1.1.1.8" ], "RoutingPrefix":26, + "Type":"IPv4" }, "Type":"Ethernet" } diff --git a/chromeos/test/data/network/user.onc b/chromeos/test/data/network/user.onc index bd97bb3..d95bc76 100644 --- a/chromeos/test/data/network/user.onc +++ b/chromeos/test/data/network/user.onc @@ -11,11 +11,9 @@ "ProxySettings": { "Type": "Direct" }, - "IPConfigs": [ - { "Type": "IPv4", - "IPAddress": "127.0.0.1", - "SearchDomains": [ "acme.org" ] }, - { "Type": "IPv4", - "IPAddress": "1.2.3.4" } - ] + "StaticIPConfig": { + "Type": "IPv4", + "IPAddress": "1.2.3.4", + "SearchDomains": [ "acme.org" ] + } } diff --git a/chromeos/test/data/network/vpn_active_settings.onc b/chromeos/test/data/network/vpn_active_settings.onc index 62b3c21..f3c6f78 100644 --- a/chromeos/test/data/network/vpn_active_settings.onc +++ b/chromeos/test/data/network/vpn_active_settings.onc @@ -1,5 +1,24 @@ { "Type": "VPN", "Name": "testopenvpn", "ConnectionState": "Connected", - "GUID": "123" + "GUID": "123", + "IPConfigs":[ + { + "Gateway":"2001:db8:85a3::7a2e:370:7331", + "IPAddress":"2001:0db8:85a3:0000:0000:8a2e:0370:7334", + "NameServers":[], + "RoutingPrefix":12, + "Type":"IPv6" + } + ], + "SavedIPConfig":{ + "Gateway":"1.1.1.4", + "IPAddress":"124.124.124.124", + "NameServers":[ + "1.1.1.5", + "1.1.1.6" + ], + "RoutingPrefix":25, + "Type":"IPv4" + } } |