MRI version bumpup for Aluminium
[netvirt.git] / vpnmanager / api / src / main / java / org / opendaylight / netvirt / vpnmanager / api / intervpnlink / IVpnLinkService.java
1 /*
2  * Copyright (c) 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 package org.opendaylight.netvirt.vpnmanager.api.intervpnlink;
9
10 import java.util.List;
11 import org.opendaylight.netvirt.fibmanager.api.RouteOrigin;
12 import org.opendaylight.yangtools.yang.common.Uint32;
13
14 public interface IVpnLinkService {
15
16     /**
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).
20      *
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
27      */
28     void leakRouteIfNeeded(String vpnName, String prefix, List<String> nextHopList, Uint32 label, RouteOrigin origin,
29                            int addOrRemove);
30
31     /**
32      * Leaks a route from one VPN to another.
33      *
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.
41      */
42     void leakRoute(InterVpnLinkDataComposite interVpnLink, String srcVpnUuid, String dstVpnUuid,
43                    String prefix, Uint32 label, RouteOrigin forcedOrigin);
44
45     /**
46      * Similar to leakRouteIfNeeded but the only requisite to be met is that
47      * there exists an InterVpnLink linking both VPNs.
48      *
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
54      */
55     void leakRoute(String vpnName, String prefix, List<String> nextHopList, Uint32 label, int addOrRemove);
56
57     /**
58      * Checks both L3VPNs linked by the InterVpnLink and performs all the
59      * corresponding route leaking between them.
60      *
61      * @param interVpnLinkDataComposite InterVpnLink to be considered
62      */
63     void exchangeRoutes(InterVpnLinkDataComposite interVpnLinkDataComposite);
64
65     /**
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
68      * Router.
69      *
70      * @param interVpnLink InterVpnLink to be considered.
71      */
72     void handleStaticRoutes(InterVpnLinkDataComposite interVpnLink);
73
74 }