Commit faf50c40 authored by pneubeck's avatar pneubeck Committed by Commit bot

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}
parent 457b0a1c
...@@ -69,7 +69,7 @@ TEST_F(ONCMergerTest, MandatoryValueOverwritesUserValue) { ...@@ -69,7 +69,7 @@ TEST_F(ONCMergerTest, MandatoryValueOverwritesUserValue) {
scoped_ptr<base::DictionaryValue> merged(MergeSettingsAndPoliciesToEffective( scoped_ptr<base::DictionaryValue> merged(MergeSettingsAndPoliciesToEffective(
policy_.get(), NULL, user_.get(), NULL)); policy_.get(), NULL, user_.get(), NULL));
EXPECT_TRUE(HaveSameValueAt(*merged, *policy_, "Type")); EXPECT_TRUE(HaveSameValueAt(*merged, *policy_, "Type"));
EXPECT_TRUE(HaveSameValueAt(*merged, *policy_, "IPConfigs")); EXPECT_TRUE(HaveSameValueAt(*merged, *policy_, "StaticIPConfig"));
} }
TEST_F(ONCMergerTest, MandatoryValueAndNoUserValue) { TEST_F(ONCMergerTest, MandatoryValueAndNoUserValue) {
......
...@@ -153,7 +153,7 @@ void Normalizer::NormalizeNetworkConfiguration(base::DictionaryValue* network) { ...@@ -153,7 +153,7 @@ void Normalizer::NormalizeNetworkConfiguration(base::DictionaryValue* network) {
bool remove = false; bool remove = false;
network->GetBooleanWithoutPathExpansion(::onc::kRemove, &remove); network->GetBooleanWithoutPathExpansion(::onc::kRemove, &remove);
if (remove) { if (remove) {
network->RemoveWithoutPathExpansion(::onc::network_config::kIPConfigs, network->RemoveWithoutPathExpansion(::onc::network_config::kStaticIPConfig,
NULL); NULL);
network->RemoveWithoutPathExpansion(::onc::network_config::kName, NULL); network->RemoveWithoutPathExpansion(::onc::network_config::kName, NULL);
network->RemoveWithoutPathExpansion(::onc::network_config::kNameServers, network->RemoveWithoutPathExpansion(::onc::network_config::kNameServers,
......
...@@ -170,7 +170,6 @@ const OncFieldSignature ethernet_fields[] = { ...@@ -170,7 +170,6 @@ const OncFieldSignature ethernet_fields[] = {
{ ::onc::ethernet::kEAP, &kEAPSignature}, { ::onc::ethernet::kEAP, &kEAPSignature},
{NULL}}; {NULL}};
// Not supported for policy but for reading network state.
const OncFieldSignature ipconfig_fields[] = { const OncFieldSignature ipconfig_fields[] = {
{ ::onc::ipconfig::kGateway, &kStringSignature}, { ::onc::ipconfig::kGateway, &kStringSignature},
{ ::onc::ipconfig::kIPAddress, &kStringSignature}, { ::onc::ipconfig::kIPAddress, &kStringSignature},
...@@ -289,10 +288,6 @@ const OncFieldSignature network_configuration_fields[] = { ...@@ -289,10 +288,6 @@ const OncFieldSignature network_configuration_fields[] = {
{ ::onc::network_config::kEthernet, &kEthernetSignature}, { ::onc::network_config::kEthernet, &kEthernetSignature},
{ ::onc::network_config::kGUID, &kStringSignature}, { ::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}, { ::onc::network_config::kName, &kStringSignature},
// Not supported, yet. // Not supported, yet.
...@@ -306,7 +301,6 @@ const OncFieldSignature network_configuration_fields[] = { ...@@ -306,7 +301,6 @@ const OncFieldSignature network_configuration_fields[] = {
// Not supported, yet. // Not supported, yet.
{ ::onc::network_config::kSearchDomains, &kStringListSignature}, { ::onc::network_config::kSearchDomains, &kStringListSignature},
{ ::onc::network_config::kSavedIPConfig, &kSavedIPConfigSignature},
{ ::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},
...@@ -318,8 +312,10 @@ const OncFieldSignature network_with_state_fields[] = { ...@@ -318,8 +312,10 @@ const OncFieldSignature network_with_state_fields[] = {
{ ::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::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::kWiFi, &kWiFiWithStateSignature}, { ::onc::network_config::kWiFi, &kWiFiWithStateSignature},
{NULL}}; {NULL}};
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "base/json/json_reader.h" #include "base/json/json_reader.h"
#include "base/json/json_writer.h" #include "base/json/json_writer.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/string_util.h"
#include "base/values.h" #include "base/values.h"
#include "chromeos/network/onc/onc_signature.h" #include "chromeos/network/onc/onc_signature.h"
#include "chromeos/network/onc/onc_translation_tables.h" #include "chromeos/network/onc/onc_translation_tables.h"
...@@ -27,6 +28,17 @@ namespace onc { ...@@ -27,6 +28,17 @@ namespace onc {
namespace { 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) { scoped_ptr<base::StringValue> ConvertValueToString(const base::Value& value) {
std::string str; std::string str;
if (!value.GetAsString(&str)) if (!value.GetAsString(&str))
...@@ -59,6 +71,7 @@ class LocalTranslator { ...@@ -59,6 +71,7 @@ class LocalTranslator {
void TranslateVPN(); void TranslateVPN();
void TranslateWiFi(); void TranslateWiFi();
void TranslateEAP(); void TranslateEAP();
void TranslateStaticIPConfig();
void TranslateNetworkConfiguration(); void TranslateNetworkConfiguration();
// Copies all entries from |onc_object_| to |shill_dictionary_| for which a // Copies all entries from |onc_object_| to |shill_dictionary_| for which a
...@@ -89,6 +102,8 @@ class LocalTranslator { ...@@ -89,6 +102,8 @@ class LocalTranslator {
void LocalTranslator::TranslateFields() { void LocalTranslator::TranslateFields() {
if (onc_signature_ == &kNetworkConfigurationSignature) if (onc_signature_ == &kNetworkConfigurationSignature)
TranslateNetworkConfiguration(); TranslateNetworkConfiguration();
else if (onc_signature_ == &kStaticIPConfigSignature)
TranslateStaticIPConfig();
else if (onc_signature_ == &kEthernetSignature) else if (onc_signature_ == &kEthernetSignature)
TranslateEthernet(); TranslateEthernet();
else if (onc_signature_ == &kVPNSignature) else if (onc_signature_ == &kVPNSignature)
...@@ -119,6 +134,21 @@ void LocalTranslator::TranslateEthernet() { ...@@ -119,6 +134,21 @@ void LocalTranslator::TranslateEthernet() {
CopyFieldsAccordingToSignature(); 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() { 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.
......
...@@ -477,6 +477,12 @@ void ShillToONCTranslator::TranslateSavedOrStaticIPConfig( ...@@ -477,6 +477,12 @@ void ShillToONCTranslator::TranslateSavedOrStaticIPConfig(
onc_object_->SetWithoutPathExpansion(::onc::ipconfig::kNameServers, onc_object_->SetWithoutPathExpansion(::onc::ipconfig::kNameServers,
onc_nameservers.release()); 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() { void ShillToONCTranslator::TranslateSavedIPConfig() {
......
...@@ -103,34 +103,37 @@ scoped_ptr<base::DictionaryValue> Validator::MapObject( ...@@ -103,34 +103,37 @@ scoped_ptr<base::DictionaryValue> Validator::MapObject(
bool valid = ValidateObjectDefault(signature, onc_object, repaired.get()); bool valid = ValidateObjectDefault(signature, onc_object, repaired.get());
if (valid) { if (valid) {
if (&signature == &kToplevelConfigurationSignature) if (&signature == &kToplevelConfigurationSignature) {
valid = ValidateToplevelConfiguration(repaired.get()); valid = ValidateToplevelConfiguration(repaired.get());
else if (&signature == &kNetworkConfigurationSignature) } else if (&signature == &kNetworkConfigurationSignature) {
valid = ValidateNetworkConfiguration(repaired.get()); valid = ValidateNetworkConfiguration(repaired.get());
else if (&signature == &kEthernetSignature) } else if (&signature == &kEthernetSignature) {
valid = ValidateEthernet(repaired.get()); valid = ValidateEthernet(repaired.get());
else if (&signature == &kIPConfigSignature) } else if (&signature == &kIPConfigSignature ||
&signature == &kSavedIPConfigSignature ||
&signature == &kStaticIPConfigSignature) {
valid = ValidateIPConfig(repaired.get()); valid = ValidateIPConfig(repaired.get());
else if (&signature == &kWiFiSignature) } else if (&signature == &kWiFiSignature) {
valid = ValidateWiFi(repaired.get()); valid = ValidateWiFi(repaired.get());
else if (&signature == &kVPNSignature) } else if (&signature == &kVPNSignature) {
valid = ValidateVPN(repaired.get()); valid = ValidateVPN(repaired.get());
else if (&signature == &kIPsecSignature) } else if (&signature == &kIPsecSignature) {
valid = ValidateIPsec(repaired.get()); valid = ValidateIPsec(repaired.get());
else if (&signature == &kOpenVPNSignature) } else if (&signature == &kOpenVPNSignature) {
valid = ValidateOpenVPN(repaired.get()); valid = ValidateOpenVPN(repaired.get());
else if (&signature == &kVerifyX509Signature) } else if (&signature == &kVerifyX509Signature) {
valid = ValidateVerifyX509(repaired.get()); valid = ValidateVerifyX509(repaired.get());
else if (&signature == &kCertificatePatternSignature) } else if (&signature == &kCertificatePatternSignature) {
valid = ValidateCertificatePattern(repaired.get()); valid = ValidateCertificatePattern(repaired.get());
else if (&signature == &kProxySettingsSignature) } else if (&signature == &kProxySettingsSignature) {
valid = ValidateProxySettings(repaired.get()); valid = ValidateProxySettings(repaired.get());
else if (&signature == &kProxyLocationSignature) } else if (&signature == &kProxyLocationSignature) {
valid = ValidateProxyLocation(repaired.get()); valid = ValidateProxyLocation(repaired.get());
else if (&signature == &kEAPSignature) } else if (&signature == &kEAPSignature) {
valid = ValidateEAP(repaired.get()); valid = ValidateEAP(repaired.get());
else if (&signature == &kCertificateSignature) } else if (&signature == &kCertificateSignature) {
valid = ValidateCertificate(repaired.get()); valid = ValidateCertificate(repaired.get());
}
} }
if (valid) { if (valid) {
......
...@@ -186,7 +186,7 @@ INSTANTIATE_TEST_CASE_P( ...@@ -186,7 +186,7 @@ INSTANTIATE_TEST_CASE_P(
&kNetworkConfigurationSignature, &kNetworkConfigurationSignature,
true), true),
OncParams("translation_of_shill_ethernet_with_ipconfig.onc", OncParams("translation_of_shill_ethernet_with_ipconfig.onc",
&kNetworkConfigurationSignature, &kNetworkWithStateSignature,
true), true),
OncParams("translation_of_shill_wifi_with_state.onc", OncParams("translation_of_shill_wifi_with_state.onc",
&kNetworkWithStateSignature, &kNetworkWithStateSignature,
...@@ -319,6 +319,10 @@ INSTANTIATE_TEST_CASE_P( ...@@ -319,6 +319,10 @@ INSTANTIATE_TEST_CASE_P(
&kNetworkConfigurationSignature, &kNetworkConfigurationSignature,
false), false),
RepairParams("", "network-nested-state-field-repaired")), 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", std::make_pair(OncParams("openvpn-missing-verify-x509-name",
&kNetworkConfigurationSignature, false), &kNetworkConfigurationSignature, false),
RepairParams("", "openvpn-missing-verify-x509-name")), RepairParams("", "openvpn-missing-verify-x509-name")),
......
...@@ -5,24 +5,58 @@ ...@@ -5,24 +5,58 @@
}, },
"GUID": "123", "GUID": "123",
"IPConfigs": { "IPConfigs": {
"DevicePolicy": [ { "Active": [ {
"IPAddress": "127.0.0.1", "Gateway": "2001:db8:85a3::7a2e:370:7331",
"Type": "IPv4" "IPAddress": "2001:0db8:85a3:0000:0000:8a2e:0370:7334",
"NameServers": [ ],
"RoutingPrefix": 12,
"Type": "IPv6"
} ], } ],
"Effective": "UserPolicy", "Effective": "Unmanaged"
"UserPolicy": [ { },
"IPAddress": "127.0.0.1", "SavedIPConfig": {
"RoutingPrefix": 32, "Gateway": {
"Type": "IPv4" "Active": "1.1.1.4",
} ], "Effective": "Unmanaged"
"UserSetting": [ { },
"IPAddress": "127.0.0.1", "IPAddress": {
"SearchDomains": [ "acme.org" ], "Active": "124.124.124.124",
"Type": "IPv4" "Effective": "Unmanaged"
}, { },
"IPAddress": "1.2.3.4", "NameServers": {
"Type": "IPv4" "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": { "Name": {
"Active": "testopenvpn", "Active": "testopenvpn",
......
{ "GUID": "123", { "GUID": "123",
"Type": "VPN", "Type": "VPN",
"Name": "testopenvpn", "Name": "testopenvpn",
"IPConfigs": [ "StaticIPConfig": {
{ "Type": "IPv4", "Type": "IPv4",
"IPAddress": "127.0.0.1" } "IPAddress": "127.0.0.1"
], },
"VPN": { "VPN": {
"Host": "device policys host", "Host": "device policys host",
"Recommended": ["Host"], "Recommended": ["Host"],
......
...@@ -3,5 +3,15 @@ ...@@ -3,5 +3,15 @@
"Name": "name", "Name": "name",
"Ethernet": { "Ethernet": {
"Authentication": "None" "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"
} }
} }
...@@ -89,11 +89,11 @@ ...@@ -89,11 +89,11 @@
"GUID": "guid", "GUID": "guid",
"Type": "Ethernet", "Type": "Ethernet",
"Name": "name", "Name": "name",
"IPConfigs": [ "StaticIPConfig": {
{ "Type": "IPv4", "Type": "IPv4",
"IPAddress": "127.0.0.1", "IPAddress": "127.0.0.1",
"RoutingPrefix": 123 } "RoutingPrefix": 123
], },
"Ethernet": { "Ethernet": {
"Authentication": "None" "Authentication": "None"
} }
...@@ -170,11 +170,11 @@ ...@@ -170,11 +170,11 @@
"GUID": "guid", "GUID": "guid",
"Type": "Ethernet", "Type": "Ethernet",
"Name": "name", "Name": "name",
"IPConfigs": [ "StaticIPConfig": {
{ "Type": "IPv4", "Type": "IPv4",
"IPAddress": "127.0.0.1", "IPAddress": "127.0.0.1",
"RoutingPrefix": 123 } "RoutingPrefix": 123
], },
"Ethernet": { "Ethernet": {
"Authentication": "None" "Authentication": "None"
} }
...@@ -224,6 +224,19 @@ ...@@ -224,6 +224,19 @@
"Authentication": "None" "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": { "network-with-client-cert-pattern": {
"GUID": "guid", "GUID": "guid",
"Type": "WiFi", "Type": "WiFi",
......
...@@ -3,11 +3,16 @@ ...@@ -3,11 +3,16 @@
[ { "GUID": "123", [ { "GUID": "123",
"Type": "VPN", "Type": "VPN",
"Name": "testopenvpn", "Name": "testopenvpn",
"IPConfigs": [ "StaticIPConfig": {
{ "Type": "IPv4", "Gateway":"1.1.1.1",
"IPAddress": "127.0.0.1", "IPAddress": "127.0.0.1",
"RoutingPrefix": 32 } "NameServers":[
], "1.1.1.2",
"1.1.1.3"
],
"RoutingPrefix": 32,
"Type": "IPv4"
},
"VPN": { "VPN": {
"Host": "policys host", "Host": "policys host",
"Recommended": ["Host"], "Recommended": ["Host"],
......
{ "GUID": "123", { "GUID": "123",
"Type": "VPN", "Type": "VPN",
"Name": "testopenvpn", "Name": "testopenvpn",
"IPConfigs": [ "StaticIPConfig": {
{ "Type": "IPv4", "Type": "IPv4",
"IPAddress": "127.0.0.1", "IPAddress": "127.0.0.1",
"RoutingPrefix": 32 } "RoutingPrefix": 32
], },
"VPN": { "VPN": {
"Host": "policys host", "Host": "policys host",
"Recommended": ["Host"], "Recommended": ["Host"],
......
{ "GUID": "123", { "GUID": "123",
"Type": "VPN", "Type": "VPN",
"Name": "testopenvpn", "Name": "testopenvpn",
"IPConfigs": [ "StaticIPConfig": {
{ "Type": "IPv4", "Type": "IPv4",
"IPAddress": "127.0.0.1", "IPAddress": "127.0.0.1",
"RoutingPrefix": 32 } "RoutingPrefix": 32
], },
"VPN": { "VPN": {
"Host": "policys host", "Host": "policys host",
"Type": "OpenVPN", "Type": "OpenVPN",
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
[ { "GUID": "123", [ { "GUID": "123",
"Type": "VPN", "Type": "VPN",
"Name": "testopenvpn", "Name": "testopenvpn",
"IPConfigs": [ "StaticIPConfig": {
{ "Type": "IPv4", "Type": "IPv4",
"IPAddress": "127.0.0.1", "IPAddress": "127.0.0.1",
"RoutingPrefix": 32 } "RoutingPrefix": 32
], },
"VPN": { "VPN": {
"Host": "policys host", "Host": "policys host",
"Recommended": ["Host"], "Recommended": ["Host"],
......
{ "GUID": "guid", { "GUID": "guid",
"Type": "ethernet", "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
} }
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
[ { "GUID": "123", [ { "GUID": "123",
"Type": "VPN", "Type": "VPN",
"Name": "testopenvpn", "Name": "testopenvpn",
"IPConfigs": [ "StaticIPConfig": {
{ "Type": "IPv4", "Type": "IPv4",
"IPAddress": "127.0.0.1", "IPAddress": "127.0.0.1",
"RoutingPrefix": 32 } "RoutingPrefix": 32
], },
"VPN": { "VPN": {
"Host": "policys host", "Host": "policys host",
"Recommended": ["Host"], "Recommended": ["Host"],
......
...@@ -4,5 +4,15 @@ ...@@ -4,5 +4,15 @@
}, },
"GUID":"guid", "GUID":"guid",
"Name":"", "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" "Type":"Ethernet"
} }
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
"1.1.1.6" "1.1.1.6"
], ],
"RoutingPrefix":25, "RoutingPrefix":25,
"Type":"IPv4"
}, },
"StaticIPConfig":{ "StaticIPConfig":{
"Gateway":"1.1.1.7", "Gateway":"1.1.1.7",
...@@ -40,6 +41,7 @@ ...@@ -40,6 +41,7 @@
"1.1.1.8" "1.1.1.8"
], ],
"RoutingPrefix":26, "RoutingPrefix":26,
"Type":"IPv4"
}, },
"Type":"Ethernet" "Type":"Ethernet"
} }
...@@ -11,11 +11,9 @@ ...@@ -11,11 +11,9 @@
"ProxySettings": { "ProxySettings": {
"Type": "Direct" "Type": "Direct"
}, },
"IPConfigs": [ "StaticIPConfig": {
{ "Type": "IPv4", "Type": "IPv4",
"IPAddress": "127.0.0.1", "IPAddress": "1.2.3.4",
"SearchDomains": [ "acme.org" ] }, "SearchDomains": [ "acme.org" ]
{ "Type": "IPv4", }
"IPAddress": "1.2.3.4" }
]
} }
{ "Type": "VPN", { "Type": "VPN",
"Name": "testopenvpn", "Name": "testopenvpn",
"ConnectionState": "Connected", "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"
}
} }
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