diff --git a/DPCDevClient/DPCDevClient.csproj b/DPCDevClient/DPCDevClient.csproj
index fc91336..c0f1627 100644
--- a/DPCDevClient/DPCDevClient.csproj
+++ b/DPCDevClient/DPCDevClient.csproj
@@ -21,6 +21,7 @@
DEBUG;TRACE
prompt
true
+ x64
bin\x64\Release\
@@ -32,6 +33,9 @@
prompt
true
+
+ DPCDevClient.Program
+
diff --git a/DPCDevClient/Program.cs b/DPCDevClient/Program.cs
index da8bee3..bce44c6 100644
--- a/DPCDevClient/Program.cs
+++ b/DPCDevClient/Program.cs
@@ -1,10 +1,10 @@
-using DPCLibrary.Utils;
+using DPCLibrary.Enums;
+using DPCLibrary.Utils;
using DPCService.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Net.NetworkInformation;
namespace DPCDevClient
{
@@ -12,7 +12,39 @@ internal class Program
{
static void Main(string[] args)
{
+ AddressChangedCallback(null, null);
+ NetworkChange.NetworkAddressChanged += new NetworkAddressChangedEventHandler(AddressChangedCallback);
+
+ string value;
+ do
+ {
+ Console.WriteLine("Startup Complete, Type 'quit' to Shutdown...");
+ value = Console.ReadLine();
+ } while (value.ToUpperInvariant() != "QUIT");
+ }
+
+ static void AddressChangedCallback(object sender, EventArgs e)
+ {
+ Console.WriteLine("Network change detected");
+
+ Console.WriteLine("All Gateway Settings");
+ IList allAdapters = AccessNetInterface.GetAllNetworkInterfaces();
+ foreach (NetworkInterface n in allAdapters)
+ {
+ Console.WriteLine("Name: {0}", n.Name);
+ Console.WriteLine(" Has IPv4 Gateway {0}", AccessNetInterface.InterfaceHasIPv4Gateway(n));
+ Console.WriteLine(" Has IPv6 Gateway {0}", AccessNetInterface.InterfaceHasIPv6Gateway(n));
+ }
+
+ Console.WriteLine("Local Gateway Settings");
+ IList localAdapters = AccessNetInterface.GetLocalNetworkInterfaces();
+ foreach (NetworkInterface n in localAdapters)
+ {
+ Console.WriteLine("Name: {0}", n.Name);
+ Console.WriteLine(" Has IPv4 Gateway {0}", AccessNetInterface.InterfaceHasIPv4Gateway(n));
+ Console.WriteLine(" Has IPv6 Gateway {0}", AccessNetInterface.InterfaceHasIPv6Gateway(n));
+ }
}
}
}
diff --git a/DPCInstaller/ADMX/en-US/DPC.adml b/DPCInstaller/ADMX/en-US/DPC.adml
index b943893..3b01504 100644
--- a/DPCInstaller/ADMX/en-US/DPC.adml
+++ b/DPCInstaller/ADMX/en-US/DPC.adml
@@ -397,8 +397,6 @@ NOTE: This is equivalent to nslookup and cannot account for related but unknown
NOTE: This option does not support wildcards
-NOTE: This option only supports IPv4 address resolution
-
When a Forced Tunnel configuration is enabled this setting is ignored
'Value Name' should be the route to include
@@ -423,8 +421,6 @@ NOTE: This is equivalent to nslookup and cannot account for related but unknown
NOTE: This option does not support wildcards
-NOTE: This option only supports IPv4 address resolution
-
When a Split Tunnel configuration is enabled this setting is ignored
'Value Name' should be the route to include
@@ -481,8 +477,6 @@ NOTE: When Register DNS is configured on the Machine Tunnel, this option is igno
Office 365 traffic is often high bandwidth and communicating with a known and trusted source. These routes can change weekly so the exclusion list is dynamically generated by querying the Microsoft API.
NOTE: This option requires the device identity (not just the user) to have direct (unauthenticated) Internet access to https://endpoints.office.com. Currently a proxy is not supported with this option.
-
-NOTE: This option only supports IPv4 address resolution
Optional - VPN Protocol
Specify the VPN Protocol to use and the order to fallback.
diff --git a/DPCInstaller/ProductVersion.wxi b/DPCInstaller/ProductVersion.wxi
index 4b74044..9144750 100644
--- a/DPCInstaller/ProductVersion.wxi
+++ b/DPCInstaller/ProductVersion.wxi
@@ -1,3 +1,3 @@
-
+
diff --git a/DPCLibrary/DPCLibrary.csproj b/DPCLibrary/DPCLibrary.csproj
index 6dfa206..553d917 100644
--- a/DPCLibrary/DPCLibrary.csproj
+++ b/DPCLibrary/DPCLibrary.csproj
@@ -77,6 +77,7 @@
+
@@ -127,7 +128,7 @@
-
+
@@ -145,6 +146,7 @@
Resources.resx
+
diff --git a/DPCLibrary/Enums/NetworkCapability.cs b/DPCLibrary/Enums/NetworkCapability.cs
new file mode 100644
index 0000000..f977f02
--- /dev/null
+++ b/DPCLibrary/Enums/NetworkCapability.cs
@@ -0,0 +1,10 @@
+namespace DPCLibrary.Enums
+{
+ public enum NetworkCapability
+ {
+ Unknown,
+ IPv4Only,
+ IPv6Only,
+ IPv4AndIpv6
+ }
+}
\ No newline at end of file
diff --git a/DPCLibrary/Models/ProfileUpdate.cs b/DPCLibrary/Models/ManagedProfile.cs
similarity index 100%
rename from DPCLibrary/Models/ProfileUpdate.cs
rename to DPCLibrary/Models/ManagedProfile.cs
diff --git a/DPCLibrary/Models/RasConstants.cs b/DPCLibrary/Models/RasConstants.cs
index 7754156..ad3b0a6 100644
--- a/DPCLibrary/Models/RasConstants.cs
+++ b/DPCLibrary/Models/RasConstants.cs
@@ -23,6 +23,7 @@ public static class RasConstants
public const int CNLEN = 15; //lmcons.h
public const int DNLEN = CNLEN; //lmcons.h
public static readonly IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1);
+ public const int RTM_MAX_ADDRESS_SIZE = 16;
public const int MaxAdapterName = 128;
}
diff --git a/DPCLibrary/Properties/AssemblyInfo.cs b/DPCLibrary/Properties/AssemblyInfo.cs
index acb4178..77012f1 100644
--- a/DPCLibrary/Properties/AssemblyInfo.cs
+++ b/DPCLibrary/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("D'Arcy Services Ltd")]
[assembly: AssemblyProduct("DPCLibrary")]
-[assembly: AssemblyCopyright("Copyright © 2024")]
+[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,6 +32,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("4.0.*")]
+[assembly: AssemblyVersion("5.0.*")]
[assembly: NeutralResourcesLanguage("en")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/DPCLibrary/Utils/AccessNetInterface.cs b/DPCLibrary/Utils/AccessNetInterface.cs
new file mode 100644
index 0000000..c796292
--- /dev/null
+++ b/DPCLibrary/Utils/AccessNetInterface.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.NetworkInformation;
+
+namespace DPCLibrary.Utils
+{
+ public static class AccessNetInterface
+ {
+ public static IList GetAllNetworkInterfaces()
+ {
+ IList adapters = NetworkInterface.GetAllNetworkInterfaces().ToList();
+ return adapters;
+ }
+
+ public static IList GetLocalNetworkInterfaces()
+ {
+ IList adapters = GetAllNetworkInterfaces().Where(ni => ni.OperationalStatus == OperationalStatus.Up &&
+ ni.NetworkInterfaceType != NetworkInterfaceType.Loopback &&
+ ni.NetworkInterfaceType != NetworkInterfaceType.Ppp ).ToList();
+ return adapters;
+ }
+
+ public static IList GetVPNNetworkInterfaces()
+ {
+ IList adapters = GetAllNetworkInterfaces().Where(ni => ni.NetworkInterfaceType == NetworkInterfaceType.Ppp).ToList();
+ return adapters;
+ }
+
+ private static IPAddress[] ValidGateways(NetworkInterface ni)
+ {
+ IPInterfaceProperties IPDetails = ni.GetIPProperties();
+ IPAddress[] validGateways = IPDetails.GatewayAddresses.Where(gw => !gw.Address.IsIPv6Multicast).Select(gw => gw.Address).ToArray();
+ return validGateways;
+ }
+
+ public static bool InterfaceHasIPv4Gateway(NetworkInterface ni)
+ {
+ IPAddress[] validGateways = ValidGateways(ni);
+ return validGateways.Where(gw => gw.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).Count() > 0;
+ }
+
+ public static bool InterfaceHasIPv6Gateway(NetworkInterface ni)
+ {
+ IPAddress[] validGateways = ValidGateways(ni);
+ return validGateways.Where(gw => gw.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6).Count() > 0;
+ }
+ }
+}
diff --git a/DPCLibrary/Utils/AccessWMI.cs b/DPCLibrary/Utils/AccessWMI.cs
index fd29a42..2ad90bc 100644
--- a/DPCLibrary/Utils/AccessWMI.cs
+++ b/DPCLibrary/Utils/AccessWMI.cs
@@ -23,32 +23,17 @@ public static class AccessWMI
private const string MDMWMINamespace = @"root\cimv2\mdm\dmmap";
private const string MDMWMIClassName = "MDM_VPNv2_01";
private const string NetAdapterWMINamespace = @"root\StandardCimv2";
- private const string NetAdapterWMIClassName = "MSFT_NetAdapter";
- private const string NetAdapterConfigWMINamespace = @"root\Cimv2";
- private const string NetAdapterConfigWMIClassName = "Win32_NetworkAdapterConfiguration";
private const string NetInterfaceWMIClassName = "MSFT_NetIPInterface";
private const string RemoteAccessWMINamespace = @"root\Microsoft\Windows\RemoteAccess\Client";
private const string CSPURI = "./Vendor/MSFT/VPNv2";
- public static IList GetNetworkAdapters()
- {
- IEnumerable NetAdapters = WMISession.EnumerateInstances(NetAdapterWMINamespace, NetAdapterWMIClassName);
- return NetAdapters.ToList();
- }
-
public static IList GetNetIPInterfaces()
{
IEnumerable NetAdapters = WMISession.EnumerateInstances(NetAdapterWMINamespace, NetInterfaceWMIClassName);
return NetAdapters.ToList();
}
- public static IList GetNetworkAdapterConfig()
- {
- IEnumerable NetConfig = WMISession.EnumerateInstances(NetAdapterConfigWMINamespace, NetAdapterConfigWMIClassName);
- return NetConfig.ToList();
- }
-
//Can't use Getinstance as Name format is not understood (see Get-NetIPInterface | ft name, interfacealias, addressfamily), instead pull
//List of all interfaces and loop through them searching for the correct interface name
public static CimInstance GetNetIPInterface(string interfaceName, IPAddressFamily protocol)
@@ -69,48 +54,6 @@ public static CimInstance GetNetIPInterface(string interfaceName, IPAddressFamil
return null;
}
- //Can't use Getinstance as Name format is not understood (see Get-NetIPInterface | ft name, interfacealias, addressfamily), instead pull
- //List of all interfaces and loop through them searching for the correct interface name
- public static uint? GetNetIPInterfaceIndex(string interfaceName, IPAddressFamily protocol)
- {
- IList interfaces = GetNetIPInterfaces();
- foreach (CimInstance instance in interfaces)
- {
- if ((string)instance.CimInstanceProperties["InterfaceAlias"].Value == interfaceName)
- {
- int familyInt = Convert.ToInt32(instance.CimInstanceProperties["AddressFamily"].Value, CultureInfo.InvariantCulture);
- if ((IPAddressFamily)familyInt == protocol)
- {
- return Convert.ToUInt32(instance.CimInstanceProperties["InterfaceIndex"].Value, CultureInfo.InvariantCulture);
- }
- }
- }
-
- return null;
- }
-
- public static CimInstance GetNetAdapterConfig(string interfaceName, IPAddressFamily protocol)
- {
- CimInstance interfaceInstance = GetNetIPInterface(interfaceName, protocol);
- if (interfaceInstance == null) return null;
-
- return GetNetAdapterConfig(Convert.ToInt32(interfaceInstance.CimInstanceProperties["InterfaceIndex"].Value, CultureInfo.InvariantCulture));
- }
-
- public static CimInstance GetNetAdapterConfig(int interfaceIndex)
- {
- IList adapters = GetNetworkAdapterConfig();
- foreach (CimInstance instance in adapters)
- {
- if (Convert.ToInt32(instance.CimInstanceProperties["InterfaceIndex"].Value, CultureInfo.InvariantCulture) == interfaceIndex)
- {
- return instance;
- }
- }
-
- return null;
- }
-
public static uint? GetInterfaceMTU(string interfaceName, IPAddressFamily protocol)
{
CimInstance instance = GetNetIPInterface(interfaceName, protocol);
diff --git a/DPCLibrary/Utils/HttpService.cs b/DPCLibrary/Utils/HttpService.cs
index 872689c..386da23 100644
--- a/DPCLibrary/Utils/HttpService.cs
+++ b/DPCLibrary/Utils/HttpService.cs
@@ -1,8 +1,10 @@
-using DPCLibrary.Models;
+using DPCLibrary.Enums;
+using DPCLibrary.Models;
using DPCLibrary.Singletons;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
+using System.Linq;
using System.Net;
using System.Net.Http;
using IPAddress = System.Net.IPAddress;
@@ -13,6 +15,46 @@ public static class HttpService
{
private static bool breakNetwork = false; //Overridden in Tests - not a nice solution but simple without rewriting the entire network stack and removes the need for Microsoft Fakes (Enterprise Only)
+ ///
+ /// This method handles the core logic of preparing to get the latest Office 365 exclusion routes. The Microsoft endpoint requires a unique identifier
+ /// so we get it from registry if it already exists, if it doesn't we generate a new one and save it.
+ /// After we get the results from the HTTP Service we process the results to only return the results that DPC can handle. This is because the service
+ /// will return various types of result including URLs, wildcard URLs, IPv4 and IPv6 routes
+ ///
+ public static List GetOffice365ExcludeRoutes()
+ {
+ Guid? nClientId = AccessRegistry.ReadMachineGuid(RegistrySettings.ClientId, RegistrySettings.InternalStateOffset);
+ Guid clientId;
+ if (nClientId == null)
+ {
+ clientId = Guid.NewGuid();
+ AccessRegistry.SaveMachineData(RegistrySettings.ClientId, clientId.ToString());
+ }
+ else
+ {
+ clientId = (Guid)nClientId;
+ }
+
+ Office365Exclusion[] Office365Endpoints = HttpService.GetOffice365EndPoints(clientId);
+ List UsableIPList = Office365Endpoints.Where(e => e.Ips != null && e.Category == Office365EndpointCategory.Optimize).Select(e => e.Ips).ToList();
+ List ipList = new List();
+ foreach (string[] list in UsableIPList)
+ {
+ foreach (string item in list)
+ {
+ //Skip existing entries
+ if (ipList.Contains(item)) continue;
+
+ if (Validate.IPv4EndpointAddress(item) || Validate.IPv4CIDR(item) || Validate.IPv6EndpointAddress(item) || Validate.IPv6CIDR(item))
+ {
+ ipList.Add(item);
+ }
+ }
+ }
+
+ return ipList;
+ }
+
public static Office365Exclusion[] GetOffice365EndPoints(Guid clientId)
{
if (breakNetwork)
diff --git a/DPCLibrary/Utils/VPNProfileCreator.cs b/DPCLibrary/Utils/VPNProfileCreator.cs
index c805412..420eb72 100644
--- a/DPCLibrary/Utils/VPNProfileCreator.cs
+++ b/DPCLibrary/Utils/VPNProfileCreator.cs
@@ -6,7 +6,6 @@
using System.Globalization;
using System.IO;
using System.Linq;
-using System.Net;
using System.Text;
using System.Xml;
using System.Xml.Schema;
@@ -28,7 +27,7 @@ public class VPNProfileCreator
private readonly StringBuilder ProfileString = new StringBuilder();
private readonly StringBuilder ValidationFailures = new StringBuilder();
private readonly StringBuilder ValidationWarnings = new StringBuilder();
- private readonly StringBuilder ValidationDebugMessages = new StringBuilder();
+ private readonly StringBuilder ValidationInformationalMessages = new StringBuilder();
private readonly string TunnelRegOffset;
//All Tunnels
@@ -382,7 +381,7 @@ public void LoadFromRegistry()
{
ValidationFailures.Clear(); //Clear any existing errors as its assumed that the class is being reused
ValidationWarnings.Clear();
- ValidationDebugMessages.Clear();
+ ValidationInformationalMessages.Clear();
LoadRegistryVariable(ref TunnelType, RegistrySettings.ForceTunnel);
@@ -540,7 +539,18 @@ public void LoadFromRegistry()
LoadRegistryVariable(ref DisableCryptoBinding, RegistrySettings.DisableCryptoBinding, false);
LoadRegistryVariable(ref DNSRouteList, RegistrySettings.DNSRouteList);
+ if (DNSRouteList != null && DNSRouteList.Count > 0 && TunnelType == TunnelType.ForceTunnel)
+ {
+ ValidationWarnings.AppendLine("DNS Inclusions configured while the profile is a Forced Tunnel, ignoring inclusions");
+ DNSRouteList.Clear();
+ }
+
LoadRegistryVariable(ref DNSExcludeRouteList, RegistrySettings.DNSExcludeRouteList);
+ if (DNSExcludeRouteList != null && DNSExcludeRouteList.Count > 0 && TunnelType == TunnelType.SplitTunnel)
+ {
+ ValidationWarnings.AppendLine("DNS Exclusions configured while the profile is a Split Tunnel, ignoring exclusions");
+ DNSExcludeRouteList.Clear();
+ }
}
//Load in Register DNS info for both tunnels, then check the other Tunnel to check that it isn't enabled on both tunnels
@@ -584,7 +594,7 @@ private void ConfigureO365ExcludeRoutes()
{
try
{
- excludeList = GetOffice365ExcludeRoutes();
+ excludeList = HttpService.GetOffice365ExcludeRoutes();
AccessRegistry.SaveMachineData(RegistrySettings.O365LastUpdate, DateTime.UtcNow.ToString(CultureInfo.InvariantCulture));
AccessRegistry.SaveMachineData(RegistrySettings.O365ExclusionKey, excludeList);
@@ -632,6 +642,7 @@ private void ConfigureDNSIncludeRoutes()
try
{
+ //No observed issues have been encountered when IPv6 routes are asked to route down a VPN Tunnel that doesn't support the protocol
string warnings = GetDNSRoutes(ref includeList, DNSRouteList);
if (!string.IsNullOrWhiteSpace(warnings))
@@ -869,11 +880,8 @@ private void LoadRegistryVariable(ref IList var)
}
}
- public void Generate()
+ public void Generate(NetworkCapability gatewayCapability)
{
- ValidateParameters();
-
- //Perform DNS Lookups after performing Validation to avoid routes been added before needing to strip them back out as part of parameter consistancy validation
if (DNSExcludeRouteList != null && DNSExcludeRouteList.Count > 0)
{
ConfigureDNSExcludeRoutes();
@@ -884,6 +892,8 @@ public void Generate()
ConfigureDNSIncludeRoutes();
}
+ ValidateParameters(gatewayCapability);
+
if (ValidateFailed())
{
//We know that there are issues so severe that the profile won't be installed so don't attempt to generate as this can cause crashes which won't show the validation warnings
@@ -1274,6 +1284,11 @@ public bool ValidateWarnings()
return ValidationWarnings.Length != 0;
}
+ public bool ValidateInformationalMessages()
+ {
+ return ValidationInformationalMessages.Length != 0;
+ }
+
public string GetProfileName()
{
return ProfileName;
@@ -1303,6 +1318,18 @@ public string GetValidationWarnings()
}
}
+ public string GetValidationInformationalMessages()
+ {
+ if (string.IsNullOrWhiteSpace(ValidationInformationalMessages.ToString()))
+ {
+ return "";
+ }
+ else
+ {
+ return ValidationInformationalMessages.Insert(0, " - ").ToString().TrimEnd('\n').Replace("\n", "\n - ");
+ }
+ }
+
public string GetProfile() => ProfileString.ToString();
public ManagedProfile GetProfileUpdate()
@@ -1319,7 +1346,7 @@ public ManagedProfile GetProfileUpdate()
MachineEKU = MachineEKU,
ProxyExcludeList = ProxyExcludeList,
ProxyBypassForLocal = ProxyBypassForLocal,
- MTU = MTU
+ MTU = MTU,
};
}
@@ -1328,7 +1355,7 @@ public string SaveProfile(string savePath)
return SaveProfile(ProfileName, GetProfile(), savePath);
}
- private void ValidateParameters()
+ private void ValidateParameters(NetworkCapability ipSupport)
{
//Core Params
//Profile Name
@@ -1345,7 +1372,7 @@ private void ValidateParameters()
if (!string.IsNullOrWhiteSpace(OverrideXML))
{
//Skip parameter validation if override is enabled
- ValidationDebugMessages.AppendLine("Override specified, ignoring checks on all other registry values");
+ ValidationInformationalMessages.AppendLine("Override specified, ignoring checks on all other registry values");
return;
}
@@ -1371,9 +1398,26 @@ private void ValidateParameters()
DNSSuffixList = ValidateList(DNSSuffixList, Validate.ValidateFQDN);
TrustedNetworkList = ValidateList(TrustedNetworkList, Validate.ValidateTrustedNetwork);
- RouteList = ValidateDictionary(RouteList, Validate.IPv4OrIPv6OrCIDR, Validate.Comment);
- RouteExcludeList = ValidateDictionary(RouteExcludeList, Validate.IPv4OrIPv6OrCIDR, Validate.Comment);
- DomainInformationList = ValidateDictionary(DomainInformationList, Validate.ValidateFQDN, Validate.IPAddressCommaList);
+ RouteList = ValidateDictionary(RouteList, Validate.IPv4OrIPv6OrCIDR, Validate.Comment, true);
+ if (ipSupport == NetworkCapability.IPv4AndIpv6)
+ {
+ RouteExcludeList = ValidateDictionary(RouteExcludeList, Validate.IPv4OrIPv6OrCIDR, Validate.Comment, false);
+ }
+ else if (ipSupport == NetworkCapability.IPv4Only)
+ {
+ RouteExcludeList = ValidateDictionary(RouteExcludeList, Validate.IPv4OrCIDR, Validate.Comment, false);
+ }
+ else if (ipSupport == NetworkCapability.IPv6Only)
+ {
+ RouteExcludeList = ValidateDictionary(RouteExcludeList, Validate.IPv6OrCIDR, Validate.Comment, false);
+ }
+ else
+ {
+ ValidationWarnings.AppendLine("Local Network Gateway in Unknown state, defaulting to IPv4 only routing");
+ RouteExcludeList = ValidateDictionary(RouteExcludeList, Validate.IPv4OrCIDR, Validate.Comment, false);
+ }
+
+ DomainInformationList = ValidateDictionary(DomainInformationList, Validate.ValidateFQDN, Validate.IPAddressCommaList, true);
if (InterfaceMetric > 9999)
{
@@ -1541,18 +1585,6 @@ private void ValidateParameters()
}
}
- if (DNSExcludeRouteList != null && DNSExcludeRouteList.Count > 0 && TunnelType == TunnelType.SplitTunnel)
- {
- ValidationWarnings.AppendLine("DNS Exclusions configured while the profile is a Split Tunnel, Ignoring exclusions");
- DNSExcludeRouteList.Clear();
- }
-
- if (DNSRouteList != null && DNSRouteList.Count > 0 && TunnelType == TunnelType.ForceTunnel)
- {
- ValidationWarnings.AppendLine("DNS Inclusions configured while the profile is a Forced Tunnel, Ignoring inclusions");
- DNSRouteList.Clear();
- }
-
//Optional User Params
if (EKUMapping)
{
@@ -1706,7 +1738,7 @@ private IList ValidateList(IList list, Func valida
return returnList;
}
- private Dictionary ValidateDictionary(Dictionary list, Func validateKeyFunction, Func validateValueFunction)
+ private Dictionary ValidateDictionary(Dictionary list, Func validateKeyFunction, Func validateValueFunction, bool WarnSeverity)
{
Dictionary returnList = new Dictionary();
if (list != null)
@@ -1715,7 +1747,14 @@ private Dictionary ValidateDictionary(Dictionary
{
if (!validateKeyFunction(item.Key))
{
- ValidationWarnings.AppendLine(validateKeyFunction.Method + " Failed to validate Key: " + item.Key);
+ if (WarnSeverity)
+ {
+ ValidationWarnings.AppendLine(validateKeyFunction.Method + " Failed to validate Key: " + item.Key);
+ }
+ else
+ {
+ ValidationInformationalMessages.AppendLine("Removing IP Address as gateway does not support it: " + item.Key);
+ }
}
else if (!validateValueFunction(item.Value))
{
@@ -1827,46 +1866,6 @@ private void ValidationCallBack(object sender, ValidationEventArgs args)
}
}
- ///
- /// This method handles the core logic of preparing to get the latest Office 365 exclusion routes. The Microsoft endpoint requires a unique identifier
- /// so we get it from registry if it already exists, if it doesn't we generate a new one and save it.
- /// After we get the results from the HTTP Service we process the results to only return the results that DPC can handle. This is because the service
- /// will return various types of result including URLs, wildcard URLs, IPv4 and IPv6 routes of which DPC can only handle IPv4 currently
- ///
- /// IPv4 route list to be excluded
- private static List GetOffice365ExcludeRoutes()
- {
- Guid? nClientId = AccessRegistry.ReadMachineGuid(RegistrySettings.ClientId, RegistrySettings.InternalStateOffset);
- Guid clientId;
- if (nClientId == null)
- {
- clientId = Guid.NewGuid();
- AccessRegistry.SaveMachineData(RegistrySettings.ClientId, clientId.ToString());
- }
- else
- {
- clientId = (Guid)nClientId;
- }
-
- Office365Exclusion[] Office365Endpoints = HttpService.GetOffice365EndPoints(clientId);
- List UsableIPList = Office365Endpoints.Where(e => e.Ips != null && e.Category == Office365EndpointCategory.Optimize).Select(e => e.Ips).ToList();
- List ipList = new List();
- foreach (string[] list in UsableIPList)
- {
- foreach (string item in list)
- {
- if (ipList.Contains(item)) continue;
- //Don't add IPv6 addresses as currently windows won't connect the profile if a client doesn't have an IPv6 address and there are IPv6 routes in the Route Table
- if (Validate.IPv4EndpointAddress(item) || Validate.IPv4CIDR(item))
- {
- ipList.Add(item);
- }
- }
- }
-
- return ipList;
- }
-
private static Dictionary ResolveDNS(string DNSName, string comment)
{
Dictionary unvalidatedList = new Dictionary();
@@ -1892,7 +1891,6 @@ private static Dictionary ResolveDNS(string DNSName, string comm
private static string GetDNSRoutes(ref Dictionary resolvedIPList, Dictionary DNSList)
{
string warnings = string.Empty;
- //Dictionary resolvedIPList = new Dictionary();
foreach (KeyValuePair DNS in DNSList)
{
try
@@ -1901,12 +1899,12 @@ private static string GetDNSRoutes(ref Dictionary resolvedIPList
{
if (resolvedIPList.ContainsKey(item.Key))
{
+ //Value is the comment to be included with the IP Address so update the value to include all the sources for a specific IP
resolvedIPList[item.Key] += " + " + item.Value;
continue; //Skip Duplicate IPs
}
- //Don't add IPv6 addresses as IPv6 Exclusions added to a machine without an IPv6 address breaks the tunnel completely
- //if (Validate.IPv4(item) || Validate.IPv6(item))
- if (Validate.IPv4EndpointAddress(item.Key))
+
+ if (Validate.IPv4EndpointAddress(item.Key) || Validate.IPv6EndpointAddress(item.Key))
{
resolvedIPList.Add(item.Key, item.Value);
}
diff --git a/DPCLibraryTests/VPNProfileCreatorTests.cs b/DPCLibraryTests/VPNProfileCreatorTests.cs
index d2bef22..d11e9ed 100644
--- a/DPCLibraryTests/VPNProfileCreatorTests.cs
+++ b/DPCLibraryTests/VPNProfileCreatorTests.cs
@@ -237,7 +237,7 @@ public void UserLoadRegistryWithNothing(ProfileType profileType)
{
VPNProfileCreator pro = new VPNProfileCreator(profileType, true);
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(pro.GetValidationFailures());
TestContext.WriteLine(pro.GetValidationWarnings());
Assert.IsTrue(pro.ValidateFailed());
@@ -249,7 +249,7 @@ public void DeviceLoadRegistryWithNothing()
{
VPNProfileCreator pro = new VPNProfileCreator(ProfileType.Machine, true);
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(pro.GetValidationFailures());
TestContext.WriteLine(pro.GetValidationWarnings());
Assert.IsTrue(pro.ValidateFailed());
@@ -266,7 +266,7 @@ public void UserLoadRegistryWithMultipleThumbprintLists(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -304,7 +304,7 @@ public void UserLoadRegistryWith3NPS(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -342,7 +342,7 @@ public void UserLoadRegistryWithNullValues(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -383,7 +383,7 @@ public void UserProfileAlwaysOn(bool alwaysOn)
VPNProfileCreator pro = new VPNProfileCreator(ProfileType.User, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -427,7 +427,7 @@ public void BackupProfileAlwaysNotOn(bool alwaysOn)
VPNProfileCreator pro = new VPNProfileCreator(ProfileType.UserBackup, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -469,7 +469,7 @@ public void UserLoadRegistryWithMultiNetwork(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -508,7 +508,7 @@ public void UserLoadRegistryWithSingleNetwork(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -542,7 +542,7 @@ public void UserLoadRegistryWithDisabledCryptobinding(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -575,7 +575,7 @@ public void UserLoadRegistryWithSmartCard(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -620,7 +620,7 @@ public void UserLoadRegistryWithTrafficFilterDefaultConfig(ProfileType profileTy
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -666,7 +666,7 @@ public void UserLoadRegistryWithTrafficFilterSYSTEMAppId(ProfileType profileType
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -700,7 +700,7 @@ public void UserLoadRegistryWithSingleLineOverride(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -735,7 +735,7 @@ public void UserLoadRegistryWithEKUOIDMissing(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -765,7 +765,7 @@ public void UserLoadRegistryWithEKUSettings(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -802,7 +802,7 @@ public void UserLoadRegistryWithEKUMissingEKUName(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -836,7 +836,7 @@ public void ProfileSavePath(string savePath)
VPNProfileCreator pro = new VPNProfileCreator(ProfileType.User, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string actualSavePath = pro.SaveProfile(savePath);
@@ -869,7 +869,7 @@ public void UserLoadRegistryWithMinimalSettings(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -902,7 +902,7 @@ public void UserLoadRegistryWithExcludeRoutes(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -936,7 +936,7 @@ public void UserLoadRegistryWithRouteMetric(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -972,7 +972,7 @@ public void UserLoadRegistryWithExcludeRoutesAndRouteMetric(ProfileType profileT
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1010,7 +1010,7 @@ public void UserLoadRegistryWithPACProxySettings(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1049,7 +1049,7 @@ public void UserLoadRegistryWithServerProxySettingsShouldWarn(ProfileType profil
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1089,7 +1089,7 @@ public void UserLoadRegistryWithServerProxySettings(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1130,7 +1130,7 @@ public void UserLoadRegistryWithDomainInfoSettings(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1180,7 +1180,7 @@ public void UserLoadRegistryWithExcludeValues(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1222,7 +1222,7 @@ public void UserLoadRegistryWithO365ExclusionSettings(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1264,7 +1264,7 @@ public void UserLoadRegistryWithO365InitialFailSettings(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1307,7 +1307,7 @@ public void UserLoadRegistryWithO365FailOnSecondAttemptSettings(ProfileType prof
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
//Trigger the HttpService to throw errors on every connection attempt
type.SetStaticField("breakNetwork", BindingFlags.NonPublic, true);
@@ -1315,7 +1315,7 @@ public void UserLoadRegistryWithO365FailOnSecondAttemptSettings(ProfileType prof
//Call 2
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1354,7 +1354,7 @@ public void UserLoadRegistryWithDNSIncludeSettings(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1393,7 +1393,7 @@ public void UserLoadRegistryWithDNSIncludeDuplicateIPsSettings(ProfileType profi
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1434,7 +1434,7 @@ public void UserLoadRegistryWithDNSExcludeDuplicateIPsSettings(ProfileType profi
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1475,7 +1475,7 @@ public void UserLoadRegistryWithDNSExcludeSettings(ProfileType profileType)
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1520,7 +1520,7 @@ public void UserLoadRegistryWithDNSExcludeInitialFailSettings(ProfileType profil
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1571,7 +1571,7 @@ public void UserLoadRegistryWithDNSExcludeFailOnSecondAttemptSettings(ProfileTyp
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(pro.GetValidationFailures());
TestContext.WriteLine(pro.GetValidationWarnings());
@@ -1584,7 +1584,7 @@ public void UserLoadRegistryWithDNSExcludeFailOnSecondAttemptSettings(ProfileTyp
//Call 2
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1628,7 +1628,7 @@ public void UserLoadRegistryWithDNSIncludeInitialFailSettings(ProfileType profil
VPNProfileCreator pro = new VPNProfileCreator(profileType, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1678,7 +1678,7 @@ public void UserLoadRegistryWithDNSIncludeFailOnSecondAttemptSettings(ProfileTyp
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(pro.GetValidationFailures());
TestContext.WriteLine(pro.GetValidationWarnings());
@@ -1691,7 +1691,7 @@ public void UserLoadRegistryWithDNSIncludeFailOnSecondAttemptSettings(ProfileTyp
//Call 2
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1725,7 +1725,7 @@ public void DeviceLoadRegistryWithMinimalSettings()
VPNProfileCreator pro = new VPNProfileCreator(ProfileType.Machine, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1753,7 +1753,7 @@ public void DeviceLoadRegistryWithRouteMetric()
VPNProfileCreator pro = new VPNProfileCreator(ProfileType.Machine, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1797,7 +1797,7 @@ public void DeviceLoadRegistryWithDomainNameInfoSettings()
VPNProfileCreator pro = new VPNProfileCreator(ProfileType.Machine, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
@@ -1832,7 +1832,7 @@ public void DeviceLoadRegistryForceTunnel()
VPNProfileCreator pro = new VPNProfileCreator(ProfileType.Machine, false);
pro.LoadFromRegistry();
- pro.Generate();
+ pro.Generate(NetworkCapability.IPv4AndIpv6);
string profile = pro.GetProfile();
diff --git a/DPCManagement/RRASReport/Get-RRASReport.ps1 b/DPCManagement/RRASReport/Get-RRASReport.ps1
index bd8a672..ab31ff9 100644
--- a/DPCManagement/RRASReport/Get-RRASReport.ps1
+++ b/DPCManagement/RRASReport/Get-RRASReport.ps1
@@ -51,10 +51,10 @@ foreach ($Server in $RRASServers) {
$formattedStart = ($Client.ConnectionStartTime).ToString("dd/MM/yyyy HH:mm")
$duration = New-TimeSpan -Start $Client.ConnectionStartTime -End (Get-Date)
if ($duration.Days -gt 0) {
- $durationFormatted = "{0}d {1:hh:mm:ss}" -f $duration.Days, $duration
+ $durationFormatted = $duration.ToString("d\d\ hh\:mm\:ss")
}
else {
- $durationFormatted = "{0:hh:mm:ss}" -f $duration
+ $durationFormatted = $duration.ToString("hh\:mm\:ss")
}
$AllClientDetails += [PSCustomObject]@{
diff --git a/DPCManagement/Scripts/Get-DPCLogs.ps1 b/DPCManagement/Scripts/Get-DPCLogs.ps1
index f08ec7c..b710e9b 100644
--- a/DPCManagement/Scripts/Get-DPCLogs.ps1
+++ b/DPCManagement/Scripts/Get-DPCLogs.ps1
@@ -57,6 +57,9 @@ try
Write-Output "Getting Hostname"
$env:COMPUTERNAME | Out-File (Join-Path -Path $SavePath -ChildPath "SystemInfo\HostName.txt")
+ Write-Output "Getting local Network Settings"
+ ipconfig /all | Out-File (Join-Path -Path $SavePath -ChildPath "SystemInfo\IPDetails.txt")
+
Write-Output "Getting DPC Service Details"
sc.exe qc DPCService | Out-File (Join-Path -Path $SavePath -ChildPath "SystemInfo\ServiceDetails.txt")
diff --git a/DPCManagement/Scripts/Run-TestsAsSYSTEM.ps1 b/DPCManagement/Scripts/Run-TestsAsSYSTEM.ps1
index 1c31bfa..5284962 100644
--- a/DPCManagement/Scripts/Run-TestsAsSYSTEM.ps1
+++ b/DPCManagement/Scripts/Run-TestsAsSYSTEM.ps1
@@ -1,5 +1,5 @@
#$PSExecPath = "C:\Program Files\WindowsApps\Microsoft.SysinternalsSuite_2025.2.0.0_x64__8wekyb3d8bbwe\Tools\PsExec.exe"
-$VSPath = "C:\Program Files\Microsoft Visual Studio\2022\Community"
+$VSPath = "C:\Program Files\Microsoft Visual Studio\18\Community"
$VSTestPath = "$VSPath\Common7\IDE\Extensions\TestPlatform\vstest.console.exe"
$MSBuildpath = "$VSPath\MSBuild\Current\Bin\msbuild.exe"
$SolutionRootPath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent
diff --git a/DPCManagement/Scripts/Update-ETWChannelOrder.ps1 b/DPCManagement/Scripts/Update-ETWChannelOrder.ps1
index 8abf6a5..2b64567 100644
--- a/DPCManagement/Scripts/Update-ETWChannelOrder.ps1
+++ b/DPCManagement/Scripts/Update-ETWChannelOrder.ps1
@@ -28,7 +28,7 @@ if (($null -eq $OperationalChannel) -or ($null -eq $AdminChannel) -or ($null -eq
{
throw "Something went wrong identifying standard channels"
}
-
+
#Create a new Element as the existing Element gets messed up when all the children are re-ordered
$Channels = $Manifest.CreateElement("channels")
diff --git a/DPCService/Core/DPCService.Designer.cs b/DPCService/Core/DPCService.Designer.cs
index 9b24dc7..cc4b66e 100644
--- a/DPCService/Core/DPCService.Designer.cs
+++ b/DPCService/Core/DPCService.Designer.cs
@@ -28,8 +28,12 @@ protected override void Dispose(bool disposing)
///
private void InitializeComponent()
{
- components = new System.ComponentModel.Container();
+ //
+ // DPCService
+ //
+ this.CanShutdown = true;
this.ServiceName = "DPCService";
+
}
#endregion
diff --git a/DPCService/Core/DPCService.cs b/DPCService/Core/DPCService.cs
index 5669e8f..43c48bd 100644
--- a/DPCService/Core/DPCService.cs
+++ b/DPCService/Core/DPCService.cs
@@ -142,10 +142,25 @@ protected override void OnStart(string[] args)
/// them to stop and then gracefully return control to the OS.
///
protected override void OnStop()
+ {
+ ServiceShutdown("OnStop");
+ }
+
+ ///
+ /// This is the method automatically called when Windows is asked to restart and possibly shutdown (Fast start appears to disable this event). It tries to cancel all existing processes, wait for
+ /// them to stop and then gracefully return control to the OS.
+ ///
+ protected override void OnShutdown()
+ {
+ ServiceShutdown("OnShutdown");
+ base.OnShutdown();
+ }
+
+ private void ServiceShutdown(string callingEvent)
{
try
{
- DPCServiceEvents.Log.Shutdown();
+ DPCServiceEvents.Log.Shutdown(callingEvent);
// Update the service state to Start Pending.
ServiceStatus serviceStatus = new ServiceStatus
{
diff --git a/DPCService/Core/DPCService.resx b/DPCService/Core/DPCService.resx
new file mode 100644
index 0000000..e5858cc
--- /dev/null
+++ b/DPCService/Core/DPCService.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ False
+
+
\ No newline at end of file
diff --git a/DPCService/Core/MonitorVPN.cs b/DPCService/Core/MonitorVPN.cs
index d1cb4a8..05e250e 100644
--- a/DPCService/Core/MonitorVPN.cs
+++ b/DPCService/Core/MonitorVPN.cs
@@ -5,6 +5,8 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.Eventing.Reader;
+using System.Linq;
+using System.Net.NetworkInformation;
using System.Threading;
using System.Threading.Tasks;
@@ -39,6 +41,7 @@ public MonitorVPN(SharedData sharedData, CancellationToken token)
token.Register(TokenCancelled);
RootToken = token;
+ AddressChangedCallback(null, null); //Ensure that the initial network state is recorded
}
catch (Exception e)
{
@@ -73,6 +76,8 @@ public void MonitorStart()
MonitorList.Add(new TaskFactory().StartNew(() => AccessRasApi.Start(ConnectionEvent.RASCN_Disconnection, MonitorCancelToken.Token, ProcessDisconnectionEvent)));
MonitorList.Add(new TaskFactory().StartNew(() => AccessRasApi.Start(ConnectionEvent.RASCN_ReConnection, MonitorCancelToken.Token, ProcessReconnectionEvent)));
+ NetworkChange.NetworkAddressChanged += new NetworkAddressChangedEventHandler(AddressChangedCallback);
+
//Get initial application configuration settings
bool restartOnPortAlreadyOpen = AccessRegistry.ReadMachineBoolean(RegistrySettings.RestartOnPortAlreadyOpen, false);
if (restartOnPortAlreadyOpen)
@@ -257,6 +262,42 @@ public void ConnectionFailureLogRestartOnPortAlreadyOpen(object sender, EventRec
}
}
+ private void AddressChangedCallback(object sender, EventArgs e)
+ {
+ bool usingIPv4 = false;
+ bool usingIPv6 = false;
+
+ try
+ {
+ IList adapters = AccessNetInterface.GetLocalNetworkInterfaces();
+
+ usingIPv4 = adapters.Where(n => AccessNetInterface.InterfaceHasIPv4Gateway(n)).Count() > 0;
+ usingIPv6 = adapters.Where(n => AccessNetInterface.InterfaceHasIPv6Gateway(n)).Count() > 0;
+ }
+ catch (Exception ex)
+ {
+ DPCServiceEvents.Log.ErrorGettingNetworkInterfaces(ex.Message);
+ }
+
+ if (usingIPv4 && usingIPv6)
+ {
+ SharedData.LocalGatewayCapability = NetworkCapability.IPv4AndIpv6;
+ }
+ else if (usingIPv4)
+ {
+ SharedData.LocalGatewayCapability = NetworkCapability.IPv4Only;
+ }
+ else if (usingIPv6)
+ {
+ SharedData.LocalGatewayCapability = NetworkCapability.IPv6Only;
+ }
+ else
+ {
+ DPCServiceEvents.Log.NetworkChangeUnkownType();
+ SharedData.LocalGatewayCapability = NetworkCapability.Unknown;
+ }
+ }
+
private void TokenCancelled()
{
try
diff --git a/DPCService/Core/ProfileManager.cs b/DPCService/Core/ProfileManager.cs
index 6d69c31..a55d185 100644
--- a/DPCService/Core/ProfileManager.cs
+++ b/DPCService/Core/ProfileManager.cs
@@ -19,6 +19,7 @@ internal class ProfileManager
private readonly CancellationToken RootToken;
private static readonly Dictionary ProfileList = new Dictionary();
private Timer UpdateTimer = null;
+ private Task GPUpdateNotification;
// This is the synchronization point that prevents events
// from running concurrently, and prevents the main thread
@@ -33,6 +34,7 @@ public ProfileManager(SharedData sharedData, CancellationToken token)
SharedData = sharedData;
token.Register(ShutdownProfileMonitors);
RootToken = token;
+ RegisterForGPUpdateNotification();
}
public void ManagerStartup()
@@ -338,6 +340,25 @@ private void ClearUnmanagedProfiles(object sender, ElapsedEventArgs args)
DPCServiceEvents.Log.TraceMethodFinished("ClearSystemProfiles", "ProfileManager");
}
+ private void ProcessGPUpdateNotification()
+ {
+ DPCServiceEvents.Log.GroupPolicyUpdated();
+ SharedData.OnGPOUpdated(); //Force a refresh when Group Policy has potentially changed
+ }
+
+ private void RegisterForGPUpdateNotification()
+ {
+ DPCServiceEvents.Log.StartGPUpdateMonitoring();
+ try
+ {
+ GPUpdateNotification = new TaskFactory().StartNew(() => AccessUserEnv.StartGPUpdateNotification(RootToken, ProcessGPUpdateNotification));
+ }
+ catch (Exception e)
+ {
+ DPCServiceEvents.Log.MonitorGPUpdateErrorOnStartup(e.Message, e.StackTrace);
+ }
+ }
+
private void ShutdownProfileMonitors()
{
try
@@ -376,6 +397,9 @@ private void ShutdownProfileMonitors()
//Cancel all subThreads
ProfileCancelToken.Cancel();
+ //Wait for the GPO Notification thread to stop
+ GPUpdateNotification?.Wait();
+
//Wait for all child threads to stop
foreach (KeyValuePair t in ProfileList)
{
diff --git a/DPCService/Core/ProfileMonitor.cs b/DPCService/Core/ProfileMonitor.cs
index a390eac..6423e7c 100644
--- a/DPCService/Core/ProfileMonitor.cs
+++ b/DPCService/Core/ProfileMonitor.cs
@@ -22,7 +22,6 @@ public class ProfileMonitor
private string LogProfileName; //Profile name to use when logging, needed for when there isn't a valid profile name set or the profile name is in the middle of changing
private string OldProfileName;
private CancellationToken CancelToken;
- private Task GPUpdateNotification;
// This is the synchronization point that prevents events
// from running concurrently, and prevents the main thread
@@ -55,12 +54,11 @@ public ProfileMonitor(SharedData sharedData, ProfileType profileType, Cancellati
}
//Setup regular check for updated Monitor
- RegisterTimedEvents();
+ RegisterEvents();
UpdateTimer.AutoReset = true;
UpdateTimer.Interval = SharedData.GetUpdateTime();
TriggerEventsManually(); //Force an initial start
- RegisterForGPUpdateNotification();
UpdateTimer.Start();
//Wait for cancellation token to complete before returning thread, this ensures that errors are captured in the thread collection logic
@@ -72,7 +70,30 @@ public ProfileMonitor(SharedData sharedData, ProfileType profileType, Cancellati
}
}
+ private void CheckProfile(object sender, GPOEventArgs args)
+ {
+ DPCServiceEvents.Log.GPOProfileUpdate(LogProfileName);
+ CheckProfile();
+ //Reset the timer
+ UpdateTimer.Stop();
+ UpdateTimer.Start();
+ }
+
+ private void CheckProfile(object sender, GatewayEventArgs args)
+ {
+ DPCServiceEvents.Log.NetworkChangeProfileUpdate(LogProfileName);
+ CheckProfile();
+ //Reset the timer
+ UpdateTimer.Stop();
+ UpdateTimer.Start();
+ }
+
private void CheckProfile(object sender, ElapsedEventArgs args)
+ {
+ DPCServiceEvents.Log.TimeBasedProfileUpdate(LogProfileName);
+ CheckProfile();
+ }
+ private void CheckProfile()
{
DPCServiceEvents.Log.TraceStartMethod("CheckProfile", LogProfileName);
//Skip execution if another instance of this method is already running
@@ -84,7 +105,7 @@ private void CheckProfile(object sender, ElapsedEventArgs args)
{
profile.LoadFromRegistry(); //Reload settings from registry to check for any Group Policy Updates
bool newName = UpdateProfileName(); //Update Name as early as possible to enable better logging of profile names
- profile.Generate();
+ profile.Generate(SharedData.LocalGatewayCapability);
string savePath = null;
try
{
@@ -111,6 +132,11 @@ private void CheckProfile(object sender, ElapsedEventArgs args)
DPCServiceEvents.Log.ProfileGenerationWarnings(LogProfileName, profile.GetValidationWarnings());
}
+ if (profile.ValidateInformationalMessages())
+ {
+ DPCServiceEvents.Log.ProfileGenerationMessages(LogProfileName, profile.GetValidationInformationalMessages());
+ }
+
if (!genFailed)
{
//Build Succeeded and new profile name is selected so schedule old profile removal unless there was no profile previously
@@ -235,28 +261,6 @@ private void CheckForCorruptHiddenPBKs(object sender, ElapsedEventArgs args)
DPCServiceEvents.Log.TraceMethodFinished("CheckForCorruptHiddenPBKs", LogProfileName);
}
- private void ProcessGPUpdateNotification()
- {
- DPCServiceEvents.Log.GroupPolicyUpdated();
- TriggerEventsManually(); //Force a refresh when Group Policy has potentially changed
- //Reset the timer
- UpdateTimer.Stop();
- UpdateTimer.Start();
- }
-
- private void RegisterForGPUpdateNotification()
- {
- DPCServiceEvents.Log.StartGPUpdateMonitoring(LogProfileName);
- try
- {
- GPUpdateNotification = new TaskFactory().StartNew(() => AccessUserEnv.StartGPUpdateNotification(CancelToken, ProcessGPUpdateNotification));
- }
- catch (Exception e)
- {
- DPCServiceEvents.Log.MonitorGPUpdateErrorOnStartup(e.Message, e.StackTrace);
- }
- }
-
public static string SaveWMIProfile(string debugPath, string profileName, string logProfileName, CancellationToken cancelToken)
{
string installedProfileExport;
@@ -328,8 +332,6 @@ private void TokenCancelled()
Thread.Sleep(10);
}
- GPUpdateNotification?.Wait();
-
DPCServiceEvents.Log.ProfileUpdateShutdownComplete(LogProfileName);
}
catch (Exception e)
@@ -401,16 +403,18 @@ private void LoadRegistryVariable(ref string var, string registryValue)
private void TriggerEventsManually()
{
Thread.Sleep(SharedData.GetRandomTime(true)); //Manually triggering a profile update can happen to multiple profiles simultaneously, as such we add a random short pause to split the profile operations out a bit
- CheckProfile(null, null);
+ CheckProfile();
if (ProfileType != ProfileType.Machine)
{
CheckForCorruptHiddenPBKs(null, null);
}
}
- private void RegisterTimedEvents()
+ private void RegisterEvents()
{
UpdateTimer.Elapsed += new ElapsedEventHandler(CheckProfile);
+ SharedData.GatewayChanged += new SharedData.GatewayChangedHandler(CheckProfile);
+ SharedData.GPOUpdated += new SharedData.GPOChangedHandler(CheckProfile);
if (ProfileType != ProfileType.Machine)
{
UpdateTimer.Elapsed += new ElapsedEventHandler(CheckForCorruptHiddenPBKs);
diff --git a/DPCService/DPCService.csproj b/DPCService/DPCService.csproj
index 659eed6..2e2eb32 100644
--- a/DPCService/DPCService.csproj
+++ b/DPCService/DPCService.csproj
@@ -119,6 +119,8 @@
+
+
@@ -157,6 +159,9 @@
+
+ DPCService.cs
+
ResXFileCodeGenerator
Resources.Designer.cs
diff --git a/DPCService/Models/GPOEventArgs.cs b/DPCService/Models/GPOEventArgs.cs
new file mode 100644
index 0000000..07d1914
--- /dev/null
+++ b/DPCService/Models/GPOEventArgs.cs
@@ -0,0 +1,8 @@
+using System;
+
+namespace DPCService.Models
+{
+ public class GPOEventArgs : EventArgs
+ {
+ }
+}
diff --git a/DPCService/Models/GatewayEventArgs.cs b/DPCService/Models/GatewayEventArgs.cs
new file mode 100644
index 0000000..d6a498f
--- /dev/null
+++ b/DPCService/Models/GatewayEventArgs.cs
@@ -0,0 +1,10 @@
+using DPCLibrary.Enums;
+using System;
+
+namespace DPCService.Models
+{
+ public class GatewayEventArgs : EventArgs
+ {
+ public NetworkCapability NetworkCapability { get; set; }
+ }
+}
diff --git a/DPCService/Models/SharedData.cs b/DPCService/Models/SharedData.cs
index 406e123..add8a4f 100644
--- a/DPCService/Models/SharedData.cs
+++ b/DPCService/Models/SharedData.cs
@@ -1,6 +1,7 @@
using DPCLibrary.Enums;
using DPCLibrary.Models;
using DPCLibrary.Utils;
+using DPCService.Enums;
using DPCService.Utils;
using System;
using System.Collections.Generic;
@@ -24,6 +25,20 @@ public class SharedData
private bool UpdateOnUnmanagedConnection;
private CancellationToken CancelToken;
private bool rasManRestartNeeded = false;
+ private NetworkCapability _LocalGatewayCapability = NetworkCapability.Unknown;
+ public delegate void GatewayChangedHandler(object source, GatewayEventArgs e);
+ public delegate void GPOChangedHandler(object source, GPOEventArgs e);
+ public event GatewayChangedHandler GatewayChanged;
+ public event GPOChangedHandler GPOUpdated;
+ protected virtual void OnGatewayChanged()
+ {
+ GatewayChanged?.Invoke(this, new GatewayEventArgs { NetworkCapability = _LocalGatewayCapability });
+ }
+
+ public virtual void OnGPOUpdated()
+ {
+ GPOUpdated?.Invoke(this, new GPOEventArgs());
+ }
public bool DumpOnException { get; }
@@ -405,5 +420,23 @@ public void HandleConnectedProfileUpdate()
}
}
}
+
+ public NetworkCapability LocalGatewayCapability
+ {
+ get
+ {
+ return _LocalGatewayCapability;
+ }
+ set
+ {
+ if (_LocalGatewayCapability != value)
+ {
+ //Only trigger an update if the setting has changed from its current value
+ DPCServiceEvents.Log.NetworkChangeDetected(_LocalGatewayCapability.ToString(), value.ToString());
+ _LocalGatewayCapability = value;
+ OnGatewayChanged();
+ }
+ }
+ }
}
}
\ No newline at end of file
diff --git a/DPCService/Utils/DPCServiceEvents.cs b/DPCService/Utils/DPCServiceEvents.cs
index eea5f3e..7098385 100644
--- a/DPCService/Utils/DPCServiceEvents.cs
+++ b/DPCService/Utils/DPCServiceEvents.cs
@@ -20,7 +20,7 @@ internal sealed class DPCServiceEvents : EventSource
public void InteractiveModeEnabled() { WriteEvent(3); }
[Event(4, Message = "DPC Service Startup Complete", Level = EventLevel.Informational, Channel = EventChannel.Admin)]
- public void StartupComplete() { WriteEvent(4); }
+ public void StartupComplete() { WriteEvent(4); StartupCompleteOperational(); }
[Event(5, Message = "DPC Initializing", Level = EventLevel.Verbose, Channel = EventChannel.Operational)]
public void DPCServiceInitializing() { WriteEvent(5); }
@@ -49,8 +49,8 @@ internal sealed class DPCServiceEvents : EventSource
public void FoundExistingProfiles(int number) { WriteEvent(25, number); }
[Event(26, Message = "Starting unmanaged Profile Removal Service", Level = EventLevel.Informational, Channel = EventChannel.Admin)]
public void StartingUnmanagedProfileRemovalService() { WriteEvent(26); }
- [Event(28, Message = "Starting GPUpdate Notification Service for profile {0}", Level = EventLevel.Informational, Channel = EventChannel.Admin)]
- public void StartGPUpdateMonitoring(string profileName) { WriteEvent(28, profileName); }
+ [Event(28, Message = "Starting GPUpdate Notification Service", Level = EventLevel.Informational, Channel = EventChannel.Admin)]
+ public void StartGPUpdateMonitoring() { WriteEvent(28); }
[Event(29, Message = "Custom MTU setting enabled while existing profiles have not been configured for removal\nIf there are any non-DPC Profiles on this system they will likely also be impacted by the MTU change", Level = EventLevel.Warning, Channel = EventChannel.Admin)]
public void ExistingProfileMTUImpact() { WriteEvent(29); }
[Event(30, Message = "File Logging Configured to: {0}", Level = EventLevel.Informational, Channel = EventChannel.Admin)]
@@ -59,21 +59,25 @@ internal sealed class DPCServiceEvents : EventSource
public void FileLoggingConfigError(string message) { WriteEvent(31, message); }
[Event(32, Message = "File Logging Closure Failed with error message: {0}", Level = EventLevel.Error, Channel = EventChannel.Admin)]
public void FileLoggingDisposeError(string message) { WriteEvent(32, message); }
+ [Event(33, Message = "DPC Service Startup Complete", Level = EventLevel.Informational, Channel = EventChannel.Operational)]
+ public void StartupCompleteOperational() { WriteEvent(33); }
#endregion 1-100 Application Startup
#region 100-199 Application Shutdown
- [Event(100, Message = "DPC Service is stopping", Level = EventLevel.Informational, Channel = EventChannel.Admin)]
- public void Shutdown() { WriteEvent(100); }
+ [Event(100, Message = "DPC Service is stopping from event {0}", Level = EventLevel.Informational, Channel = EventChannel.Admin)]
+ public void Shutdown(string eventName) { WriteEvent(100, eventName); }
[Event(101, Message = "DPC Service is Stopped", Level = EventLevel.Informational, Channel = EventChannel.Admin)]
- public void ShutdownCompleted() { WriteEvent(101); }
+ public void ShutdownCompleted() { WriteEvent(101); ShutdownCompletedOperational(); }
[Event(102, Message = "Canceling all child services", Level = EventLevel.Informational, Channel = EventChannel.Admin)]
public void CancelChildServices() { WriteEvent(102); }
[Event(103, Message = "All child services stopped", Level = EventLevel.Informational, Channel = EventChannel.Admin)]
public void CancelChildServicesCompleted() { WriteEvent(103); }
+ [Event(104, Message = "DPC Service is Stopped", Level = EventLevel.Informational, Channel = EventChannel.Operational)]
+ public void ShutdownCompletedOperational() { WriteEvent(104); }
#endregion 100-199 Application Shutdown
@@ -124,6 +128,10 @@ internal sealed class DPCServiceEvents : EventSource
public void MonitorGPUpdateErrorOnStartup(string message, string stackTrace) { WriteEvent(1022, message, stackTrace); }
[Event(1023, Message = "Spinlock for checking corrupt PBKs in Profile {0} was already owned, skipping profile update", Level = EventLevel.Warning, Channel = EventChannel.Debug)]
public void CorruptPbkCheckSkipped(string profileName) { WriteEvent(1023, profileName); }
+ [Event(1024, Message = "Network change detected, local gateway capability has changed from {0} to {1}", Level = EventLevel.Informational, Channel = EventChannel.Operational)]
+ public void NetworkChangeDetected(string oldValue, string newValue) { WriteEvent(1024, oldValue, newValue); }
+ [Event(1025, Message = "Network change detected, neither IPv4 or IPv6 are supported", Level = EventLevel.Warning, Channel = EventChannel.Operational)]
+ public void NetworkChangeUnkownType() { WriteEvent(1025); }
#endregion 1000-1099 VPN Monitoring
#region 1100-1299 Profile Monitoring
@@ -363,8 +371,16 @@ internal sealed class DPCServiceEvents : EventSource
public void ProfileDebugUpdateProfileDetail(string profileName, string variable, string errorMessage) { WriteEvent(1224, profileName, variable, errorMessage); }
[Event(1225, Message = "No Corrupt PBK Files Found", Level = EventLevel.Informational, Channel = EventChannel.Debug)]
public void DebugNoCorruptPbksFound() { WriteEvent(1225); }
- [Event(1226, Message = "Error getting Proxy Exclusions for Profile {0}: {1}\nStackTrace: {2}", Level = EventLevel.Error, Channel = EventChannel.Operational)]
- public void ErrorGettingProxyExclusions(string profileName, string errorMessage, string stackTrace) { WriteEvent(1226, profileName, errorMessage, stackTrace); }
+ [Event(1226, Message = "Network Capabilities changed, forcing profile update to {0}", Level = EventLevel.Informational, Channel = EventChannel.Operational)]
+ public void NetworkChangeProfileUpdate(string profileName) { WriteEvent(1226, profileName); }
+ [Event(1227, Message = "Scheduled profile update for profile {0}", Level = EventLevel.Informational, Channel = EventChannel.Operational)]
+ public void TimeBasedProfileUpdate(string profileName) { WriteEvent(1227, profileName); }
+ [Event(1228, Message = "Group Policy Updated, updating profile {0}", Level = EventLevel.Informational, Channel = EventChannel.Operational)]
+ public void GPOProfileUpdate(string profileName) { WriteEvent(1228, profileName); }
+ [Event(1229, Message = "Profile {0} has the following additional messages: \n{1}", Level = EventLevel.Informational, Channel = EventChannel.Operational)]
+ public void ProfileGenerationMessages(string profileName, string errors) { WriteEvent(1229, profileName, errors); }
+ [Event(1230, Message = "Error getting Proxy Exclusions for Profile {0}: {1}\nStackTrace: {2}", Level = EventLevel.Error, Channel = EventChannel.Operational)]
+ public void ErrorGettingProxyExclusions(string profileName, string errorMessage, string stackTrace) { WriteEvent(1230, profileName, errorMessage, stackTrace); }
//Event Logs now fail to generate if additional logs are added at this point in the file, adding to the end appears to work for some reason...
#endregion 1100-1299 Profile Monitoring
@@ -389,6 +405,8 @@ internal sealed class DPCServiceEvents : EventSource
public void EventMonitoringConnectionFailedUnknownProperties(int propertyCount) { WriteEvent(2008, propertyCount); }
[Event(2009, Message = "Duplicate Connection Failed event detected with Disconnect Id: {0}", Level = EventLevel.Warning, Channel = EventChannel.Debug)]
public void EventMonitoringConnectionFailedDuplicateEvent(uint disconnectId) { WriteEvent(2009, disconnectId); }
+ [Event(2010, Message = "Windows failed to return network interface list: {0}", Level = EventLevel.Error, Channel = EventChannel.Operational)]
+ public void ErrorGettingNetworkInterfaces(string message) { WriteEvent(2010, message); }
#endregion 2000-2099 Profile Monitoring
#region 9000-10000 Special events
diff --git a/DPCService/Utils/ProfileAction.cs b/DPCService/Utils/ProfileAction.cs
index 6faebcd..55da3cb 100644
--- a/DPCService/Utils/ProfileAction.cs
+++ b/DPCService/Utils/ProfileAction.cs
@@ -479,7 +479,6 @@ public static ManagedProfile GetProfile(string profileName, ProfileType profileT
{
newProfile.MTU = (uint)mtu;
}
-
}
catch (Exception e)
{
diff --git a/README.md b/README.md
index 94f4ef8..8d75a4b 100644
--- a/README.md
+++ b/README.md
@@ -69,6 +69,12 @@ This script is very much in development so please take care and people to active
# Release Notes
+## Version 5.3.0
+- Added support for IPv6 Office 365 Exclusion Routes
+- Re-worked profile route management engine to only configure compatible exclusion routes based on current device network configuration
+- Profile is now validated and potentially regenerated whenever a network change is detected
+- Improved service shutdown logic in the event of device restart
+
## Version 5.2.2
- Updated Proxy examples in ADMX files
- Fixed incorrect Proxy Exceptions option for User Backup Tunnel in ADMX files
diff --git a/ServiceIntergrationTests/AccessRasTests.cs b/ServiceIntergrationTests/AccessRasTests.cs
index 0e1a098..5925368 100644
--- a/ServiceIntergrationTests/AccessRasTests.cs
+++ b/ServiceIntergrationTests/AccessRasTests.cs
@@ -177,7 +177,7 @@ public void UpdateVPNStrategyCustomCryptography(VPNStrategy strategy)
integrityCheckMethod: "SHA256",
encryptionMethod: "AES128"
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
Assert.IsFalse(profile.ValidateFailed());
Assert.IsFalse(profile.ValidateWarnings());
@@ -228,7 +228,7 @@ public void UpdateVPNStrategyCustomCryptographyNotValid(VPNStrategy strategy)
encryptionMethod: "AES128",
vPNStrategy: VPNStrategy.Ikev2Only
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
Assert.IsFalse(profile.ValidateFailed());
Assert.IsFalse(profile.ValidateWarnings());
@@ -263,7 +263,7 @@ public void UpdateVPNStrategyCustomCryptographyNotValid(VPNStrategy strategy)
encryptionMethod: "AES128",
vPNStrategy: strategy
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
Assert.IsFalse(profile.ValidateFailed());
Assert.IsTrue(profile.ValidateWarnings()); //Should have warning disabling customcryptography
diff --git a/ServiceIntergrationTests/HelperFunctions.cs b/ServiceIntergrationTests/HelperFunctions.cs
index 51b1aac..3f24ce2 100644
--- a/ServiceIntergrationTests/HelperFunctions.cs
+++ b/ServiceIntergrationTests/HelperFunctions.cs
@@ -221,7 +221,7 @@ public static VPNProfileCreator BasicUserProfile(SharedData sharedData, string t
{ "10.0.0.0/8", "Server Network" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
Assert.IsFalse(profile.ValidateFailed());
Assert.IsFalse(profile.ValidateWarnings());
@@ -268,7 +268,7 @@ public static string BasicUserProfileCustomCrypto(SharedData sharedData, string
integrityCheckMethod: "SHA256",
encryptionMethod: "AES128"
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
Assert.IsFalse(profile.ValidateFailed());
Assert.IsFalse(profile.ValidateWarnings());
@@ -300,7 +300,7 @@ public static VPNProfileCreator BasicForceTunnelUserProfile(SharedData sharedDat
new List() { "27ac9369faf25207bb2627cefaccbe4ef9c319b8" },
new List() { "NPS01.Test.local" }
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
Assert.IsFalse(profile.ValidateFailed());
Assert.IsFalse(profile.ValidateWarnings());
diff --git a/ServiceIntergrationTests/MachineProfileTests.cs b/ServiceIntergrationTests/MachineProfileTests.cs
index 6aa96bd..f3b91fb 100644
--- a/ServiceIntergrationTests/MachineProfileTests.cs
+++ b/ServiceIntergrationTests/MachineProfileTests.cs
@@ -72,7 +72,7 @@ public void BasicMachineProfileWithTrafficFilters()
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -110,7 +110,7 @@ public void BasicMachineProfileWithTrafficFiltersProtocolOnly()
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -148,7 +148,7 @@ public void BasicMachineProfileWithTrafficFiltersPortAllowICMP()
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -186,7 +186,7 @@ public void BasicMachineProfileWithTrafficFiltersPortNoAppId()
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -226,7 +226,7 @@ public void BasicMachineProfileWithTrafficFiltersForceTunnel()
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -266,7 +266,7 @@ public void BasicMachineProfileWithTrafficFiltersInboundRule()
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -309,7 +309,7 @@ public void BasicMachineProfileWithTrafficFiltersRemoteSplit()
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -353,7 +353,7 @@ public void BasicMachineProfileWithTrafficFiltersRemotePortSplit()
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -397,7 +397,7 @@ public void BasicMachineProfileWithTrafficFiltersRemoteAddress()
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -441,7 +441,7 @@ public void BasicMachineProfileWithTrafficFiltersLocalAddress()
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -487,7 +487,7 @@ public void BasicMachineProfileWithTrafficFiltersAllOptionsSplit()
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -533,7 +533,7 @@ public void BasicMachineProfileWithTrafficFiltersAllOptionsSplitMixedPorts()
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -576,7 +576,7 @@ public void BasicMachineProfileWithTrafficFiltersLocalAndRemoteAddresses()
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -622,7 +622,7 @@ public void BasicMachineProfileWithTrafficFiltersAllOptionsForce()
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -661,7 +661,7 @@ public void BasicMachineProfileWithTrafficFiltersDefault()
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -697,7 +697,7 @@ public void BasicMachineProfileWithManualProxy()
{ "10.0.0.1", "DC1" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -740,7 +740,7 @@ public void BasicMachineProfileWithManualProxyAndExclusions(string proxyAddress)
{ "10.0.0.1", "DC1" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -776,7 +776,7 @@ public void BasicMachineProfileWithPACProxy()
{ "10.0.0.1", "DC1" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -809,7 +809,7 @@ public void BasicMachineProfile()
{ "10.0.0.1", "DC1" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -842,7 +842,7 @@ public void BasicMachineProfileRename()
{ "10.0.0.1", "DC1" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -870,7 +870,7 @@ public void BasicMachineProfileRename()
{ "10.0.0.1", "DC1" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -909,7 +909,7 @@ public void BasicMachineProfileWithMTU(uint MTUValue)
},
mTU: MTUValue
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -947,7 +947,7 @@ public void BasicMachineProfileWithMTUWarning(uint MTUValue)
},
mTU: MTUValue
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -981,7 +981,7 @@ public void BasicMachineProfileWithCertificateEKUFilter()
},
machineEKU: new List { "1.3.6.1.4.1.57200.1.100.2", "1.3.6.1.4.1.100.1.100.2" }
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1016,7 +1016,7 @@ public void BasicMachineProfileRegisterDNS()
registerDNS: true,
dnsAlreadyRegistered: false
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1051,7 +1051,7 @@ public void BasicMachineProfileRegisterDNSWithUserTunnelAlsoRegistered()
registerDNS: true,
dnsAlreadyRegistered: true
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1086,7 +1086,7 @@ public void BasicMachineWithRoutesProfile()
{ "20.56.241.0/24", "External Route" },
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1130,7 +1130,7 @@ public void BasicMachineWithRoutesProfileAndRouteMetric(uint metric)
},
routeMetric: metric
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1169,7 +1169,7 @@ public void BasicMachineWithDomainNameInfoProfile()
{ "10.0.0.1", "DC1" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1210,7 +1210,7 @@ public void BasicMachineWithDomainNameInfoAndTrustedNetworkProfile()
},
trustedNetworkList: new List() { "test.com", "example.net" }
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1244,7 +1244,7 @@ public void BasicMachineWithTrustedNetworkProfile()
{ "10.0.0.1", "DC1" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1276,14 +1276,14 @@ public void OverrideMachineProfile()
HelperFunctions.DefaultConnectionURL,
overrideProfile
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
VPNProfileCreator originalProfile = new VPNProfileCreator(ProfileType.Machine, false);
originalProfile.LoadMachineProfile(profileName,
TunnelType.SplitTunnel,
HelperFunctions.DefaultConnectionURL
);
- originalProfile.Generate();
+ originalProfile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
@@ -1317,7 +1317,7 @@ public void OverrideMachineProfileErrorsAreWarnings()
HelperFunctions.DefaultConnectionURL,
"truetrueAutomaticMschapv2"
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1361,7 +1361,7 @@ public void BasicMachineDebugSave(string savePath)
{ "10.0.0.1", "DC1" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
diff --git a/ServiceIntergrationTests/SharedDataTests.cs b/ServiceIntergrationTests/SharedDataTests.cs
index e9aedea..0d44f51 100644
--- a/ServiceIntergrationTests/SharedDataTests.cs
+++ b/ServiceIntergrationTests/SharedDataTests.cs
@@ -62,7 +62,7 @@ private ManagedProfile CreateBasicUserProfileUpdate(string profileName)
{ "10.0.0.0/8", "Server Network" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -317,7 +317,7 @@ public void InitialBasicSetupWithExistingConnection()
{ "10.0.0.0/8", "Server Network" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
diff --git a/ServiceIntergrationTests/UserProfileTests.cs b/ServiceIntergrationTests/UserProfileTests.cs
index 0dc53ea..dc23f91 100644
--- a/ServiceIntergrationTests/UserProfileTests.cs
+++ b/ServiceIntergrationTests/UserProfileTests.cs
@@ -63,7 +63,7 @@ public void BasicUserProfile(ProfileType profileType)
{ "10.0.0.0/8", "Server Network" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -112,7 +112,7 @@ public void BasicUserProfileWithWeirdCharsInRouteName(string character)
{ "10.0.0.0/8", "Server " + character + " Client Network" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -149,7 +149,7 @@ public void BasicUserProfileDisableNPSValidationNoNPSServers(ProfileType profile
},
disableNPSValidation: true
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -187,7 +187,7 @@ public void BasicUserProfileDisableNPSValidation(ProfileType profileType)
},
disableNPSValidation: true
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -226,7 +226,7 @@ public void BasicUserProfileWithDeviceCompliance(ProfileType profileType)
deviceComplianceEnabled: true,
deviceComplianceIssuerHash: "47beabc922eae80e78783462a79f45c254fde68b"
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -266,7 +266,7 @@ public void BasicUserProfileWithDeviceComplianceCertificateOID(ProfileType profi
deviceComplianceEKUOID: "1.3.5.6.1.1000.1",
deviceComplianceIssuerHash: "47beabc922eae80e78783462a79f45c254fde68b"
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -311,7 +311,7 @@ public void BasicUserProfileWithDeviceComplianceCertificateOIDAndCustomEKU(Profi
eKUName: EKUName,
eKUOID: EKUOID
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -363,7 +363,7 @@ public void CompleteUserProfileWithDeviceCompliance(ProfileType profileType)
encryptionMethod: "AES256",
registerDNS: true
);;
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -403,7 +403,7 @@ public void BasicUserProfileWithWildcardDNSSuffixList(ProfileType profileType)
},
dNSSuffixList: new List() { ".Test.local" }
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -442,7 +442,7 @@ public void BasicUserProfileWithWildcardTrustedDomain(ProfileType profileType)
},
trustedNetworkList: new List() { ".Test.local" }
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -480,7 +480,7 @@ public void BasicUserProfileWithMultipleTrustedDomain(ProfileType profileType)
},
trustedNetworkList: new List() { "XYZ-INTRANET", "MySite XYZ Intranet" }
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -518,7 +518,7 @@ public void BasicUserProfileSSTPOnly(ProfileType profileType)
},
vPNStrategy: VPNStrategy.SstpOnly
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -565,7 +565,7 @@ public void UserWithDomainNameInfoSSTPAndRegisterDNS(ProfileType profileType)
interfaceMetric: 1,
trustedNetworkList: new List() { "ninja.online"}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -604,7 +604,7 @@ public void BasicUserProfileRegisterDNS(ProfileType profileType)
vPNStrategy: VPNStrategy.SstpOnly,
registerDNS: true
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -638,7 +638,7 @@ public void ForceUserSSTP(ProfileType profileType)
new List() { "NPS01.Test.local" },
vPNStrategy: VPNStrategy.SstpFirst
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -672,7 +672,7 @@ public void ForceUserOffice365(ProfileType profileType)
new List() { "NPS01.Test.local" },
excludeO365: true
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -705,7 +705,7 @@ public void ForceUserOffice365BothTunnels()
new List() { "NPS01.Test.local" },
excludeO365: true
);
- userProfile.Generate();
+ userProfile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(userProfile.GetValidationFailures());
TestContext.WriteLine(userProfile.GetValidationWarnings());
Assert.IsFalse(userProfile.ValidateFailed());
@@ -720,7 +720,7 @@ public void ForceUserOffice365BothTunnels()
new List() { "NPS01.Test.local" },
excludeO365: true
);
- backupProfile.Generate();
+ backupProfile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(backupProfile.GetValidationFailures());
TestContext.WriteLine(backupProfile.GetValidationWarnings());
Assert.IsFalse(backupProfile.ValidateFailed());
@@ -764,7 +764,7 @@ public void ForceUserSSTPWithCustomCrypto(ProfileType profileType)
integrityCheckMethod: "SHA256",
encryptionMethod: "AES128"
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -802,7 +802,7 @@ public void BasicUserProfileDisableCryptoBinding(ProfileType profileType)
},
disableCryptoBinding: true
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -840,7 +840,7 @@ public void BasicUserProfileSmartCard(ProfileType profileType)
},
enableEKUSmartCard: true
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -876,7 +876,7 @@ public void BasicUserAndBackupProfile()
{ "10.0.0.0/8", "Server Network" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
//Create Backup Profile
string backupProfileName = "Test Profile 2";
@@ -895,8 +895,8 @@ public void BasicUserAndBackupProfile()
);
//Generate Profiles
- profile.Generate();
- backupProfile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
+ backupProfile.Generate(NetworkCapability.IPv4AndIpv6);
//Validate Primary Profile
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
@@ -955,7 +955,7 @@ public void BasicUserProfileWithTrafficFilters(ProfileType profileType)
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -997,7 +997,7 @@ public void BasicUserProfileWithTrafficFiltersProtocolOnly(ProfileType profileTy
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1039,7 +1039,7 @@ public void BasicUserProfileWithTrafficFiltersPortAllowICMP(ProfileType profileT
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1081,7 +1081,7 @@ public void BasicUserProfileWithTrafficFiltersPortNoAppId(ProfileType profileTyp
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1125,7 +1125,7 @@ public void BasicUserProfileWithTrafficFiltersForceTunnel(ProfileType profileTyp
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1169,7 +1169,7 @@ public void BasicUserProfileWithTrafficFiltersInboundRule(ProfileType profileTyp
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1216,7 +1216,7 @@ public void BasicUserProfileWithTrafficFiltersRemoteSplit(ProfileType profileTyp
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1262,7 +1262,7 @@ public void BasicUserProfileWithTrafficFiltersRemotePortSplit(ProfileType profil
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1308,7 +1308,7 @@ public void BasicUserProfileWithTrafficFiltersRemoteAddress(ProfileType profileT
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1354,7 +1354,7 @@ public void BasicUserProfileWithTrafficFiltersLocalAddress(ProfileType profileTy
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1402,7 +1402,7 @@ public void BasicUserProfileWithTrafficFiltersAllOptionsSplit(ProfileType profil
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1450,7 +1450,7 @@ public void BasicUserProfileWithTrafficFiltersAllOptionsSplitMixedPorts(ProfileT
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1495,7 +1495,7 @@ public void BasicUserProfileWithTrafficFiltersLocalAndRemoteAddresses(ProfileTyp
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1543,7 +1543,7 @@ public void BasicUserProfileWithTrafficFiltersAllOptionsForce(ProfileType profil
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1584,7 +1584,7 @@ public void BasicUserProfileWithTrafficFiltersDefault(ProfileType profileType)
}
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1627,7 +1627,7 @@ public void BasicUserProfileWithExcludeRoutes(ProfileType profileType)
{ "192.168.0.0/24", "Test DMZNetwork" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1665,7 +1665,7 @@ public void BasicUserProfileWithRouteMetric(ProfileType profileType)
},
routeMetric: 56
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1709,7 +1709,7 @@ public void BasicUserProfileWithExcludeRoutesAndRouteMetric(ProfileType profileT
},
routeMetric: 99
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1753,7 +1753,7 @@ public void BasicUserProfileWithUpdatedRouteMetric(ProfileType profileType)
},
routeMetric: 99
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1788,7 +1788,7 @@ public void BasicUserProfileWithUpdatedRouteMetric(ProfileType profileType)
},
routeMetric: 10 //UPDATED
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1820,7 +1820,7 @@ public void BasicForceTunnelUserProfile()
new List() { "27ac9369faf25207bb2627cefaccbe4ef9c319b8" },
new List() { "NPS01.Test.local" }
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1857,7 +1857,7 @@ public void BasicForceTunnelUserProfileWithRouteList(ProfileType profileType)
{ "10.0.0.0/8", "Server Network" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1892,7 +1892,7 @@ public void BasicForceTunnelDNSRegisteredUserProfile(ProfileType profileType)
registerDNS: true,
dnsAlreadyRegistered: false
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1927,7 +1927,7 @@ public void BasicForceTunnelDNSRegisteredOnBothTunnelsUserProfile(ProfileType pr
registerDNS: true,
dnsAlreadyRegistered: true
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -1966,7 +1966,7 @@ public void BasicUserProfileWithIPv6Routes(ProfileType profileType)
{"542:dec:295::/46", "IPv6 Range 2" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2009,7 +2009,7 @@ public void BasicUserProfileWithDefaultRoutes(ProfileType profileType)
{"2a01:111:f402::/48", "Office Route" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2052,7 +2052,7 @@ public void BasicUserProfileWithIPv6ExcludeRoutes(ProfileType profileType)
{"2a01:111:f402::/48", "Office Route" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2092,7 +2092,7 @@ public void BasicUserWithRoutesProfile(ProfileType profileType)
{ "20.56.241.0/24", "External Route" },
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2137,7 +2137,7 @@ public void BasicUserProfileWithDomainNameInfo(ProfileType profileType)
{ "10.0.0.0/8", "Server Network" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2184,7 +2184,7 @@ public void BasicUserProfileWithDomainNameInfoAndTrustedNetwork(ProfileType prof
{ "10.0.0.0/8", "Server Network" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2226,7 +2226,7 @@ public void BasicUserProfileWithMTU(uint MTUValue)
mTU: MTUValue
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2267,7 +2267,7 @@ public void BasicUserProfileWithMTUWarning(uint MTUValue)
mTU: MTUValue
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2305,7 +2305,7 @@ public void BasicUserProfileWithTrustedNetwork(ProfileType profileType)
{ "10.0.0.0/8", "Server Network" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2341,7 +2341,7 @@ public void BasicForceUserProfileWithManualProxy(ProfileType profileType)
proxyType: ProxyType.Manual,
proxyValue: "http://proxy.test.local:8080"
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2382,7 +2382,7 @@ public void BasicForceUserProfileWithManualProxyAndExclusions(string proxyAddres
proxyBypassForLocal: true,
proxyExcludeList: new List() { "*.test.local", "www.test.com"}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2419,7 +2419,7 @@ public void BasicForceUserProfileWithSmartCard(ProfileType profileType)
proxyValue: "http://proxy.test.local:8080",
enableEKUSmartCard: true
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2455,7 +2455,7 @@ public void BasicForceUserProfileWithPACProxy(ProfileType profileType)
proxyType:ProxyType.PAC,
proxyValue:"http://proxy.test.local/proxyfile.pac"
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2492,7 +2492,7 @@ public void BasicForceUserProfileWithPACProxyWithExclusion(ProfileType profileTy
proxyValue: "http://proxy.test.local/proxyfile.pac",
proxyExcludeList: new List() { "exclude.me.local"}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2529,7 +2529,7 @@ public void BasicForceUserProfileWithPACProxyWithSilentExclusion(ProfileType pro
proxyValue: "http://proxy.test.local/proxyfile.pac",
proxyExcludeList: new List() { "PACFILE" }
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2574,7 +2574,7 @@ public void BasicUserForceTunnelProfileWithDomainNameInfo(ProfileType profileTyp
{ "10.0.0.0/8", "Server Network" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2621,7 +2621,7 @@ public void BasicUserForceTunnelProfileWithDomainNameInfoAndTrustedNetwork(Profi
{ "10.0.0.0/8", "Server Network" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2659,7 +2659,7 @@ public void BasicUserForceTunnelProfileWithTrustedNetwork(ProfileType profileTyp
{ "10.0.0.0/8", "Server Network" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2699,7 +2699,7 @@ public void BasicUserForceTunnelProfileWithManualProxy(ProfileType profileType)
{ "10.0.0.0/8", "Network" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2739,7 +2739,7 @@ public void BasicUserForceTunnelProfileWithPACProxy(ProfileType profileType)
{ "10.0.0.0/8", "Server Network" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2775,7 +2775,7 @@ public void OverrideUserProfile(ProfileType profileType)
new List() { "NPS01.Test.local" },
overrideProfile
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
VPNProfileCreator originalProfile = new VPNProfileCreator(profileType, false);
originalProfile.LoadUserProfile(profileName,
@@ -2785,7 +2785,7 @@ public void OverrideUserProfile(ProfileType profileType)
new List() { "27ac9369faf25207bb2627cefaccbe4ef9c319b8" },
new List() { "NPS01.Test.local" }
);
- originalProfile.Generate();
+ originalProfile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
@@ -2824,7 +2824,7 @@ public void OverrideUserProfileErrorsAreWarnings(ProfileType profileType)
"AutomaticMschapv2",
vPNStrategy: VPNStrategy.SstpFirst //As NativeProtocolType is set to Automatic the default VPNStrategy is actually SSTPFirst so we need to set this directly as the DPC default is IKEv2Only
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2859,7 +2859,7 @@ public void OverrideUserProfileErrorsAreWarningsDefaultVPNStrategy(ProfileType p
new List() { "NPS01.Test.local" },
"AutomaticMschapv2"
); //Don't update the DPC VPN Strategy so default it to IKEv2 Only. This will trigger an update as NativeProtocolType is set to automatic which is SSTPFirst
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2905,7 +2905,7 @@ public void BasicUserDebugSave(string savePath)
{ "10.0.0.0/8", "Server Network" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());
@@ -2987,7 +2987,7 @@ public void BasicUserBackupDebugSaveWin10(string savePath)
{ "10.0.0.0/8", "Server Network" }
}
);
- profile.Generate();
+ profile.Generate(NetworkCapability.IPv4AndIpv6);
TestContext.WriteLine(profile.GetValidationFailures());
TestContext.WriteLine(profile.GetValidationWarnings());
Assert.IsFalse(profile.ValidateFailed());