use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class MultiTableMapCache method removeMapping.
public void removeMapping(Eid eid) {
Eid key = MaskUtil.normalize(eid);
ILispDAO table = getVniTable(key);
if (table == null) {
return;
}
if (key.getAddress() instanceof SourceDestKey) {
ILispDAO db = getSDInnerDao(key, table);
if (db != null) {
db.remove(SourceDestKeyHelper.getSrcBinary(key));
if (db.isEmpty()) {
removeSDInnerDao(key, table);
}
}
} else {
table.remove(key);
}
if (table.isEmpty()) {
removeVniTable(eid);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class MultiTableMapCache method addMapping.
public void addMapping(Eid key, Object value) {
Eid eid = MaskUtil.normalize(key);
ILispDAO table = getOrInstantiateVniTable(key);
if (eid.getAddress() instanceof SourceDestKey) {
Eid srcKey = SourceDestKeyHelper.getSrcBinary(eid);
ILispDAO srcDstDao = getOrInstantiateSDInnerDao(eid, table);
srcDstDao.put(srcKey, new MappingEntry<>(SubKeys.RECORD, value));
} else {
table.put(eid, new MappingEntry<>(SubKeys.RECORD, value));
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class MultiTableMapCache method getData.
@Override
public Object getData(Eid eid, String subKey) {
Eid key = MaskUtil.normalize(eid);
ILispDAO table = getVniTable(key);
if (table == null) {
return null;
}
if (key.getAddress() instanceof SourceDestKey) {
ILispDAO srcDstDao = getSDInnerDao(key, table);
return srcDstDao.getSpecific(SourceDestKeyHelper.getSrcBinary(key), subKey);
} else {
return table.getSpecific(key, subKey);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class MultiTableMapCache method getMapping.
public Object getMapping(Eid srcEid, Eid dstEid) {
if (dstEid == null) {
return null;
}
ILispDAO table = getVniTable(dstEid);
if (table == null) {
return null;
}
// a map-request for an actual SrcDst LCAF, ignore src eid
if (dstEid.getAddress() instanceof SourceDestKey) {
Eid srcAddr = SourceDestKeyHelper.getSrcBinary(dstEid);
Eid dstAddr = SourceDestKeyHelper.getDstBinary(dstEid);
return getMappingLpmSD(srcAddr, dstAddr, table);
}
// potential map-request for SrcDst LCAF from non SrcDst capable devices
return getMappingLpmSD(srcEid, dstEid, table);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class LispAuthenticationTest method validate__NoAuthentication.
@Test
public void validate__NoAuthentication() throws Exception {
// LISP(Type = 3 Map-Register, P=1, M=1
// Record Counter: 1
// Nonce: (something)
// Key ID: 0x0000
// AuthDataLength: 0:
// EID prefix: 153.16.254.1/32 (EID=0x9910FE01), TTL: 10, Authoritative,
// No-Action
// Local RLOC: 192.168.136.10 (RLOC=0xC0A8880A), Reachable,
// Priority/Weight: 1/100, Multicast Priority/Weight: 255/0
//
final ByteBuffer byteBuffer = hexToByteBuffer("38 00 01 01 FF BB " + "00 00 00 00 00 00 00 00 00 00 " + "00 00 " + "00 0a 01 20 10 00 00 00 00 01 99 10 fe 01 01 64 " + "ff 00 00 05 00 01 c0 a8 88 0a");
MapRegister mapRegister = MapRegisterSerializer.getInstance().deserialize(byteBuffer, null);
assertTrue(validate(mapRegister, byteBuffer, EID, 0, PASSWORD));
assertTrue(validate(mapRegister, byteBuffer, EID, 0, WRONG_PASSWORD));
}
Aggregations