blob: c06704f662a35403e575d6a58bd1a10dd49bd84a [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;
20import java.util.Set;
21
Ray Milkeya95193c2017-08-10 15:35:36 -070022import org.onlab.packet.IpAddress;
23import org.onosproject.store.Store;
24
Mohammad Shahidaa7c1232017-08-09 11:13:15 +053025/**
26 * EVPN route store.
27 */
28public interface EvpnRouteStore extends Store<EvpnInternalRouteEvent,
29 EvpnRouteStoreDelegate> {
30
31 /**
32 * Adds or updates the given route in the store.
33 *
34 * @param route route to add or update
35 */
36 void updateRoute(EvpnRoute route);
37
38 /**
39 * Removes the given route from the store.
40 *
41 * @param route route to remove
42 */
43 void removeRoute(EvpnRoute route);
44
45 /**
46 * Returns the IDs for all route tables in the store.
47 *
48 * @return route table IDs
49 */
Jonathan Harte9c0c6e2017-08-09 16:44:13 -070050 Set<EvpnRouteTableId> getRouteTables();
Mohammad Shahidaa7c1232017-08-09 11:13:15 +053051
52 /**
53 * Returns the routes in the given route table, grouped by prefix.
54 *
55 * @param table route table ID
56 * @return routes
57 */
Jonathan Harte9c0c6e2017-08-09 16:44:13 -070058 Collection<EvpnRouteSet> getRoutes(EvpnRouteTableId table);
Mohammad Shahidaa7c1232017-08-09 11:13:15 +053059
60 /**
61 * Returns the routes that point to the given next hop IP address.
62 *
63 * @param ip IP address of the next hop
64 * @return routes for the given next hop
65 */
66 // TODO think about including route table info
67 Collection<EvpnRoute> getRoutesForNextHop(IpAddress ip);
68
69}