Skip to content

Commit 0f46f58

Browse files
committed
IPv6 subnet calculator added
1 parent e8e9234 commit 0f46f58

17 files changed

Lines changed: 194 additions & 127 deletions
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Globalization;
3+
using System.Numerics;
4+
using System.Windows.Data;
5+
6+
namespace NETworkManager.Converters
7+
{
8+
public sealed class BigIntegerToStringConverter : IValueConverter
9+
{
10+
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
11+
{
12+
return ((BigInteger)value).ToString();
13+
}
14+
15+
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
16+
{
17+
throw new NotImplementedException();
18+
}
19+
}
20+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Copyright (c) 2015, lduchosal
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
10+
* Redistributions in binary form must reproduce the above copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
14+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
18+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Source/NETworkManager/MainWindow.xaml.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,9 @@ private async void MetroWindowMain_Closing(object sender, CancelEventArgs e)
405405
if (notifyIcon != null)
406406
notifyIcon.Dispose();
407407
}
408-
#endregion
408+
#endregion
409409

410-
#region Application Views
410+
#region Application Views
411411
NetworkInterfaceView networkInterfaceView;
412412
IPScannerHostView ipScannerHostView;
413413
PortScannerHostView portScannerHostView;
@@ -589,9 +589,9 @@ private void EventSystem_RedirectToApplicationEvent(object sender, EventArgs e)
589589
break;
590590
}
591591
}
592-
#endregion
592+
#endregion
593593

594-
#region Settings
594+
#region Settings
595595
private void OpenSettings()
596596
{
597597
// Save current language code
@@ -681,9 +681,9 @@ private async void CloseSettings()
681681
if (SettingsManager.Current.SettingsChanged)
682682
SettingsManager.Save();
683683
}
684-
#endregion
684+
#endregion
685685

686-
#region Handle WndProc messages (Single instance, handle HotKeys)
686+
#region Handle WndProc messages (Single instance, handle HotKeys)
687687
private HwndSource hwndSoure;
688688

689689
// This is called after MainWindow() and before OnContentRendered() --> to register hotkeys...
@@ -720,9 +720,9 @@ private IntPtr HwndHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref
720720

721721
return IntPtr.Zero;
722722
}
723-
#endregion
723+
#endregion
724724

725-
#region Update check
725+
#region Update check
726726
private void CheckForUpdates()
727727
{
728728
Updater updater = new Updater();
@@ -742,9 +742,9 @@ private void Updater_UpdateAvailable(object sender, UpdateAvailableArgs e)
742742
UpdateText = string.Format(LocalizationManager.GetStringByKey("String_VersionxxAvailable"), e.Version);
743743
UpdateAvailable = true;
744744
}
745-
#endregion
745+
#endregion
746746

747-
#region HotKeys (Register / Unregister)
747+
#region HotKeys (Register / Unregister)
748748
[DllImport("user32.dll")]
749749
private static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vk);
750750
[DllImport("user32.dll")]
@@ -777,9 +777,9 @@ private void UnregisterHotKeys()
777777
// Clear list
778778
RegisteredHotKeys.Clear();
779779
}
780-
#endregion
780+
#endregion
781781

782-
#region NotifyIcon
782+
#region NotifyIcon
783783
private void InitNotifyIcon()
784784
{
785785
notifyIcon = new NotifyIcon();
@@ -853,9 +853,9 @@ private void BringWindowToFront()
853853

854854
Activate();
855855
}
856-
#endregion
856+
#endregion
857857

