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;
}
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;
}
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);
}
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;
}
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);
}
Aggregations