Class SubnetUtils6.SubnetInfo
java.lang.Object
org.apache.commons.net.util.SubnetUtils6.SubnetInfo
- Enclosing class:
SubnetUtils6
Contains IPv6 subnet summary information.
- Since:
- 3.13.0
-
Method Summary
Modifier and TypeMethodDescriptionGets the address used to initialize this subnet.Gets the count of available addresses in this subnet.Gets the CIDR notation for this subnet.Gets the highest address in this subnet.Gets the lowest address in this subnet (the network address).Gets the network address for this subnet.intGets the prefix length for this subnet.booleanisInRange(byte[] addr) Tests if the given address is within this subnet range.booleanTests if the given address is within this subnet range.booleanisInRange(BigInteger addr) Tests if the given address is within this subnet range.booleanisInRange(Inet6Address addr) Tests if the given address is within this subnet range.toString()Returns a summary of this subnet for debugging.
-
Method Details
-
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
Gets the prefix length for this subnet.- Returns:
- the prefix length (0-128).
-
isInRange
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
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
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
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
-