use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.mpls.ttl._case.SetMplsTtlActionBuilder in project openflowplugin by opendaylight.
the class GroupConvertorTest method assembleSetMplsTtlActionBuilder.
private static ActionBuilder assembleSetMplsTtlActionBuilder(final int actionOrder) {
final SetMplsTtlActionBuilder setMplsTtlActionBuilder = new SetMplsTtlActionBuilder();
setMplsTtlActionBuilder.setMplsTtl((short) 0X1);
final SetMplsTtlActionCaseBuilder setMplsTtlActionCaseBuilder = new SetMplsTtlActionCaseBuilder();
setMplsTtlActionCaseBuilder.setSetMplsTtlAction(setMplsTtlActionBuilder.build());
final ActionBuilder actionsB3 = new ActionBuilder();
actionsB3.setOrder(actionOrder).setAction(setMplsTtlActionCaseBuilder.build());
return actionsB3;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.mpls.ttl._case.SetMplsTtlActionBuilder in project openflowplugin by opendaylight.
the class TableFeaturesConvertor method setActionTableFeatureProperty.
private static void setActionTableFeatureProperty(final TableFeaturePropertiesBuilder builder, final TableFeaturesPropType type, final List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> salActions) {
List<Action> actionList = new ArrayList<>();
for (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action currAction : salActions) {
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionType = currAction.getAction();
ActionBuilder actionBuilder = new ActionBuilder();
if (actionType instanceof OutputActionCase) {
OutputActionCaseBuilder outputActionCaseBuilder = new OutputActionCaseBuilder();
actionBuilder.setActionChoice(outputActionCaseBuilder.build());
} else if (actionType instanceof GroupActionCase) {
GroupCaseBuilder groupActionBuilder = new GroupCaseBuilder();
actionBuilder.setActionChoice(groupActionBuilder.build());
} else if (actionType instanceof CopyTtlOutCase) {
CopyTtlOutCaseBuilder copyTtlOutCaseBuilder = new CopyTtlOutCaseBuilder();
actionBuilder.setActionChoice(copyTtlOutCaseBuilder.build());
} else if (actionType instanceof CopyTtlInCase) {
CopyTtlInCaseBuilder copyTtlInCaseBuilder = new CopyTtlInCaseBuilder();
actionBuilder.setActionChoice(copyTtlInCaseBuilder.build());
} else if (actionType instanceof SetMplsTtlActionCase) {
SetMplsTtlCaseBuilder setMplsTtlActionBuilder = new SetMplsTtlCaseBuilder();
actionBuilder.setActionChoice(setMplsTtlActionBuilder.build());
} else if (actionType instanceof DecMplsTtlCase) {
DecMplsTtlCaseBuilder decMplsTtlCaseBuilder = new DecMplsTtlCaseBuilder();
actionBuilder.setActionChoice(decMplsTtlCaseBuilder.build());
} else if (actionType instanceof PushVlanActionCase) {
PushVlanCaseBuilder pushVlanActionBuilder = new PushVlanCaseBuilder();
actionBuilder.setActionChoice(pushVlanActionBuilder.build());
} else if (actionType instanceof PopVlanActionCase) {
PopVlanCaseBuilder popVlanCaseBuilder = new PopVlanCaseBuilder();
actionBuilder.setActionChoice(popVlanCaseBuilder.build());
} else if (actionType instanceof PushMplsActionCase) {
PushMplsCaseBuilder pushMplsActionBuilder = new PushMplsCaseBuilder();
actionBuilder.setActionChoice(pushMplsActionBuilder.build());
} else if (actionType instanceof PopMplsActionCase) {
PopMplsCaseBuilder popMplsCaseBuilder = new PopMplsCaseBuilder();
actionBuilder.setActionChoice(popMplsCaseBuilder.build());
} else if (actionType instanceof SetQueueActionCase) {
SetQueueCaseBuilder setQueueActionBuilder = new SetQueueCaseBuilder();
actionBuilder.setActionChoice(setQueueActionBuilder.build());
} else if (actionType instanceof SetNwTtlActionCase) {
SetNwTtlCaseBuilder setNwTtlActionBuilder = new SetNwTtlCaseBuilder();
actionBuilder.setActionChoice(setNwTtlActionBuilder.build());
} else if (actionType instanceof DecNwTtlCase) {
DecNwTtlCaseBuilder decNwTtlCaseBuilder = new DecNwTtlCaseBuilder();
actionBuilder.setActionChoice(decNwTtlCaseBuilder.build());
} else if (actionType instanceof SetFieldCase) {
SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
actionBuilder.setActionChoice(setFieldCaseBuilder.build());
} else if (actionType instanceof PushPbbActionCase) {
PushPbbCaseBuilder pushPbbCaseBuilder = new PushPbbCaseBuilder();
actionBuilder.setActionChoice(pushPbbCaseBuilder.build());
} else if (actionType instanceof PopPbbActionCase) {
PopPbbCaseBuilder popPbbCaseBuilder = new PopPbbCaseBuilder();
actionBuilder.setActionChoice(popPbbCaseBuilder.build());
}
// Experimenter action is unhandled
actionList.add(actionBuilder.build());
}
ActionRelatedTableFeaturePropertyBuilder propBuilder = new ActionRelatedTableFeaturePropertyBuilder();
propBuilder.setAction(actionList);
builder.setType(type);
builder.addAugmentation(ActionRelatedTableFeatureProperty.class, propBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.mpls.ttl._case.SetMplsTtlActionBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginGroupTestCommandProvider method createSetMplsTtlAction.
private List<Action> createSetMplsTtlAction() {
SetMplsTtlActionBuilder setMplsTtlActionBuilder = new SetMplsTtlActionBuilder();
setMplsTtlActionBuilder.setMplsTtl((short) 0X1);
ActionBuilder action = new ActionBuilder();
action.setAction(new SetMplsTtlActionCaseBuilder().setSetMplsTtlAction(setMplsTtlActionBuilder.build()).build());
List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.mpls.ttl._case.SetMplsTtlActionBuilder in project openflowplugin by opendaylight.
the class TableFeaturesResponseConvertorTest method createSetMplsTtlCase.
private static SetMplsTtlCase createSetMplsTtlCase() {
SetMplsTtlCaseBuilder setMplsTtlCaseBuilder = new SetMplsTtlCaseBuilder();
SetMplsTtlActionBuilder setMplsTtlActionBuilder = new SetMplsTtlActionBuilder();
setMplsTtlActionBuilder.setMplsTtl((short) 42);
setMplsTtlCaseBuilder.setSetMplsTtlAction(setMplsTtlActionBuilder.build());
return setMplsTtlCaseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.mpls.ttl._case.SetMplsTtlActionBuilder in project openflowplugin by opendaylight.
the class OF13SetMplsTtlActionDeserializer method deserialize.
@Override
public Action deserialize(ByteBuf input) {
final ActionBuilder builder = new ActionBuilder();
input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
SetMplsTtlCaseBuilder caseBuilder = new SetMplsTtlCaseBuilder();
SetMplsTtlActionBuilder actionBuilder = new SetMplsTtlActionBuilder();
actionBuilder.setMplsTtl(input.readUnsignedByte());
caseBuilder.setSetMplsTtlAction(actionBuilder.build());
builder.setActionChoice(caseBuilder.build());
input.skipBytes(ActionConstants.SET_MPLS_TTL_PADDING);
return builder.build();
}
Aggregations