Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | ce2a03d | 2017-08-03 19:21:03 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
| 5 | * the License. You may obtain a copy of the License at |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
| 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
| 11 | * specific language governing permissions and limitations under the License. |
| 12 | */ |
| 13 | |
| 14 | package org.onosproject.bgp.controller; |
| 15 | |
Shashikanth VH | 0a82a8e | 2016-02-02 20:42:53 +0530 | [diff] [blame] | 16 | import java.util.List; |
| 17 | |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 18 | import org.onosproject.bgpio.protocol.BgpVersion; |
Shashikanth VH | 0a82a8e | 2016-02-02 20:42:53 +0530 | [diff] [blame] | 19 | import org.onosproject.bgpio.types.BgpValueType; |
Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 20 | |
| 21 | /** |
| 22 | * Abstraction of an BGP session info. Maintian session parameters obtained during session creation. |
| 23 | */ |
| 24 | public interface BgpSessionInfo { |
| 25 | /** |
| 26 | * Gets the bgp session type iBGP/eBGP. |
| 27 | * |
| 28 | * @return isiBGPSession, true if session is of type internal, otherwise false. |
| 29 | */ |
| 30 | boolean isIbgpSession(); |
| 31 | |
| 32 | /** |
| 33 | * Gets the negotiated hold time for the session. |
| 34 | * |
| 35 | * @return negotiated hold time. |
| 36 | */ |
| 37 | short negotiatedholdTime(); |
| 38 | |
| 39 | /** |
| 40 | * Gets the BGP ID of BGP peer. |
| 41 | * |
| 42 | * @return bgp ID. |
| 43 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 44 | BgpId remoteBgpId(); |
Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 45 | |
| 46 | /** |
| 47 | * Gets the BGP version of peer. |
| 48 | * |
| 49 | * @return bgp version. |
| 50 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 51 | BgpVersion remoteBgpVersion(); |
Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 52 | |
| 53 | /** |
| 54 | * Gets the BGP remote bgp AS number. |
| 55 | * |
| 56 | * @return remoteBgpASNum peer AS number. |
| 57 | */ |
| 58 | long remoteBgpASNum(); |
| 59 | |
| 60 | /** |
| 61 | * Gets the BGP peer hold time. |
| 62 | * |
| 63 | * @return bgp hold time. |
| 64 | */ |
| 65 | short remoteBgpHoldTime(); |
| 66 | |
| 67 | /** |
| 68 | * Gets the BGP version for this bgp peer. |
| 69 | * |
| 70 | * @return bgp identifier. |
| 71 | */ |
| 72 | int remoteBgpIdentifier(); |
Shashikanth VH | 0a82a8e | 2016-02-02 20:42:53 +0530 | [diff] [blame] | 73 | |
| 74 | /** |
| 75 | * Gets the BGP capabilities for this BGP peer. |
| 76 | * |
| 77 | * @return BGP peer capabilities. |
| 78 | */ |
| 79 | List<BgpValueType> remoteBgpCapability(); |
Shashikanth VH | 9f8afb4 | 2015-11-04 18:00:30 +0530 | [diff] [blame] | 80 | } |