Search in sources :

Example 41 with Dst

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.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();
}
Also used : InstanceIdType(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType) EidBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.EidBuilder)

Example 42 with Dst

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.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());
}
Also used : DatagramPacket(io.netty.channel.socket.DatagramPacket) RequestMapping(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.RequestMapping) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 43 with Dst

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.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() + ".");
    }
}
Also used : InstanceIdType(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType) MapReply(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply)

Example 44 with Dst

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.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));
}
Also used : MappingRecord(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord) MappingData(org.opendaylight.lispflowmapping.lisp.type.MappingData) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 45 with Dst

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.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));
}
Also used : MappingRecord(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.record.container.MappingRecord) MappingData(org.opendaylight.lispflowmapping.lisp.type.MappingData) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)50 BigInteger (java.math.BigInteger)30 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)23 ArrayList (java.util.ArrayList)22 VersionDatapathIdConvertorData (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionDatapathIdConvertorData)20 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)19 Ipv4Match (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match)18 UdpMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch)18 TcpMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch)17 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)16 MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)15 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder)15 Ipv6Match (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6Match)14 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)13 SctpMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatch)13 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match)12 ArpMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatch)12 FlowWildcardsV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowWildcardsV10)12 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match)12 IpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder)9