use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6BinaryBuilder in project lispflowmapping by opendaylight.
the class LispAddressUtil method toRloc.
public static Rloc toRloc(Ipv6AddressBinary address) {
RlocBuilder builder = new RlocBuilder();
builder.setAddressType(Ipv6BinaryAfi.class);
builder.setVirtualNetworkId(null);
builder.setAddress((Address) new Ipv6BinaryBuilder().setIpv6Binary(address).build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6BinaryBuilder in project lispflowmapping by opendaylight.
the class LispAddressUtil method toEid.
public static Eid toEid(Ipv6AddressBinary address, InstanceIdType vni) {
EidBuilder builder = new EidBuilder();
builder.setAddressType(Ipv6BinaryAfi.class);
builder.setVirtualNetworkId(vni);
builder.setAddress((Address) new Ipv6BinaryBuilder().setIpv6Binary(address).build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6BinaryBuilder in project lispflowmapping by opendaylight.
the class LispAddressUtilTest method ipAddressToByteArray_ipv6Binary.
/**
* Tests {@link LispAddressUtil#ipAddressToByteArray(Address)} method with ipv6Binary value.
*/
@Test
public void ipAddressToByteArray_ipv6Binary() {
final Ipv6Binary expectedIpv6 = new Ipv6BinaryBuilder().setIpv6Binary(IPV6_ADDRESS_BINARY_TEST).build();
final byte[] testedAddress = LispAddressUtil.ipAddressToByteArray(expectedIpv6);
assertArrayEquals(IPV6_ADDRESS_BYTES_A_TEST, testedAddress);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6BinaryBuilder in project lispflowmapping by opendaylight.
the class Ipv6BinarySerializer method deserializeRlocData.
@Override
protected Rloc deserializeRlocData(ByteBuffer buffer) {
RlocBuilder rb = new RlocBuilder();
rb.setAddressType(Ipv6BinaryAfi.class);
rb.setVirtualNetworkId(null);
rb.setAddress(new Ipv6BinaryBuilder().setIpv6Binary(deserializeData(buffer)).build());
return rb.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6BinaryBuilder in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTestUtil method removePrefixIfNecessary.
static Eid removePrefixIfNecessary(Eid eid) {
EidBuilder eb = new EidBuilder(eid);
Address address = eid.getAddress();
if (address instanceof Ipv4PrefixBinary) {
Ipv4Binary convertedEid = new Ipv4BinaryBuilder().setIpv4Binary(((Ipv4PrefixBinary) address).getIpv4AddressBinary()).build();
return eb.setAddress(convertedEid).setAddressType(Ipv4BinaryAfi.class).build();
} else if (address instanceof Ipv6PrefixBinary) {
Ipv6Binary convertedEid = new Ipv6BinaryBuilder().setIpv6Binary(((Ipv6PrefixBinary) address).getIpv6AddressBinary()).build();
return eb.setAddress(convertedEid).setAddressType(Ipv6BinaryAfi.class).build();
}
return eid;
}
Aggregations