use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid 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();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class LispAddressUtil method toIpPrefixEid.
public static Eid toIpPrefixEid(IpAddress addr, int vni) {
// If you touch this, be sure that sfclisp compiles!
int mask = addressTypeFromIpAddress(addr) == Ipv4Afi.class ? 32 : 128;
IpPrefix prefix = asIpPrefix(String.valueOf(addr.getValue()), mask);
// XXX getMapping rcp fails if VNI set to 0
return toEidNoVni(prefix);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class Ipv6Serializer method deserializeEidData.
@Override
protected Eid deserializeEidData(ByteBuffer buffer, LispAddressSerializerContext ctx) {
EidBuilder eb = new EidBuilder();
eb.setAddressType(Ipv6Afi.class);
eb.setVirtualNetworkId(getVni(ctx));
eb.setAddress(new Ipv6Builder().setIpv6(deserializeData(buffer)).build());
return eb.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class NoAddressSerializer method deserializeEidData.
@Override
protected Eid deserializeEidData(ByteBuffer buffer, LispAddressSerializerContext ctx) {
EidBuilder eb = new EidBuilder();
eb.setAddressType(NoAddressAfi.class);
eb.setVirtualNetworkId(getVni(ctx));
eb.setAddress(new NoAddressBuilder().setNoAddress(true).build());
return eb.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class ServicePathSerializer method deserializeLcafEidData.
@Override
protected Eid deserializeLcafEidData(ByteBuffer buffer, byte res2, short length, LispAddressSerializerContext ctx) {
EidBuilder eb = new EidBuilder();
eb.setAddressType(ServicePathLcaf.class);
eb.setVirtualNetworkId(getVni(ctx));
eb.setAddress(deserializeData(buffer));
return eb.build();
}
Aggregations