blob: 9b8e2d2c0177ecba80c52f1900bffd88ebbbdc96 [file] [log] [blame]
Andreas Papazoisa9964ea2016-01-08 15:58:22 +02001/*
Andreas Papazoise6aebaa2016-05-26 15:25:51 +03002 * Copyright 2016-present Open Networking Laboratory
Andreas Papazoisa9964ea2016-01-08 15:58:22 +02003 *
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.sdxl3;
18
19import org.onlab.packet.IpAddress;
20import org.onosproject.incubator.net.intf.Interface;
Andreas Papazoisc2c45012016-01-20 14:26:11 +020021import org.onosproject.net.ConnectPoint;
22import org.onosproject.routing.config.BgpConfig;
Andreas Papazoise6aebaa2016-05-26 15:25:51 +030023import org.onosproject.sdxl3.config.SdxParticipantsConfig;
Andreas Papazoisc2c45012016-01-20 14:26:11 +020024
25import java.util.List;
Andreas Papazoisa9964ea2016-01-08 15:58:22 +020026
27/*
28 * Service for managing peers connections
29 */
30public interface SdxL3PeerService {
31
Andreas Papazoise6aebaa2016-05-26 15:25:51 +030032 Class<SdxParticipantsConfig> CONFIG_CLASS = SdxParticipantsConfig.class;
33 String CONFIG_KEY = "participants";
Andreas Papazoisc2c45012016-01-20 14:26:11 +020034
35 /**
36 * Returns the list of IP addresses of BGP peers.
37 *
38 * @param bgpConfig BGP configuration
39 * @return list of IP addresses of peers
40 */
41 List<IpAddress> getPeerAddresses(BgpConfig bgpConfig);
Andreas Papazoisa9964ea2016-01-08 15:58:22 +020042
43 /**
44 * Returns the interface used as connection point to peer.
45 *
Andreas Papazoisc2c45012016-01-20 14:26:11 +020046 * @param peerAddress IP address of peer
Andreas Papazoisa9964ea2016-01-08 15:58:22 +020047 * @return interface to the peer
48 */
Andreas Papazoisc2c45012016-01-20 14:26:11 +020049 Interface getInterfaceForPeer(IpAddress peerAddress);
50
51 /**
52 * Adds details for a BGP peer to the configuration.
53 *
54 * @param peerName Peer name
55 * @param peerAddress Peer IP address
56 * @param port Connection point with peer
57 * @param interfaceName Name of the interface configured on port
58 */
59 void addPeerDetails(String peerName, IpAddress peerAddress,
60 ConnectPoint port, String interfaceName);
61
62 /**
63 * Removes details for a BGP peer to the configuration.
64 *
65 * @param peerAddress Peer IP address
66 */
67 void removePeerDetails(IpAddress peerAddress);
68
Andreas Papazoisa9964ea2016-01-08 15:58:22 +020069}