public final class Ipv4Util extends Object
Modifier and Type | Field and Description |
---|---|
static int |
IP4_BITS_LENGTH |
static int |
IP4_LENGTH |
Modifier and Type | Method and Description |
---|---|
static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address |
addressForByteBuf(io.netty.buffer.ByteBuf buffer)
Reads from ByteBuf buffer and converts bytes to Ipv4Address.
|
static io.netty.buffer.ByteBuf |
byteBufForAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address 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.Ipv4Address address)
Converts Ipv4Address to byte array.
|
static byte[] |
bytesForPrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix prefix)
Converts Ipv4Prefix to byte array.
|
static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress |
getIpAddress(InetAddress inetAddress)
Converts InetAddress to IpAddress.
|
protected static int |
getPrefixLength(String prefixValue)
Obtains prefix length from given string prefix.
|
static int |
getPrefixLengthBytes(String prefix)
Returns number of minimum bytes needed to cover all bits of prefix.
|
static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address |
incrementIpv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address ipv4Address)
Increment Address.
|
static String |
incrementIpv4Address(String ipv4Address)
Increment Address.
|
static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix |
incrementIpv4Prefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix ipv4Prefix) |
static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone |
noZoneAddressForByteBuf(io.netty.buffer.ByteBuf buffer)
Reads from ByteBuf buffer and converts bytes to Ipv4Address.
|
static int |
prefixBitsToBytes(int bits) |
static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix |
prefixForByteBuf(io.netty.buffer.ByteBuf buf)
Creates an Ipv4Prefix object from given ByteBuf.
|
static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix |
prefixForBytes(byte[] bytes,
int length)
Creates an Ipv4Prefix object from given byte array.
|
static List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix> |
prefixListForBytes(byte[] bytes)
Creates a list of Ipv4 Prefixes from given byte array.
|
static InetSocketAddress |
toInetSocketAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress ipAddress,
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber port)
Converts IpAddress and PortNumber to InetSocketAddress.
|
static String |
toStringIP(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress ipAddress)
Get string representation of IpAddress.
|
public static final int IP4_LENGTH
public static final int IP4_BITS_LENGTH
public static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address addressForByteBuf(io.netty.buffer.ByteBuf buffer)
buffer
- containing Ipv4 address, starting at reader indexpublic static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone noZoneAddressForByteBuf(io.netty.buffer.ByteBuf buffer)
buffer
- containing Ipv4 address, starting at reader indexpublic static io.netty.buffer.ByteBuf byteBufForAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address ipAddress)
ipAddress
- Ipv4 addresspublic static byte[] bytesForAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address address)
address
- Ipv4Address to be convertedpublic static int prefixBitsToBytes(int bits)
public static int getPrefixLengthBytes(String prefix)
public static byte[] bytesForPrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix prefix)
prefix
- Ipv4Prefix to be convertedpublic static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix prefixForBytes(byte[] bytes, int length)
bytes
- IPv4 addresslength
- prefix lengthpublic static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix prefixForByteBuf(io.netty.buffer.ByteBuf buf)
buf
- Buffer containing serialized prefixpublic static List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix> prefixListForBytes(byte[] bytes)
bytes
- to be converted to List of Ipv4Prefixes.protected static int getPrefixLength(String prefixValue)
prefixValue
- value of prefixpublic static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress getIpAddress(InetAddress inetAddress)
inetAddress
- addresspublic static InetSocketAddress toInetSocketAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress ipAddress, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber port)
ipAddress
- addressport
- numberpublic static String incrementIpv4Address(String ipv4Address)
ipv4Address
- String containing Ipv4Addresspublic static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address incrementIpv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address ipv4Address)
ipv4Address
- ipv4 address to be incrementedpublic static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix incrementIpv4Prefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix ipv4Prefix)
public static String toStringIP(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress ipAddress)
ipAddress
- addressCopyright © 2019 OpenDaylight. All rights reserved.