private void init(SubnetMask mask) { this.mask = mask; byte[] networkBytes = Utils.GetBytes(Utils.GetNetworkBits(this.GetAddressBits(), mask.NetworkPrefixLength)); this.network = new NetworkAddress( new IPAddress(networkBytes), mask ); }
public NetworkAddress(IPAddress ipaddress, SubnetMask subnetMask) : base(ipaddress, subnetMask) { init(); }
public SubnetIpAddress(IPAddress ipaddress, SubnetMask subnetMask) : base(ipaddress.GetAddressBytes()) { init(subnetMask); }
public SubnetIpAddress(byte[] address, long scopeid) : base(address, scopeid) { init(SubnetMask.GetDefaultValue(this.AddressFamily)); }
public SubnetIpAddress(long newAddress) : base(newAddress) { init(SubnetMask.GetDefaultValue(this.AddressFamily)); }
public static bool IsInSameSubnet(IPAddress reference, IPAddress comparison, SubnetMask subnetMask) { return(IsInSameSubnet(new SubnetIpAddress(reference, subnetMask), comparison)); }