5c4f0102e2dc36ef7cb1d78bab8d373103f126a3
[netvirt.git] / 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 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
15 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
16 import org.opendaylight.genius.mdsalutil.MatchInfoBase;
17 import org.opendaylight.netvirt.fibmanager.api.RouteOrigin;
18 import org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.instances.VpnInstance;
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.fibmanager.rev150330.vrfentries.VrfEntry;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.adjacency.list.Adjacency;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.neutron.vpn.portip.port.data.VpnPortipToPort;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.subnetmaps.Subnetmap;
24
25
26 public interface IVpnManager {
27     void addExtraRoute(String vpnName, String destination, String nextHop,
28             String rd, String routerID, int label, RouteOrigin origin);
29
30     void addExtraRoute(String vpnName, String destination, String nextHop, String rd, String routerID,
31             int label, Long l3vni, RouteOrigin origin, String intfName, Adjacency operationalAdj,
32             VrfEntry.EncapType encapType, WriteTransaction writeConfigTxn);
33
34     void delExtraRoute(String vpnName, String destination, String nextHop, String rd, String routerID);
35
36     void delExtraRoute(String vpnName, String destination, String nextHop, String rd, String routerID,
37             String intfName, WriteTransaction writeConfigTxn);
38
39     void removePrefixFromBGP(String primaryRd, String rd, String vpnName, String prefix, String nextHop,
40             String tunnelIp, BigInteger dpnId, WriteTransaction writeConfigTxn);
41
42     /**
43      * Returns true if the specified VPN exists.
44      *
45      * @param vpnName it must match against the vpn-instance-name attrib in one of the VpnInstances
46      */
47     boolean existsVpn(String vpnName);
48
49     boolean isVPNConfigured();
50
51     /**
52      * Retrieves the list of DPNs where the specified VPN has footprint.
53      *
54      * @param vpnInstanceName The name of the Vpn instance
55      * @return The list of DPNs
56      */
57     List<BigInteger> getDpnsOnVpn(String vpnInstanceName);
58
59     String getPrimaryRdFromVpnInstance(VpnInstance vpnInstance);
60
61     void addSubnetMacIntoVpnInstance(String vpnName, String subnetVpnName, String srcMacAddress,
62             BigInteger dpnId, WriteTransaction tx);
63
64     void removeSubnetMacFromVpnInstance(String vpnName, String subnetVpnName, String srcMacAddress,
65             BigInteger dpnId, WriteTransaction tx);
66
67     void addRouterGwMacFlow(String routerName, String routerGwMac, BigInteger dpnId, Uuid extNetworkId,
68             String subnetVpnName, WriteTransaction writeTx);
69
70     void removeRouterGwMacFlow(String routerName, String routerGwMac, BigInteger dpnId, Uuid extNetworkId,
71             String subnetVpnName, WriteTransaction writeTx);
72
73     void addArpResponderFlowsToExternalNetworkIps(String id, Collection<String> fixedIps, String macAddress,
74             BigInteger dpnId, Uuid extNetworkId, WriteTransaction writeTx);
75
76     void addArpResponderFlowsToExternalNetworkIps(String id, Collection<String> fixedIps, String routerGwMac,
77             BigInteger dpnId, long vpnId, String extInterfaceName, int lportTag, WriteTransaction writeTx);
78
79     void removeArpResponderFlowsToExternalNetworkIps(String id, Collection<String> fixedIps, String macAddress,
80             BigInteger dpnId, Uuid extNetworkId, WriteTransaction writeTx);
81
82     void removeArpResponderFlowsToExternalNetworkIps(String id, Collection<String> fixedIps,
83             BigInteger dpnId, String extInterfaceName, int lportTag, WriteTransaction writeTx);
84
85     void onSubnetAddedToVpn(Subnetmap subnetmap, boolean isBgpVpn, Long elanTag);
86
87     void onSubnetDeletedFromVpn(Subnetmap subnetmap, boolean isBgpVpn);
88
89     List<MatchInfoBase> getEgressMatchesForVpn(String vpnName);
90
91     VpnInstance getVpnInstance(DataBroker broker, String vpnInstanceName);
92
93     String getVpnRd(DataBroker broker, String vpnName);
94
95     VpnPortipToPort getNeutronPortFromVpnPortFixedIp(DataBroker broker, String vpnName, String fixedIp);
96 }