use of org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit in project netvirt by opendaylight.
the class VxlanGreConntrackBasedSnatService method installNaptPfibFlowForVxlanGre.
protected void installNaptPfibFlowForVxlanGre(Routers routers, BigInteger dpnId, Long extNetVpnId, int addOrRemove) {
LOG.info("installNaptPfibFlowForVxlanGre: Install Napt preFibFlow on dpId {} with matching extNetVpnId {} " + "for router {}", dpnId, extNetVpnId, routers.getRouterName());
List<MatchInfoBase> matches = new ArrayList<>();
matches.add(MatchEthernetType.IPV4);
if (addOrRemove == NwConstants.ADD_FLOW) {
matches.add(new MatchMetadata(MetaDataUtil.getVpnIdMetadata(extNetVpnId), MetaDataUtil.METADATA_MASK_VRFID));
}
ArrayList<ActionInfo> listActionInfo = new ArrayList<>();
ArrayList<InstructionInfo> instructions = new ArrayList<>();
listActionInfo.add(new ActionNxLoadInPort(BigInteger.ZERO));
listActionInfo.add(new ActionNxResubmit(NwConstants.L3_FIB_TABLE));
instructions.add(new InstructionApplyActions(listActionInfo));
String flowRef = getFlowRef(dpnId, NwConstants.NAPT_PFIB_TABLE, extNetVpnId);
syncFlow(dpnId, NwConstants.NAPT_PFIB_TABLE, flowRef, NatConstants.SNAT_TRK_FLOW_PRIORITY, flowRef, NwConstants.COOKIE_SNAT_TABLE, matches, instructions, addOrRemove);
}
use of org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit in project netvirt by opendaylight.
the class Ipv6NodeListener method createTableMissEntry.
private void createTableMissEntry(BigInteger dpnId) {
if (!ipv6ServiceEosHandler.isClusterOwner()) {
LOG.trace("Not a cluster Owner, skip flow programming.");
return;
}
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.IPV6_TABLE, "IPv6TableMissFlow", 0, "IPv6 Table Miss Flow", 0, 0, NwConstants.COOKIE_IPV6_TABLE, matches, instructions);
mdsalUtil.installFlow(flowEntity);
}
use of org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit 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.actions.ActionNxResubmit 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.actions.ActionNxResubmit 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