Search in sources :

Example 1 with NxmNxReg0

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg0 in project netvirt by opendaylight.

the class OpenFlow13Utils method createActionNxMoveReg0ToNsc1Register.

public static Action createActionNxMoveReg0ToNsc1Register(int order) {
    ActionBuilder ab = createActionBuilder(order);
    ab.setAction(nxMoveRegAction(new SrcNxRegCaseBuilder().setNxReg(NxmNxReg0.class).build(), new DstNxNshc1CaseBuilder().setNxNshc1Dst(Boolean.TRUE).build(), 31, false));
    return ab.build();
}
Also used : NxmNxReg0(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg0) SrcNxRegCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.src.choice.grouping.src.choice.SrcNxRegCaseBuilder) OutputActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder) DstNxNshc1CaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxNshc1CaseBuilder)

Example 2 with NxmNxReg0

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg0 in project netvirt by opendaylight.

the class OpenFlow13ProviderTest method createEgressClassifierNextHopNoC1C2Flow.

@Test
public void createEgressClassifierNextHopNoC1C2Flow() {
    Flow flow = openflowProvider.createEgressClassifierNextHopNoC1C2Flow(nodeId);
    assertEquals(flow.getTableId().shortValue(), NwConstants.EGRESS_SFC_CLASSIFIER_NEXTHOP_TABLE);
    assertEquals(flow.getPriority().intValue(), OpenFlow13Provider.EGRESS_CLASSIFIER_NEXTHOP_NOC1C2_PRIORITY);
    assertEquals(flow.getId().getValue(), OpenFlow13Provider.EGRESS_CLASSIFIER_NEXTHOP_NOC1C2_FLOW_NAME + nodeId.getValue());
    assertEquals(flow.getCookie().getValue(), OpenFlow13Provider.EGRESS_CLASSIFIER_NEXTHOP_COOKIE);
    checkMatchC1(flow.getMatch(), OpenFlow13Provider.DEFAULT_NSH_CONTEXT_VALUE);
    checkMatchC2(flow.getMatch(), OpenFlow13Provider.DEFAULT_NSH_CONTEXT_VALUE);
    assertEquals(2, flow.getInstructions().getInstruction().size());
    Instruction curInstruction = flow.getInstructions().getInstruction().get(0).getInstruction();
    List<Action> actionList = checkApplyActionSize(curInstruction, 4);
    checkActionMoveTunReg(actionList.get(0), NxmNxReg0.class, true);
    checkActionMoveNsc1(actionList.get(0), false);
    checkActionMoveTunId(actionList.get(1), true);
    checkActionMoveNsc2(actionList.get(1), false);
    checkActionMoveTunReg(actionList.get(2), NxmNxReg6.class, true);
    checkActionMoveNsc4(actionList.get(2), false);
    checkActionLoadTunId(actionList.get(3), OpenFlow13Provider.SFC_TUNNEL_ID);
    curInstruction = flow.getInstructions().getInstruction().get(1).getInstruction();
    checkActionGotoTable(curInstruction, NwConstants.EGRESS_SFC_CLASSIFIER_EGRESS_TABLE);
}
Also used : Action(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action) Instruction(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction) Flow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow) NxAugMatchNodesNodeTableFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow) GeneralAugMatchNodesNodeTableFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlow) Test(org.junit.Test)

Example 3 with NxmNxReg0

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg0 in project openflowplugin by opendaylight.

the class Test method createNxActionBld.

private static ActionBuilder createNxActionBld(int actionKeyVal) {
    // vendor part
    DstNxRegCaseBuilder nxRegCaseBld = new DstNxRegCaseBuilder().setNxReg(NxmNxReg0.class);
    DstBuilder dstBld = new DstBuilder().setDstChoice(nxRegCaseBld.build()).setStart(0).setEnd(5);
    NxRegLoadBuilder nxRegLoadBuilder = new NxRegLoadBuilder();
    nxRegLoadBuilder.setDst(dstBld.build());
    nxRegLoadBuilder.setValue(BigInteger.valueOf(55L));
    NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder topNxActionCaseBld = new NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder();
    topNxActionCaseBld.setNxRegLoad(nxRegLoadBuilder.build());
    // base part
    ActionBuilder abExt = new ActionBuilder();
    abExt.setKey(new ActionKey(actionKeyVal));
    abExt.setAction(topNxActionCaseBld.build());
    return abExt;
}
Also used : DstBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.DstBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder) DstNxRegCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxRegCaseBuilder) NxRegLoadBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.NxRegLoadBuilder) NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder(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.NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder) ActionKey(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey)

Example 4 with NxmNxReg0

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg0 in project openflowplugin by opendaylight.

the class Reg0CodecTest method createMatchEntry.

private MatchEntry createMatchEntry() {
    MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
    final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
    final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
    matchEntryBuilder.setOxmClass(Nxm1Class.class);
    matchEntryBuilder.setOxmMatchField(NxmNxReg0.class);
    matchEntryBuilder.setHasMask(false);
    valuesBuilder.setValue((long) 1);
    caseBuilder.setRegValues(valuesBuilder.build());
    matchEntryBuilder.setMatchEntryValue(caseBuilder.build());
    return matchEntryBuilder.build();
}
Also used : MatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder) RegCaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.RegCaseValueBuilder) RegValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.reg.grouping.RegValuesBuilder)

Example 5 with NxmNxReg0

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg0 in project openflowplugin by opendaylight.

the class Reg0CodecTest method deserializeTest.

@Test
public void deserializeTest() {
    createBuffer(buffer);
    input = reg0Codec.deserialize(buffer);
    final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
    assertEquals(Nxm1Class.class, input.getOxmClass());
    assertEquals(NxmNxReg0.class, input.getOxmMatchField());
    assertEquals(false, input.isHasMask());
    assertEquals(1, result.getRegValues().getValue().intValue());
}
Also used : RegCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.RegCaseValue) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder)2 NxmNxReg0 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg0)2 NiciraActionDeserializerKey (org.opendaylight.openflowjava.nx.api.NiciraActionDeserializerKey)1 NiciraActionSerializerKey (org.opendaylight.openflowjava.nx.api.NiciraActionSerializerKey)1 MatchEntryDeserializerKey (org.opendaylight.openflowjava.protocol.api.keys.MatchEntryDeserializerKey)1 OutputActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder)1 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action)1 ActionKey (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey)1 Flow (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow)1 Instruction (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction)1 Nxm0Class (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class)1 Nxm1Class (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class)1 MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)1 ActionConntrack (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionConntrack)1 ActionMultipath (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionMultipath)1 ActionOutputReg (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionOutputReg)1 ActionPopNsh (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionPopNsh)1 ActionPushNsh (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionPushNsh)1 ActionRegLoad (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoad)1