Mohammad Shahid | aa7c123 | 2017-08-09 11:13:15 +0530 | [diff] [blame] | 1 | /* |
| 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 Milkey | a95193c | 2017-08-10 15:35:36 -0700 | [diff] [blame] | 17 | package org.onosproject.evpnrouteservice; |
Mohammad Shahid | aa7c123 | 2017-08-09 11:13:15 +0530 | [diff] [blame] | 18 | |
| 19 | import java.util.Collection; |
| 20 | |
Ray Milkey | a95193c | 2017-08-10 15:35:36 -0700 | [diff] [blame] | 21 | import org.onlab.packet.IpAddress; |
| 22 | |
Mohammad Shahid | aa7c123 | 2017-08-09 11:13:15 +0530 | [diff] [blame] | 23 | /** |
| 24 | * Represents a route table that stores routes. |
| 25 | */ |
| 26 | public 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 Hart | e9c0c6e | 2017-08-09 16:44:13 -0700 | [diff] [blame] | 47 | EvpnRouteTableId id(); |
Mohammad Shahid | aa7c123 | 2017-08-09 11:13:15 +0530 | [diff] [blame] | 48 | |
| 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 | } |