import java.math.BigInteger;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.ext.routers.Routers;
+
public interface CentralizedSwitchScheduler {
/**
* Schedule the centralized switch for the router.
- * @param routerName the router name.
+ * @param router the external router.
* @return success/failure
*/
- boolean scheduleCentralizedSwitch(String routerName);
+ boolean scheduleCentralizedSwitch(Routers router);
+
+ /**
+ * Update the centralized switch scheduled for the router.
+ * @param oldRouter the existing external router.
+ * @param newRouter the new external router.
+ * @return success/failure
+ */
+ boolean updateCentralizedSwitch(Routers oldRouter, Routers newRouter);
/**
* Releases the centralized switch scheduled for the router.
- * @param routerName the router name.
+ * @param router the external router.
* @return success/failure
*/
- boolean releaseCentralizedSwitch(String routerName);
+ boolean releaseCentralizedSwitch(Routers router);
/**
* Retrieves the centralized switch scheduled for the router.
package org.opendaylight.netvirt.natservice.ha;
-import com.google.common.base.Optional;
-
import java.math.BigInteger;
-import java.util.HashMap;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker;
import org.opendaylight.netvirt.natservice.api.CentralizedSwitchScheduler;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.subnetmaps.Subnetmap;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.subnetmaps.SubnetmapKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
@Singleton
public class WeightedCentralizedSwitchScheduler implements CentralizedSwitchScheduler {
- private final Map<BigInteger,Integer> switchWeightsMap = new HashMap<>();
+ private static final Logger LOG = LoggerFactory.getLogger(WeightedCentralizedSwitchScheduler.class);
+ private final Map<BigInteger,Integer> switchWeightsMap = new ConcurrentHashMap<>();
+ private final Map<String,String> subnetIdToRouterPortMap = new ConcurrentHashMap<>();
private final DataBroker dataBroker;
- private final NatDataUtil natDataUtil;
final OdlInterfaceRpcService interfaceManager;
private final int initialSwitchWeight = 0;
private final IVpnFootprintService vpnFootprintService;
@Inject
public WeightedCentralizedSwitchScheduler(DataBroker dataBroker, OdlInterfaceRpcService interfaceManager,
- NatDataUtil natDataUtil, IVpnFootprintService vpnFootprintService) {
+ IVpnFootprintService vpnFootprintService) {
this.dataBroker = dataBroker;
this.interfaceManager = interfaceManager;
- this.natDataUtil = natDataUtil;
this.vpnFootprintService = vpnFootprintService;
}
@Override
- public boolean scheduleCentralizedSwitch(String routerName) {
+ public boolean scheduleCentralizedSwitch(Routers router) {
BigInteger nextSwitchId = getSwitchWithLowestWeight();
+ String routerName = router.getRouterName();
RouterToNaptSwitchBuilder routerToNaptSwitchBuilder =
new RouterToNaptSwitchBuilder().setRouterName(routerName);
RouterToNaptSwitch id = routerToNaptSwitchBuilder.setPrimarySwitchId(nextSwitchId).build();
+ addToDpnMaps(routerName, router.getSubnetIds(), nextSwitchId);
try {
- WriteTransaction writeOperTxn = dataBroker.newWriteOnlyTransaction();
- Routers router = NatUtil.getRoutersFromConfigDS(dataBroker, routerName);
- String vpnName = router.getRouterName();
- String primaryRd = NatUtil.getPrimaryRd(dataBroker, vpnName);
- for (Uuid subnetUuid :router.getSubnetIds()) {
- Optional<Subnetmap> subnetMapEntry =
- SingleTransactionDataBroker.syncReadOptionalAndTreatReadFailedExceptionAsAbsentOptional(
- dataBroker, LogicalDatastoreType.CONFIGURATION, getSubnetMapIdentifier(subnetUuid));
- if (subnetMapEntry.isPresent()) {
-
- Uuid routerPortUuid = subnetMapEntry.get().getRouterInterfacePortId();
-
- vpnFootprintService.updateVpnToDpnMapping(nextSwitchId, vpnName, primaryRd,
- routerPortUuid.getValue(), null, true);
- NatUtil.addToNeutronRouterDpnsMap(dataBroker, routerName, routerPortUuid.getValue(),
- nextSwitchId, writeOperTxn);
- NatUtil.addToDpnRoutersMap(dataBroker, routerName, routerPortUuid.getValue(),
- nextSwitchId, writeOperTxn);
- }
- }
- writeOperTxn.submit();
SingleTransactionDataBroker.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION,
getNaptSwitchesIdentifier(routerName), id);
switchWeightsMap.put(nextSwitchId,switchWeightsMap.get(nextSwitchId) + 1);
} catch (TransactionCommitFailedException e) {
- // TODO Auto-generated catch block
+ LOG.error("ScheduleCentralizedSwitch failed for {}", routerName);
}
return true;
}
@Override
- public boolean releaseCentralizedSwitch(String routerName) {
+ public boolean updateCentralizedSwitch(Routers oldRouter, Routers newRouter) {
+ String routerName = newRouter.getRouterName();
+ List<Uuid> addedSubnetIds = getUpdatedSubnetIds(newRouter.getSubnetIds(), oldRouter.getSubnetIds());
+ List<Uuid> deletedSubnetIds = getUpdatedSubnetIds(oldRouter.getSubnetIds(), newRouter.getSubnetIds());
+ BigInteger primarySwitchId = NatUtil.getPrimaryNaptfromRouterName(dataBroker, newRouter.getRouterName());
+ addToDpnMaps(routerName, addedSubnetIds, primarySwitchId);
+ deleteFromDpnMaps(routerName, deletedSubnetIds, primarySwitchId);
+ return true;
+ }
+
+ @Override
+ public boolean releaseCentralizedSwitch(Routers router) {
+ String routerName = router.getRouterName();
BigInteger primarySwitchId = NatUtil.getPrimaryNaptfromRouterName(dataBroker, routerName);
+ deleteFromDpnMaps(routerName, router.getSubnetIds(), primarySwitchId);
try {
- WriteTransaction writeOperTxn = dataBroker.newWriteOnlyTransaction();
- Routers router = natDataUtil.getRouter(routerName);
- String vpnName = router.getRouterName();
- String primaryRd = NatUtil.getPrimaryRd(dataBroker, vpnName);
- for (Uuid subnetUuid :router.getSubnetIds()) {
- Optional<Subnetmap> subnetMapEntry =
- SingleTransactionDataBroker.syncReadOptionalAndTreatReadFailedExceptionAsAbsentOptional(
- dataBroker, LogicalDatastoreType.CONFIGURATION, getSubnetMapIdentifier(subnetUuid));
- if (subnetMapEntry.isPresent()) {
- Uuid routerPortUuid = subnetMapEntry.get().getRouterInterfacePortId();
- vpnFootprintService.updateVpnToDpnMapping(primarySwitchId, vpnName, primaryRd,
- routerPortUuid.getValue(), null, false);
- NatUtil.removeFromNeutronRouterDpnsMap(dataBroker, routerName, primarySwitchId, writeOperTxn);
- NatUtil.removeFromDpnRoutersMap(dataBroker, routerName, routerName, interfaceManager,
- writeOperTxn);
- }
- }
- writeOperTxn.submit();
SingleTransactionDataBroker.syncDelete(dataBroker, LogicalDatastoreType.CONFIGURATION,
getNaptSwitchesIdentifier(routerName));
switchWeightsMap.put(primarySwitchId,switchWeightsMap.get(primarySwitchId) - 1);
return true;
}
+ private void addToDpnMaps(String routerName, List<Uuid> addedSubnetIds, BigInteger primarySwitchId) {
+ if (addedSubnetIds == null || addedSubnetIds.isEmpty()) {
+ LOG.debug("addToDpnMaps no subnets associated with {}", routerName);
+ return;
+ }
+ String primaryRd = NatUtil.getPrimaryRd(dataBroker, routerName);
+ WriteTransaction writeOperTxn = dataBroker.newWriteOnlyTransaction();
+ for (Uuid subnetUuid : addedSubnetIds) {
+ try {
+ Subnetmap subnetMapEntry = SingleTransactionDataBroker.syncRead(dataBroker,
+ LogicalDatastoreType.CONFIGURATION, getSubnetMapIdentifier(subnetUuid));
+ Uuid routerPortUuid = subnetMapEntry.getRouterInterfacePortId();
+ subnetIdToRouterPortMap.put(subnetUuid.getValue(), routerPortUuid.getValue());
+ vpnFootprintService.updateVpnToDpnMapping(primarySwitchId, routerName, primaryRd,
+ routerPortUuid.getValue(), null, true);
+ NatUtil.addToNeutronRouterDpnsMap(dataBroker, routerName, routerPortUuid.getValue(),
+ primarySwitchId, writeOperTxn);
+ NatUtil.addToDpnRoutersMap(dataBroker, routerName, routerPortUuid.getValue(),
+ primarySwitchId, writeOperTxn);
+ } catch (ReadFailedException e) {
+ LOG.error("addToDpnMaps failed for {}", routerName);
+ }
+ }
+ writeOperTxn.submit();
+ }
+
+
+
+ private void deleteFromDpnMaps(String routerName, List<Uuid> deletedSubnetIds, BigInteger primarySwitchId) {
+ if (deletedSubnetIds == null || deletedSubnetIds.isEmpty()) {
+ LOG.debug("deleteFromDpnMaps no subnets associated with {}", routerName);
+ return;
+ }
+ WriteTransaction writeOperTxn = dataBroker.newWriteOnlyTransaction();
+ String primaryRd = NatUtil.getPrimaryRd(dataBroker, routerName);
+ for (Uuid subnetUuid :deletedSubnetIds) {
+ String routerPort = subnetIdToRouterPortMap.remove(subnetUuid.getValue());
+ if (routerPort == null) {
+ LOG.error("The router port was not found for {}", subnetUuid.getValue());
+ continue;
+ }
+ vpnFootprintService.updateVpnToDpnMapping(primarySwitchId, routerName, primaryRd,
+ routerPort, null, false);
+ NatUtil.removeFromNeutronRouterDpnsMap(dataBroker, routerName, primarySwitchId, writeOperTxn);
+ NatUtil.removeFromDpnRoutersMap(dataBroker, routerName, routerName, interfaceManager,
+ writeOperTxn);
+ }
+ writeOperTxn.submit();
+ }
+
@Override
public boolean addSwitch(BigInteger dpnId) {
/* Initialize the switch in the map with weight 0 */
NaptSwitches naptSwitches = getNaptSwitches(dataBroker);
for (RouterToNaptSwitch routerToNaptSwitch : naptSwitches.getRouterToNaptSwitch()) {
if (dpnId.equals(routerToNaptSwitch.getPrimarySwitchId())) {
- releaseCentralizedSwitch(routerToNaptSwitch.getRouterName());
+ Routers router = NatUtil.getRoutersFromConfigDS(dataBroker, routerToNaptSwitch.getRouterName());
+ releaseCentralizedSwitch(router);
switchWeightsMap.remove(dpnId);
- scheduleCentralizedSwitch(routerToNaptSwitch.getRouterName());
+ scheduleCentralizedSwitch(router);
break;
}
}
// TODO Auto-generated method stub
return false;
}
+
+ public static List<Uuid> getUpdatedSubnetIds(
+ List<Uuid> updatedSubnetIds,
+ List<Uuid> currentSubnetIds) {
+ if (updatedSubnetIds == null) {
+ return null;
+ }
+ List<Uuid> newSubnetIds = new ArrayList<>(updatedSubnetIds);
+ if (currentSubnetIds == null) {
+ return newSubnetIds;
+ }
+ List<Uuid> origSubnetIds = new ArrayList<>(currentSubnetIds);
+ for (Iterator<Uuid> iterator = newSubnetIds.iterator(); iterator.hasNext();) {
+ Uuid updatedSubnetId = iterator.next();
+ for (Uuid currentSubnetId : origSubnetIds) {
+ if (updatedSubnetId.getValue().equals(currentSubnetId.getValue())) {
+ iterator.remove();
+ break;
+ }
+ }
+ }
+ return newSubnetIds;
+ }
}
\ No newline at end of file
import org.opendaylight.genius.mdsalutil.matches.MatchMetadata;
import org.opendaylight.genius.mdsalutil.matches.MatchTunnelId;
import org.opendaylight.netvirt.natservice.api.SnatServiceListener;
-import org.opendaylight.netvirt.vpnmanager.api.IVpnManager;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdOutput;
public abstract class AbstractSnatService implements SnatServiceListener {
+ private static final Logger LOG = LoggerFactory.getLogger(AbstractSnatService.class);
+ static final int LOAD_START = mostSignificantBit(MetaDataUtil.METADATA_MASK_SH_FLAG.intValue());
+ static final int LOAD_END = mostSignificantBit(MetaDataUtil.METADATA_MASK_VRFID.intValue() | MetaDataUtil
+ .METADATA_MASK_SH_FLAG.intValue());
protected final DataBroker dataBroker;
protected final IMdsalApiManager mdsalManager;
protected final IdManagerService idManager;
- protected final NaptManager naptManager;
protected final NAPTSwitchSelector naptSwitchSelector;
protected final ItmRpcService itmManager;
protected final OdlInterfaceRpcService interfaceManager;
- private final IVpnManager vpnManager;
- private static final Logger LOG = LoggerFactory.getLogger(AbstractSnatService.class);
- static final int LOAD_START = mostSignificantBit(MetaDataUtil.METADATA_MASK_SH_FLAG.intValue());
- static final int LOAD_END = mostSignificantBit(MetaDataUtil.METADATA_MASK_VRFID.intValue() | MetaDataUtil
- .METADATA_MASK_SH_FLAG.intValue());
public AbstractSnatService(final DataBroker dataBroker, final IMdsalApiManager mdsalManager,
final ItmRpcService itmManager,
final OdlInterfaceRpcService interfaceManager,
final IdManagerService idManager,
- final NaptManager naptManager,
- final NAPTSwitchSelector naptSwitchSelector,
- final IVpnManager vpnManager) {
+ final NAPTSwitchSelector naptSwitchSelector) {
this.dataBroker = dataBroker;
this.mdsalManager = mdsalManager;
this.itmManager = itmManager;
this.interfaceManager = interfaceManager;
this.idManager = idManager;
- this.naptManager = naptManager;
this.naptSwitchSelector = naptSwitchSelector;
- this.vpnManager = vpnManager;
}
public void init() {
NwConstants.COOKIE_SNAT_TABLE, matches, instructions, addOrRemove);
}
- protected BigInteger getPrimaryNaptSwitch(String routerName, long routerId) {
- // Allocate Primary Napt Switch for this router
- BigInteger primarySwitchId = NatUtil.getPrimaryNaptfromRouterId(dataBroker, routerId);
- if (primarySwitchId != null && !primarySwitchId.equals(BigInteger.ZERO)) {
- LOG.debug("getPrimaryNaptSwitch : Primary NAPT switch with DPN ID {} is already elected for router",
- primarySwitchId, routerName);
- return primarySwitchId;
- }
-
- primarySwitchId = naptSwitchSelector.selectNewNAPTSwitch(routerName);
- LOG.debug("getPrimaryNaptSwitch : Primary NAPT switch DPN ID {}", primarySwitchId);
- if (primarySwitchId == null || primarySwitchId.equals(BigInteger.ZERO)) {
- LOG.error("getPrimaryNaptSwitch : Unable to to select the primary NAPT switch");
- }
-
- return primarySwitchId;
- }
-
protected String getFlowRef(BigInteger dpnId, short tableId, long routerID) {
return new StringBuilder().append(NatConstants.NAPT_FLOWID_PREFIX).append(dpnId).append(NatConstants
.FLOWID_SEPARATOR).append(tableId).append(NatConstants.FLOWID_SEPARATOR).append(routerID).toString();
import org.opendaylight.genius.mdsalutil.matches.MatchMetadata;
import org.opendaylight.genius.mdsalutil.matches.MatchTunnelId;
import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchCtState;
-import org.opendaylight.netvirt.vpnmanager.api.IVpnManager;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.OdlInterfaceRpcService;
public class ConntrackBasedSnatService extends AbstractSnatService {
+ private static final Logger LOG = LoggerFactory.getLogger(ConntrackBasedSnatService.class);
protected final int trackedNewCtState = 0x21;
protected final int trackedNewCtMask = 0x21;
protected final int snatCtState = 0x40;
protected final int snatCtStateMask = 0x40;
protected final int dnatCtState = 0x80;
protected final int dnatCtStateMask = 0x80;
- private static final Logger LOG = LoggerFactory.getLogger(ConntrackBasedSnatService.class);
public ConntrackBasedSnatService(DataBroker dataBroker, IMdsalApiManager mdsalManager, ItmRpcService itmManager,
- OdlInterfaceRpcService interfaceManager, IdManagerService idManager, NaptManager naptManager,
- NAPTSwitchSelector naptSwitchSelector, IVpnManager vpnManager) {
- super(dataBroker, mdsalManager, itmManager, interfaceManager, idManager, naptManager, naptSwitchSelector,
- vpnManager);
+ OdlInterfaceRpcService interfaceManager, IdManagerService idManager,
+ NAPTSwitchSelector naptSwitchSelector) {
+ super(dataBroker, mdsalManager, itmManager, interfaceManager, idManager, naptSwitchSelector);
}
@Override
List<ExternalIps> externalIps = routers.getExternalIps();
// Allocate Primary Napt Switch for this router
if (routers.isEnableSnat() && externalIps != null && !externalIps.isEmpty()) {
- boolean result = centralizedSwitchScheduler.scheduleCentralizedSwitch(routerName);
+ boolean result = centralizedSwitchScheduler.scheduleCentralizedSwitch(routers);
}
//snatServiceManger.notify(routers, null, Action.ADD);
} else {
BigInteger primarySwitchId;
if (originalSNATEnabled) {
//SNAT disabled for the router
- centralizedSwitchScheduler.releaseCentralizedSwitch(routerName);
+ centralizedSwitchScheduler.releaseCentralizedSwitch(update);
} else {
- centralizedSwitchScheduler.scheduleCentralizedSwitch(routerName);
+ centralizedSwitchScheduler.scheduleCentralizedSwitch(update);
}
+ } else if (updatedSNATEnabled) {
+ centralizedSwitchScheduler.updateCentralizedSwitch(original,update);
}
List<ExternalIps> originalExternalIps = original.getExternalIps();
List<ExternalIps> updateExternalIps = update.getExternalIps();
if (!Objects.equals(originalExternalIps, updateExternalIps)) {
if (originalExternalIps == null || originalExternalIps.isEmpty()) {
- centralizedSwitchScheduler.scheduleCentralizedSwitch(routerName);
+ centralizedSwitchScheduler.scheduleCentralizedSwitch(update);
}
}
} else {
String routerName = router.getRouterName();
if (natMode == NatMode.Conntrack) {
if (router.isEnableSnat()) {
- centralizedSwitchScheduler.releaseCentralizedSwitch(routerName);
+ centralizedSwitchScheduler.releaseCentralizedSwitch(router);
}
} else {
DataStoreJobCoordinator dataStoreCoordinator = DataStoreJobCoordinator.getInstance();
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
import org.opendaylight.genius.datastoreutils.AsyncDataTreeChangeListenerBase;
import org.opendaylight.genius.datastoreutils.DataStoreJobCoordinator;
import org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.NeutronRouterDpns;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.RouterDpnList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.router.dpn.list.DpnVpninterfacesList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.neutron.router.dpns.router.dpn.list.dpn.vpninterfaces.list.RouterInterfaces;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.config.rev170206.NatserviceConfig;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.config.rev170206.NatserviceConfig.NatMode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.ProviderTypes;
LOG.warn("add : NAPT switch is not selected.");
return;
}
- //If it is a router port skip the notify.
- for (Uuid subnetUuid :router.getSubnetIds()) {
- try {
- Optional<Subnetmap> subnetMapEntry =
- SingleTransactionDataBroker.syncReadOptional(dataBroker,
- LogicalDatastoreType.CONFIGURATION, getSubnetMapIdentifier(subnetUuid));
- if (subnetMapEntry.isPresent()) {
- String routerPortUuid = subnetMapEntry.get().getRouterInterfacePortId().getValue();
- List<RouterInterfaces> routerInterfaces = dpnInfo.getRouterInterfaces();
- for (RouterInterfaces routerInterface : routerInterfaces) {
- if (routerPortUuid.equals(routerInterface.getInterface())) {
- return;
- }
- }
- }
- } catch (ReadFailedException e) {
- LOG.warn("add : The subnet map entry is not present.");
- return;
- }
-
+ //If it is for NAPT switch skip as the flows would be already programmed.
+ if (naptSwitch.equals(dpnId)) {
+ LOG.debug("Skipping the notification recived for NAPT switch {}", routerUuid);
+ return;
}
natServiceManager.notify(router, naptSwitch, dpnId,
SnatServiceManager.Action.SNAT_ROUTER_ENBL);
LOG.warn("remove : NAPT switch is not selected.");
return;
}
+ //If it is for NAPT switch skip as the flows would be already programmed.
+ if (naptSwitch.equals(dpnId)) {
+ LOG.debug("Skipping the notification recived for NAPT switch {}", routerUuid);
+ return;
+ }
natServiceManager.notify(router, naptSwitch, dpnId,
SnatServiceManager.Action.SNAT_ROUTER_DISBL);
} else {
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.infrautils.inject.AbstractLifecycle;
import org.opendaylight.netvirt.neutronvpn.interfaces.INeutronVpnManager;
-import org.opendaylight.netvirt.vpnmanager.api.IVpnManager;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.OdlInterfaceRpcService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.ItmRpcService;
private final ItmRpcService itmManager;
private final OdlInterfaceRpcService interfaceManager;
private final IdManagerService idManager;
- private final NaptManager naptManager;
private final NAPTSwitchSelector naptSwitchSelector;
private NatMode natMode;
- private final IVpnManager vpnManager;
private final INeutronVpnManager nvpnManager;
@Inject
final ItmRpcService itmManager,
final OdlInterfaceRpcService interfaceManager,
final IdManagerService idManager,
- final NaptManager naptManager,
final NAPTSwitchSelector naptSwitchSelector,
- final IVpnManager vpnManager,
final NatserviceConfig config,
final INeutronVpnManager nvpnManager) {
this.dataBroker = dataBroker;
this.itmManager = itmManager;
this.interfaceManager = interfaceManager;
this.idManager = idManager;
- this.naptManager = naptManager;
this.naptSwitchSelector = naptSwitchSelector;
- this.vpnManager = vpnManager;
if (config != null) {
this.natMode = config.getNatMode();
}
NatOverVxlanUtil.validateAndCreateVxlanVniPool(dataBroker, nvpnManager, idManager,
NatConstants.ODL_VNI_POOL_NAME);
return new ConntrackBasedSnatService(dataBroker, mdsalManager, itmManager, interfaceManager, idManager,
- naptManager, naptSwitchSelector, vpnManager);
+ naptSwitchSelector);
}
return null;
}