Search in sources :

Example 1 with ActionRegMoveBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegMoveBuilder in project openflowplugin by opendaylight.

the class RegMoveConvertor method convert.

@Override
public Action convert(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
    Preconditions.checkArgument(nxActionArg instanceof NxActionRegMoveGrouping);
    NxActionRegMoveGrouping nxAction = (NxActionRegMoveGrouping) nxActionArg;
    Dst dst = nxAction.getNxRegMove().getDst();
    Src src = nxAction.getNxRegMove().getSrc();
    final ActionRegMoveBuilder actionRegMoveBuilder = new ActionRegMoveBuilder();
    NxActionRegMoveBuilder nxActionRegMove = new NxActionRegMoveBuilder();
    nxActionRegMove.setDst(resolveDst(dst.getDstChoice()));
    nxActionRegMove.setDstOfs(dst.getStart());
    nxActionRegMove.setSrc(resolveSrc(src.getSrcChoice()));
    nxActionRegMove.setSrcOfs(src.getStart());
    nxActionRegMove.setNBits(dst.getEnd() - dst.getStart() + 1);
    actionRegMoveBuilder.setNxActionRegMove(nxActionRegMove.build());
    return ActionUtil.createAction(actionRegMoveBuilder.build());
}
Also used : NxActionRegMoveBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMoveBuilder) ActionRegMoveBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegMoveBuilder) Dst(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.Dst) Src(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.Src) NxActionRegMoveBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMoveBuilder) NxActionRegMoveGrouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionRegMoveGrouping)

Example 2 with ActionRegMoveBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegMoveBuilder in project openflowplugin by opendaylight.

the class RegMoveCodecTest method createAction.

private Action createAction() {
    ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
    ActionBuilder actionBuilder = new ActionBuilder();
    actionBuilder.setExperimenterId(experimenterId);
    final ActionRegMoveBuilder actionRegMoveBuilder = new ActionRegMoveBuilder();
    NxActionRegMoveBuilder nxActionRegMoveBuilder = new NxActionRegMoveBuilder();
    nxActionRegMoveBuilder.setNBits(1);
    nxActionRegMoveBuilder.setSrcOfs(2);
    nxActionRegMoveBuilder.setDstOfs(3);
    nxActionRegMoveBuilder.setSrc((long) 4);
    nxActionRegMoveBuilder.setDst((long) 5);
    actionRegMoveBuilder.setNxActionRegMove(nxActionRegMoveBuilder.build());
    actionBuilder.setActionChoice(actionRegMoveBuilder.build());
    return actionBuilder.build();
}
Also used : NxActionRegMoveBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMoveBuilder) ActionRegMoveBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegMoveBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder) NxActionRegMoveBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMoveBuilder) ExperimenterId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId)

Example 3 with ActionRegMoveBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegMoveBuilder in project openflowplugin by opendaylight.

the class RegMoveCodec method deserialize.

@Override
public Action deserialize(final ByteBuf message) {
    final ActionBuilder actionBuilder = deserializeHeader(message);
    final ActionRegMoveBuilder actionRegMoveBuilder = new ActionRegMoveBuilder();
    NxActionRegMoveBuilder nxActionRegMoveBuilder = new NxActionRegMoveBuilder();
    nxActionRegMoveBuilder.setNBits(message.readUnsignedShort());
    nxActionRegMoveBuilder.setSrcOfs(message.readUnsignedShort());
    nxActionRegMoveBuilder.setDstOfs(message.readUnsignedShort());
    nxActionRegMoveBuilder.setSrc(message.readUnsignedInt());
    nxActionRegMoveBuilder.setDst(message.readUnsignedInt());
    actionRegMoveBuilder.setNxActionRegMove(nxActionRegMoveBuilder.build());
    actionBuilder.setActionChoice(actionRegMoveBuilder.build());
    return actionBuilder.build();
}
Also used : NxActionRegMoveBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMoveBuilder) ActionRegMoveBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegMoveBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder) NxActionRegMoveBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMoveBuilder)

Aggregations

ActionRegMoveBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegMoveBuilder)3 NxActionRegMoveBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMoveBuilder)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 NxActionRegMoveGrouping (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionRegMoveGrouping)1 Dst (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.Dst)1 Src (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.Src)1