Search in sources :

Example 71 with InstructionApplyActions

use of org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions in project netvirt by opendaylight.

the class AclServiceOFFlowBuilder method getResubmitInstructionInfo.

/**
 * Returns resubmit instruction info to the given table ID.
 *
 * @param tableId the table id
 * @return resubmit list of InstructionInfo objects
 */
public static List<InstructionInfo> getResubmitInstructionInfo(short tableId) {
    List<InstructionInfo> instructions = new ArrayList<>();
    List<ActionInfo> actionsInfos = new ArrayList<>();
    actionsInfos.add(new ActionNxResubmit(tableId));
    instructions.add(new InstructionApplyActions(actionsInfos));
    return instructions;
}
Also used : InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) ArrayList(java.util.ArrayList) ActionNxResubmit(org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit) ActionInfo(org.opendaylight.genius.mdsalutil.ActionInfo) InstructionApplyActions(org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions)

Example 72 with InstructionApplyActions

use of org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions in project netvirt by opendaylight.

the class AclServiceOFFlowBuilder method getDropInstructionInfo.

/**
 * Returns drop instruction info.
 * @return drop list of InstructionInfo objects
 */
public static List<InstructionInfo> getDropInstructionInfo() {
    List<InstructionInfo> instructions = new ArrayList<>();
    List<ActionInfo> actionsInfos = new ArrayList<>();
    actionsInfos.add(new ActionDrop());
    instructions.add(new InstructionApplyActions(actionsInfos));
    return instructions;
}
Also used : InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) ArrayList(java.util.ArrayList) ActionInfo(org.opendaylight.genius.mdsalutil.ActionInfo) InstructionApplyActions(org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions) ActionDrop(org.opendaylight.genius.mdsalutil.actions.ActionDrop)

Example 73 with InstructionApplyActions

use of org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions in project netvirt by opendaylight.

the class AbstractAclServiceImpl method programConntrackRecircRule.

protected void programConntrackRecircRule(BigInteger dpId, int lportTag, String portId, MatchEthernetType matchEtherType, int addOrRemove) {
    List<MatchInfoBase> matches = new ArrayList<>();
    matches.add(matchEtherType);
    matches.add(AclServiceUtils.buildLPortTagMatch(lportTag, serviceMode));
    List<InstructionInfo> instructions = new ArrayList<>();
    if (addOrRemove == NwConstants.ADD_FLOW) {
        Long elanTag = getElanIdFromAclInterface(portId);
        if (elanTag == null) {
            LOG.error("ElanId not found for portId={}; Context: dpId={}, lportTag={}, addOrRemove={},", portId, dpId, lportTag, addOrRemove);
            return;
        }
        List<ActionInfo> actionsInfos = new ArrayList<>();
        actionsInfos.add(new ActionNxConntrack(2, 0, 0, elanTag.intValue(), getAclForExistingTrafficTable()));
        instructions.add(new InstructionApplyActions(actionsInfos));
    }
    String flowName = this.directionString + "_Fixed_Conntrk_" + dpId + "_" + lportTag + "_" + matchEtherType + "_Recirc";
    syncFlow(dpId, getAclConntrackSenderTable(), flowName, AclConstants.ACL_DEFAULT_PRIORITY, "ACL", 0, 0, AclConstants.COOKIE_ACL_BASE, matches, instructions, addOrRemove);
}
Also used : InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) ArrayList(java.util.ArrayList) ActionInfo(org.opendaylight.genius.mdsalutil.ActionInfo) ActionNxConntrack(org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack) InstructionApplyActions(org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions) MatchInfoBase(org.opendaylight.genius.mdsalutil.MatchInfoBase)

Example 74 with InstructionApplyActions

use of org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions in project netvirt by opendaylight.

the class AbstractAclServiceImpl method getDispatcherTableResubmitInstructions.

/**
 * Gets the dispatcher table resubmit instructions based on ingress/egress service mode w.r.t switch.
 *
 * @param actionsInfos
 *            the actions infos
 * @return the instructions for dispatcher table resubmit
 */
