Search in sources :

Example 1 with NxActionOutputRegBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.output.reg.grouping.NxActionOutputRegBuilder in project openflowplugin by opendaylight.

the class OutputRegConvertor method convert.

@Override
public Action convert(final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
    Preconditions.checkArgument(nxActionArg instanceof NxActionOutputRegGrouping);
    NxActionOutputRegGrouping nxAction = (NxActionOutputRegGrouping) nxActionArg;
    Src src = nxAction.getNxOutputReg().getSrc();
    final ActionOutputRegBuilder builder = new ActionOutputRegBuilder();
    NxActionOutputRegBuilder nxActionOutputRegBuilder = new NxActionOutputRegBuilder();
    nxActionOutputRegBuilder.setSrc(RegMoveConvertor.resolveSrc(src.getSrcChoice()));
    nxActionOutputRegBuilder.setNBits(src.getOfsNbits());
    nxActionOutputRegBuilder.setMaxLen(nxAction.getNxOutputReg().getMaxLen());
    builder.setNxActionOutputReg(nxActionOutputRegBuilder.build());
    return ActionUtil.createAction(builder.build());
}
Also used : Src(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.output.reg.grouping.nx.output.reg.Src) NxActionOutputRegBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.output.reg.grouping.NxActionOutputRegBuilder) ActionOutputRegBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionOutputRegBuilder) NxActionOutputRegBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.output.reg.grouping.NxActionOutputRegBuilder) NxActionOutputRegGrouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionOutputRegGrouping)

Example 2 with NxActionOutputRegBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.output.reg.grouping.NxActionOutputRegBuilder in project openflowplugin by opendaylight.

the class OutputRegCodec method deserialize.

@Override
public Action deserialize(final ByteBuf message) {
    final ActionBuilder actionBuilder = deserializeHeader(message);
    final ActionOutputRegBuilder builder = new ActionOutputRegBuilder();
    NxActionOutputRegBuilder nxActionOutputRegBuilder = new NxActionOutputRegBuilder();
    nxActionOutputRegBuilder.setNBits(message.readUnsignedShort());
    nxActionOutputRegBuilder.setSrc(message.readUnsignedInt());
    nxActionOutputRegBuilder.setMaxLen(message.readUnsignedShort());
    message.skipBytes(PADDING_IN_OUTPUT_REG_ACTION);
    builder.setNxActionOutputReg(nxActionOutputRegBuilder.build());
    actionBuilder.setActionChoice(builder.build());
    return actionBuilder.build();
}
Also used : ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder) NxActionOutputRegBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.output.reg.grouping.NxActionOutputRegBuilder) ActionOutputRegBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionOutputRegBuilder) NxActionOutputRegBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.output.reg.grouping.NxActionOutputRegBuilder)

Example 3 with NxActionOutputRegBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.output.reg.grouping.NxActionOutputRegBuilder in project openflowplugin by opendaylight.

the class OutputRegCodecTest method createAction.

private Action createAction() {
    ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
    ActionBuilder actionBuilder = new ActionBuilder();
    actionBuilder.setExperimenterId(experimenterId);
    final ActionOutputRegBuilder actionOutputRegBuilder = new ActionOutputRegBuilder();
    NxActionOutputRegBuilder nxActionOutputBuilder = new NxActionOutputRegBuilder();
    nxActionOutputBuilder.setNBits(1);
    nxActionOutputBuilder.setSrc((long) 2);
    nxActionOutputBuilder.setMaxLen(3);
    actionOutputRegBuilder.setNxActionOutputReg(nxActionOutputBuilder.build());
    actionBuilder.setActionChoice(actionOutputRegBuilder.build());
    return actionBuilder.build();
}
Also used : ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder) NxActionOutputRegBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.output.reg.grouping.NxActionOutputRegBuilder) ActionOutputRegBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionOutputRegBuilder) NxActionOutputRegBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.output.reg.grouping.NxActionOutputRegBuilder) ExperimenterId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId)

Aggregations

ActionOutputRegBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionOutputRegBuilder)3 NxActionOutputRegBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.output.reg.grouping.NxActionOutputRegBuilder)3 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder)2 ExperimenterId (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId)1 NxActionOutputRegGrouping (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionOutputRegGrouping)1 Src (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.output.reg.grouping.nx.output.reg.Src)1