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

            return(equalResult);
        }
Exemplo n.º 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;
        }
Exemplo n.º 3
0
        public static IPv4SubnetMask FromString(string rawValue)
        {
            IPv4Address pseudoAddress = IPv4Address.FromString(rawValue);

            return(FromByteArray(pseudoAddress.GetBytes()));
        }