use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder in project lispflowmapping by opendaylight.
the class LispAddressUtil method asIpv6PrefixBinaryEid.
public static Eid asIpv6PrefixBinaryEid(InstanceIdType vni, byte[] address, short mask) {
Preconditions.checkArgument(address.length == 16, "asIpv6PrefixBinaryEid called with incorrect length byte array ({})", address.length);
EidBuilder builder = new EidBuilder();
builder.setAddressType(Ipv6PrefixBinaryAfi.class);
builder.setVirtualNetworkId(vni);
builder.setAddress(new Ipv6PrefixBinaryBuilder().setIpv6AddressBinary(new Ipv6AddressBinary(address)).setIpv6MaskLength(mask).build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder in project lispflowmapping by opendaylight.
the class LispAddressUtil method toEid.
public static Eid toEid(DistinguishedNameType dn, InstanceIdType vni) {
EidBuilder builder = new EidBuilder();
builder.setAddressType(DistinguishedNameAfi.class);
builder.setVirtualNetworkId(vni);
builder.setAddress((Address) new DistinguishedNameBuilder().setDistinguishedName(dn).build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder in project lispflowmapping by opendaylight.
the class LispAddressUtil method convertFromBinary.
public static Eid convertFromBinary(Eid eid) {
Pair<Class<? extends LispAddressFamily>, Address> converted = convertFromBinary(eid.getAddress());
if (converted.getRight() == null) {
return eid;
}
EidBuilder eb = new EidBuilder(eid);
eb.setAddressType(converted.getLeft());
eb.setAddress(converted.getRight());
return eb.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder in project lispflowmapping by opendaylight.
the class LispAddressUtil method asEid.
public static Eid asEid(SimpleAddress address, InstanceIdType vni) {
EidBuilder builder = new EidBuilder();
builder.setAddressType(addressTypeFromSimpleAddress(address));
builder.setVirtualNetworkId(vni);
// XXX Not sure if the below actually works as expected... also, what happens to AFI?
builder.setAddress(addressFromSimpleAddress(address));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder in project lispflowmapping by opendaylight.
the class ExplicitLocatorPathSerializer method deserializeLcafEidData.
@Override
protected Eid deserializeLcafEidData(ByteBuffer buffer, byte res2, short length, LispAddressSerializerContext ctx) {
EidBuilder eb = new EidBuilder();
eb.setAddressType(ExplicitLocatorPathLcaf.class);
eb.setVirtualNetworkId(getVni(ctx));
eb.setAddress(deserializeData(buffer, length, ctx));
return eb.build();
}
Aggregations