use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createTunnelIpv4SrcInstructions.
private static InstructionsBuilder createTunnelIpv4SrcInstructions() {
final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
// Build the tunnel endpoint source IPv4 address
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
final Ipv4Prefix dstIp = new Ipv4Prefix("172.16.100.200");
// Add the new IPv4 object as the tunnel destination
final TunnelIpv4MatchBuilder tunnelIpv4MatchBuilder = new TunnelIpv4MatchBuilder();
tunnelIpv4MatchBuilder.setTunnelIpv4Source(dstIp);
setFieldBuilder.setLayer3Match(tunnelIpv4MatchBuilder.build());
// Add the IPv4 tunnel src 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_src)
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());
// 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.action.types.rev131112.action.list.ActionKey in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createAppyActionInstruction18.
private static InstructionsBuilder createAppyActionInstruction18() {
final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final LoopbackActionBuilder loopbackActionBuilder = new LoopbackActionBuilder();
ab.setAction(new LoopbackActionCaseBuilder().setLoopbackAction(loopbackActionBuilder.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.action.types.rev131112.action.list.ActionKey in project openflowplugin by opendaylight.
the class LLDPPacketPuntEnforcer method createSendToControllerInstructions.
private static InstructionsBuilder createSendToControllerInstructions() {
final List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
output.setMaxLength(OFConstants.OFPCML_NO_BUFFER);
Uri value = new Uri(OutputPortValues.CONTROLLER.toString());
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
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());
ib.setOrder(0);
ib.setKey(new InstructionKey(0));
// 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.action.types.rev131112.action.list.ActionKey in project openflowplugin by opendaylight.
the class Test method createOFAction.
private static ActionBuilder createOFAction(int actionKeyVal) {
DecNwTtlBuilder ta = new DecNwTtlBuilder();
DecNwTtl decNwTtl = ta.build();
ActionBuilder ab = new ActionBuilder();
ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
ab.setKey(new ActionKey(actionKeyVal));
return ab;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey in project openflowplugin by opendaylight.
the class OpenflowpluginGroupTestCommandProvider method createAllOutputAction.
private List<Action> createAllOutputAction() {
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
output.setMaxLength(30);
Uri value = new Uri(OutputPortValues.ALL.toString());
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(ab.build());
return actions;
}
Aggregations