use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg6 in project netvirt by opendaylight.
the class OpenFlow13Utils method createActionNxMoveReg6ToNsc4Register.
public static Action createActionNxMoveReg6ToNsc4Register(int order) {
ActionBuilder ab = createActionBuilder(order);
ab.setAction(nxMoveRegAction(new SrcNxRegCaseBuilder().setNxReg(NxmNxReg6.class).build(), new DstNxNshc4CaseBuilder().setNxNshc4Dst(Boolean.TRUE).build(), 31, false));
return ab.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg6 in project netvirt by opendaylight.
the class OpenFlow13Utils method createActionNxMoveNsc4ToReg6Register.
public static Action createActionNxMoveNsc4ToReg6Register(int order) {
ActionBuilder ab = createActionBuilder(order);
ab.setAction(nxMoveRegAction(new SrcNxNshc4CaseBuilder().setNxNshc4Dst(Boolean.TRUE).build(), new DstNxRegCaseBuilder().setNxReg(NxmNxReg6.class).build(), 31, false));
return ab.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg6 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.NxmNxReg6 in project netvirt by opendaylight.
the class NexthopManager method getEgressActionsForInterface.
protected List<ActionInfo> getEgressActionsForInterface(final String ifName, int actionKey) {
List<ActionInfo> listActionInfo = new ArrayList<>();
try {
Future<RpcResult<GetEgressActionsForInterfaceOutput>> result = interfaceManager.getEgressActionsForInterface(new GetEgressActionsForInterfaceInputBuilder().setIntfName(ifName).build());
RpcResult<GetEgressActionsForInterfaceOutput> rpcResult = result.get();
if (!rpcResult.isSuccessful()) {
LOG.error("RPC Call to Get egress actions for interface {} returned with Errors {}", ifName, rpcResult.getErrors());
} else {
List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actions = rpcResult.getResult().getAction();
for (Action action : actions) {
actionKey = action.getKey().getOrder() + actionKey;
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionClass = action.getAction();
if (actionClass instanceof OutputActionCase) {
listActionInfo.add(new ActionOutput(actionKey, ((OutputActionCase) actionClass).getOutputAction().getOutputNodeConnector()));
} else if (actionClass instanceof PushVlanActionCase) {
listActionInfo.add(new ActionPushVlan(actionKey));
} else if (actionClass instanceof SetFieldCase) {
if (((SetFieldCase) actionClass).getSetField().getVlanMatch() != null) {
int vlanVid = ((SetFieldCase) actionClass).getSetField().getVlanMatch().getVlanId().getVlanId().getValue();
listActionInfo.add(new ActionSetFieldVlanVid(actionKey, vlanVid));
}
} else if (actionClass instanceof NxActionResubmitRpcAddGroupCase) {
Short tableId = ((NxActionResubmitRpcAddGroupCase) actionClass).getNxResubmit().getTable();
listActionInfo.add(new ActionNxResubmit(actionKey, tableId));
} else if (actionClass instanceof NxActionRegLoadNodesNodeTableFlowApplyActionsCase) {
NxRegLoad nxRegLoad = ((NxActionRegLoadNodesNodeTableFlowApplyActionsCase) actionClass).getNxRegLoad();
listActionInfo.add(new ActionRegLoad(actionKey, NxmNxReg6.class, nxRegLoad.getDst().getStart(), nxRegLoad.getDst().getEnd(), nxRegLoad.getValue().longValue()));
}
}
}
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Exception when egress actions for interface {}", ifName, e);
}
return listActionInfo;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg6 in project openflowplugin by opendaylight.
the class Reg6CodecTest 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(NxmNxReg6.class);
matchEntryBuilder.setHasMask(false);
valuesBuilder.setValue((long) 1);
caseBuilder.setRegValues(valuesBuilder.build());
matchEntryBuilder.setMatchEntryValue(caseBuilder.build());
return matchEntryBuilder.build();
}
Aggregations