Search in sources :

Example 1 with NxActionRegMoveGrouping

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionRegMoveGrouping 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)

Aggregations

ActionRegMoveBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegMoveBuilder)1 NxActionRegMoveBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMoveBuilder)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