add interface for VpnFootprintService
[netvirt.git] / vpnservice / vpnmanager / vpnmanager-api / src / main / java / org / opendaylight / netvirt / vpnmanager / api / IVpnManager.java
1 /*
2  * Copyright © 2015, 2017 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.netvirt.vpnmanager.api;
10
11 import java.math.BigInteger;
12 import java.util.Collection;
13 import java.util.List;
14
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;
21
22 public interface IVpnManager {
23     void setFibManager(IFibManager fibManager);
24
25     void addExtraRoute(String vpnName, String destination, String nextHop,
26             String rd, String routerID, int label, RouteOrigin origin);
27
28     void delExtraRoute(String vpnName, String destination, String nextHop, String rd, String routerID);
29
30     /**
31      * Returns true if the specified VPN exists.
32      *
33      * @param vpnName it must match against the vpn-instance-name attrib in one of the VpnInstances
34      */
35     boolean existsVpn(String vpnName);
36
37     boolean isVPNConfigured();
38
39     long getArpCacheTimeoutMillis();
40
41     /**
42      * Retrieves the list of DPNs where the specified VPN has footprint.
43      *
44      * @param vpnInstanceName The name of the Vpn instance
45      * @return The list of DPNs
46      */
47     List<BigInteger> getDpnsOnVpn(String vpnInstanceName);
48
49     void setupSubnetMacIntoVpnInstance(String vpnName, String subnetVpnName, String srcMacAddress,
50             BigInteger dpnId, WriteTransaction writeTx, int addOrRemove);
51
52     void setupRouterGwMacFlow(String routerName, String routerGwMac, BigInteger dpnId, Uuid extNetworkId,
53             WriteTransaction writeTx, int addOrRemove);
54
55     void setupArpResponderFlowsToExternalNetworkIps(String id, Collection<String> fixedIps, String macAddress,
56             BigInteger dpnId, Uuid extNetworkId, WriteTransaction writeTx, int addOrRemove);
57
58     void setupArpResponderFlowsToExternalNetworkIps(String id, Collection<String> fixedIps, String routerGwMac,
59             BigInteger dpnId, long vpnId, String extInterfaceName, int lportTag, WriteTransaction writeTx,
60             int addOrRemove);
61
62     void onSubnetAddedToVpn(Subnetmap subnetmap, boolean isBgpVpn, Long elanTag);
63
64     void onSubnetDeletedFromVpn(Subnetmap subnetmap, boolean isBgpVpn);
65
66     List<MatchInfoBase> getEgressMatchesForVpn(String vpnName);
67
68 }