use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMoveBuilder 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());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMoveBuilder 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();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMoveBuilder 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();
}
Aggregations