Search in sources :

Example 1 with Ipv6BinaryBuilder

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();
}
Also used : RlocBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder) Ipv6BinaryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6BinaryBuilder)

Example 2 with Ipv6BinaryBuilder

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();
}
Also used : EidBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder) Ipv6BinaryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6BinaryBuilder)

Example 3 with Ipv6BinaryBuilder

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);
}
Also used : Ipv6BinaryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6BinaryBuilder) Ipv6Binary(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6Binary) Test(org.junit.Test)

Example 4 with Ipv6BinaryBuilder

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();
}
Also used : RlocBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder) Ipv6BinaryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6BinaryBuilder)

Example 5 with Ipv6BinaryBuilder

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;
}
Also used : Ipv4PrefixBinary(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv4PrefixBinary) Ipv4BinaryAfi(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.Ipv4BinaryAfi) SourceEidBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.SourceEidBuilder) EidBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder) InetAddress(java.net.InetAddress) Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.Address) InetSocketAddress(java.net.InetSocketAddress) Ipv4BinaryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv4BinaryBuilder) Ipv6PrefixBinary(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6PrefixBinary) Ipv4Binary(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv4Binary) Ipv6BinaryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6BinaryBuilder) Ipv6Binary(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6Binary)

Aggregations

Ipv6BinaryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6BinaryBuilder)6 EidBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder)3 Ipv6Binary (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6Binary)2 RlocBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder)2 InetAddress (java.net.InetAddress)1 InetSocketAddress (java.net.InetSocketAddress)1 Test (org.junit.Test)1 Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.Address)1 Ipv4BinaryAfi (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.Ipv4BinaryAfi)1 Ipv4Binary (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv4Binary)1 Ipv4BinaryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv4BinaryBuilder)1 Ipv4PrefixBinary (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv4PrefixBinary)1 Ipv6PrefixBinary (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6PrefixBinary)1 SourceEidBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.SourceEidBuilder)1