use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder in project lispflowmapping by opendaylight.
the class Ipv6PrefixBinarySerializer method deserializeEidData.
@Override
protected Eid deserializeEidData(ByteBuffer buffer, LispAddressSerializerContext ctx) {
byte[] ipBuffer = new byte[16];
buffer.get(ipBuffer);
Ipv6PrefixBinary prefix = new Ipv6PrefixBinaryBuilder().setIpv6AddressBinary(new Ipv6AddressBinary(ipBuffer)).setIpv6MaskLength(ctx.getMaskLen()).build();
EidBuilder eb = new EidBuilder();
eb.setAddressType(Ipv6PrefixBinaryAfi.class);
eb.setVirtualNetworkId(getVni(ctx));
eb.setAddress(prefix);
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 toEid.
public static Eid toEid(Ipv4Prefix prefix, InstanceIdType vni) {
EidBuilder builder = new EidBuilder();
builder.setAddressType(Ipv4PrefixAfi.class);
builder.setVirtualNetworkId(vni);
builder.setAddress((Address) new Ipv4PrefixBuilder().setIpv4Prefix(prefix).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 asSrcDstEid.
public static Eid asSrcDstEid(String src, String dst, int smask, int dmask, long vni) {
EidBuilder builder = new EidBuilder();
builder.setAddressType(SourceDestKeyLcaf.class);
builder.setVirtualNetworkId(new InstanceIdType(Long.valueOf(vni)));
builder.setAddress(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKeyBuilder().setSourceDestKey(asSrcDst(src, dst, smask, dmask)).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 toEidNoVni.
// XXX getMapping rcp fails if VNI set to 0
public static Eid toEidNoVni(IpPrefix prefix) {
EidBuilder builder = new EidBuilder();
builder.setAddress(addressFromIpPrefix(prefix));
builder.setAddressType(addressTypeFromIpPrefix(prefix));
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 asIpv4PrefixEid.
public static Eid asIpv4PrefixEid(Eid eid, Inet4Address address, short mask) {
EidBuilder builder = new EidBuilder();
builder.setAddressType(Ipv4PrefixAfi.class);
builder.setVirtualNetworkId(eid.getVirtualNetworkId());
builder.setAddress(new Ipv4PrefixBuilder().setIpv4Prefix(IetfInetUtil.INSTANCE.ipv4PrefixFor(address, mask)).build());
return builder.build();
}
Aggregations