Package org.jboss.netty.handler.ipfilter
Class CIDR6
java.lang.Object
org.jboss.netty.handler.ipfilter.CIDR
org.jboss.netty.handler.ipfilter.CIDR6
- All Implemented Interfaces:
Comparable<CIDR>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BigInteger
The big integer for the base addressprivate final BigInteger
The big integer for the end addressprivate static final InternalLogger
Fields inherited from class org.jboss.netty.handler.ipfilter.CIDR
baseAddress, cidrMask
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static InetAddress
Convert a big integer into an IPv6 address.int
boolean
contains
(InetAddress inetAddress) Compares the given InetAddress against the CIDR and returns true if the ip is in the subnet-ip-range and false if not.private static BigInteger
Given an IPv6 address, convert it into a BigInteger.private static BigInteger
ipv6CidrMaskToBaseAddress
(int cidrMask) Given an IPv6 baseAddress length, return the block length.private static BigInteger
ipv6CidrMaskToMask
(int cidrMask) Methods inherited from class org.jboss.netty.handler.ipfilter.CIDR
equals, getBaseAddress, getIpV4FromIpV6, getIpV6FromIpV4, getMask, hashCode, newCIDR, newCIDR, newCIDR, toString
-
Field Details
-
logger
-
addressBigInt
The big integer for the base address -
addressEndBigInt
The big integer for the end address
-
-
Constructor Details
-
CIDR6
-
-
Method Details
-
getEndAddress
- Specified by:
getEndAddress
in classCIDR
- Returns:
- the end address of this block.
-
compareTo
-
contains
Description copied from class:CIDR
Compares the given InetAddress against the CIDR and returns true if the ip is in the subnet-ip-range and false if not. -
ipv6CidrMaskToBaseAddress
Given an IPv6 baseAddress length, return the block length. I.e., a baseAddress length of 96 will return 2**32. -
ipv6CidrMaskToMask
-
ipv6AddressToBigInteger
Given an IPv6 address, convert it into a BigInteger.- Returns:
- the integer representation of the InetAddress
- Throws:
IllegalArgumentException
- if the address is not an IPv6 address.
-
bigIntToIPv6Address
Convert a big integer into an IPv6 address.- Returns:
- the inetAddress from the integer
- Throws:
UnknownHostException
- if the big integer is too large, and thus an invalid IPv6 address.
-