blob: 7399ed7563a97563c70be10087dd3e90ee808243 [file] [log] [blame]
Jonathan Hart41349e92015-02-09 14:14:02 -08001/*
2 * Copyright 2015 Open Networking Laboratory
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 */
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;
Pingping Line28ae4c2015-03-13 11:37:03 -070020
Jonathan Hart66018992015-07-31 11:19:27 -070021import java.util.Collection;
22
Jonathan Hart41349e92015-02-09 14:14:02 -080023/**
24 * Provides a way of interacting with the RIB management component.
25 */
26public interface RoutingService {
27
Jonathan Hart66018992015-07-31 11:19:27 -070028 String ROUTER_APP_ID = "org.onosproject.router";
29
Jonathan Hart4cb39882015-08-12 23:50:55 -040030 Class<BgpConfig> CONFIG_CLASS = BgpConfig.class;
31
Jonathan Hart41349e92015-02-09 14:14:02 -080032 /**
Pingping Line28ae4c2015-03-13 11:37:03 -070033 * Starts the routing service.
34 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070035 void start();
Pingping Line28ae4c2015-03-13 11:37:03 -070036
37 /**
38 * Adds FIB listener.
39 *
40 * @param fibListener listener to send FIB updates to
41 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070042 void addFibListener(FibListener fibListener);
Pingping Line28ae4c2015-03-13 11:37:03 -070043
44 /**
Jonathan Hart41349e92015-02-09 14:14:02 -080045 * Stops the routing service.
46 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070047 void stop();
Jonathan Hart41349e92015-02-09 14:14:02 -080048
49 /**
50 * Gets all IPv4 routes known to SDN-IP.
51 *
52 * @return the SDN-IP IPv4 routes
53 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070054 Collection<RouteEntry> getRoutes4();
Jonathan Hart41349e92015-02-09 14:14:02 -080055
56 /**
57 * Gets all IPv6 routes known to SDN-IP.
58 *
59 * @return the SDN-IP IPv6 routes
60 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070061 Collection<RouteEntry> getRoutes6();
Pingping Line28ae4c2015-03-13 11:37:03 -070062
63 /**
Pingping Line28ae4c2015-03-13 11:37:03 -070064 * Finds out the route entry which has the longest matchable IP prefix.
65 *
66 * @param ipAddress IP address used to find out longest matchable IP prefix
67 * @return a route entry which has the longest matchable IP prefix if
68 * found, otherwise null
69 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070070 RouteEntry getLongestMatchableRouteEntry(IpAddress ipAddress);
Pingping Line28ae4c2015-03-13 11:37:03 -070071
Jonathan Hart41349e92015-02-09 14:14:02 -080072}