blob: f04c7984d1ee5488bd723df81c5a5931285bf21a [file] [log] [blame]
Jonathan Hart41349e92015-02-09 14:14:02 -08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Jonathan Hart41349e92015-02-09 14:14:02 -08003 *
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 */
Jonathan Hart2da1e602015-02-18 19:09:24 -080016package org.onosproject.routing;
Jonathan Hart41349e92015-02-09 14:14:02 -080017
Pingping Line28ae4c2015-03-13 11:37:03 -070018import org.onlab.packet.IpAddress;
Jonathan Hart4cb39882015-08-12 23:50:55 -040019import org.onosproject.routing.config.BgpConfig;
Jonathan Hart6344f572015-12-15 08:26:25 -080020import org.onosproject.routing.config.RouterConfig;
Pingping Line28ae4c2015-03-13 11:37:03 -070021
Jonathan Hart66018992015-07-31 11:19:27 -070022import java.util.Collection;
23
Jonathan Hart41349e92015-02-09 14:14:02 -080024/**
25 * Provides a way of interacting with the RIB management component.
Jonathan Hart92ca5d32016-04-14 18:05:52 -070026 *
27 * @deprecated in Goldeneye. Use RouteService instead.
Jonathan Hart41349e92015-02-09 14:14:02 -080028 */
Jonathan Hart92ca5d32016-04-14 18:05:52 -070029@Deprecated
Jonathan Hart41349e92015-02-09 14:14:02 -080030public interface RoutingService {
31
Jonathan Hart66018992015-07-31 11:19:27 -070032 String ROUTER_APP_ID = "org.onosproject.router";
33
Jonathan Hart4cb39882015-08-12 23:50:55 -040034 Class<BgpConfig> CONFIG_CLASS = BgpConfig.class;
Jonathan Hart6344f572015-12-15 08:26:25 -080035 Class<RouterConfig> ROUTER_CONFIG_CLASS = RouterConfig.class;
Jonathan Hart4cb39882015-08-12 23:50:55 -040036
Jonathan Hart41349e92015-02-09 14:14:02 -080037 /**
Pingping Line28ae4c2015-03-13 11:37:03 -070038 * Starts the routing service.
39 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070040 void start();
Pingping Line28ae4c2015-03-13 11:37:03 -070041
42 /**
43 * Adds FIB listener.
44 *
45 * @param fibListener listener to send FIB updates to
46 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070047 void addFibListener(FibListener fibListener);
Pingping Line28ae4c2015-03-13 11:37:03 -070048
49 /**
Jonathan Hart41349e92015-02-09 14:14:02 -080050 * Stops the routing service.
51 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070052 void stop();
Jonathan Hart41349e92015-02-09 14:14:02 -080053
54 /**
Jonathan Hartde15e1c2016-02-03 10:51:50 -080055 * Gets all IPv4 routes from the RIB.
Jonathan Hart41349e92015-02-09 14:14:02 -080056 *
Jonathan Hartde15e1c2016-02-03 10:51:50 -080057 * @return the IPv4 routes
Jonathan Hart41349e92015-02-09 14:14:02 -080058 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070059 Collection<RouteEntry> getRoutes4();
Jonathan Hart41349e92015-02-09 14:14:02 -080060
61 /**
Jonathan Hartde15e1c2016-02-03 10:51:50 -080062 * Gets all IPv6 routes from the RIB.
Jonathan Hart41349e92015-02-09 14:14:02 -080063 *
Jonathan Hartde15e1c2016-02-03 10:51:50 -080064 * @return the IPv6 routes
Jonathan Hart41349e92015-02-09 14:14:02 -080065 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070066 Collection<RouteEntry> getRoutes6();
Pingping Line28ae4c2015-03-13 11:37:03 -070067
68 /**
Pingping Line28ae4c2015-03-13 11:37:03 -070069 * Finds out the route entry which has the longest matchable IP prefix.
70 *
71 * @param ipAddress IP address used to find out longest matchable IP prefix
72 * @return a route entry which has the longest matchable IP prefix if
73 * found, otherwise null
74 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070075 RouteEntry getLongestMatchableRouteEntry(IpAddress ipAddress);
Pingping Line28ae4c2015-03-13 11:37:03 -070076
Jonathan Hart41349e92015-02-09 14:14:02 -080077}