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