blob: 9dd5e73b723bf3cb14363ad1ace3c787a135f3a3 [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
17package org.onosproject.incubator.net.routing;
18
19import org.onlab.packet.IpAddress;
20import org.onosproject.store.Store;
21
22import java.util.Collection;
23import java.util.Set;
24
25/**
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 */
50 Set<RouteTableId> getRouteTables();
51
52 /**
53 * Returns the routes in the given route table, grouped by prefix.
54 *
55 * @param table route table ID
56 * @return routes
57 */
58 Collection<EvpnRouteSet> getRoutes(RouteTableId table);
59
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}