Search in sources :

Example 6 with ActionNxLoadInPort

use of org.opendaylight.genius.mdsalutil.actions.ActionNxLoadInPort in project netvirt by opendaylight.

the class ConntrackBasedSnatService method installNaptPfibEntry.

protected void installNaptPfibEntry(BigInteger dpnId, long routerId, int addOrRemove) {
    LOG.info("installNaptPfibEntry : called for dpnId {} and routerId {} ", dpnId, routerId);
    List<MatchInfoBase> matches = new ArrayList<>();
    matches.add(MatchEthernetType.IPV4);
    matches.add(new NxMatchCtState(DNAT_CT_STATE, DNAT_CT_STATE_MASK));
    matches.add(new MatchMetadata(MetaDataUtil.getVpnIdMetadata(routerId), MetaDataUtil.METADATA_MASK_VRFID));
    ArrayList<ActionInfo> listActionInfo = new ArrayList<>();
    ArrayList<InstructionInfo> instructionInfo = new ArrayList<>();
    listActionInfo.add(new ActionNxLoadInPort(BigInteger.ZERO));
    listActionInfo.add(new ActionNxResubmit(NwConstants.L3_FIB_TABLE));
    instructionInfo.add(new InstructionApplyActions(listActionInfo));
    String flowRef = getFlowRef(dpnId, NwConstants.NAPT_PFIB_TABLE, routerId);
    flowRef = flowRef + "INBOUND";
    syncFlow(dpnId, NwConstants.NAPT_PFIB_TABLE, flowRef, NatConstants.DEFAULT_PSNAT_FLOW_PRIORITY, flowRef, NwConstants.COOKIE_SNAT_TABLE, matches, instructionInfo, addOrRemove);
}
Also used : MatchMetadata(org.opendaylight.genius.mdsalutil.matches.MatchMetadata) ArrayList(java.util.ArrayList) ActionInfo(org.opendaylight.genius.mdsalutil.ActionInfo) NxMatchCtState(org.opendaylight.genius.mdsalutil.nxmatches.NxMatchCtState) ActionNxLoadInPort(org.opendaylight.genius.mdsalutil.actions.ActionNxLoadInPort) InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) ActionNxResubmit(org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit) InstructionApplyActions(org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions) MatchInfoBase(org.opendaylight.genius.mdsalutil.MatchInfoBase)

Example 7 with ActionNxLoadInPort

use of org.opendaylight.genius.mdsalutil.actions.ActionNxLoadInPort 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);
}
Also used : MatchMetadata(org.opendaylight.genius.mdsalutil.matches.MatchMetadata) ActionNxLoadInPort(org.opendaylight.genius.mdsalutil.actions.ActionNxLoadInPort) 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) MatchInfoBase(org.opendaylight.genius.mdsalutil.MatchInfoBase)

Example 8 with ActionNxLoadInPort

use of org.opendaylight.genius.mdsalutil.actions.ActionNxLoadInPort in project netvirt by opendaylight.

the class BgpRouteVrfEntryHandler method addTunnelInterfaceActions.

@Override
protected void addTunnelInterfaceActions(NexthopManager.AdjacencyResult adjacencyResult, long vpnId, VrfEntry vrfEntry, List<ActionInfo> actionInfos, String rd) {
    Class<? extends TunnelTypeBase> tunnelType = VpnExtraRouteHelper.getTunnelType(getNextHopManager().getInterfaceManager(), adjacencyResult.getInterfaceName());
    if (tunnelType == null) {
        LOG.debug("Tunnel type not found for vrfEntry {}", vrfEntry);
        return;
    }
    String nextHopIp = adjacencyResult.getNextHopIp();
    if (tunnelType.equals(TunnelTypeMplsOverGre.class)) {
        java.util.Optional<Long> optionalLabel = FibUtil.getLabelForNextHop(vrfEntry, nextHopIp);
        if (!optionalLabel.isPresent()) {
            LOG.warn("NextHopIp {} not found in vrfEntry {}", nextHopIp, vrfEntry);
            return;
        }
        long label = optionalLabel.get();
        LOG.debug("addTunnelInterfaceActions: Push label action for prefix {} rd {} l3vni {} nextHop {}", vrfEntry.getDestPrefix(), rd, vrfEntry.getL3vni(), nextHopIp);
        actionInfos.add(new ActionPushMpls());
        actionInfos.add(new ActionSetFieldMplsLabel(label));
        actionInfos.add(new ActionNxLoadInPort(BigInteger.ZERO));
    } else if (tunnelType.equals(TunnelTypeVxlan.class)) {
        actionInfos.add(new ActionSetFieldTunnelId(BigInteger.valueOf(vrfEntry.getL3vni())));
        LOG.debug("addTunnelInterfaceActions: adding set tunnel id action for prefix {} rd {} l3vni {}" + " nextHop {} ", vrfEntry.getDestPrefix(), rd, vrfEntry.getL3vni(), nextHopIp);
        addRewriteDstMacAction(vpnId, vrfEntry, null, /*prefixInfo*/
        actionInfos);
    }
}
Also used : ActionPushMpls(org.opendaylight.genius.mdsalutil.actions.ActionPushMpls) ActionNxLoadInPort(org.opendaylight.genius.mdsalutil.actions.ActionNxLoadInPort) TunnelTypeVxlan(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeVxlan) ActionSetFieldTunnelId(org.opendaylight.genius.mdsalutil.actions.ActionSetFieldTunnelId) ActionSetFieldMplsLabel(org.opendaylight.genius.mdsalutil.actions.ActionSetFieldMplsLabel)

Aggregations

ActionNxLoadInPort (org.opendaylight.genius.mdsalutil.actions.ActionNxLoadInPort)8 ArrayList (java.util.ArrayList)7 ActionInfo (org.opendaylight.genius.mdsalutil.ActionInfo)7 InstructionInfo (org.opendaylight.genius.mdsalutil.InstructionInfo)7 ActionNxResubmit (org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit)7 InstructionApplyActions (org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions)7 MatchMetadata (org.opendaylight.genius.mdsalutil.matches.MatchMetadata)7 FlowEntity (org.opendaylight.genius.mdsalutil.FlowEntity)4 MatchInfo (org.opendaylight.genius.mdsalutil.MatchInfo)4 MatchInfoBase (org.opendaylight.genius.mdsalutil.MatchInfoBase)3 ActionMoveSourceDestinationEth (org.opendaylight.genius.mdsalutil.actions.ActionMoveSourceDestinationEth)2 ActionSetFieldEthernetSource (org.opendaylight.genius.mdsalutil.actions.ActionSetFieldEthernetSource)2 NxMatchCtState (org.opendaylight.genius.mdsalutil.nxmatches.NxMatchCtState)2 ActionMoveSourceDestinationIp (org.opendaylight.genius.mdsalutil.actions.ActionMoveSourceDestinationIp)1 ActionMoveSourceDestinationIpv6 (org.opendaylight.genius.mdsalutil.actions.ActionMoveSourceDestinationIpv6)1 ActionNxLoadMetadata (org.opendaylight.genius.mdsalutil.actions.ActionNxLoadMetadata)1 ActionPushMpls (org.opendaylight.genius.mdsalutil.actions.ActionPushMpls)1 ActionSetFieldMplsLabel (org.opendaylight.genius.mdsalutil.actions.ActionSetFieldMplsLabel)1 ActionSetFieldTunnelId (org.opendaylight.genius.mdsalutil.actions.ActionSetFieldTunnelId)1 ActionSetIcmpType (org.opendaylight.genius.mdsalutil.actions.ActionSetIcmpType)1