Package org.opendaylight.protocol.util
Class Ipv6Util
- java.lang.Object
-
- org.opendaylight.protocol.util.Ipv6Util
-
public final class Ipv6Util extends Object
Util class for creating generated Ipv6Address.
-
-
Field Summary
Fields Modifier and Type Field Description static int
IPV6_BITS_LENGTH
static int
IPV6_LENGTH
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone
addressForByteBuf(io.netty.buffer.ByteBuf buffer)
Reads from ByteBuf buffer and converts bytes to Ipv6Address.static io.netty.buffer.ByteBuf
byteBufForAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone ipAddress)
From string ipAddress creates an InetAddress and puts it into ByteBuf.static byte[]
bytesForAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone address)
Converts Ipv6Address to byte array.static byte[]
bytesForPrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix prefix)
Converts Ipv6Prefix to byte array.static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone
getFullForm(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone ip)
Creates uncompressed IP Address.static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix
prefixForByteBuf(io.netty.buffer.ByteBuf buf)
Creates an Ipv6Prefix object from given ByteBuf.static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix
prefixForBytes(byte[] bytes, int length)
Creates an Ipv6Prefix object from given byte array.static List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix>
prefixListForBytes(byte[] bytes)
Creates a list of Ipv6 Prefixes from given byte array.static void
writeIpv6Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone ipv6Address, io.netty.buffer.ByteBuf output)
Writes IPv6 address if not null, otherwise writes zeros to theoutput
ByteBuf.static void
writeIpv6Prefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix ipv6Prefix, io.netty.buffer.ByteBuf output)
Writes IPv6 prefix if not null, otherwise writes zeros to theoutput
ByteBuf.static void
writeMinimalPrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix ipv6Prefix, io.netty.buffer.ByteBuf output)
-
-
-
Field Detail
-
IPV6_LENGTH
public static final int IPV6_LENGTH
- See Also:
- Constant Field Values
-
IPV6_BITS_LENGTH
public static final int IPV6_BITS_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
getFullForm
public static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone getFullForm(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone ip)
Creates uncompressed IP Address.- Parameters:
ip
- to be uncompressed- Returns:
- Ipv6Address with same, but uncompressed, value
-
addressForByteBuf
public static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone addressForByteBuf(io.netty.buffer.ByteBuf buffer)
Reads from ByteBuf buffer and converts bytes to Ipv6Address.- Parameters:
buffer
- containing Ipv6 address, starting at reader index- Returns:
- Ipv6Address
-
byteBufForAddress
public static io.netty.buffer.ByteBuf byteBufForAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone ipAddress)
From string ipAddress creates an InetAddress and puts it into ByteBuf.- Parameters:
ipAddress
- Ipv6 address- Returns:
- ByteBuf with filled in bytes from ipAddress
-
bytesForAddress
public static byte[] bytesForAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone address)
Converts Ipv6Address to byte array.- Parameters:
address
- Ipv6Address to be converted- Returns:
- byte array
-
bytesForPrefix
public static byte[] bytesForPrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix prefix)
Converts Ipv6Prefix to byte array. Prefix length at the end.- Parameters:
prefix
- Ipv6Prefix to be converted- Returns:
- byte array with prefix length at the end
-
prefixForBytes
public static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix prefixForBytes(byte[] bytes, int length)
Creates an Ipv6Prefix object from given byte array.- Parameters:
bytes
- IPv6 addresslength
- prefix length- Returns:
- Ipv6Prefix object
-
prefixForByteBuf
public static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix prefixForByteBuf(io.netty.buffer.ByteBuf buf)
Creates an Ipv6Prefix object from given ByteBuf. Prefix length is assumed to be in the left most byte of the buffer.- Parameters:
buf
- IPv6 address- Returns:
- Ipv6Prefix object
-
prefixListForBytes
public static List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix> prefixListForBytes(byte[] bytes)
Creates a list of Ipv6 Prefixes from given byte array.- Parameters:
bytes
- to be converted to List of Ipv6Prefixes.- Returns:
- A List of Ipv6Prefixes
-
writeIpv6Address
public static void writeIpv6Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone ipv6Address, io.netty.buffer.ByteBuf output)
Writes IPv6 address if not null, otherwise writes zeros to theoutput
ByteBuf. ByteBuf's writerIndex is increased by 16.- Parameters:
ipv6Address
- IPv6 address to be written to the output.output
- ByteBuf, where ipv6Address or zeros are written.
-
writeIpv6Prefix
public static void writeIpv6Prefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix ipv6Prefix, io.netty.buffer.ByteBuf output)
Writes IPv6 prefix if not null, otherwise writes zeros to theoutput
ByteBuf. ByteBuf's writerIndex is increased by 17.- Parameters:
ipv6Prefix
- IPv6 prefix to be written to the output. Prefix is written in the last byte.output
- ByteBuf, where ipv6Prefix or zeros are written.
-
writeMinimalPrefix
public static void writeMinimalPrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix ipv6Prefix, io.netty.buffer.ByteBuf output)
-
-