use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.Dst 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.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.Dst in project lispflowmapping by opendaylight.
the class LispSouthboundHandlerTest method mapRequest__UsesIpv6EncapsulatedUdpPort.
@Ignore
@Test
public void mapRequest__UsesIpv6EncapsulatedUdpPort() throws Exception {
// Internet Protocol Version 6, Src: 2610:d0:ffff:192::1
// (2610:d0:ffff:192::1), Dst: 2610:d0:ffff:192::2
// (2610:d0:ffff:192::2)
// encapsulated UDP source port: 4342
mapRequestPacket = extractWSUdpByteArray("0000 00 0c 29 34 3e 1b 00 0c 29 f6 d6 0d 08 00 45 00 " + "0010 00 b0 00 00 40 00 40 11 ea 7b 0a 00 3a 9c 0a 00 " + "0020 01 26 10 f6 10 f6 00 9c 9b 19 80 00 00 00 60 00 " + "0030 00 00 00 68 11 ff 26 10 00 d0 ff ff 01 92 00 00 " + "0040 00 00 00 00 00 01 26 10 00 d0 ff ff 01 92 00 00 " + "0050 00 00 00 00 00 02 10 f6 10 f6 00 68 94 8b 14 00 " + "0060 00 01 ff f5 bf 5d 7b 75 93 e6 00 02 26 10 00 d0 " + "0070 ff ff 01 92 00 00 00 00 00 00 00 01 00 01 0a 00 " + "0080 3a 9c 00 80 00 02 26 10 00 d0 ff ff 01 92 00 00 " + "0090 00 00 00 00 00 02 00 00 00 0a 01 80 10 00 00 00 " + "00a0 00 02 26 10 00 d0 ff ff 01 92 00 00 00 00 00 00 " + "00b0 00 01 01 64 ff 00 00 05 00 01 0a 00 3a 9c");
ArgumentCaptor<RequestMapping> captor = ArgumentCaptor.forClass(RequestMapping.class);
DatagramPacket replyPacket = handleMapRequestPacket(mapRequestPacket);
Mockito.verify(mockLispSouthboundPlugin).sendNotificationIfPossible(Mockito.any());
assertEquals(4342, replyPacket.recipient().getPort());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.Dst in project lispflowmapping by opendaylight.
the class MultiSiteScenario method assertPing.
private void assertPing(final Site srcSite, final int srcHostIndex, final Site dstSite, final int dstHostIndex, boolean expectedPingWorks, final Site... additionalSitesFromMapping) {
final MapReply mapReplyFromSrcToDst = emitMapRequestMessage(srcSite.getHost(srcHostIndex), dstSite.getHost(dstHostIndex), dstSite.getVNI());
if (checkActionAndRloc(dstSite, expectedPingWorks, mapReplyFromSrcToDst, additionalSitesFromMapping)) {
return;
}
final MapReply mapReplyFromDstToSrc = emitMapRequestMessage(dstSite.getHost(dstHostIndex), srcSite.getHost(srcHostIndex), srcSite.getVNI());
if (checkActionAndRloc(srcSite, expectedPingWorks, mapReplyFromDstToSrc)) {
return;
}
final InstanceIdType iidDst = mapReplyFromSrcToDst.getMappingRecordItem().get(0).getMappingRecord().getEid().getVirtualNetworkId();
final InstanceIdType iidSrc = mapReplyFromDstToSrc.getMappingRecordItem().get(0).getMappingRecord().getEid().getVirtualNetworkId();
final boolean isIIDEqual = iidDst.equals(iidSrc);
if (expectedPingWorks != isIIDEqual) {
fail("IID problem. Dst value " + iidDst.getValue() + ". Src value " + iidSrc.getValue() + ".");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.Dst in project lispflowmapping by opendaylight.
the class MappingSystemTest method getMappingTest_NbFirst_withServicePathDestinationAddress_singleELPLocatorRecord_IndexOutOfBounds.
/**
* Tests {@link MappingSystem#getMapping} method with ServicePath type dst address and single ExplicitLocatorPath
* type locator record. Service index out of bounds. Returns the original mapping.
*/
@Test
public void getMappingTest_NbFirst_withServicePathDestinationAddress_singleELPLocatorRecord_IndexOutOfBounds() {
final MappingRecord mappingRecord = getDefaultMappingRecordBuilder().setLocatorRecord(Lists.newArrayList(getDefaultLocatorRecordBuilder().setRloc(getELPTypeRloc()).build())).build();
final MappingData mappingData = getDefaultMappingData(mappingRecord);
Mockito.when(pmcMock.getMapping(EID_IPV4_SRC, EID_SERVICE_PATH_INDEX_OOB)).thenReturn(mappingData);
assertEquals(mappingData, mappingSystem.getMapping(EID_IPV4_SRC, EID_SERVICE_PATH_INDEX_OOB));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.Dst in project lispflowmapping by opendaylight.
the class MappingSystemTest method getMappingTest_NbFirst_withServicePathDestinationAddress_IpPrefixLocatorRecord.
/**
* Tests {@link MappingSystem#getMapping} method with ServicePath type dst address and single IpPrefix type locator
* record. Returns the original mapping.
*/
@Test
public void getMappingTest_NbFirst_withServicePathDestinationAddress_IpPrefixLocatorRecord() {
final MappingRecord mappingRecord = getDefaultMappingRecordBuilder().setLocatorRecord(Lists.newArrayList(getDefaultLocatorRecordBuilder().setRloc(getIpPrefixTypeRloc()).build())).build();
final MappingData mappingData = getDefaultMappingData(mappingRecord);
Mockito.when(pmcMock.getMapping(EID_IPV4_SRC, EID_SERVICE_PATH)).thenReturn(mappingData);
assertEquals(mappingData, mappingSystem.getMapping(EID_IPV4_SRC, EID_SERVICE_PATH));
}
Aggregations