use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.ApplyActionsCaseBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkGroupTransactionProvider method createAppyActionInstruction3.
private static InstructionsBuilder createAppyActionInstruction3() {
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
PushPbbActionBuilder pbb = new PushPbbActionBuilder();
pbb.setEthernetType(0x88E7);
ab.setAction(new PushPbbActionCaseBuilder().setPushPbbAction(pbb.build()).build());
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.ApplyActionsCaseBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkGroupTransactionProvider method createAppyActionInstruction7.
private static InstructionsBuilder createAppyActionInstruction7() {
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SetVlanIdActionBuilder vl = new SetVlanIdActionBuilder();
VlanId vlanId = new VlanId(4012);
vl.setVlanId(vlanId);
ab.setAction(new SetVlanIdActionCaseBuilder().setSetVlanIdAction(vl.build()).build());
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.ApplyActionsCaseBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkGroupTransactionProvider method createAppyActionInstruction.
private static InstructionsBuilder createAppyActionInstruction() {
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
ControllerActionBuilder controller = new ControllerActionBuilder();
controller.setMaxLength(5);
ab.setAction(new ControllerActionCaseBuilder().setControllerAction(controller.build()).build());
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.ApplyActionsCaseBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkGroupTransactionProvider method createAppyActionInstruction21.
private static InstructionsBuilder createAppyActionInstruction21() {
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
PopVlanActionBuilder popVlanActionBuilder = new PopVlanActionBuilder();
ab.setAction(new PopVlanActionCaseBuilder().setPopVlanAction(popVlanActionBuilder.build()).build());
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.ApplyActionsCaseBuilder in project openflowplugin by opendaylight.
the class FlowModInputMessageFactoryTest method createInstructions.
private List<Instruction> createInstructions() {
final List<Instruction> instructions = new ArrayList<>();
InstructionBuilder insBuilder = new InstructionBuilder();
GotoTableCaseBuilder goToCaseBuilder = new GotoTableCaseBuilder();
GotoTableBuilder instructionBuilder = new GotoTableBuilder();
instructionBuilder.setTableId((short) 43);
goToCaseBuilder.setGotoTable(instructionBuilder.build());
insBuilder.setInstructionChoice(goToCaseBuilder.build());
instructions.add(insBuilder.build());
WriteMetadataCaseBuilder metadataCaseBuilder = new WriteMetadataCaseBuilder();
WriteMetadataBuilder metadataBuilder = new WriteMetadataBuilder();
byte[] metadata = new byte[] { (byte) 0xFF, 0x01, 0x04, 0x01, 0x06, 0x00, 0x07, 0x01 };
metadataBuilder.setMetadata(metadata);
byte[] metadataMask = new byte[] { (byte) 0xFF, 0x05, 0x00, 0x00, 0x09, 0x30, 0x00, 0x30 };
metadataBuilder.setMetadataMask(metadataMask);
metadataCaseBuilder.setWriteMetadata(metadataBuilder.build());
insBuilder.setInstructionChoice(metadataCaseBuilder.build());
instructions.add(insBuilder.build());
insBuilder = new InstructionBuilder();
final ApplyActionsCaseBuilder applyActionsCaseBuilder = new ApplyActionsCaseBuilder();
final ApplyActionsBuilder actionsBuilder = new ApplyActionsBuilder();
final List<Action> actions = new ArrayList<>();
final ActionBuilder actionBuilder = new ActionBuilder();
OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
OutputActionBuilder outputBuilder = new OutputActionBuilder();
outputBuilder.setPort(new PortNumber(42L));
outputBuilder.setMaxLength(52);
caseBuilder.setOutputAction(outputBuilder.build());
actionBuilder.setActionChoice(caseBuilder.build());
actions.add(actionBuilder.build());
actionsBuilder.setAction(actions);
applyActionsCaseBuilder.setApplyActions(actionsBuilder.build());
insBuilder.setInstructionChoice(applyActionsCaseBuilder.build());
instructions.add(insBuilder.build());
return instructions;
}
Aggregations