use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createAppyActionInstruction37.
private static InstructionsBuilder createAppyActionInstruction37() {
final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
final ActionBuilder ab2 = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
final SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
final SetFieldBuilder setFieldBuilder2 = new SetFieldBuilder();
// Ip
final IpMatchBuilder ipmatch = new IpMatchBuilder();
final IpMatchBuilder ipmatch1 = new IpMatchBuilder();
final IpMatchBuilder ipmatch2 = new IpMatchBuilder();
final Dscp dscp = new Dscp((short) 3);
ipmatch.setIpDscp(dscp);
ipmatch1.setIpEcn((short) 2);
ipmatch2.setIpProtocol((short) 120);
setFieldBuilder.setIpMatch(ipmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setIpMatch(ipmatch1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
ab1.setKey(new ActionKey(1));
actionList.add(ab1.build());
setFieldBuilder2.setIpMatch(ipmatch2.build());
ab2.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder2.build()).build());
ab2.setKey(new ActionKey(2));
actionList.add(ab2.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
ib.setKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our 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.flow.types.rev131026.instruction.list.InstructionKey in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createMeterInstructions.
private static InstructionsBuilder createMeterInstructions() {
final MeterBuilder aab = new MeterBuilder();
aab.setMeterId(new MeterId(1L));
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new MeterCaseBuilder().setMeter(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createAppyActionInstruction27.
private static InstructionsBuilder createAppyActionInstruction27() {
final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetNwSrcActionBuilder setNwsrcActionBuilder = new SetNwSrcActionBuilder();
final Ipv4Builder ipsrc = new Ipv4Builder();
final Ipv4Prefix prefixsrc = new Ipv4Prefix("10.0.23.21/24");
ipsrc.setIpv4Address(prefixsrc);
setNwsrcActionBuilder.setAddress(ipsrc.build());
ab.setAction(new SetNwSrcActionCaseBuilder().setSetNwSrcAction(setNwsrcActionBuilder.build()).build());
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createDropInstructions.
private static InstructionsBuilder createDropInstructions() {
final DropActionBuilder dab = new DropActionBuilder();
final DropAction dropAction = dab.build();
final ActionBuilder ab = new ActionBuilder();
ab.setAction(new DropActionCaseBuilder().setDropAction(dropAction).build());
ab.setKey(new ActionKey(0));
// Add our drop action to a list
final List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
ab.setKey(new ActionKey(0));
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createAppyActionInstruction38.
private static InstructionsBuilder createAppyActionInstruction38() {
final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
final SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
// IPv4
final Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
final Ipv4MatchBuilder ipv4Match1 = new Ipv4MatchBuilder();
final Ipv4Prefix dstip = new Ipv4Prefix("200.71.9.5210");
final Ipv4Prefix srcip = new Ipv4Prefix("100.1.1.1");
ipv4Match1.setIpv4Destination(dstip);
ipv4Match.setIpv4Source(srcip);
setFieldBuilder.setLayer3Match(ipv4Match.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setLayer3Match(ipv4Match1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
ab1.setKey(new ActionKey(1));
actionList.add(ab1.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
ib.setKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our 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;
}
Aggregations