use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.apply.actions._case.ApplyActionsBuilder in project openflowplugin by opendaylight.
the class FlowUtils method createDirectMacToMacFlow.
/**
* Returns a {@link FlowBuilder} forwarding all packets to controller port.
*/
public static FlowBuilder createDirectMacToMacFlow(final Short tableId, final int priority, final MacAddress srcMac, final MacAddress dstMac, final NodeConnectorRef dstPort) {
FlowBuilder macToMacFlow = new FlowBuilder().setTableId(tableId).setFlowName("mac2mac");
macToMacFlow.setId(new FlowId(Long.toString(macToMacFlow.hashCode())));
EthernetMatch ethernetMatch = new EthernetMatchBuilder().setEthernetSource(new EthernetSourceBuilder().setAddress(srcMac).build()).setEthernetDestination(new EthernetDestinationBuilder().setAddress(dstMac).build()).build();
MatchBuilder match = new MatchBuilder();
match.setEthernetMatch(ethernetMatch);
Uri outputPort = dstPort.getValue().firstKeyOf(NodeConnector.class, NodeConnectorKey.class).getId();
Action outputToControllerAction = new ActionBuilder().setOrder(0).setAction(new OutputActionCaseBuilder().setOutputAction(new OutputActionBuilder().setMaxLength(Integer.valueOf(0xffff)).setOutputNodeConnector(outputPort).build()).build()).build();
// Create an Apply Action
ApplyActions applyActions = new ApplyActionsBuilder().setAction(ImmutableList.of(outputToControllerAction)).build();
// Wrap our Apply Action in an Instruction
Instruction applyActionsInstruction = new InstructionBuilder().setOrder(0).setInstruction(new ApplyActionsCaseBuilder().setApplyActions(applyActions).build()).build();
// Put our Instruction in a list of Instructions
macToMacFlow.setMatch(new MatchBuilder().setEthernetMatch(ethernetMatch).build()).setInstructions(new InstructionsBuilder().setInstruction(ImmutableList.of(applyActionsInstruction)).build()).setPriority(priority).setBufferId(OFConstants.OFP_NO_BUFFER).setHardTimeout(0).setIdleTimeout(0).setFlags(new FlowModFlags(false, false, false, false, false));
return macToMacFlow;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.apply.actions._case.ApplyActionsBuilder in project openflowplugin by opendaylight.
the class FlowInstructionResponseConvertor method convert.
@Override
public Instructions convert(List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction> source, VersionConvertorData data) {
InstructionsBuilder instructionsBuilder = new InstructionsBuilder();
List<Instruction> salInstructionList = new ArrayList<>();
int instructionTreeNodekey = 0;
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction salInstruction;
for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction switchInst : source) {
if (switchInst.getInstructionChoice() instanceof ApplyActionsCase) {
ApplyActionsCase actionsInstruction = (ApplyActionsCase) switchInst.getInstructionChoice();
ApplyActionsCaseBuilder applyActionsCaseBuilder = new ApplyActionsCaseBuilder();
ApplyActionsBuilder applyActionsBuilder = new ApplyActionsBuilder();
final ActionResponseConvertorData actionResponseConvertorData = new ActionResponseConvertorData(data.getVersion());
actionResponseConvertorData.setActionPath(ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
final Optional<List<Action>> actions = getConvertorExecutor().convert(actionsInstruction.getApplyActions().getAction(), actionResponseConvertorData);
applyActionsBuilder.setAction(FlowConvertorUtil.wrapActionList(actions.orElse(Collections.emptyList())));
applyActionsCaseBuilder.setApplyActions(applyActionsBuilder.build());
salInstruction = applyActionsCaseBuilder.build();
} else if (switchInst.getInstructionChoice() instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.ClearActionsCase) {
ClearActionsCaseBuilder clearActionsCaseBuilder = new ClearActionsCaseBuilder();
salInstruction = clearActionsCaseBuilder.build();
} else if (switchInst.getInstructionChoice() instanceof GotoTableCase) {
GotoTableCase gotoTableCase = (GotoTableCase) switchInst.getInstructionChoice();
GoToTableCaseBuilder goToTableCaseBuilder = new GoToTableCaseBuilder();
GoToTableBuilder goToTableBuilder = new GoToTableBuilder();
goToTableBuilder.setTableId(gotoTableCase.getGotoTable().getTableId());
goToTableCaseBuilder.setGoToTable(goToTableBuilder.build());
salInstruction = goToTableCaseBuilder.build();
} else if (switchInst.getInstructionChoice() instanceof MeterCase) {
MeterCase meterIdInstruction = (MeterCase) switchInst.getInstructionChoice();
MeterCaseBuilder meterCaseBuilder = new MeterCaseBuilder();
MeterBuilder meterBuilder = new MeterBuilder();
meterBuilder.setMeterId(new MeterId(meterIdInstruction.getMeter().getMeterId()));
meterCaseBuilder.setMeter(meterBuilder.build());
salInstruction = meterCaseBuilder.build();
} else if (switchInst.getInstructionChoice() instanceof WriteActionsCase) {
WriteActionsCase writeActionsCase = (WriteActionsCase) switchInst.getInstructionChoice();
WriteActionsCaseBuilder writeActionsCaseBuilder = new WriteActionsCaseBuilder();
WriteActionsBuilder writeActionsBuilder = new WriteActionsBuilder();
final ActionResponseConvertorData actionResponseConvertorData = new ActionResponseConvertorData(data.getVersion());
actionResponseConvertorData.setActionPath(ActionPath.FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS);
final Optional<List<Action>> actions = getConvertorExecutor().convert(writeActionsCase.getWriteActions().getAction(), actionResponseConvertorData);
writeActionsBuilder.setAction(FlowConvertorUtil.wrapActionList(actions.orElse(Collections.emptyList())));
writeActionsCaseBuilder.setWriteActions(writeActionsBuilder.build());
salInstruction = writeActionsCaseBuilder.build();
} else if (switchInst.getInstructionChoice() instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.WriteMetadataCase) {
org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.WriteMetadataCase writeMetadataCase = (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.WriteMetadataCase) switchInst.getInstructionChoice();
WriteMetadataCaseBuilder writeMetadataCaseBuilder = new WriteMetadataCaseBuilder();
WriteMetadataBuilder writeMetadataBuilder = new WriteMetadataBuilder();
writeMetadataBuilder.setMetadata(new BigInteger(OFConstants.SIGNUM_UNSIGNED, writeMetadataCase.getWriteMetadata().getMetadata()));
writeMetadataBuilder.setMetadataMask(new BigInteger(OFConstants.SIGNUM_UNSIGNED, writeMetadataCase.getWriteMetadata().getMetadataMask()));
writeMetadataCaseBuilder.setWriteMetadata(writeMetadataBuilder.build());
salInstruction = writeMetadataCaseBuilder.build();
} else {
continue;
}
InstructionBuilder instBuilder = new InstructionBuilder();
instBuilder.setInstruction(salInstruction);
instBuilder.setKey(new InstructionKey(instructionTreeNodekey));
instBuilder.setOrder(instructionTreeNodekey);
instructionTreeNodekey++;
salInstructionList.add(instBuilder.build());
}
instructionsBuilder.setInstruction(salInstructionList);
return instructionsBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.apply.actions._case.ApplyActionsBuilder in project openflowplugin by opendaylight.
the class ApplyActionsInstructionDeserializer method deserialize.
@Override
public Instruction deserialize(ByteBuf input) {
final InstructionBuilder builder = new InstructionBuilder();
input.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
int instructionLength = input.readUnsignedShort();
input.skipBytes(InstructionConstants.PADDING_IN_ACTIONS_INSTRUCTION);
ApplyActionsCaseBuilder caseBuilder = new ApplyActionsCaseBuilder();
ApplyActionsBuilder actionsBuilder = new ApplyActionsBuilder();
actionsBuilder.setAction(deserializeActions(input, instructionLength));
caseBuilder.setApplyActions(actionsBuilder.build());
builder.setInstructionChoice(caseBuilder.build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.apply.actions._case.ApplyActionsBuilder in project openflowplugin by opendaylight.
the class FlowModInputMessageFactoryTest method testFlowModInputMessageFactory.
/**
* Testing of {@link FlowModInputMessageFactory} for correct translation from POJO.
*/
@Test
public void testFlowModInputMessageFactory() throws Exception {
FlowModInputBuilder builder = new FlowModInputBuilder();
BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
byte[] cookie = new byte[] { (byte) 0xFF, 0x01, 0x04, 0x01, 0x06, 0x00, 0x07, 0x01 };
builder.setCookie(new BigInteger(1, cookie));
byte[] cookieMask = new byte[] { (byte) 0xFF, 0x05, 0x00, 0x00, 0x09, 0x30, 0x00, 0x30 };
builder.setCookieMask(new BigInteger(1, cookieMask));
builder.setTableId(new TableId(65L));
builder.setCommand(FlowModCommand.forValue(2));
builder.setIdleTimeout(12);
builder.setHardTimeout(0);
builder.setPriority(126);
builder.setBufferId(2L);
builder.setOutPort(new PortNumber(4422L));
builder.setOutGroup(98L);
builder.setFlags(new FlowModFlags(true, false, true, false, true));
MatchBuilder matchBuilder = new MatchBuilder();
matchBuilder.setType(OxmMatchType.class);
final List<MatchEntry> entries = new ArrayList<>();
MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(InPhyPort.class);
entriesBuilder.setHasMask(false);
InPhyPortCaseBuilder inPhyPortCaseBuilder = new InPhyPortCaseBuilder();
InPhyPortBuilder inPhyPortBuilder = new InPhyPortBuilder();
inPhyPortBuilder.setPortNumber(new PortNumber(42L));
inPhyPortCaseBuilder.setInPhyPort(inPhyPortBuilder.build());
entriesBuilder.setMatchEntryValue(inPhyPortCaseBuilder.build());
entries.add(entriesBuilder.build());
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(IpEcn.class);
entriesBuilder.setHasMask(false);
IpEcnCaseBuilder ipEcnCaseBuilder = new IpEcnCaseBuilder();
IpEcnBuilder ipEcnBuilder = new IpEcnBuilder();
ipEcnBuilder.setEcn((short) 4);
ipEcnCaseBuilder.setIpEcn(ipEcnBuilder.build());
entriesBuilder.setMatchEntryValue(ipEcnCaseBuilder.build());
entries.add(entriesBuilder.build());
matchBuilder.setMatchEntry(entries);
builder.setMatch(matchBuilder.build());
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();
metadataBuilder.setMetadata(cookie);
metadataBuilder.setMetadataMask(cookieMask);
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());
builder.setInstruction(instructions);
final FlowModInput message = builder.build();
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
// simulate parent message
out.writeInt(1);
out.writeZero(2);
out.writeShort(3);
flowModFactory.serialize(message, out);
// read parent message
out.readInt();
out.skipBytes(2);
out.readShort();
BufferHelper.checkHeaderV13(out, (byte) 14, 128);
cookie = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
out.readBytes(cookie);
Assert.assertEquals("Wrong cookie", message.getCookie(), new BigInteger(1, cookie));
cookieMask = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
out.readBytes(cookieMask);
Assert.assertEquals("Wrong cookieMask", message.getCookieMask(), new BigInteger(1, cookieMask));
Assert.assertEquals("Wrong tableId", message.getTableId().getValue().intValue(), out.readUnsignedByte());
Assert.assertEquals("Wrong command", message.getCommand().getIntValue(), out.readUnsignedByte());
Assert.assertEquals("Wrong idleTimeOut", message.getIdleTimeout().intValue(), out.readShort());
Assert.assertEquals("Wrong hardTimeOut", message.getHardTimeout().intValue(), out.readShort());
Assert.assertEquals("Wrong priority", message.getPriority().intValue(), out.readUnsignedShort());
Assert.assertEquals("Wrong bufferId", message.getBufferId().intValue(), out.readUnsignedInt());
Assert.assertEquals("Wrong outPort", message.getOutPort().getValue().intValue(), out.readUnsignedInt());
Assert.assertEquals("Wrong outGroup", message.getOutGroup().intValue(), out.readUnsignedInt());
Assert.assertEquals("Wrong flags", message.getFlags(), createFlowModFlagsFromBitmap(out.readUnsignedShort()));
out.skipBytes(PADDING_IN_FLOW_MOD_MESSAGE);
Assert.assertEquals("Wrong match type", 1, out.readUnsignedShort());
out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
Assert.assertEquals("Wrong oxm class", 0x8000, out.readUnsignedShort());
short fieldAndMask = out.readUnsignedByte();
Assert.assertEquals("Wrong oxm hasMask", 0, fieldAndMask & 1);
Assert.assertEquals("Wrong oxm field", 1, fieldAndMask >> 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
Assert.assertEquals("Wrong oxm value", 42, out.readUnsignedInt());
Assert.assertEquals("Wrong oxm class", 0x8000, out.readUnsignedShort());
fieldAndMask = out.readUnsignedByte();
Assert.assertEquals("Wrong oxm hasMask", 0, fieldAndMask & 1);
Assert.assertEquals("Wrong oxm field", 9, fieldAndMask >> 1);
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
Assert.assertEquals("Wrong oxm value", 4, out.readUnsignedByte());
out.skipBytes(7);
Assert.assertEquals("Wrong instruction type", 1, out.readUnsignedShort());
out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
Assert.assertEquals("Wrong instruction value", 43, out.readUnsignedByte());
out.skipBytes(3);
Assert.assertEquals("Wrong instruction type", 2, out.readUnsignedShort());
out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
out.skipBytes(EncodeConstants.SIZE_OF_INT_IN_BYTES);
byte[] cookieRead = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
out.readBytes(cookieRead);
byte[] cookieMaskRead = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
out.readBytes(cookieMaskRead);
Assert.assertArrayEquals("Wrong metadata", cookie, cookieRead);
Assert.assertArrayEquals("Wrong metadata mask", cookieMask, cookieMaskRead);
Assert.assertEquals("Wrong instruction type", 4, out.readUnsignedShort());
Assert.assertEquals("Wrong instruction length", 24, out.readUnsignedShort());
out.skipBytes(4);
Assert.assertEquals("Wrong action type", 0, out.readUnsignedShort());
Assert.assertEquals("Wrong action length", 16, out.readUnsignedShort());
Assert.assertEquals("Wrong port", 42, out.readUnsignedInt());
Assert.assertEquals("Wrong max-length", 52, out.readUnsignedShort());
out.skipBytes(6);
Assert.assertTrue("Unread data", out.readableBytes() == 0);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.apply.actions._case.ApplyActionsBuilder in project openflowplugin by opendaylight.
the class MultipartReplyMessageFactoryTest method createFlowStats.
private static List<FlowStats> createFlowStats() {
FlowStatsBuilder builder = new FlowStatsBuilder();
builder.setTableId((short) 1);
builder.setDurationSec(1L);
builder.setDurationNsec(1L);
builder.setPriority(1);
builder.setIdleTimeout(1);
builder.setHardTimeout(1);
builder.setCookie(BigInteger.valueOf(1234L));
builder.setPacketCount(BigInteger.valueOf(1234L));
builder.setByteCount(BigInteger.valueOf(1234L));
MatchBuilder matchBuilder = new MatchBuilder();
matchBuilder.setType(OxmMatchType.class);
final List<MatchEntry> entries = new ArrayList<>();
MatchEntryBuilder entriesBuilder = new MatchEntryBuilder();
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(InPhyPort.class);
entriesBuilder.setHasMask(false);
InPhyPortCaseBuilder inPhyPortCaseBuilder = new InPhyPortCaseBuilder();
InPhyPortBuilder inPhyPortBuilder = new InPhyPortBuilder();
inPhyPortBuilder.setPortNumber(new PortNumber(42L));
inPhyPortCaseBuilder.setInPhyPort(inPhyPortBuilder.build());
entriesBuilder.setMatchEntryValue(inPhyPortCaseBuilder.build());
entries.add(entriesBuilder.build());
entriesBuilder.setOxmClass(OpenflowBasicClass.class);
entriesBuilder.setOxmMatchField(IpEcn.class);
entriesBuilder.setHasMask(false);
IpEcnCaseBuilder ipEcnCaseBuilder = new IpEcnCaseBuilder();
IpEcnBuilder ipEcnBuilder = new IpEcnBuilder();
ipEcnBuilder.setEcn((short) 4);
ipEcnCaseBuilder.setIpEcn(ipEcnBuilder.build());
entriesBuilder.setMatchEntryValue(ipEcnCaseBuilder.build());
entries.add(entriesBuilder.build());
matchBuilder.setMatchEntry(entries);
builder.setMatch(matchBuilder.build());
final List<Instruction> instructions = new ArrayList<>();
// Goto_table instruction
InstructionBuilder builderInstruction = new InstructionBuilder();
GotoTableCaseBuilder gotoCaseBuilder = new GotoTableCaseBuilder();
GotoTableBuilder instructionBuilder = new GotoTableBuilder();
instructionBuilder.setTableId((short) 5);
gotoCaseBuilder.setGotoTable(instructionBuilder.build());
builderInstruction.setInstructionChoice(gotoCaseBuilder.build());
instructions.add(builderInstruction.build());
// Write_metadata instruction
builderInstruction = new InstructionBuilder();
WriteMetadataCaseBuilder metadataCaseBuilder = new WriteMetadataCaseBuilder();
WriteMetadataBuilder metadataBuilder = new WriteMetadataBuilder();
metadataBuilder.setMetadata(ByteBufUtils.hexStringToBytes("00 01 02 03 04 05 06 07"));
metadataBuilder.setMetadataMask(ByteBufUtils.hexStringToBytes("07 06 05 04 03 02 01 00"));
metadataCaseBuilder.setWriteMetadata(metadataBuilder.build());
builderInstruction.setInstructionChoice(metadataCaseBuilder.build());
instructions.add(builderInstruction.build());
// Clear_actions instruction
builderInstruction = new InstructionBuilder();
builderInstruction.setInstructionChoice(new ClearActionsCaseBuilder().build());
instructions.add(builderInstruction.build());
// Meter instruction
builderInstruction = new InstructionBuilder();
MeterCaseBuilder meterCaseBuilder = new MeterCaseBuilder();
MeterBuilder meterBuilder = new MeterBuilder();
meterBuilder.setMeterId(42L);
meterCaseBuilder.setMeter(meterBuilder.build());
builderInstruction.setInstructionChoice(meterCaseBuilder.build());
instructions.add(builderInstruction.build());
// Write_actions instruction
builderInstruction = new InstructionBuilder();
final WriteActionsCaseBuilder writeActionsCaseBuilder = new WriteActionsCaseBuilder();
final WriteActionsBuilder writeActionsBuilder = new WriteActionsBuilder();
OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
OutputActionBuilder outputBuilder = new OutputActionBuilder();
outputBuilder.setPort(new PortNumber(45L));
outputBuilder.setMaxLength(55);
caseBuilder.setOutputAction(outputBuilder.build());
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(caseBuilder.build());
List<Action> actions = new ArrayList<>();
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
SetNwTtlCaseBuilder ttlCaseBuilder = new SetNwTtlCaseBuilder();
SetNwTtlActionBuilder ttlActionBuilder = new SetNwTtlActionBuilder();
ttlActionBuilder.setNwTtl((short) 64);
ttlCaseBuilder.setSetNwTtlAction(ttlActionBuilder.build());
actionBuilder.setActionChoice(ttlCaseBuilder.build());
actions.add(actionBuilder.build());
writeActionsBuilder.setAction(actions);
writeActionsCaseBuilder.setWriteActions(writeActionsBuilder.build());
builderInstruction.setInstructionChoice(writeActionsCaseBuilder.build());
instructions.add(builderInstruction.build());
// Apply_actions instruction
builderInstruction = new InstructionBuilder();
final ApplyActionsCaseBuilder applyActionsCaseBuilder = new ApplyActionsCaseBuilder();
final ApplyActionsBuilder applyActionsBuilder = new ApplyActionsBuilder();
actions = new ArrayList<>();
actionBuilder = new ActionBuilder();
PushVlanCaseBuilder vlanCaseBuilder = new PushVlanCaseBuilder();
PushVlanActionBuilder vlanBuilder = new PushVlanActionBuilder();
vlanBuilder.setEthertype(new EtherType(new EtherType(14)));
vlanCaseBuilder.setPushVlanAction(vlanBuilder.build());
actionBuilder.setActionChoice(vlanCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(new PopPbbCaseBuilder().build());
actions.add(actionBuilder.build());
applyActionsBuilder.setAction(actions);
applyActionsCaseBuilder.setApplyActions(applyActionsBuilder.build());
builderInstruction.setInstructionChoice(applyActionsCaseBuilder.build());
instructions.add(builderInstruction.build());
builder.setInstruction(instructions);
List<FlowStats> list = new ArrayList<>();
list.add(builder.build());
return list;
}
Aggregations