| Modifier and Type | Field and Description |
|---|---|
private int |
addressEndInt
The integer for the end address
|
private int |
addressInt
The integer for the base address
|
baseAddress, cidrMask| Modifier | Constructor and Description |
|---|---|
protected |
CIDR4(java.net.Inet4Address newaddr,
int mask) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(CIDR arg) |
boolean |
contains(java.net.InetAddress inetAddress)
Compares the given InetAddress against the CIDR and returns true if
the ip is in the subnet-ip-range and false if not.
|
java.net.InetAddress |
getEndAddress() |
private static java.net.InetAddress |
intToIPv4Address(int addr)
Convert an integer into an (IPv4) InetAddress.
|
private static int |
ipv4AddressToInt(byte[] address)
Given an IPv4 address as array of bytes, convert it into an integer.
|
private static int |
ipv4AddressToInt(java.net.InetAddress addr)
Given an IPv4 address, convert it into an integer.
|
private static int |
ipv4PrefixLengthToLength(int prefixLength)
Given an IPv4 baseAddress length, return the block length.
|
private static int |
ipv4PrefixLengthToMask(int prefixLength)
Given a baseAddress length, return a netmask.
|
equals, getBaseAddress, getIpV4FromIpV6, getIpV6FromIpV4, getMask, hashCode, newCIDR, newCIDR, newCIDR, toStringprivate int addressInt
private final int addressEndInt
public java.net.InetAddress getEndAddress()
getEndAddress in class CIDRpublic int compareTo(CIDR arg)
public boolean contains(java.net.InetAddress inetAddress)
CIDRprivate static int ipv4PrefixLengthToLength(int prefixLength)
private static int ipv4PrefixLengthToMask(int prefixLength)
private static java.net.InetAddress intToIPv4Address(int addr)
throws java.net.UnknownHostException
java.net.UnknownHostExceptionprivate static int ipv4AddressToInt(java.net.InetAddress addr)
java.lang.IllegalArgumentException - if the address is really an
IPv6 address.private static int ipv4AddressToInt(byte[] address)
java.lang.IllegalArgumentException - if the address is really an
IPv6 address.