示例#1
0
        public Boolean IsIPAdressANetworkAddress(IPv4Address address)
        {
            Byte[]  andResult   = ByteHelper.AndArray(_maskAsByte, address.GetBytes());
            Boolean equalResult = ByteHelper.AreEqual(andResult, address.GetBytes());

            return(equalResult);
        }
示例#2
0
        public IPv4Route(IPv4Address network, IPv4SubnetMask subnetMask)
        {
            Byte[] networkBytes = network.GetBytes();

            Byte[]  and    = ByteHelper.AndArray(subnetMask.GetBytes(), networkBytes);
            Boolean result = ByteHelper.AreEqual(networkBytes, and);

            if (result == false)
            {
                throw new ArgumentException();
            }

            Network    = network;
            SubnetMask = subnetMask;
        }