858-
#region ICommands & Actions
858+
#region ICommands & Actions
859859
public ICommand OpenWebsiteCommand
860860
{
861861
get { return new RelayCommand(p => OpenWebsiteAction(p)); }
@@ -1052,30 +1052,30 @@ private void ClearSearchAction()
10521052
{
10531053
Search = string.Empty;
10541054
}
1055-
#endregion
1055+
#endregion
10561056

1057-
#region Events
1057+
#region Events
10581058
private void SettingsManager_PropertyChanged(object sender, PropertyChangedEventArgs e)
10591059
{
10601060
if (e.PropertyName == nameof(SettingsInfo.Window_ShowCurrentApplicationTitle))
10611061
OnPropertyChanged(nameof(ShowCurrentApplicationTitle));
10621062
}
1063-
#endregion
1063+
#endregion
10641064

1065-
#region Bugfixes
1065+
#region Bugfixes
10661066
private void ScrollViewer_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
10671067
{
10681068
e.Handled = true;
10691069
}
1070-
#endregion
1070+
#endregion
10711071

1072-
#region Window helper
1072+
#region Window helper
10731073
// Move the window when the user hold the title...
10741074
private void HeaderBorder_MouseDown(object sender, MouseButtonEventArgs e)
10751075
{
10761076
if (e.ChangedButton == MouseButton.Left)
10771077
DragMove();
10781078
}
1079-
#endregion
1079+
#endregion
10801080
}
10811081
}

Source/NETworkManager/Models/Documentation/LibraryManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ public static List<LibraryInfo> List
1515
new LibraryInfo("ControlzEx", "https://github.com/ControlzEx/ControlzEx", "Shared Controlz for WPF and ... more", "MIT License", "https://github.com/ButchersBoy/Dragablz/blob/master/LICENSE"),
1616
new LibraryInfo("Heijden.DNS", "https://www.codeproject.com/Articles/23673/DNS-NET-Resolver-C", "Reusable DNS resolver component.", "Code Project Open License", "https://www.codeproject.com/info/cpol10.aspx"),
1717
new LibraryInfo("Octokit", "https://github.com/octokit/octokit.net", "A GitHub API client library for .NET", "MIT License", "https://github.com/octokit/octokit.net/blob/master/LICENSE.txt"),
18-
new LibraryInfo("#SNMP Libary", "https://github.com/lextm/sharpsnmplib", "Sharp SNMP Library- Open Source SNMP for .NET and Mono", "MIT License", "https://github.com/lextm/sharpsnmplib/blob/master/LICENSE"),
19-
new LibraryInfo("Dragablz", "https://github.com/ButchersBoy/Dragablz", "Dragable and tearable tab control for WPF", "MIT License","https://github.com/ButchersBoy/Dragablz/blob/master/LICENSE")
18+
new LibraryInfo("#SNMP Libary", "https://github.com/lextm/sharpsnmplib", "Sharp SNMP Library - Open Source SNMP for .NET and Mono", "MIT License", "https://github.com/lextm/sharpsnmplib/blob/master/LICENSE"),
19+
new LibraryInfo("Dragablz", "https://github.com/ButchersBoy/Dragablz", "Dragable and tearable tab control for WPF", "MIT License","https://github.com/ButchersBoy/Dragablz/blob/master/LICENSE"),
20+
new LibraryInfo("IPNetwork", "https://github.com/lduchosal/ipnetwork", "C# library take care of complex network, IP, IPv4, IPv6, netmask, CIDR, subnet, subnetting, supernet, and supernetting calculation for .NET developers.", "BSD-2-Clause", "https://github.com/lduchosal/ipnetwork/blob/master/LICENSE")
2021
};
2122
}
2223
}

