Package com.alibaba.druid.support.http.util

Examples of com.alibaba.druid.support.http.util.IPAddress


            }

            return false;
        }

        IPAddress ipAddress = new IPAddress(remoteAddress);

        for (IPRange range : denyList) {
            if (range.isIPAddressInRange(ipAddress)) {
                return false;
            }
View Full Code Here


            if (denyList.size() == 0 && allowList.size() == 0) {
                return true;
            }
        }

        IPAddress ipAddress = new IPAddress(remoteAddress);

        for (IPRange range : denyList) {
            if (range.isIPAddressInRange(ipAddress)) {
                return false;
            }
View Full Code Here

        if (ipV6) {
            return "0:0:0:0:0:0:0:1".equals(remoteAddress) || (denyList.size() == 0 && allowList.size() == 0);
        }

        IPAddress ipAddress = new IPAddress(remoteAddress);

        for (IPRange range : denyList) {
            if (range.isIPAddressInRange(ipAddress)) {
                return false;
            }
View Full Code Here

            if (denyList.size() == 0 && allowList.size() == 0) {
                return true;
            }
        }

        IPAddress ipAddress = new IPAddress(remoteAddress);

        for (IPRange range : denyList) {
            if (range.isIPAddressInRange(ipAddress)) {
                return false;
            }
View Full Code Here

            if (denyList.size() == 0 && allowList.size() == 0) {
                return true;
            }
        }

        IPAddress ipAddress = new IPAddress(remoteAddress);

        for (IPRange range : denyList) {
            if (range.isIPAddressInRange(ipAddress)) {
                return false;
            }
View Full Code Here

            }
           
            return false;
        }

        IPAddress ipAddress = new IPAddress(remoteAddress);

        for (IPRange range : denyList) {
            if (range.isIPAddressInRange(ipAddress)) {
                return false;
            }
View Full Code Here

        IPRange rang = new IPRange("128.242.127.0/24");

        assertEquals("128.242.127.0", rang.getIPAddress().toString());
        assertEquals("255.255.255.0", rang.getIPSubnetMask().toString());

        assertTrue(rang.isIPAddressInRange(new IPAddress("128.242.127.2")));

        assertFalse(rang.isIPAddressInRange(new IPAddress("128.242.126.2")));
       
        rang.toString();
    }
View Full Code Here

        IPRange rang = new IPRange("128.242.127.0/30");

        assertEquals("128.242.127.0", rang.getIPAddress().toString());
        assertEquals("255.255.255.252", rang.getIPSubnetMask().toString());

        assertTrue(rang.isIPAddressInRange(new IPAddress("128.242.127.0")));
        assertTrue(rang.isIPAddressInRange(new IPAddress("128.242.127.1")));
        assertTrue(rang.isIPAddressInRange(new IPAddress("128.242.127.2")));
        assertTrue(rang.isIPAddressInRange(new IPAddress("128.242.127.3")));

        assertFalse(rang.isIPAddressInRange(new IPAddress("128.242.127.4")));

    }
View Full Code Here

    }

    public void test_ipRange_2() throws Exception {
        IPRange rang = new IPRange("10.16.200.0/24");

        assertTrue(rang.isIPAddressInRange(new IPAddress("10.16.200.0")));
        assertTrue(rang.isIPAddressInRange(new IPAddress("10.16.200.255")));

    }
View Full Code Here

    }

    public void test_ipRange_3() throws Exception {
        IPRange rang = new IPRange("0.0.0.0/0");
        assertTrue(rang.isIPAddressInRange(new IPAddress("2.16.200.0")));

    }
View Full Code Here

TOP

Related Classes of com.alibaba.druid.support.http.util.IPAddress

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.