Search in sources :

Example 1 with NxRegMove

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMove in project genius by opendaylight.

the class ActionMoveSourceDestinationEth method buildAction.

@Override
public Action buildAction(int newActionKey) {
    ActionBuilder ab = new ActionBuilder();
    NxRegMove regMove = new NxRegMoveBuilder().setSrc(new SrcBuilder().setSrcChoice(new SrcOfEthSrcCaseBuilder().setOfEthSrc(Boolean.TRUE).build()).setStart(0).build()).setDst(new DstBuilder().setDstChoice(new DstOfEthDstCaseBuilder().setOfEthDst(Boolean.TRUE).build()).setStart(0).setEnd(47).build()).build();
    ab.setAction(new NxActionRegMoveNodesNodeTableFlowApplyActionsCaseBuilder().setNxRegMove(regMove).build());
    ab.setKey(new ActionKey(newActionKey));
    return ab.build();
}
Also used : NxRegMoveBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMoveBuilder) DstBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.DstBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder) NxRegMove(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMove) NxActionRegMoveNodesNodeTableFlowApplyActionsCaseBuilder(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.NxActionRegMoveNodesNodeTableFlowApplyActionsCaseBuilder) ActionKey(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey) SrcBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.SrcBuilder) SrcOfEthSrcCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.src.choice.grouping.src.choice.SrcOfEthSrcCaseBuilder) DstOfEthDstCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstOfEthDstCaseBuilder)

Example 2 with NxRegMove

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMove in project genius by opendaylight.

the class ActionMoveSourceDestinationEthTest method verifyAction.

private void verifyAction(Action action) {
    assertTrue(action.getAction() instanceof NxActionRegMoveNodesNodeTableFlowApplyActionsCase);
    NxActionRegMoveNodesNodeTableFlowApplyActionsCase actionCase = (NxActionRegMoveNodesNodeTableFlowApplyActionsCase) action.getAction();
    NxRegMove nxRegMove = actionCase.getNxRegMove();
    assertTrue(nxRegMove.getSrc().getSrcChoice() instanceof SrcOfEthSrcCase);
    SrcOfEthSrcCase srcChoice = (SrcOfEthSrcCase) nxRegMove.getSrc().getSrcChoice();
    assertTrue(srcChoice.isOfEthSrc());
    assertEquals(0, nxRegMove.getSrc().getStart().intValue());
    assertTrue(nxRegMove.getDst().getDstChoice() instanceof DstOfEthDstCase);
    DstOfEthDstCase dstChoice = (DstOfEthDstCase) nxRegMove.getDst().getDstChoice();
    assertTrue(dstChoice.isOfEthDst());
    assertEquals(0, nxRegMove.getDst().getStart().intValue());
    assertEquals(47, nxRegMove.getDst().getEnd().intValue());
}
Also used : DstOfEthDstCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstOfEthDstCase) NxRegMove(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMove) SrcOfEthSrcCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.src.choice.grouping.src.choice.SrcOfEthSrcCase) NxActionRegMoveNodesNodeTableFlowApplyActionsCase(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.NxActionRegMoveNodesNodeTableFlowApplyActionsCase)

Example 3 with NxRegMove

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMove in project genius by opendaylight.

the class ActionMoveSourceDestinationIpTest method verifyAction.

private void verifyAction(Action action) {
    assertTrue(action.getAction() instanceof NxActionRegMoveNodesNodeTableFlowApplyActionsCase);
    NxActionRegMoveNodesNodeTableFlowApplyActionsCase actionCase = (NxActionRegMoveNodesNodeTableFlowApplyActionsCase) action.getAction();
    NxRegMove nxRegMove = actionCase.getNxRegMove();
    assertTrue(nxRegMove.getSrc().getSrcChoice() instanceof SrcOfIpSrcCase);
    SrcOfIpSrcCase srcChoice = (SrcOfIpSrcCase) nxRegMove.getSrc().getSrcChoice();
    assertTrue(srcChoice.isOfIpSrc());
    assertEquals(0, nxRegMove.getSrc().getStart().intValue());
    assertTrue(nxRegMove.getDst().getDstChoice() instanceof DstOfIpDstCase);
    DstOfIpDstCase dstChoice = (DstOfIpDstCase) nxRegMove.getDst().getDstChoice();
    assertTrue(dstChoice.isOfIpDst());
    assertEquals(0, nxRegMove.getDst().getStart().intValue());
    assertEquals(31, nxRegMove.getDst().getEnd().intValue());
}
Also used : SrcOfIpSrcCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.src.choice.grouping.src.choice.SrcOfIpSrcCase) NxRegMove(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMove) DstOfIpDstCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstOfIpDstCase) NxActionRegMoveNodesNodeTableFlowApplyActionsCase(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.NxActionRegMoveNodesNodeTableFlowApplyActionsCase)

Example 4 with NxRegMove

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMove in project genius by opendaylight.

the class ActionMoveSourceDestinationIpv6Test method verifyAction.

