blob: 0b3379fce6ab6538eb3b0c2719408cc7804a06dd [file] [log] [blame]
Mohammad Shahidaa7c1232017-08-09 11:13:15 +05301/*
2 * Copyright 2017-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Ray Milkeya95193c2017-08-10 15:35:36 -070017package org.onosproject.evpnrouteservice;
Mohammad Shahidaa7c1232017-08-09 11:13:15 +053018
19import java.util.Collection;
20
Ray Milkeya95193c2017-08-10 15:35:36 -070021import org.onlab.packet.IpAddress;
22
Mohammad Shahidaa7c1232017-08-09 11:13:15 +053023/**
24 * Represents a route table that stores routes.
25 */
26public interface EvpnTable {
27
28 /**
29 * Adds a route to the route table.
30 *
31 * @param route route
32 */
33 void update(EvpnRoute route);
34
35 /**
36 * Removes a route from the route table.
37 *
38 * @param route route
39 */
40 void remove(EvpnRoute route);
41
42 /**
43 * Returns the route table ID.
44 *
45 * @return route table ID
46 */
Jonathan Harte9c0c6e2017-08-09 16:44:13 -070047 EvpnRouteTableId id();
Mohammad Shahidaa7c1232017-08-09 11:13:15 +053048
49 /**
50 * Returns all routes in the route table.
51 *
52 * @return collection of routes, grouped by prefix
53 */
54 Collection<EvpnRouteSet> getRoutes();
55
56 /**
57 * Returns the routes in this table pertaining to a given prefix.
58 *
59 * @param prefix IP prefix
60 * @return routes for the prefix
61 */
62 EvpnRouteSet getRoutes(EvpnPrefix prefix);
63
64 /**
65 * Returns all routes that have the given next hop.
66 *
67 * @param nextHop next hop IP address
68 * @return collection of routes
69 */
70 Collection<EvpnRoute> getRoutesForNextHop(IpAddress nextHop);
71
72 /**
73 * Releases route table resources held locally.
74 */
75 void shutdown();
76
77 /**
78 * Releases route table resources across the entire cluster.
79 */
80 void destroy();
81
82}