add some ipv6 stuff

This commit is contained in:
Doug MacEachern 2006-02-28 20:52:55 +00:00
parent 041ab0034f
commit bfad6a3193
1 changed files with 11 additions and 0 deletions

View File

@ -14,10 +14,14 @@ public class NetFlags {
public static final String ANY_ADDR = "0.0.0.0"; public static final String ANY_ADDR = "0.0.0.0";
public static final String ANY_ADDR_V6 = "::";
public static final String LOOPBACK_HOSTNAME = "localhost"; public static final String LOOPBACK_HOSTNAME = "localhost";
public static final String LOOPBACK_ADDRESS = "127.0.0.1"; public static final String LOOPBACK_ADDRESS = "127.0.0.1";
public static final String LOOPBACK_ADDRESS_V6 = "::1";
/** /**
* interface is up * interface is up
*/ */
@ -165,4 +169,11 @@ public class NetFlags {
return retval; return retval;
} }
public static boolean isAnyAddress(String address) {
return
(address == null) ||
address.equals(ANY_ADDR) ||
address.equals(ANY_ADDR_V6);
}
} }