diff --git a/src/System.Net.IPNetwork/IPNetwork.cs b/src/System.Net.IPNetwork/IPNetwork.cs index 3a15cfc..6ab9e80 100644 --- a/src/System.Net.IPNetwork/IPNetwork.cs +++ b/src/System.Net.IPNetwork/IPNetwork.cs @@ -311,6 +311,25 @@ public static IPNetwork Parse(IPAddress ipaddress, IPAddress netmask) return ipnetwork; } + /// + /// 192.168.0.1/24 + /// 192.168.0.1 255.255.255.0 + /// + /// Network : 192.168.0.0 + /// Netmask : 255.255.255.0 + /// Cidr : 24 + /// Start : 192.168.0.1 + /// End : 192.168.0.254 + /// Broadcast : 192.168.0.255 + /// + /// + /// + public static IPNetwork Parse(string network) + { + IPNetwork.InternalParse(false, network, CidrGuess.ClassFull, true, out var ipnetwork); + return ipnetwork; + } + /// /// 192.168.0.1/24 /// 192.168.0.1 255.255.255.0 @@ -325,12 +344,32 @@ public static IPNetwork Parse(IPAddress ipaddress, IPAddress netmask) /// /// /// - public static IPNetwork Parse(string network, bool sanitanize = true) + public static IPNetwork Parse(string network, bool sanitanize) { IPNetwork.InternalParse(false, network, CidrGuess.ClassFull, sanitanize, out var ipnetwork); return ipnetwork; } + /// + /// 192.168.0.1/24 + /// 192.168.0.1 255.255.255.0 + /// + /// Network : 192.168.0.0 + /// Netmask : 255.255.255.0 + /// Cidr : 24 + /// Start : 192.168.0.1 + /// End : 192.168.0.254 + /// Broadcast : 192.168.0.255 + /// + /// + /// + /// + public static IPNetwork Parse(string network, ICidrGuess cidrGuess) + { + IPNetwork.InternalParse(false, network, cidrGuess, true, out var ipnetwork); + return ipnetwork; + } + /// /// 192.168.0.1/24 /// 192.168.0.1 255.255.255.0 @@ -346,7 +385,7 @@ public static IPNetwork Parse(string network, bool sanitanize = true) /// /// /// - public static IPNetwork Parse(string network, ICidrGuess cidrGuess, bool sanitanize = true) + public static IPNetwork Parse(string network, ICidrGuess cidrGuess, bool sanitanize) { IPNetwork.InternalParse(false, network, cidrGuess, sanitanize, out var ipnetwork); return ipnetwork;