2 * Copyright © 2015, 2017 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.netvirt.vpnmanager.api;
11 import java.math.BigInteger;
12 import java.util.Collection;
13 import java.util.List;
15 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
16 import org.opendaylight.genius.mdsalutil.MatchInfoBase;
17 import org.opendaylight.netvirt.fibmanager.api.IFibManager;
18 import org.opendaylight.netvirt.fibmanager.api.RouteOrigin;
19 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.subnetmaps.Subnetmap;
22 public interface IVpnManager {
23 void setFibManager(IFibManager fibManager);
25 void addExtraRoute(String vpnName, String destination, String nextHop,
26 String rd, String routerID, int label, RouteOrigin origin);
28 void delExtraRoute(String vpnName, String destination, String nextHop, String rd, String routerID);
31 * Returns true if the specified VPN exists.
33 * @param vpnName it must match against the vpn-instance-name attrib in one of the VpnInstances
35 boolean existsVpn(String vpnName);
37 boolean isVPNConfigured();
39 long getArpCacheTimeoutMillis();
42 * Retrieves the list of DPNs where the specified VPN has footprint.
44 * @param vpnInstanceName The name of the Vpn instance
45 * @return The list of DPNs
47 List<BigInteger> getDpnsOnVpn(String vpnInstanceName);
50 * Updates the footprint that a VPN has on a given DPN by adding/removing
51 * the specified interface.
53 * @param dpId DPN where the VPN interface belongs to
54 * @param vpnName Name of the VPN whose footprint is being modified
55 * @param interfaceName Name of the VPN interface to be added/removed to/from the specified DPN
56 * @param add true for addition, false for removal
58 void updateVpnFootprint(BigInteger dpId, String vpnName, String interfaceName, boolean add);
60 void setupSubnetMacIntoVpnInstance(String vpnName, String subnetVpnName, String srcMacAddress,
61 BigInteger dpnId, WriteTransaction writeTx, int addOrRemove);
63 void setupRouterGwMacFlow(String routerName, String routerGwMac, BigInteger dpnId, Uuid extNetworkId,
64 WriteTransaction writeTx, int addOrRemove);
66 void setupArpResponderFlowsToExternalNetworkIps(String id, Collection<String> fixedIps, String macAddress,
67 BigInteger dpnId, Uuid extNetworkId, WriteTransaction writeTx, int addOrRemove);
69 void setupArpResponderFlowsToExternalNetworkIps(String id, Collection<String> fixedIps, String routerGwMac,
70 BigInteger dpnId, long vpnId, String extInterfaceName, int lportTag, WriteTransaction writeTx,
73 void onSubnetAddedToVpn(Subnetmap subnetmap, boolean isBgpVpn, Long elanTag);
75 void onSubnetDeletedFromVpn(Subnetmap subnetmap, boolean isBgpVpn);
77 List<MatchInfoBase> getEgressMatchesForVpn(String vpnName);