use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType 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.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType in project lispflowmapping by opendaylight.
the class InstanceIdSerializer method deserializeLcafEidData.
@Override
protected Eid deserializeLcafEidData(ByteBuffer buffer, byte res2, short length, LispAddressSerializerContext ctx) {
long instanceId = (int) ByteUtil.asUnsignedInteger(buffer.getInt());
if (instanceId > MAX_INSTANCE_ID) {
throw new LispSerializationException("Instance ID is longer than 24 bits: " + instanceId);
}
ctx.setVni(new InstanceIdType(instanceId));
return LispAddressSerializer.getInstance().deserializeEid(buffer, ctx);
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType in project lispflowmapping by opendaylight.
the class LispAddressUtil method toEid.
public static Eid toEid(Ipv6PrefixBinary prefix, InstanceIdType vni) {
EidBuilder builder = new EidBuilder();
builder.setAddressType(Ipv6PrefixBinaryAfi.class);
builder.setVirtualNetworkId(vni);
builder.setAddress((Address) prefix);
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType in project lispflowmapping by opendaylight.
the class LispAddressUtil method asIpv4PrefixBinaryEid.
public static Eid asIpv4PrefixBinaryEid(InstanceIdType vni, byte[] address, short mask) {
Preconditions.checkArgument(address.length == 4, "asIpv4PrefixBinaryEid called with incorrect length byte array ({})", address.length);
EidBuilder builder = new EidBuilder();
builder.setAddressType(Ipv4PrefixBinaryAfi.class);
builder.setVirtualNetworkId(vni);
builder.setAddress(new Ipv4PrefixBinaryBuilder().setIpv4AddressBinary(new Ipv4AddressBinary(address)).setIpv4MaskLength(mask).build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType in project lispflowmapping by opendaylight.
the class LispAddressUtil method toEid.
public static Eid toEid(Ipv4Address address, InstanceIdType vni) {
EidBuilder builder = new EidBuilder();
builder.setAddressType(Ipv4Afi.class);
builder.setVirtualNetworkId(vni);
builder.setAddress((Address) new Ipv4Builder().setIpv4(address).build());
return builder.build();
}
Aggregations