use of org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions in project netvirt by opendaylight.
the class PolicyServiceFlowUtil method getPolicyRouteInstructions.
public List<InstructionInfo> getPolicyRouteInstructions(long groupId) {
List<InstructionInfo> instructions = new ArrayList<>();
instructions.add(new InstructionApplyActions(Collections.singletonList(new ActionGroup(groupId))));
return instructions;
}
use of org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions in project genius by opendaylight.
the class ItmUtils method setUpOrRemoveTerminatingServiceTable.
@SuppressWarnings("checkstyle:IllegalCatch")
public static void setUpOrRemoveTerminatingServiceTable(BigInteger dpnId, IMdsalApiManager mdsalManager, boolean addFlag) {
String logmsg = addFlag ? "Installing" : "Removing";
LOG.trace("{}PUNT to Controller flow in DPN {} ", logmsg, dpnId);
List<ActionInfo> listActionInfo = new ArrayList<>();
listActionInfo.add(new ActionPuntToController());
try {
List<MatchInfo> mkMatches = new ArrayList<>();
mkMatches.add(new MatchTunnelId(BigInteger.valueOf(ITMConstants.LLDP_SERVICE_ID)));
List<InstructionInfo> mkInstructions = new ArrayList<>();
mkInstructions.add(new InstructionApplyActions(listActionInfo));
FlowEntity terminatingServiceTableFlowEntity = MDSALUtil.buildFlowEntity(dpnId, NwConstants.INTERNAL_TUNNEL_TABLE, getFlowRef(NwConstants.INTERNAL_TUNNEL_TABLE, ITMConstants.LLDP_SERVICE_ID), 5, String.format("%s:%d", "ITM Flow Entry ", ITMConstants.LLDP_SERVICE_ID), 0, 0, ITMConstants.COOKIE_ITM.add(BigInteger.valueOf(ITMConstants.LLDP_SERVICE_ID)), mkMatches, mkInstructions);
if (addFlag) {
mdsalManager.installFlow(terminatingServiceTableFlowEntity);
} else {
mdsalManager.removeFlow(terminatingServiceTableFlowEntity);
}
} catch (Exception e) {
LOG.error("Error while setting up Table 36 for {}", dpnId, e);
}
}
use of org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions in project genius by opendaylight.
the class FlowBasedServicesUtils method installEgressDispatcherSplitHorizonFlow.
public static void installEgressDispatcherSplitHorizonFlow(BigInteger dpId, BoundServices boundService, String interfaceName, WriteTransaction writeTransaction, int interfaceTag, short currentServiceIndex, Interface iface) {
// only install split horizon drop flows for external interfaces
if (!isExternal(iface)) {
return;
}
if (LOG.isDebugEnabled()) {
LOG.debug("Installing split horizon drop flow for external interface {} on dpId {}", interfaceName, dpId);
}
// BigInteger.ONE is used for
BigInteger shFlagSet = BigInteger.ONE;
// checking the Split-Horizon
// flag
List<MatchInfoBase> shMatches = FlowBasedServicesUtils.getMatchInfoForEgressDispatcherTable(interfaceTag, currentServiceIndex);
shMatches.add(new MatchMetadata(shFlagSet, MetaDataUtil.METADATA_MASK_SH_FLAG));
List<InstructionInfo> shInstructions = new ArrayList<>();
List<ActionInfo> actionsInfos = new ArrayList<>();
actionsInfos.add(new ActionDrop());
shInstructions.add(new InstructionApplyActions(actionsInfos));
String flowRef = getSplitHorizonFlowRef(dpId, NwConstants.EGRESS_LPORT_DISPATCHER_TABLE, interfaceName, shFlagSet);
String serviceRef = boundService.getServiceName();
// This must be higher priority than the egress flow
int splitHorizonFlowPriority = boundService.getServicePriority() + 1;
StypeOpenflow stypeOpenFlow = boundService.getAugmentation(StypeOpenflow.class);
Flow egressSplitHorizonFlow = MDSALUtil.buildFlow(NwConstants.EGRESS_LPORT_DISPATCHER_TABLE, flowRef, splitHorizonFlowPriority, serviceRef, 0, 0, stypeOpenFlow.getFlowCookie(), shMatches, shInstructions);
installFlow(dpId, egressSplitHorizonFlow, writeTransaction);
}
Aggregations