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 openflowplugin by opendaylight.
the class MatchConvertorTest method testConversion.
@Test
public void testConversion() {
MatchBuilder builder = new MatchBuilder();
builder.setInPort(new NodeConnectorId("openflow:42:1"));
builder.setInPhyPort(new NodeConnectorId("openflow:42:2"));
MetadataBuilder metadataBuilder = new MetadataBuilder();
metadataBuilder.setMetadata(new BigInteger("3"));
builder.setMetadata(metadataBuilder.build());
EthernetMatchBuilder ethernetBuilder = new EthernetMatchBuilder();
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(4L));
ethernetBuilder.setEthernetType(ethTypeBuilder.build());
EthernetSourceBuilder ethSrcBuilder = new EthernetSourceBuilder();
ethSrcBuilder.setAddress(new MacAddress("00:00:00:00:00:05"));
ethernetBuilder.setEthernetSource(ethSrcBuilder.build());
EthernetDestinationBuilder ethDstBuilder = new EthernetDestinationBuilder();
ethDstBuilder.setAddress(new MacAddress("00:00:00:00:00:06"));
ethernetBuilder.setEthernetDestination(ethDstBuilder.build());
builder.setEthernetMatch(ethernetBuilder.build());
VlanMatchBuilder vlanBuilder = new VlanMatchBuilder();
VlanIdBuilder vlanIdBuilder = new VlanIdBuilder();
vlanIdBuilder.setVlanId(new VlanId(7));
vlanIdBuilder.setVlanIdPresent(true);
vlanBuilder.setVlanId(vlanIdBuilder.build());
vlanBuilder.setVlanPcp(new VlanPcp((short) 7));
builder.setVlanMatch(vlanBuilder.build());
IpMatchBuilder ipMatchBuilder = new IpMatchBuilder();
ipMatchBuilder.setIpDscp(new Dscp((short) 8));
ipMatchBuilder.setIpEcn((short) 9);
ipMatchBuilder.setIpProtocol((short) 10);
builder.setIpMatch(ipMatchBuilder.build());
TcpMatchBuilder tcpMatchBuilder = new TcpMatchBuilder();
tcpMatchBuilder.setTcpSourcePort(new PortNumber(11));
tcpMatchBuilder.setTcpDestinationPort(new PortNumber(12));
builder.setLayer4Match(tcpMatchBuilder.build());
Icmpv4MatchBuilder icmpv4Builder = new Icmpv4MatchBuilder();
icmpv4Builder.setIcmpv4Type((short) 13);
icmpv4Builder.setIcmpv4Code((short) 14);
builder.setIcmpv4Match(icmpv4Builder.build());
Icmpv6MatchBuilder icmpv6Builder = new Icmpv6MatchBuilder();
icmpv6Builder.setIcmpv6Type((short) 15);
icmpv6Builder.setIcmpv6Code((short) 16);
builder.setIcmpv6Match(icmpv6Builder.build());
ProtocolMatchFieldsBuilder protoBuilder = new ProtocolMatchFieldsBuilder();
protoBuilder.setMplsLabel(17L);
protoBuilder.setMplsTc((short) 18);
protoBuilder.setMplsBos((short) 19);
PbbBuilder pbbBuilder = new PbbBuilder();
pbbBuilder.setPbbIsid(20L);
protoBuilder.setPbb(pbbBuilder.build());
builder.setProtocolMatchFields(protoBuilder.build());
TunnelBuilder tunnelBuilder = new TunnelBuilder();
tunnelBuilder.setTunnelId(new BigInteger("21"));
builder.setTunnel(tunnelBuilder.build());
Ipv4MatchBuilder ipv4MatchBuilder = new Ipv4MatchBuilder();
ipv4MatchBuilder.setIpv4Source(new Ipv4Prefix("10.0.0.1/32"));
ipv4MatchBuilder.setIpv4Destination(new Ipv4Prefix("10.0.0.2/32"));
builder.setLayer3Match(ipv4MatchBuilder.build());
Match match = builder.build();
Optional<List<MatchEntry>> entriesOptional = converterManager.convert(match, new VersionConvertorData(OFConstants.OFP_VERSION_1_3));
List<MatchEntry> entries = entriesOptional.get();
Assert.assertEquals("Wrong entries size", 24, entries.size());
MatchEntry entry = entries.get(0);
checkEntryHeader(entry, InPort.class, false);
Assert.assertEquals("Wrong in port", 1, ((InPortCase) entry.getMatchEntryValue()).getInPort().getPortNumber().getValue().intValue());
entry = entries.get(1);
checkEntryHeader(entry, InPhyPort.class, false);
Assert.assertEquals("Wrong in phy port", 2, ((InPhyPortCase) entry.getMatchEntryValue()).getInPhyPort().getPortNumber().getValue().intValue());
entry = entries.get(2);
checkEntryHeader(entry, Metadata.class, false);
Assert.assertArrayEquals("Wrong metadata", new byte[] { 0, 0, 0, 0, 0, 0, 0, 3 }, ((MetadataCase) entry.getMatchEntryValue()).getMetadata().getMetadata());
entry = entries.get(3);
checkEntryHeader(entry, EthDst.class, false);
Assert.assertEquals("Wrong eth dst", new MacAddress("00:00:00:00:00:06"), ((EthDstCase) entry.getMatchEntryValue()).getEthDst().getMacAddress());
entry = entries.get(4);
checkEntryHeader(entry, EthSrc.class, false);
Assert.assertEquals("Wrong eth src", new MacAddress("00:00:00:00:00:05"), ((EthSrcCase) entry.getMatchEntryValue()).getEthSrc().getMacAddress());
entry = entries.get(5);
checkEntryHeader(entry, EthType.class, false);
Assert.assertEquals("Wrong eth type", 4, ((EthTypeCase) entry.getMatchEntryValue()).getEthType().getEthType().getValue().intValue());
entry = entries.get(6);
checkEntryHeader(entry, VlanVid.class, false);
Assert.assertEquals("Wrong vlan id", 7, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid().getVlanVid().intValue());
Assert.assertEquals("Wrong cfi bit", true, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid().isCfiBit());
entry = entries.get(7);
checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanPcp.class, false);
Assert.assertEquals("Wrong vlan pcp", 7, ((VlanPcpCase) entry.getMatchEntryValue()).getVlanPcp().getVlanPcp().intValue());
entry = entries.get(8);
checkEntryHeader(entry, IpDscp.class, false);
Assert.assertEquals("Wrong ip dscp", 8, ((IpDscpCase) entry.getMatchEntryValue()).getIpDscp().getDscp().getValue().intValue());
entry = entries.get(9);
checkEntryHeader(entry, IpEcn.class, false);
Assert.assertEquals("Wrong ip ecn", 9, ((IpEcnCase) entry.getMatchEntryValue()).getIpEcn().getEcn().intValue());
entry = entries.get(10);
checkEntryHeader(entry, IpProto.class, false);
Assert.assertEquals("Wrong ip proto", 10, ((IpProtoCase) entry.getMatchEntryValue()).getIpProto().getProtocolNumber().intValue());
entry = entries.get(11);
checkEntryHeader(entry, TcpSrc.class, false);
Assert.assertEquals("Wrong tcp src", 11, ((TcpSrcCase) entry.getMatchEntryValue()).getTcpSrc().getPort().getValue().intValue());
entry = entries.get(12);
checkEntryHeader(entry, TcpDst.class, false);
Assert.assertEquals("Wrong tcp dst", 12, ((TcpDstCase) entry.getMatchEntryValue()).getTcpDst().getPort().getValue().intValue());
entry = entries.get(13);
checkEntryHeader(entry, Icmpv4Type.class, false);
Assert.assertEquals("Wrong icmpv4 type", 13, ((Icmpv4TypeCase) entry.getMatchEntryValue()).getIcmpv4Type().getIcmpv4Type().intValue());
entry = entries.get(14);
checkEntryHeader(entry, Icmpv4Code.class, false);
Assert.assertEquals("Wrong icmpv4 code", 14, ((Icmpv4CodeCase) entry.getMatchEntryValue()).getIcmpv4Code().getIcmpv4Code().intValue());
entry = entries.get(15);
checkEntryHeader(entry, Icmpv6Type.class, false);
Assert.assertEquals("Wrong icmpv6 type", 15, ((Icmpv6TypeCase) entry.getMatchEntryValue()).getIcmpv6Type().getIcmpv6Type().intValue());
entry = entries.get(16);
checkEntryHeader(entry, Icmpv6Code.class, false);
Assert.assertEquals("Wrong icmpv6 code", 16, ((Icmpv6CodeCase) entry.getMatchEntryValue()).getIcmpv6Code().getIcmpv6Code().intValue());
entry = entries.get(17);
checkEntryHeader(entry, Ipv4Src.class, false);
Assert.assertEquals("Wrong ipv4 src", "10.0.0.1", ((Ipv4SrcCase) entry.getMatchEntryValue()).getIpv4Src().getIpv4Address().getValue());
entry = entries.get(18);
checkEntryHeader(entry, Ipv4Dst.class, false);
Assert.assertEquals("Wrong ipv4 dst", "10.0.0.2", ((Ipv4DstCase) entry.getMatchEntryValue()).getIpv4Dst().getIpv4Address().getValue());
entry = entries.get(19);
checkEntryHeader(entry, MplsLabel.class, false);
Assert.assertEquals("Wrong mpls label", 17, ((MplsLabelCase) entry.getMatchEntryValue()).getMplsLabel().getMplsLabel().intValue());
entry = entries.get(20);
checkEntryHeader(entry, MplsBos.class, false);
Assert.assertEquals("Wrong mpls bos", true, ((MplsBosCase) entry.getMatchEntryValue()).getMplsBos().isBos());
entry = entries.get(21);
checkEntryHeader(entry, MplsTc.class, false);
Assert.assertEquals("Wrong mpls tc", 18, ((MplsTcCase) entry.getMatchEntryValue()).getMplsTc().getTc().intValue());
entry = entries.get(22);
checkEntryHeader(entry, PbbIsid.class, false);
Assert.assertEquals("Wrong pbb isid", 20, ((PbbIsidCase) entry.getMatchEntryValue()).getPbbIsid().getIsid().intValue());
entry = entries.get(23);
checkEntryHeader(entry, TunnelId.class, false);
Assert.assertArrayEquals("Wrong tunnel id", new byte[] { 0, 0, 0, 0, 0, 0, 0, 21 }, ((TunnelIdCase) entry.getMatchEntryValue()).getTunnelId().getTunnelId());
}
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 openflowplugin by opendaylight.
the class MatchConvertorTest method testSctpMatchConversion.
@Test
public void testSctpMatchConversion() {
MatchBuilder builder = new MatchBuilder();
SctpMatchBuilder sctpMatchBuilder = new SctpMatchBuilder();
sctpMatchBuilder.setSctpSourcePort(new PortNumber(11));
sctpMatchBuilder.setSctpDestinationPort(new PortNumber(12));
builder.setLayer4Match(sctpMatchBuilder.build());
Match match = builder.build();
Optional<List<MatchEntry>> entriesOptional = converterManager.convert(match, new VersionConvertorData(OFConstants.OFP_VERSION_1_3));
List<MatchEntry> entries = entriesOptional.get();
Assert.assertEquals("Wrong entries size", 2, entries.size());
MatchEntry entry = entries.get(0);
checkEntryHeader(entry, SctpSrc.class, false);
Assert.assertEquals("Wrong sctp src", 11, ((SctpSrcCase) entry.getMatchEntryValue()).getSctpSrc().getPort().getValue().intValue());
entry = entries.get(1);
checkEntryHeader(entry, SctpDst.class, false);
Assert.assertEquals("Wrong sctp dst", 12, ((SctpDstCase) entry.getMatchEntryValue()).getSctpDst().getPort().getValue().intValue());
}
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 openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createTunnelIpv4DstInstructions.
private static InstructionsBuilder createTunnelIpv4DstInstructions() {
final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
// Build the tunnel endpoint destination IPv4 address
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
final Ipv4Prefix dstIp = new Ipv4Prefix("172.16.100.100");
// Add the mew IPv4 object as the tunnel destination
final TunnelIpv4MatchBuilder tunnelIpv4DstMatchBuilder = new TunnelIpv4MatchBuilder();
tunnelIpv4DstMatchBuilder.setTunnelIpv4Destination(dstIp);
setFieldBuilder.setLayer3Match(tunnelIpv4DstMatchBuilder.build());
// Add the IPv4 tunnel dst to the set_field value
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
// Resulting action is a per/flow src TEP (set_field:172.16.100.100->tun_dst)
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Add the action to the ordered list of Instructions
final InstructionBuilder ib = new InstructionBuilder();
ib.setOrder(0);
ib.setKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Add the Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
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 openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createTestFlow.
private FlowBuilder createTestFlow(final NodeBuilder nodeBuilder, final String flowTypeArg, final String tableId) {
final long TEST_ID = 123;
final FlowBuilder flow = new FlowBuilder();
long id = TEST_ID;
String flowType = flowTypeArg;
if (flowType == null) {
flowType = "f1";
}
flow.setPriority(2);
switch(flowType) {
case "f1":
id += 1;
flow.setMatch(createMatch1().build());
flow.setInstructions(createDecNwTtlInstructions().build());
break;
case "f2":
id += 2;
flow.setMatch(createMatch2().build());
flow.setInstructions(createDropInstructions().build());
break;
case "f3":
id += 3;
flow.setMatch(createMatch3().build());
flow.setInstructions(createDropInstructions().build());
break;
case "f4":
id += 4;
flow.setMatch(createEthernetMatch().build());
flow.setInstructions(createDropInstructions().build());
break;
case "f5":
id += 5;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction().build());
break;
case "f6":
id += 6;
flow.setMatch(createMatch1().build());
flow.setInstructions(createGotoTableInstructions().build());
break;
case "f7":
id += 7;
flow.setMatch(createMatch1().build());
flow.setInstructions(createMeterInstructions().build());
break;
case "f8":
id += 8;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction1().build());
break;
case "f9":
id += 9;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction2().build());
break;
case "f10":
id += 10;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction3().build());
break;
case "f11":
id += 11;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction4().build());
break;
case "f12":
id += 12;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction5().build());
break;
case "f13":
id += 13;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction6().build());
break;
case "f14":
id += 14;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction7().build());
break;
case "f15":
id += 15;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction8().build());
break;
case "f16":
id += 16;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction9().build());
break;
case "f17":
id += 17;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction10().build());
break;
case "f18":
id += 18;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction11().build());
break;
case "f19":
id += 19;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction12().build());
break;
case "f20":
id += 20;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction13().build());
break;
case "f21":
id += 21;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction14().build());
break;
case "f22":
id += 22;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction15().build());
break;
case "f23":
id += 23;
// f23 can be used as test-case for generating error notification
// if the particular group is not configured - tested
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction16().build());
break;
case "f24":
id += 24;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction17().build());
break;
case "f25":
id += 25;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction18().build());
break;
case "f26":
id += 26;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction19().build());
break;
case "f27":
id += 27;
flow.setMatch(createMatch1().build());
flow.setInstructions(createMetadataInstructions().build());
break;
case "f28":
id += 28;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction20().build());
break;
case "f29":
id += 29;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction21().build());
break;
case "f30":
id += 30;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction22().build());
break;
case "f31":
id += 31;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction23(nodeBuilder.getId()).build());
break;
case "f32":
id += 32;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction24().build());
break;
case "f33":
id += 33;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction25().build());
break;
case "f34":
id += 34;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction26().build());
break;
case "f35":
id += 35;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction27().build());
break;
case "f36":
id += 36;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction28().build());
break;
case "f37":
id += 37;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction29().build());
break;
case "f38":
id += 38;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction30().build());
break;
case "f39":
id += 39;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction31().build());
break;
case "f40":
id += 40;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction32().build());
break;
case "f41":
id += 41;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction33().build());
break;
case "f42":
id += 42;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction34().build());
break;
case "f43":
id += 43;
flow.setMatch(createICMPv6Match().build());
flow.setInstructions(createDecNwTtlInstructions().build());
break;
case "f44":
id += 44;
flow.setMatch(createInphyportMatch(nodeBuilder.getId()).build());
flow.setInstructions(createDropInstructions().build());
break;
case "f45":
id += 45;
flow.setMatch(createMetadataMatch().build());
flow.setInstructions(createDropInstructions().build());
break;
case "f46":
id += 46;
flow.setMatch(createL3IPv6Match().build());
flow.setInstructions(createDecNwTtlInstructions().build());
break;
case "f47":
id += 47;
flow.setMatch(createL4SCTPMatch().build());
flow.setInstructions(createAppyActionInstruction().build());
break;
case "f48":
id += 48;
flow.setMatch(createTunnelIDMatch().build());
flow.setInstructions(createGotoTableInstructions().build());
break;
case "f49":
id += 49;
flow.setMatch(createVlanMatch().build());
flow.setInstructions(createMeterInstructions().build());
break;
case "f50":
id += 50;
flow.setMatch(createPbbMatch().build());
flow.setInstructions(createMeterInstructions().build());
break;
case "f51":
id += 51;
flow.setMatch(createVlanMatch().build());
flow.setInstructions(createDropInstructions().build());
break;
case "f52":
id += 52;
flow.setMatch(createL4TCPMatch().build());
flow.setInstructions(createDropInstructions().build());
break;
case "f53":
id += 53;
flow.setMatch(createL4UDPMatch().build());
flow.setInstructions(createDropInstructions().build());
break;
case "f54":
id += 54;
flow.setMatch(new MatchBuilder().build());
flow.setInstructions(createSentToControllerInstructions().build());
flow.setPriority(0);
break;
case "f55":
id += 55;
flow.setMatch(createToSMatch().build());
flow.setInstructions(createDropInstructions().build());
break;
case "f56":
id += 56;
flow.setMatch(createToSMatch().build());
flow.setInstructions(createOutputInstructions("INPORT", 10).build());
break;
case "f57":
id += 57;
flow.setMatch(createToSMatch().build());
flow.setInstructions(createOutputInstructions("FLOOD", 20).build());
break;
case "f58":
id += 58;
flow.setMatch(createToSMatch().build());
flow.setInstructions(createOutputInstructions("ALL", 30).build());
break;
case "f59":
id += 59;
flow.setMatch(createToSMatch().build());
flow.setInstructions(createOutputInstructions("NORMAL", 40).build());
break;
case "f60":
id += 60;
flow.setMatch(createToSMatch().build());
flow.setInstructions(createOutputInstructions("LOCAL", 50).build());
break;
case "f61":
id += 61;
flow.setMatch(createToSMatch().build());
flow.setInstructions(createOutputInstructions("TABLE", 60).build());
break;
case "f62":
id += 62;
flow.setMatch(createToSMatch().build());
flow.setInstructions(createOutputInstructions("NONE", 70).build());
break;
case "f63":
id += 63;
flow.setMatch(createToSMatch().build());
flow.setInstructions(createStripVlanInstructions().build());
flow.setBarrier(Boolean.TRUE);
break;
case "f64":
id += 64;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction35().build());
break;
case "f65":
id += 65;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction36().build());
break;
case "f66":
id += 66;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction37().build());
break;
case "f67":
id += 67;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction38().build());
break;
case "f68":
id += 68;
flow.setMatch(createL4TCPMatch().build());
flow.setInstructions(createAppyActionInstruction39().build());
break;
case "f69":
id += 69;
flow.setMatch(createL4UDPMatch().build());
flow.setInstructions(createAppyActionInstruction40().build());
break;
case "f70":
id += 70;
flow.setMatch(createL4SCTPMatch().build());
flow.setInstructions(createAppyActionInstruction41().build());
break;
case "f71":
id += 71;
flow.setMatch(createICMPv4Match().build());
flow.setInstructions(createAppyActionInstruction42().build());
break;
case "f72":
id += 72;
flow.setMatch(createArpMatch().build());
flow.setInstructions(createAppyActionInstruction43().build());
break;
case "f73":
id += 73;
flow.setMatch(createL3IPv6Match().build());
flow.setInstructions(createAppyActionInstruction44().build());
break;
case "f74":
id += 74;
flow.setMatch(createICMPv6Match().build());
flow.setInstructions(createAppyActionInstruction45().build());
break;
case "f75":
id += 75;
flow.setMatch(createMplsMatch().build());
flow.setInstructions(createAppyActionInstruction46().build());
break;
case "f76":
id += 76;
flow.setMatch(createPbbMatch().build());
flow.setInstructions(createAppyActionInstruction47().build());
break;
case "f77":
id += 77;
flow.setMatch(createTunnelIDMatch().build());
flow.setInstructions(createAppyActionInstruction48().build());
break;
case "f78":
id += 78;
flow.setMatch(createMatch33().build());
flow.setInstructions(createDropInstructions().build());
break;
case "f79":
id += 79;
flow.setMatch(createICMPv6Match1().build());
flow.setInstructions(createDecNwTtlInstructions().build());
break;
case "f80":
id += 80;
flow.setMatch(createVlanMatch().build());
flow.setInstructions(createAppyActionInstruction88().build());
break;
case "f81":
id += 81;
flow.setMatch(createLLDPMatch().build());
flow.setInstructions(createSentToControllerInstructions().build());
break;
case "f82":
id += 82;
flow.setMatch(createToSMatch().build());
flow.setInstructions(createOutputInstructions().build());
break;
case "f83":
// Test TCP_Flag Match
id += 83;
flow.setMatch(createTcpFlagMatch().build());
flow.setInstructions(createDropInstructions().build());
break;
case "f84":
id += 84;
// match vlan=10,dl_vlan_pcp=3
flow.setMatch(createVlanMatch().build());
// vlan_pcp=4
flow.setInstructions(createAppyActionInstruction88().build());
break;
case "f85":
// Test Tunnel IPv4 Src (e.g. set_field:172.16.100.200->tun_src)
id += 85;
flow.setMatch(createMatch3().build());
flow.setInstructions(createTunnelIpv4SrcInstructions().build());
break;
case "f86":
// Test Tunnel IPv4 Dst (e.g. set_field:172.16.100.100->tun_dst)
id += 86;
flow.setMatch(createMatch1().build());
flow.setInstructions(createTunnelIpv4DstInstructions().build());
break;
default:
LOG.warn("flow type not understood: {}", flowType);
}
final FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
if (null == flow.isBarrier()) {
flow.setBarrier(Boolean.FALSE);
}
final BigInteger value = BigInteger.valueOf(10);
flow.setCookie(new FlowCookie(value));
flow.setCookieMask(new FlowCookie(value));
flow.setHardTimeout(0);
flow.setIdleTimeout(0);
flow.setInstallHw(false);
flow.setStrict(false);
flow.setContainerName(null);
flow.setFlags(new FlowModFlags(false, false, false, false, true));
flow.setId(new FlowId("12"));
flow.setTableId(getTableId(tableId));
flow.setKey(key);
flow.setFlowName(ORIGINAL_FLOW_NAME + "X" + flowType);
return flow;
}
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 openflowplugin by opendaylight.
the class MultipathConvertorTest method setUp.
@Before
public void setUp() throws Exception {
final NxMultipath nxMultipath = Mockito.mock(NxMultipath.class);
when(bucketActionsCase.getNxMultipath()).thenReturn(nxMultipath);
final Dst dst = Mockito.mock(Dst.class);
when(dst.getStart()).thenReturn(1);
when(dst.getEnd()).thenReturn(2);
final DstNxNspCase dstNxNspCase = Mockito.mock(DstNxNspCase.class);
when(dst.getDstChoice()).thenReturn(dstNxNspCase);
when(nxMultipath.getFields()).thenReturn(OfjNxHashFields.NXHASHFIELDSETHSRC);
when(nxMultipath.getBasis()).thenReturn(2);
when(nxMultipath.getAlgorithm()).thenReturn(OfjNxMpAlgorithm.NXMPALGHASHTHRESHOLD);
when(nxMultipath.getMaxLink()).thenReturn(2);
when(nxMultipath.getArg()).thenReturn(2L);
when(nxMultipath.getDst()).thenReturn(dst);
final ActionMultipath actionMultipath = Mockito.mock(ActionMultipath.class);
final NxActionMultipath nxActionMultipath = Mockito.mock(NxActionMultipath.class);
when(nxActionMultipath.getDst()).thenReturn(NiciraMatchCodecs.TUN_ID_CODEC.getHeaderWithoutHasMask().toLong());
when(nxActionMultipath.getBasis()).thenReturn(1);
when(nxActionMultipath.getAlgorithm()).thenReturn(OfjNxMpAlgorithm.NXMPALGHRW);
when(nxActionMultipath.getMaxLink()).thenReturn(2);
when(nxActionMultipath.getArg()).thenReturn(2L);
when(actionMultipath.getNxActionMultipath()).thenReturn(nxActionMultipath);
when(action.getActionChoice()).thenReturn(actionMultipath);
multipathConvertor = new MultipathConvertor();
}
Aggregations