Search in sources :

Example 46 with 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 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);
    }
}
Also used : Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) SourceDestKey(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKey) ILispDAO(org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO)

Example 47 with 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));
    }
}
Also used : Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) SourceDestKey(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKey) ILispDAO(org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO)

Example 48 with 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 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);
    }
}
Also used : Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) SourceDestKey(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKey) ILispDAO(org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO)

Example 49 with 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 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);
}
Also used : Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) SourceDestKey(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKey) ILispDAO(org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO)

Example 50 with Eid

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));
}
Also used : MapRegister(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRegister) ByteBuffer(java.nio.ByteBuffer) Test(org.junit.Test)

Aggregations

Eid (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid)173 Test (org.junit.Test)98 EidBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder)51 GotMapReply (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.GotMapReply)28 MapReply (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply)28 MappingRecord (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord)27 SourceDestKey (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKey)19 ILispDAO (org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO)18 MappingRecordBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecordBuilder)18 MapRegister (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRegister)17 MappingData (org.opendaylight.lispflowmapping.lisp.type.MappingData)16 SimpleAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress)15 ItrRloc (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.ItrRloc)14 MapRequest (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRequest)13 SourceEidBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.SourceEidBuilder)13 Rloc (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc)12 MapNotify (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapNotify)11 ArrayList (java.util.ArrayList)10 Ipv4PrefixBinary (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv4PrefixBinary)10 Ipv6PrefixBinary (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv6PrefixBinary)10