private void verifyAction(Action action) {
    assertTrue(action.getAction() instanceof NxActionRegMoveNodesNodeTableFlowApplyActionsCase);
    NxActionRegMoveNodesNodeTableFlowApplyActionsCase actionCase = (NxActionRegMoveNodesNodeTableFlowApplyActionsCase) action.getAction();
    NxRegMove nxRegMove = actionCase.getNxRegMove();
    assertTrue(nxRegMove.getSrc().getSrcChoice() instanceof SrcNxIpv6SrcCase);
    SrcNxIpv6SrcCase srcChoice = (SrcNxIpv6SrcCase) nxRegMove.getSrc().getSrcChoice();
    assertTrue(srcChoice.isNxIpv6Src());
    assertEquals(0, nxRegMove.getSrc().getStart().intValue());
    assertTrue(nxRegMove.getDst().getDstChoice() instanceof DstNxIpv6DstCase);
    DstNxIpv6DstCase dstChoice = (DstNxIpv6DstCase) nxRegMove.getDst().getDstChoice();
    assertTrue(dstChoice.isNxIpv6Dst());
    assertEquals(0, nxRegMove.getDst().getStart().intValue());
    assertEquals(127, nxRegMove.getDst().getEnd().intValue());
}
Also used : NxRegMove(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMove) DstNxIpv6DstCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxIpv6DstCase) SrcNxIpv6SrcCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.src.choice.grouping.src.choice.SrcNxIpv6SrcCase) NxActionRegMoveNodesNodeTableFlowApplyActionsCase(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.NxActionRegMoveNodesNodeTableFlowApplyActionsCase)

Example 5 with NxRegMove

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMove in project openflowplugin by opendaylight.

the class RegMoveConvertorTest method setUp.

@Before
public void setUp() throws Exception {
    final Src src = Mockito.mock(Src.class);
    final Dst dst = Mockito.mock(Dst.class);
    when(actionsCase.getNxRegMove()).thenReturn(nxRegMove);
    when(nxRegMove.getSrc()).thenReturn(src);
    when(nxRegMove.getDst()).thenReturn(dst);
    when(nxRegMove.getSrc().getStart()).thenReturn(1);
    when(nxRegMove.getSrc().getEnd()).thenReturn(2);
    when(nxRegMove.getDst().getStart()).thenReturn(3);
    when(nxRegMove.getDst().getEnd()).thenReturn(4);
    when(nxRegMove.getDst().getDstChoice()).thenReturn(Mockito.mock(DstNxTunIdCase.class));
    when(nxRegMove.getSrc().getSrcChoice()).thenReturn(Mockito.mock(SrcNxTunIdCase.class));
    final ActionRegMove actionRegMove = Mockito.mock(ActionRegMove.class);
    final NxActionRegMove nxActionRegMove = Mockito.mock(NxActionRegMove.class);
    when(nxActionRegMove.getSrc()).thenReturn(NiciraMatchCodecs.TUN_ID_CODEC.getHeaderWithoutHasMask().toLong());
    when(nxActionRegMove.getDst()).thenReturn(NiciraMatchCodecs.TUN_ID_CODEC.getHeaderWithoutHasMask().toLong());
    when(nxActionRegMove.getNBits()).thenReturn(7);
    when(actionRegMove.getNxActionRegMove()).thenReturn(nxActionRegMove);
    when(action.getActionChoice()).thenReturn(actionRegMove);
    regMoveConvertor = new RegMoveConvertor();
}
Also used : NxActionRegMove(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMove) ActionRegMove(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegMove) 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) DstNxTunIdCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxTunIdCase) SrcNxTunIdCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.src.choice.grouping.src.choice.SrcNxTunIdCase) NxActionRegMove(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMove) Before(org.junit.Before)

Aggregations

NxRegMove (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMove)7 NxActionRegMoveNodesNodeTableFlowApplyActionsCase (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.NxActionRegMoveNodesNodeTableFlowApplyActionsCase)4 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder)3 ActionKey (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey)3 NxActionRegMoveNodesNodeTableFlowApplyActionsCaseBuilder (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.NxActionRegMoveNodesNodeTableFlowApplyActionsCaseBuilder)3 NxRegMoveBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMoveBuilder)3 DstBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.DstBuilder)3 SrcBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.SrcBuilder)3 Before (org.junit.Before)1 Test (org.junit.Test)1 ActionInfo (org.opendaylight.genius.mdsalutil.ActionInfo)1 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.Action)1 ActionRegMove (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegMove)1 NxActionRegMove (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.reg.move.grouping.NxActionRegMove)1 DstNxIpv6DstCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxIpv6DstCase)1 DstNxIpv6DstCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxIpv6DstCaseBuilder)1 DstNxTunIdCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxTunIdCase)1 DstOfEthDstCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstOfEthDstCase)1 DstOfEthDstCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstOfEthDstCaseBuilder)1 DstOfIpDstCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstOfIpDstCase)1