use of org.opendaylight.genius.mdsalutil.ActionInfo in project netvirt by opendaylight.
the class VpnServiceChainUtils method buildLFibVpnPseudoPortFlow.
/**
* Builds a Flow for the LFIB table that sets the LPortTag of the
* VpnPseudoPort and sends to LPortDispatcher table.
* <ul>
* <li>Matching: eth_type = MPLS, mpls_label = VPN MPLS label
* <li>Actions: setMetadata LportTag and SI=2, pop MPLS, Go to
* LPortDispacherTable
* </ul>
*
* @param dpId DpnId
* @param label MPLS label
* @param nextHop Next Hop IP
* @param lportTag Pseudo Logical Port tag
* @return the FlowEntity
*/
public static FlowEntity buildLFibVpnPseudoPortFlow(BigInteger dpId, Long label, String nextHop, int lportTag) {
List<MatchInfo> matches = new ArrayList<>();
matches.add(MatchEthernetType.MPLS_UNICAST);
matches.add(new MatchMplsLabel(label));
List<ActionInfo> actionsInfos = Collections.singletonList(new ActionPopMpls());
List<InstructionInfo> instructions = new ArrayList<>();
instructions.add(new InstructionWriteMetadata(MetaDataUtil.getMetaDataForLPortDispatcher(lportTag, ServiceIndex.getIndex(NwConstants.SCF_SERVICE_NAME, NwConstants.SCF_SERVICE_INDEX)), MetaDataUtil.getMetaDataMaskForLPortDispatcher()));
instructions.add(new InstructionApplyActions(actionsInfos));
instructions.add(new InstructionGotoTable(NwConstants.L3_INTERFACE_TABLE));
String flowRef = getLFibVpnPseudoPortFlowRef(lportTag, label, nextHop);
return MDSALUtil.buildFlowEntity(dpId, NwConstants.L3_LFIB_TABLE, flowRef, CloudServiceChainConstants.DEFAULT_SCF_FLOW_PRIORITY, flowRef, 0, 0, NwConstants.COOKIE_VM_LFIB_TABLE, matches, instructions);
}
use of org.opendaylight.genius.mdsalutil.ActionInfo in project netvirt by opendaylight.
the class ArpResponderUtil method getEgressActionsForInterface.
/**
* Get List of Egress Action for the VPN interface.
*
* @param ifaceMgrRpcService
* Interface Manager RPC reference that invokes API to retrieve
* Egress Action
* @param ifName
* VPN Interface for which Egress Action to be retrieved
* @param actionCounter
* Action Key
* @return List of Egress Actions
*/
public static List<Action> getEgressActionsForInterface(IInterfaceManager ifaceMgrRpcService, String ifName, int actionCounter) {
List<ActionInfo> actionInfos = ifaceMgrRpcService.getInterfaceEgressActions(ifName);
AtomicInteger counter = new AtomicInteger(actionCounter);
return actionInfos.stream().map(v -> v.buildAction(counter.getAndIncrement())).collect(Collectors.toList());
}
use of org.opendaylight.genius.mdsalutil.ActionInfo in project netvirt by opendaylight.
the class QosNodeListener method createTableMissEntry.
public void createTableMissEntry(BigInteger dpnId) {
List<MatchInfo> matches = new ArrayList<>();
List<InstructionInfo> instructions = new ArrayList<>();
List<ActionInfo> actionsInfos = new ArrayList<>();
actionsInfos.add(new ActionNxResubmit(NwConstants.LPORT_DISPATCHER_TABLE));
instructions.add(new InstructionApplyActions(actionsInfos));
FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpnId, NwConstants.QOS_DSCP_TABLE, "QoSTableMissFlow", 0, "QoS Table Miss Flow", 0, 0, NwConstants.COOKIE_QOS_TABLE, matches, instructions);
mdsalUtils.installFlow(flowEntity);
}
use of org.opendaylight.genius.mdsalutil.ActionInfo in project genius by opendaylight.
the class ItmTunnelAggregationHelper method createBucket.
private Bucket createBucket(String interfaceName, IfTunnel ifTunnel, int bucketId, int portNumber) {
List<ActionInfo> listActionInfo = interfaceManager.getInterfaceEgressActions(interfaceName);
if (listActionInfo == null || listActionInfo.isEmpty()) {
LOG.warn("MULTIPLE_VxLAN_TUNNELS: could not build Egress bucket for {}", interfaceName);
}
Integer portWeight = ifTunnel.getWeight() != null ? ifTunnel.getWeight() : DEFAULT_WEIGHT;
return MDSALUtil.buildBucket(MDSALUtil.buildActions(listActionInfo), portWeight, bucketId, portNumber, MDSALUtil.WATCH_GROUP);
}
use of org.opendaylight.genius.mdsalutil.ActionInfo in project genius by opendaylight.
the class IfmUtil method getEgressActionsForInterface.
public static List<Action> getEgressActionsForInterface(String interfaceName, Long tunnelKey, Integer actionKey, InterfaceManagerCommonUtils interfaceUtils, Boolean isDefaultEgress) {
List<ActionInfo> listActionInfo = getEgressActionInfosForInterface(interfaceName, tunnelKey, actionKey == null ? 0 : actionKey, interfaceUtils, isDefaultEgress);
List<Action> actionsList = new ArrayList<>();
for (ActionInfo actionInfo : listActionInfo) {
actionsList.add(actionInfo.buildAction());
}
return actionsList;
}
Aggregations