public abstract class InetAddressUtils extends Object
Abstract InetAddressUtils class.
Modifier and Type | Class and Description |
---|---|
static class |
InetAddressUtils.AddressType |
Modifier and Type | Field and Description |
---|---|
static String |
INVALID_BRIDGE_ADDRESS |
static String |
INVALID_STP_BRIDGE_DESIGNATED_PORT |
static String |
INVALID_STP_BRIDGE_ID |
static InetAddress |
ONE_TWENTY_SEVEN |
static InetAddress |
TWO_FIFTY_FIVES |
static InetAddress |
UNPINGABLE_ADDRESS |
static InetAddress |
UNPINGABLE_ADDRESS_IPV6 |
static InetAddress |
ZEROS |
Constructor and Description |
---|
InetAddressUtils() |
Modifier and Type | Method and Description |
---|---|
static InetAddress |
addr(String ipAddrString) |
static InetAddress |
convertBigIntegerIntoInetAddress(BigInteger i) |
static InetAddress |
convertCidrToInetAddressV4(int cidr) |
static InetAddress |
convertCidrToInetAddressV6(int cidr) |
static byte[] |
decr(byte[] address) |
static String |
decr(String address) |
static BigInteger |
difference(InetAddress addr1,
InetAddress addr2) |
static BigInteger |
difference(String addr1,
String addr2) |
static String |
getBridgeAddressFromStpBridgeId(String bridgeId) |
static int |
getBridgeDesignatedPortNumber(String stpPortDesignatedPort) |
static InetAddress |
getInetAddress(byte[] ipAddrOctets) |
static InetAddress |
getInetAddress(int[] octets,
int offset,
int length) |
static InetAddress |
getInetAddress(String dottedNotation)
getInetAddress
|
static InetAddress |
getIpAddressByHexString(String ipaddrhexstrng) |
static InetAddress |
getLocalHostAddress() |
static String |
getLocalHostAddressAsString() |
static String |
getLocalHostName() |
static InetAddress |
getLowestInetAddress(List<InetAddress> addresses)
Given a list of IP addresses, return the lowest as determined by the
numeric representation and not the alphanumeric string.
|
static InetAddress |
getNetwork(InetAddress ipaddress,
InetAddress netmask) |
static byte[] |
incr(byte[] address) |
static String |
incr(String address) |
static boolean |
inSameNetwork(InetAddress addr1,
InetAddress addr2,
InetAddress mask) |
static boolean |
inSameScope(InetAddress addr1,
InetAddress addr2) |
static boolean |
isInetAddressInRange(byte[] addr,
byte[] begin,
byte[] end) |
static boolean |
isInetAddressInRange(byte[] laddr,
String beginString,
String endString) |
static boolean |
isInetAddressInRange(String ipAddr,
byte[] begin,
byte[] end) |
static boolean |
isInetAddressInRange(String addrString,
String beginString,
String endString) |
static boolean |
isValidBridgeAddress(String bridgeAddress) |
static boolean |
isValidStpBridgeId(String bridgeId) |
static boolean |
isValidStpDesignatedPort(String bridgeDesignatedPort) |
static String |
macAddressBytesToString(byte[] macAddress) |
static byte[] |
macAddressStringToBytes(String macAddress) |
static String |
normalize(String ipAddrString)
This function is used to ensure that an IP address string is in fully-qualified
format without any "::" segments for an IPv6 address.
|
static String |
normalizeMacAddress(String macAddress) |
static String |
str(InetAddress addr) |
static BigInteger |
toInteger(InetAddress ipAddress) |
static byte[] |
toIpAddrBytes(String dottedNotation)
toIpAddrBytes
|
static String |
toIpAddrString(byte[] addr)
toIpAddrString
|
static String |
toIpAddrString(InetAddress addr)
toIpAddrString
|
static String |
toOid(InetAddress addr) |
public static final String INVALID_BRIDGE_ADDRESS
public static final String INVALID_STP_BRIDGE_ID
public static final String INVALID_STP_BRIDGE_DESIGNATED_PORT
public static final InetAddress UNPINGABLE_ADDRESS
public static final InetAddress UNPINGABLE_ADDRESS_IPV6
public static final InetAddress ZEROS
public static final InetAddress TWO_FIFTY_FIVES
public static final InetAddress ONE_TWENTY_SEVEN
public static InetAddress getLocalHostAddress()
public static String getLocalHostAddressAsString()
public static String getLocalHostName()
public static String incr(String address) throws UnknownHostException
UnknownHostException
public static byte[] incr(byte[] address) throws UnknownHostException
UnknownHostException
public static String decr(String address) throws UnknownHostException
UnknownHostException
public static byte[] decr(byte[] address) throws UnknownHostException
UnknownHostException
public static InetAddress getInetAddress(int[] octets, int offset, int length)
public static InetAddress getInetAddress(byte[] ipAddrOctets)
public static InetAddress getInetAddress(String dottedNotation)
getInetAddress
dottedNotation
- a String
object.InetAddress
object.public static byte[] toIpAddrBytes(String dottedNotation)
toIpAddrBytes
dottedNotation
- a String
object.public static String toIpAddrString(InetAddress addr)
toIpAddrString
addr
- IP addressString
object.public static String toIpAddrString(byte[] addr)
toIpAddrString
addr
- an array of byte.String
object.public static InetAddress getLowestInetAddress(List<InetAddress> addresses)
addresses
- a List
object.InetAddress
object.public static BigInteger difference(String addr1, String addr2)
public static BigInteger difference(InetAddress addr1, InetAddress addr2)
public static boolean isInetAddressInRange(byte[] laddr, String beginString, String endString)
public static boolean isInetAddressInRange(String addrString, String beginString, String endString)
public static boolean inSameScope(InetAddress addr1, InetAddress addr2)
public static InetAddress getNetwork(InetAddress ipaddress, InetAddress netmask)
public static boolean inSameNetwork(InetAddress addr1, InetAddress addr2, InetAddress mask)
public static boolean isInetAddressInRange(byte[] addr, byte[] begin, byte[] end)
public static boolean isInetAddressInRange(String ipAddr, byte[] begin, byte[] end)
public static InetAddress convertCidrToInetAddressV4(int cidr)
public static InetAddress convertCidrToInetAddressV6(int cidr)
public static InetAddress convertBigIntegerIntoInetAddress(BigInteger i) throws UnknownHostException
UnknownHostException
public static InetAddress addr(String ipAddrString)
public static String normalize(String ipAddrString)
public static String str(InetAddress addr)
public static BigInteger toInteger(InetAddress ipAddress)
public static String toOid(InetAddress addr)
public static byte[] macAddressStringToBytes(String macAddress)
public static String macAddressBytesToString(byte[] macAddress)
public static boolean isValidStpDesignatedPort(String bridgeDesignatedPort)
public static int getBridgeDesignatedPortNumber(String stpPortDesignatedPort)
public static boolean isValidBridgeAddress(String bridgeAddress)
public static boolean isValidStpBridgeId(String bridgeId)
public static String getBridgeAddressFromStpBridgeId(String bridgeId)
public static InetAddress getIpAddressByHexString(String ipaddrhexstrng)
Copyright © 2017. All rights reserved.