use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address in project lispflowmapping by opendaylight.
the class Ipv4BinarySerializer method serializeData.
@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
Ipv4Binary address = (Ipv4Binary) lispAddress.getAddress();
buffer.put(address.getIpv4Binary().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address in project lispflowmapping by opendaylight.
the class Ipv4PrefixSerializer method serializeData.
@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
Ipv4Prefix prefix = (Ipv4Prefix) lispAddress.getAddress();
String address = MaskUtil.getAddressStringForIpv4Prefix(prefix);
buffer.put(InetAddresses.forString(address).getAddress());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address in project lispflowmapping by opendaylight.
the class Ipv6BinarySerializer method serializeData.
@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
Ipv6Binary address = (Ipv6Binary) lispAddress.getAddress();
buffer.put(address.getIpv6Binary().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address in project lispflowmapping by opendaylight.
the class Ipv6PrefixBinarySerializer method deserializeSimpleAddressData.
@Override
protected SimpleAddress deserializeSimpleAddressData(ByteBuffer buffer, LispAddressSerializerContext ctx) {
byte[] ipBuffer = new byte[16];
InetAddress address = null;
buffer.get(ipBuffer);
try {
address = InetAddress.getByAddress(ipBuffer);
} catch (UnknownHostException e) {
LOG.debug("Unknown host {}", ipBuffer, e);
}
return new SimpleAddress(new IpPrefix(new Ipv6Prefix(address.getHostAddress() + "/" + ctx.getMaskLen())));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address in project lispflowmapping by opendaylight.
the class Ipv6PrefixSerializer method serializeData.
@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
Ipv6Prefix prefix = (Ipv6Prefix) lispAddress.getAddress();
String address = MaskUtil.getAddressStringForIpv6Prefix(prefix);
buffer.put(InetAddresses.forString(address).getAddress());
}
Aggregations