Beispiel #1
0
 public bool Contains(IPNet network)
 {
     return(network != null &&
            AddressFamily == network.AddressFamily &&
            TinyFirstAddressInSubnet <= network.TinyFirstAddressInSubnet &&
            network.TinyLastAddressInSubnet <= TinyLastAddressInSubnet);
     //return (TSubnet & TIPAddress) == (TSubnet & network.TIPAddress & TIPAddress );
 }
Beispiel #2
0
 public static bool TryParse(string ipOrCidr, out IPNet net)
 {
     try { net = Parse(ipOrCidr); return(true); }
     catch { net = null; return(false); }
 }
Beispiel #3
0
 public bool IsPrivateNetwork(IPNet network) =>
 ReservedPrivateRanges.Any(r => r.Contains(network));
Beispiel #4
0
 public bool Contains(IPNet network) =>
 network != null &&
 AddressFamily == network.AddressFamily &&
 TinyFirstAddressInSubnet <= network.TinyFirstAddressInSubnet &&
 network.TinyLastAddressInSubnet <= TinyLastAddressInSubnet;