protected List<InstructionInfo> getDispatcherTableResubmitInstructions(List<ActionInfo> actionsInfos) {
    short dispatcherTableId = NwConstants.LPORT_DISPATCHER_TABLE;
    if (ServiceModeEgress.class.equals(this.serviceMode)) {
        dispatcherTableId = NwConstants.EGRESS_LPORT_DISPATCHER_TABLE;
    }
    List<InstructionInfo> instructions = new ArrayList<>();
    actionsInfos.add(new ActionNxResubmit(dispatcherTableId));
    instructions.add(new InstructionApplyActions(actionsInfos));
    return instructions;
}
Also used : InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) ArrayList(java.util.ArrayList) ActionNxResubmit(org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit) InstructionApplyActions(org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions)

Example 75 with InstructionApplyActions

use of org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions in project netvirt by opendaylight.

the class QosNeutronUtils method addFlow.

private void addFlow(BigInteger dpnId, Short dscpValue, String ifName, IpAddress ipAddress, Interface ifState) {
    if (ifState == null) {
        LOG.trace("Could not find the ifState for interface {}", ifName);
        return;
    }
    Integer ifIndex = ifState.getIfIndex();
    List<MatchInfo> matches = new ArrayList<>();
    if (ipAddress.getIpv4Address() != null) {
        matches.add(new MatchEthernetType(NwConstants.ETHTYPE_IPV4));
    } else {
        matches.add(new MatchEthernetType(NwConstants.ETHTYPE_IPV6));
    }
    matches.add(new MatchMetadata(MetaDataUtil.getLportTagMetaData(ifIndex), MetaDataUtil.METADATA_MASK_LPORT_TAG));
    List<ActionInfo> actionsInfos = new ArrayList<>();
    actionsInfos.add(new ActionSetFieldDscp(dscpValue));
    actionsInfos.add(new ActionNxResubmit(NwConstants.LPORT_DISPATCHER_TABLE));
    List<InstructionInfo> instructions = Collections.singletonList(new InstructionApplyActions(actionsInfos));
    FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpnId, NwConstants.QOS_DSCP_TABLE, getQosFlowId(NwConstants.QOS_DSCP_TABLE, dpnId, ifIndex), QosConstants.QOS_DEFAULT_FLOW_PRIORITY, "QoSConfigFlow", 0, 0, NwConstants.COOKIE_QOS_TABLE, matches, instructions);
    mdsalUtils.installFlow(flowEntity);
}
Also used : MatchMetadata(org.opendaylight.genius.mdsalutil.matches.MatchMetadata) ArrayList(java.util.ArrayList) ActionInfo(org.opendaylight.genius.mdsalutil.ActionInfo) MatchEthernetType(org.opendaylight.genius.mdsalutil.matches.MatchEthernetType) FlowEntity(org.opendaylight.genius.mdsalutil.FlowEntity) BigInteger(java.math.BigInteger) ActionSetFieldDscp(org.opendaylight.genius.mdsalutil.actions.ActionSetFieldDscp) MatchInfo(org.opendaylight.genius.mdsalutil.MatchInfo) InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) ActionNxResubmit(org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit) InstructionApplyActions(org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions)

Aggregations

InstructionApplyActions (org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions)78 ArrayList (java.util.ArrayList)77 InstructionInfo (org.opendaylight.genius.mdsalutil.InstructionInfo)73 ActionInfo (org.opendaylight.genius.mdsalutil.ActionInfo)72 MatchInfo (org.opendaylight.genius.mdsalutil.MatchInfo)50 FlowEntity (org.opendaylight.genius.mdsalutil.FlowEntity)38 MatchMetadata (org.opendaylight.genius.mdsalutil.matches.MatchMetadata)31 ActionNxResubmit (org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit)28 BigInteger (java.math.BigInteger)18 InstructionGotoTable (org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable)14 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)13 MatchInfoBase (org.opendaylight.genius.mdsalutil.MatchInfoBase)12 ActionGroup (org.opendaylight.genius.mdsalutil.actions.ActionGroup)12 ActionNxConntrack (org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack)11 ActionPuntToController (org.opendaylight.genius.mdsalutil.actions.ActionPuntToController)10 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)9 InstructionWriteMetadata (org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata)9 MatchIpv4Destination (org.opendaylight.genius.mdsalutil.matches.MatchIpv4Destination)9 NxCtAction (org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack.NxCtAction)8 ActionPopMpls (org.opendaylight.genius.mdsalutil.actions.ActionPopMpls)8