Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 1 | /* |
Ray Milkey | 34c9590 | 2015-04-15 09:47:53 -0700 | [diff] [blame] | 2 | * Copyright 2014-2015 Open Networking Laboratory |
Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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 |
Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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. |
Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 15 | */ |
Jonathan Hart | 2da1e60 | 2015-02-18 19:09:24 -0800 | [diff] [blame] | 16 | package org.onosproject.routing.config; |
Jonathan Hart | dc711bd | 2014-10-15 11:24:23 -0700 | [diff] [blame] | 17 | |
Pavlin Radoslavov | 2020eac | 2015-01-06 17:26:10 -0800 | [diff] [blame] | 18 | import org.onlab.packet.IpAddress; |
Pingping Lin | e28ae4c | 2015-03-13 11:37:03 -0700 | [diff] [blame] | 19 | import org.onlab.packet.IpPrefix; |
Pingping Lin | c9e16bf | 2015-04-10 14:42:41 -0700 | [diff] [blame] | 20 | import org.onlab.packet.MacAddress; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 21 | import org.onosproject.net.ConnectPoint; |
Jonathan Hart | 90a02c2 | 2015-02-13 11:52:07 -0800 | [diff] [blame] | 22 | |
| 23 | import java.util.Map; |
| 24 | import java.util.Set; |
Jonathan Hart | dc711bd | 2014-10-15 11:24:23 -0700 | [diff] [blame] | 25 | |
| 26 | /** |
Jonathan Hart | 90a02c2 | 2015-02-13 11:52:07 -0800 | [diff] [blame] | 27 | * Provides information about the routing configuration. |
Jonathan Hart | dc711bd | 2014-10-15 11:24:23 -0700 | [diff] [blame] | 28 | */ |
Jonathan Hart | 90a02c2 | 2015-02-13 11:52:07 -0800 | [diff] [blame] | 29 | public interface RoutingConfigurationService { |
| 30 | |
| 31 | /** |
| 32 | * Gets the list of BGP speakers inside the SDN network. |
| 33 | * |
| 34 | * @return the map of BGP speaker names to BGP speaker objects |
| 35 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 36 | Map<String, BgpSpeaker> getBgpSpeakers(); |
Jonathan Hart | 90a02c2 | 2015-02-13 11:52:07 -0800 | [diff] [blame] | 37 | |
| 38 | /** |
| 39 | * Gets the list of configured BGP peers. |
| 40 | * |
| 41 | * @return the map from peer IP address to BgpPeer object |
| 42 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 43 | Map<IpAddress, BgpPeer> getBgpPeers(); |
Jonathan Hart | 90a02c2 | 2015-02-13 11:52:07 -0800 | [diff] [blame] | 44 | |
Jonathan Hart | dc711bd | 2014-10-15 11:24:23 -0700 | [diff] [blame] | 45 | /** |
Pingping Lin | c9e16bf | 2015-04-10 14:42:41 -0700 | [diff] [blame] | 46 | * Gets the MAC address configured for virtual gateway in SDN network. |
| 47 | * |
| 48 | * @return the MAC address of virtual gateway |
| 49 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 50 | MacAddress getVirtualGatewayMacAddress(); |
Pingping Lin | c9e16bf | 2015-04-10 14:42:41 -0700 | [diff] [blame] | 51 | |
| 52 | /** |
| 53 | * Evaluates whether an IP address is a virtual gateway IP address. |
| 54 | * |
| 55 | * @param ipAddress the IP address to evaluate |
| 56 | * @return true if the IP address is a virtual gateway address, otherwise false |
| 57 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 58 | boolean isVirtualGatewayIpAddress(IpAddress ipAddress); |
Pingping Lin | c9e16bf | 2015-04-10 14:42:41 -0700 | [diff] [blame] | 59 | |
| 60 | /** |
Pingping Lin | e28ae4c | 2015-03-13 11:37:03 -0700 | [diff] [blame] | 61 | * Evaluates whether an IP address belongs to local SDN network. |
| 62 | * |
| 63 | * @param ipAddress the IP address to evaluate |
| 64 | * @return true if the IP address belongs to local SDN network, otherwise false |
| 65 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 66 | boolean isIpAddressLocal(IpAddress ipAddress); |
Pingping Lin | e28ae4c | 2015-03-13 11:37:03 -0700 | [diff] [blame] | 67 | |
| 68 | /** |
| 69 | * Evaluates whether an IP prefix belongs to local SDN network. |
| 70 | * |
| 71 | * @param ipPrefix the IP prefix to evaluate |
| 72 | * @return true if the IP prefix belongs to local SDN network, otherwise false |
| 73 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 74 | boolean isIpPrefixLocal(IpPrefix ipPrefix); |
Pingping Lin | e28ae4c | 2015-03-13 11:37:03 -0700 | [diff] [blame] | 75 | |
| 76 | /** |
Pingping Lin | 8a52471 | 2015-06-24 14:58:24 -0700 | [diff] [blame] | 77 | * Retrieves the entire set of connect points connected to BGP peers in the |
| 78 | * network. |
| 79 | * |
| 80 | * @return the set of connect points connected to BGP peers |
| 81 | */ |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 82 | Set<ConnectPoint> getBgpPeerConnectPoints(); |
Pingping Lin | 8a52471 | 2015-06-24 14:58:24 -0700 | [diff] [blame] | 83 | |
| 84 | /** |
Jonathan Hart | dc711bd | 2014-10-15 11:24:23 -0700 | [diff] [blame] | 85 | * Retrieves the interface that matches the given IP address. Matching |
| 86 | * means that the IP address is in one of the interface's assigned subnets. |
| 87 | * |
| 88 | * @param ipAddress IP address to match |
| 89 | * @return the matching interface |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 90 | * @deprecated in Drake release - use InterfaceService instead |
Jonathan Hart | dc711bd | 2014-10-15 11:24:23 -0700 | [diff] [blame] | 91 | */ |
Jonathan Hart | 4cb3988 | 2015-08-12 23:50:55 -0400 | [diff] [blame] | 92 | @Deprecated |
Jonathan Hart | dc711bd | 2014-10-15 11:24:23 -0700 | [diff] [blame] | 93 | Interface getMatchingInterface(IpAddress ipAddress); |
Jonathan Hart | 90a02c2 | 2015-02-13 11:52:07 -0800 | [diff] [blame] | 94 | |
Jonathan Hart | dc711bd | 2014-10-15 11:24:23 -0700 | [diff] [blame] | 95 | } |