use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushMplsActionCaseBuilder in project openflowplugin by opendaylight.
the class PushMplsActionSerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final int ethType = 10;
final Action action = new PushMplsActionCaseBuilder().setPushMplsAction(new PushMplsActionBuilder().setEthernetType(ethType).build()).build();
assertAction(action, out -> {
assertEquals(out.readUnsignedShort(), ethType);
out.skipBytes(ActionConstants.ETHERTYPE_ACTION_PADDING);
});
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushMplsActionCaseBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createAppyActionInstruction2.
private static InstructionsBuilder createAppyActionInstruction2() {
final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final PushMplsActionBuilder push = new PushMplsActionBuilder();
push.setEthernetType(Integer.valueOf(0x8847));
ab.setAction(new PushMplsActionCaseBuilder().setPushMplsAction(push.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.PushMplsActionCaseBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkGroupTransactionProvider method createAppyActionInstruction2.
private static InstructionsBuilder createAppyActionInstruction2() {
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
PushMplsActionBuilder push = new PushMplsActionBuilder();
push.setEthernetType(0x8847);
ab.setAction(new PushMplsActionCaseBuilder().setPushMplsAction(push.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.PushMplsActionCaseBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginGroupTestCommandProvider method createNonAppyPushMplsAction.
private static List<Action> createNonAppyPushMplsAction() {
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
PushMplsActionBuilder push = new PushMplsActionBuilder();
push.setEthernetType(0x8849);
ab.setAction(new PushMplsActionCaseBuilder().setPushMplsAction(push.build()).build());
actionList.add(ab.build());
return actionList;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushMplsActionCaseBuilder in project openflowplugin by opendaylight.
the class OfToSalPushMplsCase method process.
@Override
public Optional<Action> process(@Nonnull final PushMplsCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
PushMplsAction pushMplsActionFromOF = source.getPushMplsAction();
PushMplsActionBuilder pushMplsAction = new PushMplsActionBuilder();
pushMplsAction.setEthernetType(pushMplsActionFromOF.getEthertype().getValue());
return Optional.of(new PushMplsActionCaseBuilder().setPushMplsAction(pushMplsAction.build()).build());
}
Aggregations