use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.pcp.action._case.SetVlanPcpActionBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkTransactionProvider method createAppyActionInstruction8.
private static InstructionsBuilder createAppyActionInstruction8() {
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SetVlanPcpActionBuilder pcp = new SetVlanPcpActionBuilder();
VlanPcp pcp1 = new VlanPcp((short) 2);
pcp.setVlanPcp(pcp1);
ab.setAction(new SetVlanPcpActionCaseBuilder().setSetVlanPcpAction(pcp.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.action.types.rev131112.action.action.set.vlan.pcp.action._case.SetVlanPcpActionBuilder in project openflowplugin by opendaylight.
the class SetVlanPcpActionSerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final short vlan = 1;
final Action action = new SetVlanPcpActionCaseBuilder().setSetVlanPcpAction(new SetVlanPcpActionBuilder().setVlanPcp(new VlanPcp(vlan)).build()).build();
assertAction(action, out -> assertEquals(out.readUnsignedByte(), vlan));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.pcp.action._case.SetVlanPcpActionBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createAppyActionInstruction88.
private static InstructionsBuilder createAppyActionInstruction88() {
final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetVlanPcpActionBuilder pcp = new SetVlanPcpActionBuilder();
// the code point is a 3-bit(0-7) field representing the frame priority level
final VlanPcp pcp1 = new VlanPcp((short) 4);
pcp.setVlanPcp(pcp1);
ab.setAction(new SetVlanPcpActionCaseBuilder().setSetVlanPcpAction(pcp.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.action.set.vlan.pcp.action._case.SetVlanPcpActionBuilder in project openflowplugin by opendaylight.
the class SalToOfSetVlanPcpActionV10Case method process.
@Nonnull
@Override
public Optional<Action> process(@Nonnull final SetVlanPcpActionCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) {
SetVlanPcpAction setvlanpcpaction = source.getSetVlanPcpAction();
SetVlanPcpActionBuilder setVlanPcpActionBuilder = new SetVlanPcpActionBuilder();
SetVlanPcpCaseBuilder setVlanPcpCaseBuilder = new SetVlanPcpCaseBuilder();
setVlanPcpActionBuilder.setVlanPcp(setvlanpcpaction.getVlanPcp().getValue());
setVlanPcpCaseBuilder.setSetVlanPcpAction(setVlanPcpActionBuilder.build());
return Optional.of(new ActionBuilder().setActionChoice(setVlanPcpCaseBuilder.build()).build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.pcp.action._case.SetVlanPcpActionBuilder in project openflowplugin by opendaylight.
the class OF10SetVlanPcpActionDeserializer method deserialize.
@Override
public Action deserialize(ByteBuf input) {
final org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder builder = new ActionBuilder();
input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
SetVlanPcpCaseBuilder caseBuilder = new SetVlanPcpCaseBuilder();
SetVlanPcpActionBuilder actionBuilder = new SetVlanPcpActionBuilder();
actionBuilder.setVlanPcp(input.readUnsignedByte());
caseBuilder.setSetVlanPcpAction(actionBuilder.build());
builder.setActionChoice(caseBuilder.build());
input.skipBytes(ActionConstants.PADDING_IN_SET_VLAN_PCP_ACTION);
return builder.build();
}
Aggregations