Thejaswi N K | 6a4cd00 | 2015-09-21 17:19:55 +0530 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.onosproject.bgp.controller; |
| 17 | |
| 18 | /** |
| 19 | * BGP Peer configuration information. |
| 20 | */ |
Shashikanth VH | 5dd8dbe | 2015-11-26 13:22:18 +0530 | [diff] [blame] | 21 | public interface BgpPeerCfg { |
Thejaswi N K | 6a4cd00 | 2015-09-21 17:19:55 +0530 | [diff] [blame] | 22 | |
| 23 | enum State { |
| 24 | |
| 25 | /** |
| 26 | * Signifies that peer connection is idle. |
| 27 | */ |
| 28 | IDLE, |
| 29 | |
| 30 | /** |
| 31 | * Signifies that connection is initiated. |
| 32 | */ |
| 33 | CONNECT, |
| 34 | |
| 35 | /** |
| 36 | * Signifies that state is active and connection can be established. |
| 37 | */ |
| 38 | ACTIVE, |
| 39 | |
| 40 | /** |
| 41 | * Signifies that open is sent and anticipating reply. |
| 42 | */ |
| 43 | OPENSENT, |
| 44 | |
| 45 | /** |
| 46 | * Signifies that peer sent the open message as reply. |
| 47 | */ |
| 48 | OPENCONFIRM, |
| 49 | |
| 50 | /** |
| 51 | * Signifies that all the negotiation is successful and ready to exchange other messages. |
| 52 | */ |
| 53 | ESTABLISHED, |
| 54 | |
| 55 | /** |
| 56 | * Signifies that invalid state. |
| 57 | */ |
| 58 | INVALID |
| 59 | } |
| 60 | |
Shashikanth VH | dcfb7b5 | 2016-02-05 12:56:23 +0530 | [diff] [blame] | 61 | enum FlowSpec { |
| 62 | |
| 63 | /** |
| 64 | * Signifies that peer support IPV4 flow specification. |
| 65 | */ |
| 66 | IPV4, |
| 67 | |
| 68 | /** |
| 69 | * Signifies that peer support VPNV4 flow specification. |
| 70 | */ |
| 71 | VPNV4, |
| 72 | |
| 73 | /** |
| 74 | * Signifies that peer flow specification support disabled. |
| 75 | */ |
| 76 | NONE |
| 77 | } |
| 78 | |
Thejaswi N K | 6a4cd00 | 2015-09-21 17:19:55 +0530 | [diff] [blame] | 79 | /** |
| 80 | * Returns the connection State information of the peer. |
| 81 | * |
| 82 | * @return |
| 83 | * enum state is returned |
| 84 | */ |
| 85 | State getState(); |
| 86 | |
| 87 | /** |
| 88 | * Set the connection state information of the peer. |
| 89 | * |
| 90 | * @param state |
| 91 | * enum state |
| 92 | */ |
| 93 | void setState(State state); |
| 94 | |
| 95 | /** |
| 96 | * Returns the connection is initiated from us or not. |
| 97 | * |
| 98 | * @return |
| 99 | * true if the connection is initiated by this peer, false if it has been received. |
| 100 | */ |
| 101 | boolean getSelfInnitConnection(); |
| 102 | |
| 103 | /** |
| 104 | * Set the connection is initiated from us or not. |
| 105 | * |
| 106 | * @param selfInit |
| 107 | * true if the connection is initiated by this peer, false if it has been received. |
| 108 | */ |
| 109 | void setSelfInnitConnection(boolean selfInit); |
| 110 | |
| 111 | /** |
| 112 | * Returns the AS number to which this peer belongs. |
| 113 | * |
| 114 | * @return |
| 115 | * AS number |
| 116 | */ |
| 117 | int getAsNumber(); |
| 118 | |
| 119 | /** |
| 120 | * Set the AS number to which this peer belongs. |
| 121 | * |
| 122 | * @param asNumber |
| 123 | * AS number |
| 124 | */ |
| 125 | void setAsNumber(int asNumber); |
| 126 | |
| 127 | /** |
| 128 | * Get the keep alive timer value configured. |
| 129 | * |
| 130 | * @return |
| 131 | * keep alive timer value in seconds |
| 132 | */ |
| 133 | short getHoldtime(); |
| 134 | |
| 135 | /** |
| 136 | * Set the keep alive timer value. |
| 137 | * |
| 138 | * @param holdTime |
| 139 | * keep alive timer value in seconds |
| 140 | */ |
| 141 | void setHoldtime(short holdTime); |
| 142 | |
| 143 | /** |
| 144 | * Return the connection type eBGP or iBGP. |
| 145 | * |
| 146 | * @return |
| 147 | * true if iBGP, false if it is eBGP |
| 148 | */ |
| 149 | boolean getIsIBgp(); |
| 150 | |
| 151 | /** |
| 152 | * Set the connection type eBGP or iBGP. |
| 153 | * |
| 154 | * @param isIBgp |
| 155 | * true if iBGP, false if it is eBGP |
| 156 | */ |
| 157 | void setIsIBgp(boolean isIBgp); |
| 158 | |
| 159 | /** |
| 160 | * Return the peer router IP address. |
| 161 | * |
| 162 | * @return |
| 163 | * IP address in string format |
| 164 | */ |
| 165 | String getPeerRouterId(); |
| 166 | |
| 167 | /** |
| 168 | * Set the peer router IP address. |
| 169 | * |
| 170 | * @param peerId |
| 171 | * IP address in string format |
| 172 | */ |
| 173 | void setPeerRouterId(String peerId); |
| 174 | |
| 175 | /** |
| 176 | * Set the peer router IP address and AS number. |
| 177 | * |
| 178 | * @param peerId |
| 179 | * IP address in string format |
| 180 | * @param asNumber |
| 181 | * AS number |
| 182 | */ |
| 183 | void setPeerRouterId(String peerId, int asNumber); |
Shashikanth VH | 4b76e51 | 2015-11-18 15:42:37 +0530 | [diff] [blame] | 184 | |
| 185 | /** |
| 186 | * Set the peer connect instance. |
| 187 | * |
| 188 | * @param connectpeer connect peer instance |
| 189 | */ |
| 190 | void setConnectPeer(BgpConnectPeer connectpeer); |
| 191 | |
| 192 | /** |
| 193 | * Get the peer connect instance. |
| 194 | * |
| 195 | * @return peer connect instance |
| 196 | */ |
| 197 | BgpConnectPeer connectPeer(); |
Shashikanth VH | dcfb7b5 | 2016-02-05 12:56:23 +0530 | [diff] [blame] | 198 | |
| 199 | /** |
| 200 | * Gets the flow specification capability. |
| 201 | * |
| 202 | * @return flow specification status |
| 203 | */ |
| 204 | public FlowSpec flowSpecStatus(); |
| 205 | |
| 206 | /** |
| 207 | * sets the flow specification capability. |
| 208 | * |
| 209 | * @param flowSpecStatus flow specification status |
| 210 | */ |
| 211 | public void setFlowSpecStatus(FlowSpec flowSpecStatus); |
Thejaswi N K | 6a4cd00 | 2015-09-21 17:19:55 +0530 | [diff] [blame] | 212 | } |