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());
}
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();
}
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();
}
Aggregations