java.lang.Object
org.htmlunit.util.SubnetUtils
Performs subnet calculations given a network address and a subnet mask.
Inspired by
org.apache.commons.net.util.SubnetUtils.- Author:
- Ronald Brill
- See Also:
-
- "https://www.faqs.org/rfcs/rfc1519.html"
-
Constructor Summary
ConstructorsConstructorDescriptionSubnetUtils(String address, String mask) Constructs an instance from a dotted-decimal address and a dotted-decimal mask. -
Method Summary
-
Constructor Details
-
SubnetUtils
Constructs an instance from a dotted-decimal address and a dotted-decimal mask.- Parameters:
address- an IP address, e.g."192.168.0.1"mask- a dotted-decimal netmask, e.g."255.255.0.0"- Throws:
IllegalArgumentException- if the address or mask is invalid
-
-
Method Details
-
isInRange
Returns whether the given dotted-decimal IPv4 address is in the usable endpoint range for this subnet. The network and broadcast addresses are excluded.- Parameters:
address- a dot-delimited IPv4 address, e.g."192.168.0.1"- Returns:
trueif the address is in the usable range,falseotherwise
-