Source/NETworkManager/NETworkManager.csproj

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@
110110
<Reference Include="Octokit, Version=0.29.0.0, Culture=neutral, processorArchitecture=MSIL">
111111
<HintPath>..\packages\Octokit.0.29.0\lib\net45\Octokit.dll</HintPath>
112112
</Reference>
113-
<Reference Include="SharpSnmpLib, Version=10.0.6.0, Culture=neutral, PublicKeyToken=4c00852d3788e005, processorArchitecture=MSIL">
114-
<HintPath>..\packages\Lextm.SharpSnmpLib.10.0.6\lib\net452\SharpSnmpLib.dll</HintPath>
113+
<Reference Include="SharpSnmpLib, Version=10.0.7.0, Culture=neutral, PublicKeyToken=4c00852d3788e005, processorArchitecture=MSIL">
114+
<HintPath>..\packages\Lextm.SharpSnmpLib.10.0.7\lib\net452\SharpSnmpLib.dll</HintPath>
115115
</Reference>
116116
<Reference Include="System" />
117117
<Reference Include="System.Configuration" />
@@ -120,6 +120,10 @@
120120
<Reference Include="System.IO.Compression" />
121121
<Reference Include="System.IO.Compression.FileSystem" />
122122
<Reference Include="System.Management" />
123+
<Reference Include="System.Net.IPNetwork, Version=2.1.2.0, Culture=neutral, PublicKeyToken=717343cc2c25edcf, processorArchitecture=MSIL">
124+
<HintPath>..\packages\IPNetwork2.2.1.2\lib\net46\System.Net.IPNetwork.dll</HintPath>
125+
</Reference>
126+
<Reference Include="System.Numerics" />
123127
<Reference Include="System.Windows.Forms" />
124128
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
125129
<HintPath>..\packages\ControlzEx.3.0.2.4\lib\net45\System.Windows.Interactivity.dll</HintPath>
@@ -221,6 +225,7 @@
221225
<DependentUpon>PuTTYControl.xaml</DependentUpon>
222226
</Compile>
223227
<Compile Include="Converters\AutoRefreshTimeToStringConverter.cs" />
228+
<Compile Include="Converters\BigIntegerToStringConverter.cs" />
224229
<Compile Include="Converters\TcpStateToStringConverter.cs" />
225230
<Compile Include="Converters\StringIsNotNullOrEmptyToBoolConverter.cs" />
226231
<Compile Include="Converters\StringIsNotNullOrEmptyToVisibilityConverter.cs" />
@@ -581,6 +586,9 @@
581586
<Content Include="Licenses\Heijden.DNS.htm">
582587
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
583588
</Content>
589+
<Content Include="Licenses\IPNetwork.txt">
590+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
591+
</Content>
584592
<Content Include="Licenses\MahApps.Metro.txt">
585593
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
586594
</Content>
@@ -874,7 +882,7 @@
874882
<SubType>Designer</SubType>
875883
<Generator>MSBuild:Compile</Generator>
876884
</Page>
877-
<Page Include="Views\SubnetCalculatorIPv4CalculatorView.xaml">
885+
<Page Include="Views\SubnetCalculatorCalculatorView.xaml">
878886
<SubType>Designer</SubType>
879887
<Generator>MSBuild:Compile</Generator>
880888
</Page>
@@ -981,7 +989,7 @@
981989
<Compile Include="ViewModels\IPScannerViewModel.cs" />
982990
<Compile Include="ViewModels\NetworkInterfaceViewModel.cs" />
983991
<Compile Include="ViewModels\PingViewModel.cs" />
984-
<Compile Include="ViewModels\SubnetCalculatorIPv4CalculatorViewModel.cs" />
992+
<Compile Include="ViewModels\SubnetCalculatorCalculatorViewModel.cs" />
985993
<Compile Include="ViewModels\TracerouteViewModel.cs" />
986994
<Compile Include="ViewModels\WakeOnLANViewModel.cs" />
987995
<Compile Include="Utilities\RelayCommand.cs" />
@@ -1086,8 +1094,8 @@
10861094
<Compile Include="Views\WakeOnLANView.xaml.cs">
10871095
<DependentUpon>WakeOnLANView.xaml</DependentUpon>
10881096
</Compile>
1089-
<Compile Include="Views\SubnetCalculatorIPv4CalculatorView.xaml.cs">
1090-
<DependentUpon>SubnetCalculatorIPv4CalculatorView.xaml</DependentUpon>
1097+
<Compile Include="Views\SubnetCalculatorCalculatorView.xaml.cs">
1098+
<DependentUpon>SubnetCalculatorCalculatorView.xaml</DependentUpon>
10911099
</Compile>
10921100
<Compile Include="MainWindow.xaml.cs">
10931101
<DependentUpon>MainWindow.xaml</DependentUpon>

