Search in sources :

Example 1 with SourceEid

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.SourceEid in project lispflowmapping by opendaylight.

the class MappingServiceIntegrationTest method registerQueryRegisterWithSmr.

public void registerQueryRegisterWithSmr() throws SocketTimeoutException {
    cleanUP();
    lms.setShouldUseSmr(true);
    mapService.addAuthenticationKey(LispAddressUtil.asIpv4PrefixBinaryEid("153.16.254.1/32"), NULL_AUTH_KEY);
    sleepForSeconds(1);
    sendPacket(mapRegisterPacketWithNotify);
    receiveMapNotify();
    sleepForSeconds(1);
    sendPacket(mapRequestPacket);
    sleepForSeconds(1);
    mapRegisterPacketWithoutNotify[mapRegisterPacketWithoutNotify.length - 1] += 1;
    sendPacket(mapRegisterPacketWithoutNotify);
    MapRequest smr = receiveMapRequest();
    assertTrue(smr.isSmr());
    Eid sourceEid = smr.getSourceEid().getEid();
    assertTrue(LispAddressUtil.asIpv4Eid("153.16.254.1").equals(sourceEid));
    Eid smrEid = smr.getEidItem().get(0).getEid();
    assertTrue(LispAddressUtil.asIpv4PrefixBinaryEid("1.2.3.4/32").equals(smrEid));
}
Also used : Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) MapRequest(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRequest)

Example 2 with SourceEid

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.SourceEid in project lispflowmapping by opendaylight.

the class MultiSiteScenario method prepareSourceEid.

private SourceEid prepareSourceEid(final String eidPrefix) {
    final SourceEidBuilder sourceEidBuilder = new SourceEidBuilder();
    final Eid eid = LispAddressUtil.asIpv4Eid(eidPrefix, MultiSiteScenarioUtil.VNI2);
    return sourceEidBuilder.setEid(eid).build();
}
Also used : SourceEid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.SourceEid) Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) SourceEidBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.SourceEidBuilder)

Example 3 with SourceEid

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.SourceEid in project lispflowmapping by opendaylight.

the class MultiSiteScenario method checkSMR.

void checkSMR(final SocketReader socketReader, final String site, final String... hosts) {
    LOG.debug("\n" + mapService.prettyPrintMappings());
    byte[][] buffers = socketReader.getBuffers(hosts.length);
    if (areBuffersEmpty(buffers)) {
        fail("No SMR received!");
    }
    List<MapRequest> mapRequests = translateBuffersToMapRequest(buffers);
    if (hosts.length != mapRequests.size()) {
        LOG.error("Expected {} SMRs, received {}", hosts.length, mapRequests.size());
        fail("Unexpected number of SMRs received");
    }
    final Set<Eid> eids = prepareExpectedEid(hosts);
    final SourceEid expectedSourceEid = prepareSourceEid(site);
    for (MapRequest mapRequest : mapRequests) {
        LOG.trace("Map-Request: {}", mapRequest);
        assertTrue(mapRequest.isSmr());
        final SourceEid receivedSourceEid = mapRequest.getSourceEid();
        assertEquals(expectedSourceEid, receivedSourceEid);
        final List<EidItem> currentEidItems = mapRequest.getEidItem();
        assertNotNull(currentEidItems);
        assertTrue(SMRContainsExpectedEid(eids, currentEidItems));
        MappingServiceIntegrationTestUtil.sendSMRInvokedMapRequestMessage(mapRequest, lms);
    }
    // all expected eids should be after looping via mapRequests matched.
    assertTrue("Expected eids wasn't/weren't found " + eids, eids.isEmpty());
}
Also used : SourceEid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.SourceEid) Eid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid) MapRequest(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRequest) SourceEid(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.SourceEid) EidItem(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.list.EidItem)

Aggregations

Eid (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid)3 MapRequest (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapRequest)2 SourceEid (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.SourceEid)2 EidItem (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.list.EidItem)1 SourceEidBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.maprequest.SourceEidBuilder)1