Package org.jruby.ext.socket
Class SubnetUtils.SubnetInfo
java.lang.Object
org.jruby.ext.socket.SubnetUtils.SubnetInfo
- Enclosing class:
- SubnetUtils
Convenience container for subnet summary information.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intaddress()intprivate intintGet the count of available addresses.String[]Return the high address as a dotted IP address.Return the low address as a dotted IP address.private inthigh()private booleanisInRange(int address) booleanReturns true if the parameteraddressis in the range of usable endpoint addresses for this subnet.private intlow()private intnetmask()private intnetwork()toString()
-
Constructor Details
-
SubnetInfo
private SubnetInfo()
-
-
Method Details
-
netmask
private int netmask() -
network
private int network() -
address
private int address() -
broadcast
private int broadcast() -
low
private int low() -
high
private int high() -
isInRange
Returns true if the parameteraddressis in the range of usable endpoint addresses for this subnet. This excludes the network and broadcast adresses.- Parameters:
address- A dot-delimited IPv4 address, e.g. "192.168.0.1"- Returns:
- True if in range, false otherwise
-
isInRange
private boolean isInRange(int address) -
getBroadcastAddress
-
getNetworkAddress
-
getNetmask
-
getAddress
-
getLowAddress
Return the low address as a dotted IP address. Will be zero for CIDR/31 and CIDR/32 if the inclusive flag is false.- Returns:
- the IP address in dotted format, may be "0.0.0.0" if there is no valid address
-
getHighAddress
Return the high address as a dotted IP address. Will be zero for CIDR/31 and CIDR/32 if the inclusive flag is false.- Returns:
- the IP address in dotted format, may be "0.0.0.0" if there is no valid address
-
getAddressCount
public int getAddressCount()Get the count of available addresses. Will be zero for CIDR/31 and CIDR/32 if the inclusive flag is false.- Returns:
- the count of addresses, may be zero.
-
asInteger
-
getCidrSignature
-
getAllAddresses
-
toString
-