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;
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;
26 public interface IVpnManager {
27 void addExtraRoute(String vpnName, String destination, String nextHop,
28 String rd, String routerID, int label, RouteOrigin origin);
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);
34 void delExtraRoute(String vpnName, String destination, String nextHop, String rd, String routerID);
36 void delExtraRoute(String vpnName, String destination, String nextHop, String rd, String routerID,
37 String intfName, WriteTransaction writeConfigTxn);
39 void removePrefixFromBGP(String primaryRd, String rd, String vpnName, String prefix, String nextHop,
40 String tunnelIp, BigInteger dpnId, WriteTransaction writeConfigTxn);
43 * Returns true if the specified VPN exists.
45 * @param vpnName it must match against the vpn-instance-name attrib in one of the VpnInstances
47 boolean existsVpn(String vpnName);
49 boolean isVPNConfigured();
52 * Retrieves the list of DPNs where the specified VPN has footprint.
54 * @param vpnInstanceName The name of the Vpn instance
55 * @return The list of DPNs
57 List<BigInteger> getDpnsOnVpn(String vpnInstanceName);
59 String getPrimaryRdFromVpnInstance(VpnInstance vpnInstance);
61 void addSubnetMacIntoVpnInstance(String vpnName, String subnetVpnName, String srcMacAddress,
62 BigInteger dpnId, WriteTransaction tx);
64 void removeSubnetMacFromVpnInstance(String vpnName, String subnetVpnName, String srcMacAddress,
65 BigInteger dpnId, WriteTransaction tx);
67 void addRouterGwMacFlow(String routerName, String routerGwMac, BigInteger dpnId, Uuid extNetworkId,
68 String subnetVpnName, WriteTransaction writeTx);
70 void removeRouterGwMacFlow(String routerName, String routerGwMac, BigInteger dpnId, Uuid extNetworkId,
71 String subnetVpnName, WriteTransaction writeTx);
73 void addArpResponderFlowsToExternalNetworkIps(String id, Collection<String> fixedIps, String macAddress,
74 BigInteger dpnId, Uuid extNetworkId, WriteTransaction writeTx);
76 void addArpResponderFlowsToExternalNetworkIps(String id, Collection<String> fixedIps, String routerGwMac,
77 BigInteger dpnId, long vpnId, String extInterfaceName, int lportTag, WriteTransaction writeTx);
79 void removeArpResponderFlowsToExternalNetworkIps(String id, Collection<String> fixedIps, String macAddress,
80 BigInteger dpnId, Uuid extNetworkId, WriteTransaction writeTx);
82 void removeArpResponderFlowsToExternalNetworkIps(String id, Collection<String> fixedIps,
83 BigInteger dpnId, String extInterfaceName, int lportTag, WriteTransaction writeTx);
85 void onSubnetAddedToVpn(Subnetmap subnetmap, boolean isBgpVpn, Long elanTag);
87 void onSubnetDeletedFromVpn(Subnetmap subnetmap, boolean isBgpVpn);
89 List<MatchInfoBase> getEgressMatchesForVpn(String vpnName);
91 VpnInstance getVpnInstance(DataBroker broker, String vpnInstanceName);
93 String getVpnRd(DataBroker broker, String vpnName);
95 VpnPortipToPort getNeutronPortFromVpnPortFixedIp(DataBroker broker, String vpnName, String fixedIp);