2 * Copyright (c) 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
8 package org.opendaylight.netvirt.vpnmanager.api.intervpnlink;
10 import java.util.List;
11 import org.opendaylight.netvirt.fibmanager.api.RouteOrigin;
13 import org.opendaylight.yangtools.yang.common.Uint32;
15 public interface IVpnLinkService {
18 * Leaks a route belonging to a L3VPN to other L3VPN if the necessary
19 * circumstances are met, like there is an InterVpnLink linking both L3VPNs
20 * and the corresponding leaking flag is active (bgp/static/connected).
22 * @param vpnName Vpn name of the L3VPN that holds the original route
23 * @param prefix Prefix/destination of the route
24 * @param nextHopList List of nexthops (ECMP) of the route
25 * @param label Label of the route to be leaked
26 * @param origin Origin of the route (BGP|STATIC|CONNECTED)
27 * @param addOrRemove states if the routes must be leaked or withdrawn
29 void leakRouteIfNeeded(String vpnName, String prefix, List<String> nextHopList, Uint32 label, RouteOrigin origin,
33 * Leaks a route from one VPN to another.
35 * @param interVpnLink Reference to the object that holds the info about the link between the 2 VPNs
36 * @param srcVpnUuid UUID of the VPN that has the route that is going to be leaked to the other VPN
37 * @param dstVpnUuid UUID of the VPN that is going to receive the route
38 * @param prefix Prefix of the route
39 * @param label Label of the route in the original VPN
40 * @param forcedOrigin By default, origin for leaked routes is INTERVPN, however it is possible to
41 * provide a different origin if desired.
43 void leakRoute(InterVpnLinkDataComposite interVpnLink, String srcVpnUuid, String dstVpnUuid,
44 String prefix, Uint32 label, RouteOrigin forcedOrigin);
47 * Similar to leakRouteIfNeeded but the only requisite to be met is that
48 * there exists an InterVpnLink linking both VPNs.
50 * @param vpnName Vpn name of the L3VPN that holds the original route
51 * @param prefix Prefix/destination of the route
52 * @param nextHopList List of nexthops (ECMP) of the route
53 * @param label Label of the route to be leaked
54 * @param addOrRemove states if the routes must be leaked or withdrawn
56 void leakRoute(String vpnName, String prefix, List<String> nextHopList, Uint32 label, int addOrRemove);
59 * Checks both L3VPNs linked by the InterVpnLink and performs all the
60 * corresponding route leaking between them.
62 * @param interVpnLinkDataComposite InterVpnLink to be considered
64 void exchangeRoutes(InterVpnLinkDataComposite interVpnLinkDataComposite);
67 * Requests IVpnLinkService to take care of those static routes that point
68 * to the specified InterVpnLink and that may be configured in any Neutron
71 * @param interVpnLink InterVpnLink to be considered.
73 void handleStaticRoutes(InterVpnLinkDataComposite interVpnLink);