d990f28c788ba6b6e4c0ac015f017825c1cda2c3
[netvirt.git] / vpnservice / vpnmanager / vpnmanager-api / src / main / java / org / opendaylight / netvirt / vpnmanager / api / IVpnManager.java
1 /*
2  * Copyright (c) 2015 - 2016 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.netvirt.fibmanager.api.IFibManager;
17 import org.opendaylight.netvirt.fibmanager.api.RouteOrigin;
18 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
19
20 public interface IVpnManager {
21     void setFibManager(IFibManager fibManager);
22     void addExtraRoute(String destination, String nextHop, String rd, String routerID, int label, RouteOrigin origin);
23     void delExtraRoute(String destination, String nextHop, String rd, String routerID);
24
25     /**
26      * Returns true if the specified VPN exists
27      *
28      * @param vpnName it must match against the vpn-instance-name attrib in one of the VpnInstances
29      *
30      * @return
31      */
32     boolean existsVpn(String vpnName);
33     boolean isVPNConfigured();
34
35     long getArpCacheTimeoutMillis();
36     /**
37      * Retrieves the list of DPNs where the specified VPN has footprint
38      *
39      * @param vpnInstanceName The name of the Vpn instance
40      * @return The list of DPNs
41      */
42     List<BigInteger> getDpnsOnVpn(String vpnInstanceName);
43
44     /**
45      * Updates the footprint that a VPN has on a given DPN by adding/removing
46      * the specified interface
47      *
48      * @param dpId DPN where the VPN interface belongs to
49      * @param vpnName Name of the VPN whose footprint is being modified
50      * @param interfaceName Name of the VPN interface to be added/removed
51      *          to/from the specified DPN
52      * @param add true for addition, false for removal
53      */
54     void updateVpnFootprint(BigInteger dpId, String vpnName, String interfaceName, boolean add);
55
56     void setupSubnetMacIntoVpnInstance(String vpnName, String srcMacAddress,
57             BigInteger dpnId, WriteTransaction writeTx, int addOrRemove);
58
59     void setupRouterGwMacFlow(String routerName, String routerGwMac, BigInteger dpnId, Uuid extNetworkId,
60             WriteTransaction writeTx, int addOrRemove);
61
62     void setupArpResponderFlowsToExternalNetworkIps(String id, Collection<String> fixedIps, String macAddress,
63             BigInteger dpnId, Uuid extNetworkId, WriteTransaction writeTx, int addOrRemove);
64
65     void setupArpResponderFlowsToExternalNetworkIps(String id, Collection<String> fixedIps, String routerGwMac,
66             BigInteger dpnId, long vpnId, String extInterfaceName, int lPortTag, WriteTransaction writeTx,
67             int addOrRemove);
68
69 }