Add static all-zero IP address

Change-Id: I235e88b710ca2867bc381a04f579aa9da0199227
This commit is contained in:
Charles Chan 2017-05-09 10:33:04 -07:00 committed by Jonathan Hart
parent 69ebcbbefa
commit 1cf4ca32b6
2 changed files with 10 additions and 0 deletions

View File

@ -32,6 +32,11 @@ public final class Ip4Address extends IpAddress {
public static final int BYTE_LENGTH = IpAddress.INET_BYTE_LENGTH; public static final int BYTE_LENGTH = IpAddress.INET_BYTE_LENGTH;
public static final int BIT_LENGTH = IpAddress.INET_BIT_LENGTH; public static final int BIT_LENGTH = IpAddress.INET_BIT_LENGTH;
/**
* All-zero unspecified IPv4 address.
*/
public static final Ip4Address ZERO = Ip4Address.valueOf("0.0.0.0");
/** /**
* Constructor for given IP address version and address octets. * Constructor for given IP address version and address octets.
* *

View File

@ -31,6 +31,11 @@ public final class Ip6Address extends IpAddress {
public static final int BYTE_LENGTH = IpAddress.INET6_BYTE_LENGTH; public static final int BYTE_LENGTH = IpAddress.INET6_BYTE_LENGTH;
public static final int BIT_LENGTH = IpAddress.INET6_BIT_LENGTH; public static final int BIT_LENGTH = IpAddress.INET6_BIT_LENGTH;
/**
* All-zero unspecified IPv6 address.
*/
public static final Ip6Address ZERO = Ip6Address.valueOf("::");
/** /**
* Constructor for given IP address version and address octets. * Constructor for given IP address version and address octets.
* *