Search in sources :

Example 21 with RlocBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder in project lispflowmapping by opendaylight.

the class LispAddressUtil method toRloc.

public static Rloc toRloc(SimpleAddress address) {
    RlocBuilder builder = new RlocBuilder();
    builder.setAddressType(addressTypeFromSimpleAddress(address));
    builder.setVirtualNetworkId(null);
    builder.setAddress(addressFromSimpleAddress(address));
    return builder.build();
}
Also used : RlocBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder)

Example 22 with RlocBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder in project lispflowmapping by opendaylight.

the class LispAddressUtil method toRloc.

public static Rloc toRloc(Ipv4Address address) {
    RlocBuilder builder = new RlocBuilder();
    builder.setAddressType(Ipv4Afi.class);
    builder.setVirtualNetworkId(null);
    builder.setAddress((Address) new Ipv4Builder().setIpv4(address).build());
    return builder.build();
}
Also used : RlocBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder) Ipv4Builder(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Builder)

Example 23 with RlocBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder in project lispflowmapping by opendaylight.

the class LispAddressUtil method toRloc.

public static Rloc toRloc(Ipv4AddressBinary address) {
    RlocBuilder builder = new RlocBuilder();
    builder.setAddressType(Ipv4BinaryAfi.class);
    builder.setVirtualNetworkId(null);
    builder.setAddress((Address) new Ipv4BinaryBuilder().setIpv4Binary(address).build());
    return builder.build();
}
Also used : RlocBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder) Ipv4BinaryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv4BinaryBuilder)

Example 24 with RlocBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder in project lispflowmapping by opendaylight.

the class LispAddressUtil method convertFromBinary.

public static Rloc convertFromBinary(Rloc rloc) {
    Pair<Class<? extends LispAddressFamily>, Address> converted = convertFromBinary(rloc.getAddress());
    if (converted.getRight() == null) {
        return rloc;
    }
    RlocBuilder rb = new RlocBuilder(rloc);
    rb.setAddressType(converted.getLeft());
    rb.setAddress(converted.getRight());
    return rb.build();
}
Also used : LispAddressFamily(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddressFamily) InetAddress(java.net.InetAddress) Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.Address) MacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress) Ipv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address) Ipv6Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address) Inet4Address(java.net.Inet4Address) Inet6Address(java.net.Inet6Address) SimpleAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress) KeyValueAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.KeyValueAddress) RlocBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder)

Example 25 with RlocBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder in project lispflowmapping by opendaylight.

the class ExplicitLocatorPathSerializer method deserializeLcafRlocData.

@Override
protected Rloc deserializeLcafRlocData(ByteBuffer buffer, byte res2, short length, LispAddressSerializerContext ctx) {
    RlocBuilder rb = new RlocBuilder();
    rb.setAddressType(ExplicitLocatorPathLcaf.class);
    rb.setVirtualNetworkId(null);
    rb.setAddress(deserializeData(buffer, length, ctx));
    return rb.build();
}
Also used : RlocBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder)

Aggregations

RlocBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.RlocBuilder)34 Test (org.junit.Test)9 ItrRlocBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.ItrRlocBuilder)8 SimpleAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress)7 InetAddress (java.net.InetAddress)6 MapRequest (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRequest)6 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)5 MapRequestBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequestmessage.MapRequestBuilder)5 ByteBuffer (java.nio.ByteBuffer)4 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)4 ArrayList (java.util.ArrayList)3 KeyValueAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.KeyValueAddress)3 Ipv4BinaryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv4BinaryBuilder)3 ItrRloc (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.ItrRloc)3 Preconditions (com.google.common.base.Preconditions)2 Inet4Address (java.net.Inet4Address)2 Inet6Address (java.net.Inet6Address)2 Ipv6Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address)2 PortNumber (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber)2 LispAddressFamily (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddressFamily)2