use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder 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.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder 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.apply.actions._case.ApplyActionsBuilder 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.apply.actions._case.ApplyActionsBuilder 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.apply.actions._case.ApplyActionsBuilder 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;
}
Aggregations