Beispiel #1
0
        public override bool Equals(object obj)
        {
            if (obj == null || this.GetType() != obj.GetType())
            {
                return(false);
            }

            IPAddress_v4 c = (IPAddress_v4)obj;

            return(this.Value == c.Value);
        }
        public bool?Validate(HttpRequest request)
        {
            IPAddress_v4 ip = IPAddress_v4.TryCreate(request.UserHostAddress);

            if (ip == null)
            {
                return(null);
            }

            if (this.IPAddresses.Contains(ip) == true)
            {
                return(false);
            }
            return(null);
        }
Beispiel #3
0
        public Boolean?Validate(HttpRequest request)
        {
            var          req = request;
            IPAddress_v4 ip  = IPAddress_v4.TryCreate(req.UserHostAddress);

            if (ip == null)
            {
                return(null);
            }

            if (this.Start.Value <= ip.Value && ip.Value <= this.End.Value)
            {
                return(this.Allow);
            }
            return(!this.Allow);
        }
 public IPAddressCondition(IPAddress_v4 start, IPAddress_v4 end, Boolean allow)
 {
     this.Start = start;
     this.End = end;
     this.Allow = allow;
 }
 public IPAddressCondition(IPAddress_v4 start, IPAddress_v4 end)
 {
     this.Start = start;
     this.End = end;
     this.Allow = false;
 }
 public IPAddressCondition(IPAddress_v4 address)
 {
     this.Start = address;
     this.End = address;
     this.Allow = false;
 }
Beispiel #7
0
 public IPAddressCondition(IPAddress_v4 start, IPAddress_v4 end, Boolean allow)
 {
     this.Start = start;
     this.End   = end;
     this.Allow = allow;
 }
Beispiel #8
0
 public IPAddressCondition(IPAddress_v4 start, IPAddress_v4 end)
 {
     this.Start = start;
     this.End   = end;
     this.Allow = false;
 }
Beispiel #9
0
 public IPAddressCondition(IPAddress_v4 address)
 {
     this.Start = address;
     this.End   = address;
     this.Allow = false;
 }