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;
12 import org.opendaylight.yangtools.yang.common.Uint32;
14 public interface IVpnLinkService {
17 * Leaks a route belonging to a L3VPN to other L3VPN if the necessary
18 * circumstances are met, like there is an InterVpnLink linking both L3VPNs
19 * and the corresponding leaking flag is active (bgp/static/connected).
21 * @param vpnName Vpn name of the L3VPN that holds the original route
22 * @param prefix Prefix/destination of the route
23 * @param nextHopList List of nexthops (ECMP) of the route
24 * @param label Label of the route to be leaked
25 * @param origin Origin of the route (BGP|STATIC|CONNECTED)
26 * @param addOrRemove states if the routes must be leaked or withdrawn
28 void leakRouteIfNeeded(String vpnName, String prefix, List<String> nextHopList, Uint32 label, RouteOrigin origin,
32 * Leaks a route from one VPN to another.
34 * @param interVpnLink Reference to the object that holds the info about the link between the 2 VPNs
35 * @param srcVpnUuid UUID of the VPN that has the route that is going to be leaked to the other VPN
36 * @param dstVpnUuid UUID of the VPN that is going to receive the route
37 * @param prefix Prefix of the route
38 * @param label Label of the route in the original VPN
39 * @param forcedOrigin By default, origin for leaked routes is INTERVPN, however it is possible to
40 * provide a different origin if desired.
42 void leakRoute(InterVpnLinkDataComposite interVpnLink, String srcVpnUuid, String dstVpnUuid,
43 String prefix, Uint32 label, RouteOrigin forcedOrigin);
46 * Similar to leakRouteIfNeeded but the only requisite to be met is that
47 * there exists an InterVpnLink linking both VPNs.
49 * @param vpnName Vpn name of the L3VPN that holds the original route
50 * @param prefix Prefix/destination of the route
51 * @param nextHopList List of nexthops (ECMP) of the route
52 * @param label Label of the route to be leaked
53 * @param addOrRemove states if the routes must be leaked or withdrawn
55 void leakRoute(String vpnName, String prefix, List<String> nextHopList, Uint32 label, int addOrRemove);
58 * Checks both L3VPNs linked by the InterVpnLink and performs all the
59 * corresponding route leaking between them.
61 * @param interVpnLinkDataComposite InterVpnLink to be considered
63 void exchangeRoutes(InterVpnLinkDataComposite interVpnLinkDataComposite);
66 * Requests IVpnLinkService to take care of those static routes that point
67 * to the specified InterVpnLink and that may be configured in any Neutron
70 * @param interVpnLink InterVpnLink to be considered.
72 void handleStaticRoutes(InterVpnLinkDataComposite interVpnLink);