Class SubnetUtils6.SubnetInfo

java.lang.Object
org.apache.commons.net.util.SubnetUtils6.SubnetInfo
Enclosing class:
SubnetUtils6

public final class SubnetUtils6.SubnetInfo extends Object
Contains IPv6 subnet summary information.
Since:
3.13.0
  • Method Details

    • getAddress

      public String getAddress()
      Gets the address used to initialize this subnet.
      Returns:
      the address as a string in standard IPv6 format.
    • getAddressCount

      Gets the count of available addresses in this subnet.

      For IPv6, this can be astronomically large. A /64 subnet has 2^64 addresses.

      Returns:
      the count of addresses as a BigInteger.
    • getCidrSignature

      Gets the CIDR notation for this subnet.
      Returns:
      the CIDR signature (e.g., "2001:db8::1/64").
    • getHighAddress

      Gets the highest address in this subnet.
      Returns:
      the high address as a string in standard IPv6 format.
    • getLowAddress

      Gets the lowest address in this subnet (the network address).
      Returns:
      the low address as a string in standard IPv6 format.
    • getNetworkAddress

      Gets the network address for this subnet.
      Returns:
      the network address as a string in standard IPv6 format.
    • getPrefixLength

      public int getPrefixLength()
      Gets the prefix length for this subnet.
      Returns:
      the prefix length (0-128).
    • isInRange

      public boolean isInRange(BigInteger addr)
      Tests if the given address is within this subnet range.
      Parameters:
      addr - the IPv6 address to test (as a BigInteger).
      Returns:
      true if the address is in range.
    • isInRange

      public boolean isInRange(byte[] addr)
      Tests if the given address is within this subnet range.
      Parameters:
      addr - the IPv6 address to test as a byte array (16 bytes).
      Returns:
      true if the address is in range.
    • isInRange

      public boolean isInRange(Inet6Address addr)
      Tests if the given address is within this subnet range.
      Parameters:
      addr - the IPv6 address to test.
      Returns:
      true if the address is in range.
    • isInRange

      public boolean isInRange(String addr)
      Tests if the given address is within this subnet range.
      Parameters:
      addr - the IPv6 address to test as a string.
      Returns:
      true if the address is in range.
      Throws:
      IllegalArgumentException - if the address cannot be parsed.
    • toString

      public String toString()
      Returns a summary of this subnet for debugging.
      Overrides:
      toString in class Object
      Returns:
      a multi-line debug string summarizing this subnet.