Class CIDR6

java.lang.Object
org.jboss.netty.handler.ipfilter.CIDR
org.jboss.netty.handler.ipfilter.CIDR6
All Implemented Interfaces:
Comparable<CIDR>

public class CIDR6 extends CIDR
  • Field Details

    • logger

      private static final InternalLogger logger
    • addressBigInt

      private BigInteger addressBigInt
      The big integer for the base address
    • addressEndBigInt

      private final BigInteger addressEndBigInt
      The big integer for the end address
  • Constructor Details

    • CIDR6

      protected CIDR6(Inet6Address newaddress, int newmask)
  • Method Details

    • getEndAddress

      public InetAddress getEndAddress()
      Specified by:
      getEndAddress in class CIDR
      Returns:
      the end address of this block.
    • compareTo

      public int compareTo(CIDR arg)
    • contains

      public boolean contains(InetAddress inetAddress)
      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.
      Specified by:
      contains in class CIDR
      Returns:
      returns true if the given IP address is inside the currently set network.
    • ipv6CidrMaskToBaseAddress

      private static BigInteger ipv6CidrMaskToBaseAddress(int cidrMask)
      Given an IPv6 baseAddress length, return the block length. I.e., a baseAddress length of 96 will return 2**32.
    • ipv6CidrMaskToMask

      private static BigInteger ipv6CidrMaskToMask(int cidrMask)
    • ipv6AddressToBigInteger

      private static BigInteger ipv6AddressToBigInteger(InetAddress addr)
      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

      private static InetAddress bigIntToIPv6Address(BigInteger addr) throws UnknownHostException
      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.