use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoad in project openflowplugin by opendaylight.
the class RegLoadCodec method serialize.
@Override
public void serialize(final Action input, final ByteBuf outBuffer) {
ActionRegLoad actionRegLoad = (ActionRegLoad) input.getActionChoice();
serializeHeader(LENGTH, SUBTYPE, outBuffer);
outBuffer.writeShort(actionRegLoad.getNxActionRegLoad().getOfsNbits());
outBuffer.writeInt(actionRegLoad.getNxActionRegLoad().getDst().intValue());
outBuffer.writeLong(actionRegLoad.getNxActionRegLoad().getValue().longValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoad in project openflowplugin by opendaylight.
the class RegLoadConvertorTest method testConvert.
@Test
public void testConvert() throws Exception {
final ActionRegLoad actionRegLoad = (ActionRegLoad) regLoadConvertor.convert(actionsCase).getActionChoice();
Assert.assertEquals(Integer.valueOf(65), actionRegLoad.getNxActionRegLoad().getOfsNbits());
Assert.assertEquals(BigInteger.valueOf(3), actionRegLoad.getNxActionRegLoad().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoad in project openflowplugin by opendaylight.
the class RegLoadConvertor method convert.
@Override
public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(final Action input, final ActionPath path) {
NxActionRegLoad actionRegLoad = ((ActionRegLoad) input.getActionChoice()).getNxActionRegLoad();
DstBuilder dstBuilder = new DstBuilder();
dstBuilder.setDstChoice(RegMoveConvertor.resolveDstValue(actionRegLoad.getDst()));
dstBuilder.setStart(resolveStart(actionRegLoad.getOfsNbits()));
dstBuilder.setEnd(resolveEnd(actionRegLoad.getOfsNbits()));
NxRegLoadBuilder nxRegLoadBuilder = new NxRegLoadBuilder();
nxRegLoadBuilder.setDst(dstBuilder.build());
nxRegLoadBuilder.setValue(actionRegLoad.getValue());
return resolveAction(nxRegLoadBuilder.build(), path);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoad in project genius by opendaylight.
the class ActionRegLoadTest method actionInfoTestForRegLoadAction.
@Test
public void actionInfoTestForRegLoadAction() {
ActionInfo actionInfo = new ActionRegLoad(1, NxmNxReg6.class, 0, 31, 100);
Action action = actionInfo.buildAction();
assertTrue(action.getAction() instanceof NxActionRegLoadNodesNodeTableFlowApplyActionsCase);
NxActionRegLoadNodesNodeTableFlowApplyActionsCase actionsCase = (NxActionRegLoadNodesNodeTableFlowApplyActionsCase) action.getAction();
NxRegLoad nxRegLoad = actionsCase.getNxRegLoad();
assertTrue(nxRegLoad.getDst().getDstChoice() instanceof DstNxRegCase);
DstNxRegCase dstNxRegCase = (DstNxRegCase) nxRegLoad.getDst().getDstChoice();
assertEquals(NxmNxReg6.class, dstNxRegCase.getNxReg());
assertEquals((Integer) 0, nxRegLoad.getDst().getStart());
assertEquals((Integer) 31, nxRegLoad.getDst().getEnd());
assertEquals(100, nxRegLoad.getValue().longValue());
}
Aggregations