Beispiel #1
0
 public static BitArray GetHostBits(this SubnetIpAddress ipaddress)
 {
     return(Utils.GetHostBits(
                ipaddress.GetAddressBits(),
                ipaddress.subnetMask.GetNetworkPrefixLength()
                ));
 }
Beispiel #2
0
        public static bool IsInSameSubnet(SubnetIpAddress reference, IPAddress comparison)
        {
            if (reference.AddressFamily != comparison.AddressFamily)
            {
                throw new ArgumentException("reference and comparison IP addresses are not of same address family");
            }

            byte[] refBytes  = reference.GetAddressBytes();
            byte[] compBytes = comparison.GetAddressBytes();

            //TODO
            return(true);
        }