public bool InSameSubnet(Ipv4Quad ipv4Quad) { uint maskValue = mask.Value; uint ipv4QuadNetwork = ipv4Quad.Value & maskValue; uint myNetwork = address.Value & maskValue; bool result = (maskValue != 0) && (ipv4QuadNetwork == myNetwork); return(result); }
public Ipv4Address(IPAddress ipAddress) { if (ipAddress.AddressFamily == AddressFamily.InterNetwork) { _Address = new Ipv4Quad(ipAddress); IPAddress ipv4Mask = null; _Mask = new Ipv4Quad(ipv4Mask); } }
public override bool Equals(object obj) { Ipv4Quad ipv4Quad = obj as Ipv4Quad; if (null == ipv4Quad) { return(base.Equals(obj)); } else { return( (this.B1 == ipv4Quad.B1) && (this.B3 == ipv4Quad.B2) && (this.B3 == ipv4Quad.B3) && (this.B4 == ipv4Quad.B4) ); } }
public Ipv4Address(Ipv4Quad address, Ipv4Quad mask) { _Address = address; _Mask = mask; }