Search in sources :

Example 11 with ActionRegLoad

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());
}
Also used : ActionRegLoad(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoad)

Example 12 with ActionRegLoad

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());
}
Also used : ActionRegLoad(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoad) NxActionRegLoad(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoad) Test(org.junit.Test)

Example 13 with ActionRegLoad

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);
}
Also used : DstBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.DstBuilder) NxActionRegLoad(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoad) NxRegLoadBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.NxRegLoadBuilder) ActionRegLoad(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoad) NxActionRegLoad(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoad)

Example 14 with ActionRegLoad

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());
}
Also used : Action(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.Action) NxActionRegLoadNodesNodeTableFlowApplyActionsCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegLoadNodesNodeTableFlowApplyActionsCase) ActionInfo(org.opendaylight.genius.mdsalutil.ActionInfo) DstNxRegCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxRegCase) NxRegLoad(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.NxRegLoad) Test(org.junit.Test)

Aggregations

ActionRegLoad (org.opendaylight.genius.mdsalutil.actions.ActionRegLoad)8 ArrayList (java.util.ArrayList)6 ActionInfo (org.opendaylight.genius.mdsalutil.ActionInfo)5 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action)5 ActionRegLoad (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoad)5 Instruction (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction)4 NxRegLoad (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.NxRegLoad)4 Test (org.junit.Test)3 ActionNxResubmit (org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit)3 BoundServices (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices)3 NxActionRegLoad (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.load.grouping.NxActionRegLoad)3 NxmNxReg2 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg2)3 NxmNxReg6 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg6)3 NxActionRegLoadNodesNodeTableFlowApplyActionsCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegLoadNodesNodeTableFlowApplyActionsCase)3 ExecutionException (java.util.concurrent.ExecutionException)2 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)2 MatchInfo (org.opendaylight.genius.mdsalutil.MatchInfo)2 ActionOutput (org.opendaylight.genius.mdsalutil.actions.ActionOutput)2 ActionPushVlan (org.opendaylight.genius.mdsalutil.actions.ActionPushVlan)2 ActionSetFieldVlanVid (org.opendaylight.genius.mdsalutil.actions.ActionSetFieldVlanVid)2