diff --git a/util/src/main/java/org/hyperledger/besu/util/NetworkUtility.java b/util/src/main/java/org/hyperledger/besu/util/NetworkUtility.java index 58bca88b63e..7937c7df00c 100644 --- a/util/src/main/java/org/hyperledger/besu/util/NetworkUtility.java +++ b/util/src/main/java/org/hyperledger/besu/util/NetworkUtility.java @@ -197,6 +197,12 @@ public static boolean isPortAvailable(final int port) { return isPortAvailableForTcp(port) && isPortAvailableForUdp(port); } + + /** + * Is hostAddress string an ip v4 address + * @param hostAddress the host address as a string + * @return true if the host address is an ip v4 address + */ public static boolean isIpV4Address(final String hostAddress) { try { return InetAddresses.forString(hostAddress) instanceof Inet4Address; @@ -205,6 +211,11 @@ public static boolean isIpV4Address(final String hostAddress) { } } + /** + * Is hostAddress string an ip v6 address + * @param hostAddress the host address as a string + * @return true if the host address is an ip v6 address + */ public static boolean isIpV6Address(final String hostAddress) { try { return InetAddresses.forString(hostAddress) instanceof Inet6Address;