Source/NETworkManager/Resources/Localization/Resources.de-DE.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<system:String x:Key="String_Header_Scan">Scannen</system:String>
6868
<system:String x:Key="String_Header_Lookup">Lookup</system:String>
6969
<system:String x:Key="String_Header_Subnet">Subnetz</system:String>
70-
<system:String x:Key="String_Header_IPv4Calculator">IPv4-Rechner</system:String>
70+
<system:String x:Key="String_Header_IPCalculator">IP-Rechner</system:String>
7171
<system:String x:Key="String_Header_IPv4Splitter">IPv4-Splitter</system:String>
7272
<system:String x:Key="String_Header_Connect">Verbinden</system:String>
7373
<system:String x:Key="String_Header_AddSession">Sitzung hinzufügen</system:String>
@@ -535,6 +535,7 @@
535535
<system:String x:Key="String_Watermark_ExampleIPv4DNSServers">192.168.178.1; 8.8.8.8; 8.8.4.4</system:String>
536536
<system:String x:Key="String_Watermark_ExamplePortPortRangeOrService">22; 80; https; ldaps; 777 - 999; 8080</system:String>
537537
<system:String x:Key="String_Watermark_ExampleSubnet">192.168.178.133/22 oder 192.168.178.133/255.255.252.0</system:String>
538+
<system:String x:Key="String_Watermark_ExampleIPv4OrIPv6Subnet">192.168.178.133/22 oder 2001:0db8::/64</system:String>
538539
<system:String x:Key="String_Watermark_Filter">Filter...</system:String>
539540
<system:String x:Key="String_Watermark_ExampleWebsiteUri">http(s)://example.com/index.html</system:String>
540541
<system:String x:Key="String_Watermark_ExampleSubnetWithCIDR">192.168.100.0/24</system:String>

Source/NETworkManager/Resources/Localization/Resources.en-US.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<system:String x:Key="String_Header_Scan">Scan</system:String>
6868
<system:String x:Key="String_Header_Lookup">Lookup</system:String>
6969
<system:String x:Key="String_Header_Subnet">Subnet</system:String>
70-
<system:String x:Key="String_Header_IPv4Calculator">IPv4 Calculator</system:String>
70+
<system:String x:Key="String_Header_IPCalculator">IP Calculator</system:String>
7171
<system:String x:Key="String_Header_IPv4Splitter">IPv4 Splitter</system:String>
7272
<system:String x:Key="String_Header_Connect">Connect</system:String>
7373
<system:String x:Key="String_Header_AddSession">Add session</system:String>
@@ -535,6 +535,7 @@
535535
<system:String x:Key="String_Watermark_ExampleIPv4DNSServers">192.168.178.1; 8.8.8.8; 8.8.4.4</system:String>
536536
<system:String x:Key="String_Watermark_ExamplePortPortRangeOrService">22; 80; https; ldaps; 777 - 999; 8080</system:String>
537537
<system:String x:Key="String_Watermark_ExampleSubnet">192.168.178.133/22 or 192.168.178.133/255.255.252.0</system:String>
538+
<system:String x:Key="String_Watermark_ExampleIPv4OrIPv6Subnet">192.168.178.133/22 or 2001:0db8::/64</system:String>
538539
<system:String x:Key="String_Watermark_Filter">Filter...</system:String>
539540
<system:String x:Key="String_Watermark_ExampleWebsiteUri">http(s)://example.com/index.html</system:String>
540541
<system:String x:Key="String_Watermark_ExampleSubnetWithCIDR">192.168.100.0/24</system:String>

