public interface IVpnLinkService {
/**
- * Leaks a route belonging to a L3VPN to other L3VPN if the neccessary
+ * Leaks a route belonging to a L3VPN to other L3VPN if the necessary
* circumstances are met, like there is an InterVpnLink linking both L3VPNs
* and the corresponding leaking flag is active (bgp/static/connected).
*
return Optional.of(this.interVpnLinkCfg.getFirstEndpoint().getIpAddress().getValue());
}
+ public Optional<Long> getFirstEndpointLportTag() {
+ return ( !isComplete() || this.interVpnLinkState.getFirstEndpointState().getLportTag() == null )
+ ? Optional.absent()
+ : Optional.of(this.interVpnLinkState.getFirstEndpointState().getLportTag());
+ }
+
public List<BigInteger> getFirstEndpointDpns() {
return (!isComplete() || this.interVpnLinkState.getFirstEndpointState().getDpId() == null)
? Collections.emptyList()
return Optional.of(this.interVpnLinkCfg.getSecondEndpoint().getIpAddress().getValue());
}
+ public Optional<Long> getSecondEndpointLportTag() {
+ return (!isComplete() || this.interVpnLinkState.getSecondEndpointState().getLportTag() == null )
+ ? Optional.absent()
+ : Optional.of(this.interVpnLinkState.getSecondEndpointState().getLportTag());
+ }
+
public List<BigInteger> getSecondEndpointDpns() {
return (!isComplete() || this.interVpnLinkState.getSecondEndpointState().getDpId() == null)
? Collections.emptyList()
: this.interVpnLinkState.getSecondEndpointState().getDpId();
}
- public String getOtherVpnName(String thisVpnName) {
- Optional<String> optOtherVpnName = isFirstEndpointVpnName(thisVpnName) ? getSecondEndpointVpnUuid()
- : getFirstEndpointVpnUuid();
- return optOtherVpnName.orNull();
- }
-
public Optional<Long> getEndpointLportTagByIpAddr(String endpointIp) {
if (!isComplete()) {
return Optional.absent();
: Optional.of(interVpnLinkState.getFirstEndpointState().getLportTag());
}
+ public String getOtherVpnName(String vpnName) {
+ if ( !isFirstEndpointVpnName(vpnName) && !isSecondEndpointVpnName(vpnName)) {
+ LOG.debug("VPN {} does not participate in InterVpnLink {}", vpnName, getInterVpnLinkName());
+ return null;
+ }
+
+ Optional<String> optOtherVpnName = isFirstEndpointVpnName(vpnName) ? getSecondEndpointVpnUuid()
+ : getFirstEndpointVpnUuid();
+ return optOtherVpnName.orNull();
+ }
+
public String getOtherEndpoint(String vpnUuid) {
if (!isFirstEndpointVpnName(vpnUuid) && !isSecondEndpointVpnName(vpnUuid)) {
LOG.debug("VPN {} does not participate in InterVpnLink {}", vpnUuid, getInterVpnLinkName());
import org.opendaylight.netvirt.fibmanager.api.IFibManager;
import org.opendaylight.netvirt.fibmanager.api.RouteOrigin;
import org.opendaylight.netvirt.vpnmanager.api.IVpnManager;
+import org.opendaylight.netvirt.vpnmanager.api.intervpnlink.InterVpnLinkCache;
+import org.opendaylight.netvirt.vpnmanager.api.intervpnlink.InterVpnLinkDataComposite;
import org.opendaylight.netvirt.vpnmanager.arp.responder.ArpResponderUtil;
import org.opendaylight.netvirt.vpnmanager.intervpnlink.InterVpnLinkUtil;
import org.opendaylight.netvirt.vpnmanager.populator.input.L3vpnInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.vpntargets.VpnTarget;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.ext.routers.Routers;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.neutron.vpn.portip.port.data.VpnPortipToPort;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.inter.vpn.link.rev160311.inter.vpn.links.InterVpnLink;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder;
import org.opendaylight.yangtools.yang.common.RpcError;
// TODO: This is a limitation to be stated in docs. When configuring static route to go to
// another VPN, there can only be one nexthop or, at least, the nexthop to the interVpnLink should be in
// first place.
- Optional<InterVpnLink> optInterVpnLink = InterVpnLinkUtil.getInterVpnLinkByEndpointIp(dataBroker, nextHop);
- if (optInterVpnLink.isPresent()) {
- InterVpnLink interVpnLink = optInterVpnLink.get();
+ Optional<InterVpnLinkDataComposite> optVpnLink = InterVpnLinkCache.getInterVpnLinkByEndpoint(nextHop);
+ if ( optVpnLink.isPresent() && optVpnLink.get().isActive()) {
+ InterVpnLinkDataComposite interVpnLink = optVpnLink.get();
// If the nexthop is the endpoint of Vpn2, then prefix must be advertised to Vpn1 in DC-GW, with nexthops
// pointing to the DPNs where Vpn1 is instantiated. LFIB in these DPNS must have a flow entry, with lower
// priority, where if Label matches then sets the lportTag of the Vpn2 endpoint and goes to LportDispatcher
// This is like leaking one of the Vpn2 routes towards Vpn1
- boolean nexthopIsVpn2 = interVpnLink.getSecondEndpoint().getIpAddress().getValue().equals(nextHop);
- String srcVpnUuid = nexthopIsVpn2 ? interVpnLink.getSecondEndpoint().getVpnUuid().getValue()
- : interVpnLink.getFirstEndpoint().getVpnUuid().getValue();
- String dstVpnUuid = nexthopIsVpn2 ? interVpnLink.getFirstEndpoint().getVpnUuid().getValue()
- : interVpnLink.getSecondEndpoint().getVpnUuid().getValue();
+ boolean nexthopIsVpn2 = interVpnLink.getSecondEndpointVpnUuid().get().equals(nextHop);
+ String srcVpnUuid = nexthopIsVpn2 ? interVpnLink.getSecondEndpointVpnUuid().get()
+ : interVpnLink.getFirstEndpointVpnUuid().get();
+ String dstVpnUuid = interVpnLink.getOtherVpnName(srcVpnUuid);
String dstVpnRd = VpnUtil.getVpnRd(dataBroker, dstVpnUuid);
long newLabel = VpnUtil.getUniqueId(idManager, VpnConstants.VPN_IDPOOL_NAME,
- VpnUtil.getNextHopLabelKey(dstVpnRd, destination));
+ VpnUtil.getNextHopLabelKey(dstVpnRd, destination));
if (newLabel == 0) {
- LOG.error(
- "Unable to fetch label from Id Manager. Bailing out of adding intervpnlink route for destination "
- + "{}",
- destination);
+ LOG.error("Unable to fetch label from Id Manager. Bailing out of adding intervpnlink route "
+ + "for destination {}", destination);
return;
}
- InterVpnLinkUtil.leakRoute(dataBroker, bgpManager, interVpnLink, srcVpnUuid, dstVpnUuid, destination,
- newLabel);
+ InterVpnLinkUtil.leakRoute(dataBroker, bgpManager, interVpnLink.getInterVpnLinkConfig(),
+ srcVpnUuid, dstVpnUuid, destination, newLabel);
} else {
if (rd != null) {
addPrefixToBGP(rd, VpnUtil.getPrimaryRd(dataBroker, vpnName), destination, nextHopIpList,
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.vpn.rpc.rev160201.RemoveStaticRouteInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.vpn.rpc.rev160201.RemoveVpnLabelInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.vpn.rpc.rev160201.VpnRpcService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.inter.vpn.link.rev160311.inter.vpn.links.InterVpnLink;
import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
import org.opendaylight.yangtools.yang.common.RpcResult;
return result;
}
- Optional<InterVpnLink> optVpnLink = InterVpnLinkUtil.getInterVpnLinkByEndpointIp(dataBroker, nexthop);
- if (optVpnLink.isPresent()) {
- fibManager.removeOrUpdateFibEntry(dataBroker, vpnRd, destination, nexthop, null);
+ Optional<InterVpnLinkDataComposite> optVpnLink = InterVpnLinkCache.getInterVpnLinkByEndpoint(nexthop);
+ if ( optVpnLink.isPresent() ) {
+ fibManager.removeOrUpdateFibEntry(dataBroker, vpnRd, destination, nexthop, null);
bgpManager.withdrawPrefix(vpnRd, destination);
} else {
vpnInterfaceMgr.delExtraRoute(destination, nexthop, vpnRd, null /*routerId*/, null /*intfName*/, null);
@Override
protected void add(InstanceIdentifier<InterVpnLink> identifier, InterVpnLink add) {
-
+ String ivpnLinkName = add.getName();
LOG.debug("Reacting to IVpnLink {} creation. Vpn1=[name={} EndpointIp={}] Vpn2=[name={} endpointIP={}]",
- add.getName(), add.getFirstEndpoint().getVpnUuid(), add.getFirstEndpoint().getIpAddress(),
+ ivpnLinkName, add.getFirstEndpoint().getVpnUuid(), add.getFirstEndpoint().getIpAddress(),
add.getSecondEndpoint().getVpnUuid(), add.getSecondEndpoint().getIpAddress());
// Create VpnLink state
- InstanceIdentifier<InterVpnLinkState> vpnLinkStateIid = InterVpnLinkUtil.getInterVpnLinkStateIid(add.getName());
- InterVpnLinkState vpnLinkState = new InterVpnLinkStateBuilder().setInterVpnLinkName(add.getName()).build();
+ InstanceIdentifier<InterVpnLinkState> vpnLinkStateIid = InterVpnLinkUtil.getInterVpnLinkStateIid(ivpnLinkName);
+ InterVpnLinkState vpnLinkState = new InterVpnLinkStateBuilder().setInterVpnLinkName(ivpnLinkName).build();
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, vpnLinkStateIid, vpnLinkState);
InterVpnLinkKey key = add.getKey();
String vpn2Name = vpn2Uuid.getValue();
// First VPN
if (VpnUtil.getVpnInstance(this.dataBroker, vpn1Name) == null) {
- String errMsg = "InterVpnLink " + add.getName() + " creation error: could not find 1st endpoint Vpn "
- + vpn1Name;
+ String errMsg = "InterVpnLink " + ivpnLinkName + " creation error: could not find 1st endpoint Vpn "
+ + vpn1Name;
setInError(vpnLinkStateIid, vpnLinkState, errMsg);
return;
}
if (!checkVpnAvailability(key, vpn1Uuid)) {
- String errMsg = "InterVpnLink " + add.getName() + " creation error: Vpn " + vpn1Name
- + " is already associated to an inter-vpn-link ";
+ String errMsg = "InterVpnLink " + ivpnLinkName + " creation error: Vpn " + vpn1Name
+ + " is already associated to an inter-vpn-link ";
setInError(vpnLinkStateIid, vpnLinkState, errMsg);
return;
}
// Second VPN
if (VpnUtil.getVpnInstance(this.dataBroker, vpn2Name) == null) {
- String errMsg = "InterVpnLink " + add.getName() + " creation error: could not find 2nd endpoint Vpn "
- + vpn2Name;
+ String errMsg = "InterVpnLink " + ivpnLinkName + " creation error: could not find 2nd endpoint Vpn "
+ + vpn2Name;
setInError(vpnLinkStateIid, vpnLinkState, errMsg);
return;
}
if (!checkVpnAvailability(key, vpn2Uuid)) {
- String errMsg = "InterVpnLink " + add.getName() + " creation error: Vpn " + vpn2Name
- + " is already associated with an inter-vpn-link";
+ String errMsg = "InterVpnLink " + ivpnLinkName + " creation error: Vpn " + vpn2Name
+ + " is already associated with an inter-vpn-link";
setInError(vpnLinkStateIid, vpnLinkState, errMsg);
return;
}
VpnConstants.PER_VPN_INSTANCE_MAX_WAIT_TIME_IN_MILLISECONDS);
if (!vpn1Ready) {
String errMsg =
- "InterVpnLink " + add.getName() + " creation error: Operational Data for VPN " + vpn1Name
- + " not ready after " + VpnConstants.PER_INTERFACE_MAX_WAIT_TIME_IN_MILLISECONDS
- + " milliseconds";
+ "InterVpnLink " + ivpnLinkName + " creation error: Operational Data for VPN " + vpn1Name
+ + " not ready after " + VpnConstants.PER_INTERFACE_MAX_WAIT_TIME_IN_MILLISECONDS + " milliseconds";
setInError(vpnLinkStateIid, vpnLinkState, errMsg);
return;
}
VpnConstants.PER_VPN_INSTANCE_MAX_WAIT_TIME_IN_MILLISECONDS);
if (!vpn1Ready) {
String errMsg =
- "InterVpnLink " + add.getName() + " creation error: Operational Data for VPN " + vpn2Name
- + " not ready after " + VpnConstants.PER_INTERFACE_MAX_WAIT_TIME_IN_MILLISECONDS
- + " milliseconds";
+ "InterVpnLink " + ivpnLinkName + " creation error: Operational Data for VPN " + vpn2Name
+ + " not ready after " + VpnConstants.PER_INTERFACE_MAX_WAIT_TIME_IN_MILLISECONDS + " milliseconds";
setInError(vpnLinkStateIid, vpnLinkState, errMsg);
return;
}
new SecondEndpointStateBuilder().setVpnUuid(vpn2Uuid).setDpId(secondDpnList)
.setLportTag(secondVpnLportTag).build();
- InterVpnLinkUtil.updateInterVpnLinkState(dataBroker, add.getName(), InterVpnLinkState.State.Active,
- firstEndPointState, secondEndPointState);
+ InterVpnLinkUtil.updateInterVpnLinkState(dataBroker, ivpnLinkName, InterVpnLinkState.State.Active,
+ firstEndPointState, secondEndPointState);
// Note that in the DPN of the firstEndpoint we install the lportTag of the secondEndpoint and viceversa
- InterVpnLinkUtil.installLPortDispatcherTableFlow(dataBroker, mdsalManager, add, firstDpnList,
- vpn2Uuid, secondVpnLportTag);
- InterVpnLinkUtil.installLPortDispatcherTableFlow(dataBroker, mdsalManager, add, secondDpnList,
- vpn1Uuid, firstVpnLportTag);
+ InterVpnLinkUtil.installLPortDispatcherTableFlow(dataBroker, mdsalManager, ivpnLinkName, firstDpnList,
+ vpn2Name, secondVpnLportTag);
+ InterVpnLinkUtil.installLPortDispatcherTableFlow(dataBroker, mdsalManager, ivpnLinkName, secondDpnList,
+ vpn1Name, firstVpnLportTag);
// Update the VPN -> DPNs Map.
// Note: when a set of DPNs is calculated for Vpn1, these DPNs are added to the VpnToDpn map of Vpn2. Why?
// because we do the handover from Vpn1 to Vpn2 in those DPNs, so in those DPNs we must know how to reach
SecondEndpointState secondEndPointState =
new SecondEndpointStateBuilder().setVpnUuid(vpn2Uuid).setLportTag(secondVpnLportTag)
.setDpId(Collections.emptyList()).build();
- InterVpnLinkUtil.updateInterVpnLinkState(dataBroker, add.getName(), InterVpnLinkState.State.Error,
- firstEndPointState, secondEndPointState);
+ InterVpnLinkUtil.updateInterVpnLinkState(dataBroker, ivpnLinkName, InterVpnLinkState.State.Error,
+ firstEndPointState, secondEndPointState);
}
}
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.netvirt.vpnmanager.VpnFootprintService;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
+import org.opendaylight.netvirt.vpnmanager.api.intervpnlink.InterVpnLinkCache;
+import org.opendaylight.netvirt.vpnmanager.api.intervpnlink.InterVpnLinkDataComposite;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.inter.vpn.link.rev160311.inter.vpn.link.states.InterVpnLinkState;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.inter.vpn.link.rev160311.inter.vpn.link.states.InterVpnLinkStateBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.inter.vpn.link.rev160311.inter.vpn.link.states.inter.vpn.link.state.FirstEndpointState;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.inter.vpn.link.rev160311.inter.vpn.link.states.inter.vpn.link.state.FirstEndpointStateBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.inter.vpn.link.rev160311.inter.vpn.link.states.inter.vpn.link.state.SecondEndpointState;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.inter.vpn.link.rev160311.inter.vpn.link.states.inter.vpn.link.state.SecondEndpointStateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.inter.vpn.link.rev160311.inter.vpn.links.InterVpnLink;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* A task that, when a Node comes UP, checks if there are any InterVpnLink that
* created.
*/
public class InterVpnLinkNodeAddTask implements Callable<List<ListenableFuture<Void>>> {
+ private static final Logger LOG = LoggerFactory.getLogger(InterVpnLinkNodeAddTask.class);
private static final String NBR_OF_DPNS_PROPERTY_NAME = "vpnservice.intervpnlink.number.dpns";
private final DataBroker broker;
}
private void installLPortDispatcherTable(InterVpnLinkState interVpnLinkState, List<BigInteger> firstDpnList,
- List<BigInteger> secondDpnList) {
- Optional<InterVpnLink> vpnLink =
- InterVpnLinkUtil.getInterVpnLinkByName(broker, interVpnLinkState.getKey().getInterVpnLinkName());
- if (vpnLink.isPresent()) {
- Uuid firstEndpointVpnUuid = vpnLink.get().getFirstEndpoint().getVpnUuid();
- Uuid secondEndpointVpnUuid = vpnLink.get().getSecondEndpoint().getVpnUuid();
- // Note that in the DPN of the firstEndpoint we install the lportTag of the secondEndpoint and viceversa
- InterVpnLinkUtil.installLPortDispatcherTableFlow(broker, mdsalManager, vpnLink.get(), firstDpnList,
- secondEndpointVpnUuid,
- interVpnLinkState.getSecondEndpointState().getLportTag());
- InterVpnLinkUtil.installLPortDispatcherTableFlow(broker, mdsalManager, vpnLink.get(), secondDpnList,
- firstEndpointVpnUuid,
- interVpnLinkState.getFirstEndpointState().getLportTag());
- // Update the VPN -> DPNs Map.
- // Note: when a set of DPNs is calculated for Vpn1, these DPNs are added to the VpnToDpn map of Vpn2. Why?
- // because we do the handover from Vpn1 to Vpn2 in those DPNs, so in those DPNs we must know how to reach
- // to Vpn2 targets. If new Vpn2 targets are added later, the Fib will be maintained in these DPNs even if
- // Vpn2 is not physically present there.
- InterVpnLinkUtil.updateVpnFootprint(vpnFootprintService, secondEndpointVpnUuid.getValue(), firstDpnList);
- InterVpnLinkUtil.updateVpnFootprint(vpnFootprintService, firstEndpointVpnUuid.getValue(), secondDpnList);
+ List<BigInteger> secondDpnList) {
+ String ivpnLinkName = interVpnLinkState.getKey().getInterVpnLinkName();
+ Optional<InterVpnLinkDataComposite> optVpnLink = InterVpnLinkCache.getInterVpnLinkByName(ivpnLinkName);
+ if (!optVpnLink.isPresent()) {
+ LOG.warn("installLPortDispatcherTable: Could not find interVpnLink {}", ivpnLinkName);
+ return;
}
+
+ InterVpnLinkDataComposite vpnLink = optVpnLink.get();
+ Optional<Long> opt1stEndpointLportTag = vpnLink.getFirstEndpointLportTag();
+ if (!opt1stEndpointLportTag.isPresent()) {
+ LOG.warn("installLPortDispatcherTable: Could not find LPortTag for 1stEnpoint in InterVpnLink {}",
+ ivpnLinkName);
+ return;
+ }
+
+ Optional<Long> opt2ndEndpointLportTag = vpnLink.getSecondEndpointLportTag();
+ if (!opt2ndEndpointLportTag.isPresent()) {
+ LOG.warn("installLPortDispatcherTable: Could not find LPortTag for 2ndEnpoint in InterVpnLink {}",
+ ivpnLinkName);
+ return;
+ }
+
+ String firstEndpointVpnUuid = vpnLink.getFirstEndpointVpnUuid().get();
+ String secondEndpointVpnUuid = vpnLink.getSecondEndpointVpnUuid().get();
+ // Note that in the DPN of the firstEndpoint we install the lportTag of the secondEndpoint and viceversa
+
+ InterVpnLinkUtil.installLPortDispatcherTableFlow(broker, mdsalManager, ivpnLinkName, firstDpnList,
+ secondEndpointVpnUuid, opt2ndEndpointLportTag.get());
+ InterVpnLinkUtil.installLPortDispatcherTableFlow(broker, mdsalManager, ivpnLinkName, secondDpnList,
+ firstEndpointVpnUuid, opt1stEndpointLportTag.get());
+ // Update the VPN -> DPNs Map.
+ // Note: when a set of DPNs is calculated for Vpn1, these DPNs are added to the VpnToDpn map of Vpn2. Why?
+ // because we do the handover from Vpn1 to Vpn2 in those DPNs, so in those DPNs we must know how to reach
+ // to Vpn2 targets. If new Vpn2 targets are added later, the Fib will be maintained in these DPNs even if
+ // Vpn2 is not physically present there.
+ InterVpnLinkUtil.updateVpnFootprint(vpnFootprintService, secondEndpointVpnUuid, firstDpnList);
+ InterVpnLinkUtil.updateVpnFootprint(vpnFootprintService, firstEndpointVpnUuid, secondDpnList);
}
}
import org.opendaylight.netvirt.vpnmanager.api.intervpnlink.InterVpnLinkCache;
import org.opendaylight.netvirt.vpnmanager.api.intervpnlink.InterVpnLinkDataComposite;
import org.opendaylight.netvirt.vpnmanager.utilities.InterfaceUtils;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.FibEntries;
if (optOldVpnLinkState.isPresent()) {
InterVpnLinkState newVpnLinkState =
new InterVpnLinkStateBuilder(optOldVpnLinkState.get()).setState(state)
- .setFirstEndpointState(newFirstEndpointState)
- .setSecondEndpointState(newSecondEndpointState)
- .build();
+ .setFirstEndpointState(newFirstEndpointState)
+ .setSecondEndpointState(newSecondEndpointState)
+ .build();
VpnUtil.syncUpdate(broker, LogicalDatastoreType.CONFIGURATION,
InterVpnLinkUtil.getInterVpnLinkStateIid(vpnLinkName), newVpnLinkState);
InterVpnLinkCache.addInterVpnLinkStateToCaches(newVpnLinkState);
*
* @param broker dataBroker service reference
* @param mdsalManager MDSAL API accessor
- * @param interVpnLink Object that holds the needed information about both endpoints of the InterVpnLink.
+ * @param interVpnLinkName Name of the InterVpnLink.
* @param dpnList The list of DPNs where this flow must be installed
* @param vpnUuidOtherEndpoint UUID of the other endpoint of the InterVpnLink
* @param lportTagOfOtherEndpoint Dataplane identifier of the other endpoint of the InterVpnLink
* @return the list of Futures for each and every flow that has been installed
*/
public static List<ListenableFuture<Void>> installLPortDispatcherTableFlow(DataBroker broker,
- IMdsalApiManager mdsalManager, InterVpnLink interVpnLink, List<BigInteger> dpnList, Uuid vpnUuidOtherEndpoint,
- Long lportTagOfOtherEndpoint) {
+ IMdsalApiManager mdsalManager,
+ String interVpnLinkName,
+ List<BigInteger> dpnList,
+ String vpnUuidOtherEndpoint,
+ Long lportTagOfOtherEndpoint) {
List<ListenableFuture<Void>> result = new ArrayList<>();
- long vpnId = VpnUtil.getVpnId(broker, vpnUuidOtherEndpoint.getValue());
- for (BigInteger dpnId : dpnList) {
+ long vpnId = VpnUtil.getVpnId(broker, vpnUuidOtherEndpoint);
+ for ( BigInteger dpnId : dpnList ) {
// insert into LPortDispatcher table
- Flow lportDispatcherFlow = buildLPortDispatcherFlow(interVpnLink.getName(), vpnId,
- lportTagOfOtherEndpoint.intValue());
+ Flow lportDispatcherFlow = buildLPortDispatcherFlow(interVpnLinkName, vpnId,
+ lportTagOfOtherEndpoint.intValue());
result.add(mdsalManager.installFlow(dpnId, lportDispatcherFlow));
}
vpnRd, destination, label, nexthopList);
bgpManager.advertisePrefix(vpnRd, null /*macAddress*/, destination, nexthopList,
VrfEntry.EncapType.Mplsgre, label, 0 /*l3vni*/, null /*gatewayMacAddress*/);
-
- // TODO: Leak if static-routes-leaking flag is active
-
}
}