use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createAppyActionInstruction46.
private static InstructionsBuilder createAppyActionInstruction46() {
final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
final ActionBuilder ab1 = new ActionBuilder();
final SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
final ActionBuilder ab2 = new ActionBuilder();
final SetFieldBuilder setFieldBuilder2 = new SetFieldBuilder();
// MPLS
final ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder();
final ProtocolMatchFieldsBuilder protomatch1 = new ProtocolMatchFieldsBuilder();
final ProtocolMatchFieldsBuilder protomatch2 = new ProtocolMatchFieldsBuilder();
protomatch.setMplsLabel((long) 36008);
protomatch1.setMplsTc((short) 4);
protomatch2.setMplsBos((short) 1);
setFieldBuilder.setProtocolMatchFields(protomatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setProtocolMatchFields(protomatch1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
ab1.setKey(new ActionKey(1));
actionList.add(ab1.build());
setFieldBuilder2.setProtocolMatchFields(protomatch2.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.instruction.ApplyActionsCaseBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createAppyActionInstruction6.
private static InstructionsBuilder createAppyActionInstruction6() {
final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetDlSrcActionBuilder src = new SetDlSrcActionBuilder();
src.setAddress(new MacAddress("00:05:b9:7c:81:5f"));
ab.setAction(new SetDlSrcActionCaseBuilder().setSetDlSrcAction(src.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.instruction.ApplyActionsCaseBuilder 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.instruction.ApplyActionsCaseBuilder 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.instruction.ApplyActionsCaseBuilder 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;
}
Aggregations