Source/NETworkManager/Resources/Localization/Resources.ru-RU.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<system:String x:Key="String_Header_Scan">Скан</system:String>
6868
<system:String x:Key="String_Header_Lookup">Lookup</system:String>
6969
<system:String x:Key="String_Header_Subnet">Подсеть</system:String>
70-
<system:String x:Key="String_Header_IPv4Calculator">IPv4 Калькулятор</system:String>
70+
<system:String x:Key="String_Header_IPCalculator">IP Калькулятор</system:String>
7171
<system:String x:Key="String_Header_IPv4Splitter">IPv4 Делитель</system:String>
7272
<system:String x:Key="String_Header_Connect">Подключить</system:String>
7373
<system:String x:Key="String_Header_AddSession">Добавить сеанс</system:String>
@@ -535,6 +535,7 @@
535535
<system:String x:Key="String_Watermark_ExampleIPv4DNSServers">192.168.178.1; 8.8.8.8; 8.8.4.4</system:String>
536536
<system:String x:Key="String_Watermark_ExamplePortPortRangeOrService">22; 80; https; ldaps; 777 - 999; 8080</system:String>
537537
<system:String x:Key="String_Watermark_ExampleSubnet">192.168.178.133/22 or 192.168.178.133/255.255.252.0</system:String>
538+
<system:String x:Key="String_Watermark_ExampleIPv4OrIPv6Subnet">192.168.178.133/22 or 2001:0db8::/64</system:String>
538539
<system:String x:Key="String_Watermark_Filter">Фильтр...</system:String>
539540
<system:String x:Key="String_Watermark_ExampleWebsiteUri">http(s)://example.com/index.html</system:String>
540541
<system:String x:Key="String_Watermark_ExampleSubnetWithCIDR">192.168.100.0/24</system:String>

Source/NETworkManager/Utilities/RegexHelper.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static class RegexHelper
2323
private const string CidrRegex = @"([1-9]|[1-2][0-9]|3[0-2])";
2424

2525
// Match a Subnetmask like 255.255.255.0
26-
public const string SubnetmaskRegex = @"^" + SubnetmaskValues + @"&";
26+
public const string SubnetmaskRegex = @"^" + SubnetmaskValues + @"&";
2727

2828
// Match a subnet from 192.168.178.0/1 to 192.168.178.0/32
2929
public const string IPv4AddressCidrRegex = @"^" + IPv4AddressValues + @"\/" + CidrRegex + @"$";
@@ -37,6 +37,9 @@ public static class RegexHelper
3737
// Match a subnet from 192.168.178.0/0.0.0.0 to 192.168.178.0/255.255.255.255
3838
public const string SubnetCalculatorIPv4AddressSubnetmaskRegex = "^" + IPv4AddressValues + @"\/" + SubnetmaskValues + @"$";
3939

40+
// Match a subnet like
41+
public const string IPv6AddressCidrRegex = @"^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*(\/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))?$";
42+
4043
// Match a range like [0-255], [0,2,4] and [2,4-6]
4144
public const string SpecialRangeRegex = @"\[((?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|((?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)-(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)))([,]((?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|((?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)-(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))))*\]";
4245

Source/NETworkManager/Validators/SubnetCalculatorSubnetValidator.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ public override ValidationResult Validate(object value, CultureInfo cultureInfo)
1818
if (Regex.IsMatch(subnet, RegexHelper.SubnetCalculatorIPv4AddressSubnetmaskRegex))
1919
return ValidationResult.ValidResult;
2020

21+
if (Regex.IsMatch(subnet, RegexHelper.IPv6AddressCidrRegex))
22+
return ValidationResult.ValidResult;
23+
2124
return new ValidationResult(false, LocalizationManager.GetStringByKey("String_ValidationError_EnterValidSubnet"));
2225
}
2326
}

0 commit comments

Comments
 (0)