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