use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.Src 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.Src 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.Src in project lispflowmapping by opendaylight.
the class MappingSystem method getMappingNbSbIntersection.
private MappingData getMappingNbSbIntersection(Eid src, Eid dst) {
// lookupPolicy == NB_AND_SB, we return intersection
// of NB and SB mappings, or NB mapping if intersection is empty.
MappingData nbMappingData = (MappingData) pmc.getMapping(src, dst);
if (nbMappingData == null) {
return nbMappingData;
}
// no intersection for Service Path mappings
if (dst.getAddress() instanceof ServicePath) {
return updateServicePathMappingRecord(nbMappingData, dst);
}
MappingData sbMappingData = getSbMappingWithExpiration(src, dst, null);
if (sbMappingData == null) {
return nbMappingData;
}
// both NB and SB mappings exist. Compute intersection of the mappings
return MappingMergeUtil.computeNbSbIntersection(nbMappingData, sbMappingData);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.Src in project bgpcep by opendaylight.
the class PCEPObjectParserTest method testPathKeyObject.
@Test
public void testPathKeyObject() throws Exception {
final PCEPPathKeyObjectParser parser = new PCEPPathKeyObjectParser(this.ctx.getEROSubobjectHandlerRegistry());
final ByteBuf result = Unpooled.wrappedBuffer(ByteArray.fileToBytes("src/test/resources/PCEPPathKeyObject.bin"));
final PathKeyBuilder builder = new PathKeyBuilder();
builder.setProcessingRule(true);
builder.setIgnore(false);
final List<PathKeys> list = Lists.newArrayList();
list.add(new PathKeysBuilder().setLoose(true).setPathKey(new PathKey(0x1234)).setPceId(new PceId(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x50, (byte) 0x00 })).build());
builder.setPathKeys(list);
assertEquals(builder.build(), parser.parseObject(new ObjectHeaderImpl(true, false), result.slice(4, result.readableBytes() - 4)));
final ByteBuf buf = Unpooled.buffer();
parser.serializeObject(builder.build(), buf);
assertArrayEquals(result.array(), ByteArray.getAllBytes(buf));
try {
parser.parseObject(new ObjectHeaderImpl(true, true), null);
fail();
} catch (final IllegalArgumentException e) {
assertEquals("Array of bytes is mandatory. Can't be null or empty.", e.getMessage());
}
try {
parser.parseObject(new ObjectHeaderImpl(true, true), Unpooled.EMPTY_BUFFER);
fail();
} catch (final IllegalArgumentException e) {
assertEquals("Array of bytes is mandatory. Can't be null or empty.", e.getMessage());
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.Src in project bgpcep by opendaylight.
the class PCEPObjectParserTest method testCloseObject.
@Test
public void testCloseObject() throws IOException, PCEPDeserializerException {
final PCEPCloseObjectParser parser = new PCEPCloseObjectParser(this.tlvRegistry, this.viTlvRegistry);
final ByteBuf result = Unpooled.wrappedBuffer(ByteArray.fileToBytes("src/test/resources/PCEPCloseObject1.bin"));
final CCloseBuilder builder = new CCloseBuilder();
builder.setProcessingRule(false);
builder.setIgnore(false);
builder.setReason((short) 5);
builder.setTlvs(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.close.object.c.close.TlvsBuilder().build());
assertEquals(builder.build(), parser.parseObject(new ObjectHeaderImpl(false, false), result.slice(4, result.readableBytes() - 4)));
final ByteBuf buf = Unpooled.buffer();
parser.serializeObject(builder.build(), buf);
assertArrayEquals(result.array(), ByteArray.getAllBytes(buf));
try {
parser.parseObject(new ObjectHeaderImpl(true, true), null);
fail();
} catch (final IllegalArgumentException e) {
assertEquals("Array of bytes is mandatory. Can't be null or empty.", e.getMessage());
}
try {
parser.parseObject(new ObjectHeaderImpl(true, true), Unpooled.EMPTY_BUFFER);
fail();
} catch (final IllegalArgumentException e) {
assertEquals("Array of bytes is mandatory. Can't be null or empty.", e.getMessage());
}
}
Aggregations