Package org.onlab.packet
Class Ip6Prefix
- java.lang.Object
-
- org.onlab.packet.IpPrefix
-
- org.onlab.packet.Ip6Prefix
-
public final class Ip6Prefix extends IpPrefix
The class representing an IPv6 network address. This class is immutable.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_MASK_LENGTH
static IpAddress.Version
VERSION
-
Fields inherited from class org.onlab.packet.IpPrefix
IPV4_LINK_LOCAL_PREFIX, IPV4_MULTICAST_PREFIX, IPV6_LINK_LOCAL_PREFIX, IPV6_MULTICAST_PREFIX, MAX_INET_MASK_LENGTH, MAX_INET6_MASK_LENGTH
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Ip6Address
address()
Returns the IPv6 address value of the prefix.static Ip6Prefix
valueOf(byte[] address, int prefixLength)
Converts a byte array and a prefix length into an IPv6 prefix.static Ip6Prefix
valueOf(String address)
Converts a CIDR (slash) notation string (e.g., "1111:2222::/64") into an IPv6 prefix.static Ip6Prefix
valueOf(Ip6Address address, int prefixLength)
Converts an IPv6 address and a prefix length into an IPv6 prefix.-
Methods inherited from class org.onlab.packet.IpPrefix
contains, contains, equals, getIp4Prefix, getIp6Prefix, hashCode, isIp4, isIp6, isMulticast, prefixLength, toString, valueOf, valueOf, valueOf, version
-
-
-
-
Field Detail
-
VERSION
public static final IpAddress.Version VERSION
-
MAX_MASK_LENGTH
public static final int MAX_MASK_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
address
public Ip6Address address()
Returns the IPv6 address value of the prefix.
-
valueOf
public static Ip6Prefix valueOf(byte[] address, int prefixLength)
Converts a byte array and a prefix length into an IPv6 prefix.- Parameters:
address
- the IPv6 address value stored in network byte orderprefixLength
- the prefix length- Returns:
- an IPv6 prefix
- Throws:
IllegalArgumentException
- if the prefix length value is invalid
-
valueOf
public static Ip6Prefix valueOf(Ip6Address address, int prefixLength)
Converts an IPv6 address and a prefix length into an IPv6 prefix.- Parameters:
address
- the IPv6 addressprefixLength
- the prefix length- Returns:
- an IPv6 prefix
- Throws:
IllegalArgumentException
- if the prefix length value is invalid
-
valueOf
public static Ip6Prefix valueOf(String address)
Converts a CIDR (slash) notation string (e.g., "1111:2222::/64") into an IPv6 prefix.- Parameters:
address
- an IP prefix in string form (e.g.,"1111:2222::/64")- Returns:
- an IPv6 prefix
- Throws:
IllegalArgumentException
- if the arguments are invalid
-
-