use of 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 in project netvirt by opendaylight.
the class OpenFlow13ProviderTest method checkActionLoadNsi.
private void checkActionLoadNsi(Action action) {
NxActionRegLoadNodesNodeTableFlowApplyActionsCase regLoad = (NxActionRegLoadNodesNodeTableFlowApplyActionsCase) action.getAction();
DstNxNsiCase nsiCase = (DstNxNsiCase) regLoad.getNxRegLoad().getDst().getDstChoice();
assertTrue(nsiCase.isNxNsiDst());
}
use of 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 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.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegLoadNodesNodeTableFlowApplyActionsCase in project genius by opendaylight.
the class ActionLoadMacToShaTest method verifyAction.
private void verifyAction(Action action) {
assertTrue(action.getAction() instanceof NxActionRegLoadNodesNodeTableFlowApplyActionsCase);
NxActionRegLoadNodesNodeTableFlowApplyActionsCase actionCase = (NxActionRegLoadNodesNodeTableFlowApplyActionsCase) action.getAction();
assertNotNull(actionCase.getNxRegLoad());
NxRegLoad nxRegLoad = actionCase.getNxRegLoad();
assertTrue(nxRegLoad.getDst().getDstChoice() instanceof DstNxArpShaCase);
DstNxArpShaCase dstNxArpShaCase = (DstNxArpShaCase) nxRegLoad.getDst().getDstChoice();
assertTrue(dstNxArpShaCase.isNxArpSha());
assertEquals(0, nxRegLoad.getDst().getStart().intValue());
assertEquals(47, nxRegLoad.getDst().getEnd().intValue());
assertEquals(BigInteger.valueOf(NWUtil.macToLong(new MacAddress(MAC_ADDRESS))), nxRegLoad.getValue());
}
use of 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 in project genius by opendaylight.
the class ActionNxLoadMetadataTest method verifyAction.
private void verifyAction(Action action) {
assertTrue(action.getAction() instanceof NxActionRegLoadNodesNodeTableFlowApplyActionsCase);
NxActionRegLoadNodesNodeTableFlowApplyActionsCase actionCase = (NxActionRegLoadNodesNodeTableFlowApplyActionsCase) action.getAction();
assertNotNull(actionCase.getNxRegLoad());
NxRegLoad nxRegLoad = actionCase.getNxRegLoad();
assertTrue(nxRegLoad.getDst().getDstChoice() instanceof DstOfMetadataCase);
DstOfMetadataCase dstOfMetadataCase = (DstOfMetadataCase) nxRegLoad.getDst().getDstChoice();
assertTrue(dstOfMetadataCase.isOfMetadata());
assertEquals(START, nxRegLoad.getDst().getStart());
assertEquals(END, nxRegLoad.getDst().getEnd());
assertEquals(VALUE, nxRegLoad.getValue());
}
use of 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 in project netvirt by opendaylight.
the class OpenFlow13ProviderTest method checkActionLoadTunIpv4.
private void checkActionLoadTunIpv4(Action action, String ip) {
long ipl = InetAddresses.coerceToInteger(InetAddresses.forString(ip)) & 0xffffffffL;
NxActionRegLoadNodesNodeTableFlowApplyActionsCase regLoad = (NxActionRegLoadNodesNodeTableFlowApplyActionsCase) action.getAction();
DstNxTunIpv4DstCase tunDstTypeCase = (DstNxTunIpv4DstCase) regLoad.getNxRegLoad().getDst().getDstChoice();
assertTrue(tunDstTypeCase.isNxTunIpv4Dst());
assertEquals(regLoad.getNxRegLoad().getValue().longValue(), ipl);
}
Aggregations