Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 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.isis.controller; |
| 17 | |
mohamed rahil | 8ea09d4 | 2016-04-19 20:47:21 +0530 | [diff] [blame] | 18 | import org.jboss.netty.channel.Channel; |
| 19 | import org.onlab.packet.Ip4Address; |
| 20 | import org.onlab.packet.MacAddress; |
| 21 | |
| 22 | import java.util.Set; |
| 23 | |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 24 | /** |
| 25 | * Representation of an ISIS interface. |
| 26 | */ |
| 27 | public interface IsisInterface { |
| 28 | |
| 29 | /** |
mohamed rahil | 8ea09d4 | 2016-04-19 20:47:21 +0530 | [diff] [blame] | 30 | * Returns interface index. |
| 31 | * |
| 32 | * @return interface index |
| 33 | */ |
| 34 | int interfaceIndex(); |
| 35 | |
| 36 | /** |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 37 | * Sets interface index. |
| 38 | * |
| 39 | * @param interfaceIndex interface index |
| 40 | */ |
| 41 | void setInterfaceIndex(int interfaceIndex); |
| 42 | |
| 43 | /** |
mohamed rahil | 8ea09d4 | 2016-04-19 20:47:21 +0530 | [diff] [blame] | 44 | * Returns the interface IP address. |
| 45 | * |
| 46 | * @return interface IP address |
| 47 | */ |
| 48 | Ip4Address interfaceIpAddress(); |
| 49 | |
| 50 | /** |
| 51 | * Sets the interface IP address. |
| 52 | * |
| 53 | * @param interfaceIpAddress interface IP address interface IP address |
| 54 | */ |
| 55 | void setInterfaceIpAddress(Ip4Address interfaceIpAddress); |
| 56 | |
| 57 | /** |
| 58 | * Returns the network mask. |
| 59 | * |
| 60 | * @return network mask |
| 61 | */ |
| 62 | byte[] networkMask(); |
| 63 | |
| 64 | /** |
| 65 | * Sets the network mask. |
| 66 | * |
| 67 | * @param networkMask network mask |
| 68 | */ |
| 69 | void setNetworkMask(byte[] networkMask); |
| 70 | |
| 71 | /** |
| 72 | * Sets the interface MAC address. |
| 73 | * |
| 74 | * @param interfaceMacAddress interface MAC address |
| 75 | */ |
| 76 | void setInterfaceMacAddress(MacAddress interfaceMacAddress); |
| 77 | |
| 78 | /** |
| 79 | * Returns the neighbors list. |
| 80 | * |
| 81 | * @return neighbors list |
| 82 | */ |
| 83 | Set<MacAddress> neighbors(); |
| 84 | |
| 85 | /** |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 86 | * Sets intermediate system name. |
| 87 | * |
| 88 | * @param intermediateSystemName intermediate system name |
| 89 | */ |
| 90 | void setIntermediateSystemName(String intermediateSystemName); |
| 91 | |
| 92 | /** |
mohamed rahil | 8ea09d4 | 2016-04-19 20:47:21 +0530 | [diff] [blame] | 93 | * Returns system ID. |
| 94 | * |
| 95 | * @return systemID system ID |
| 96 | */ |
| 97 | String systemId(); |
| 98 | |
| 99 | /** |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 100 | * Sets system ID. |
| 101 | * |
| 102 | * @param systemId system ID |
| 103 | */ |
| 104 | void setSystemId(String systemId); |
| 105 | |
| 106 | /** |
mohamed rahil | 8ea09d4 | 2016-04-19 20:47:21 +0530 | [diff] [blame] | 107 | * Returns LAN ID. |
| 108 | * |
| 109 | * @return LAN ID |
| 110 | */ |
| 111 | String l1LanId(); |
| 112 | |
| 113 | /** |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 114 | * Sets LAN ID. |
| 115 | * |
| 116 | * @param lanId LAN ID |
| 117 | */ |
mohamed rahil | 8ea09d4 | 2016-04-19 20:47:21 +0530 | [diff] [blame] | 118 | void setL1LanId(String lanId); |
| 119 | |
| 120 | /** |
| 121 | * Returns LAN ID. |
| 122 | * |
| 123 | * @return LAN ID |
| 124 | */ |
| 125 | String l2LanId(); |
| 126 | |
| 127 | /** |
| 128 | * Sets LAN ID. |
| 129 | * |
| 130 | * @param lanId LAN ID |
| 131 | */ |
| 132 | void setL2LanId(String lanId); |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 133 | |
| 134 | /** |
| 135 | * Sets ID length. |
| 136 | * |
| 137 | * @param idLength ID length |
| 138 | */ |
| 139 | void setIdLength(int idLength); |
| 140 | |
| 141 | /** |
| 142 | * Sets max area addresses. |
| 143 | * |
| 144 | * @param maxAreaAddresses max area addresses |
| 145 | */ |
| 146 | void setMaxAreaAddresses(int maxAreaAddresses); |
| 147 | |
| 148 | /** |
mohamed rahil | 8ea09d4 | 2016-04-19 20:47:21 +0530 | [diff] [blame] | 149 | * Returns reserved packet circuit type. |
| 150 | * |
| 151 | * @return reserved packet circuit type |
| 152 | */ |
| 153 | int reservedPacketCircuitType(); |
| 154 | |
| 155 | /** |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 156 | * Sets reserved packet circuit type. |
| 157 | * |
| 158 | * @param reservedPacketCircuitType reserved packet circuit type |
| 159 | */ |
| 160 | void setReservedPacketCircuitType(int reservedPacketCircuitType); |
| 161 | |
| 162 | /** |
mohamed rahil | 8ea09d4 | 2016-04-19 20:47:21 +0530 | [diff] [blame] | 163 | * Returns point to point or broadcast. |
| 164 | * |
| 165 | * @return 1 if point to point, 2 broadcast |
| 166 | */ |
| 167 | IsisNetworkType networkType(); |
| 168 | |
| 169 | /** |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 170 | * Sets point to point. |
| 171 | * |
mohamed rahil | 8ea09d4 | 2016-04-19 20:47:21 +0530 | [diff] [blame] | 172 | * @param networkType point to point |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 173 | */ |
mohamed rahil | 8ea09d4 | 2016-04-19 20:47:21 +0530 | [diff] [blame] | 174 | void setNetworkType(IsisNetworkType networkType); |
| 175 | |
| 176 | /** |
| 177 | * Returns area address. |
| 178 | * |
| 179 | * @return area address |
| 180 | */ |
| 181 | String areaAddress(); |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 182 | |
| 183 | /** |
| 184 | * Sets area address. |
| 185 | * |
| 186 | * @param areaAddress area address |
| 187 | */ |
| 188 | void setAreaAddress(String areaAddress); |
| 189 | |
| 190 | /** |
| 191 | * Sets area length. |
| 192 | * |
| 193 | * @param areaLength area length |
| 194 | */ |
| 195 | void setAreaLength(int areaLength); |
| 196 | |
| 197 | /** |
mohamed rahil | 8ea09d4 | 2016-04-19 20:47:21 +0530 | [diff] [blame] | 198 | * Returns holding time. |
| 199 | * |
| 200 | * @return holding time |
| 201 | */ |
| 202 | int holdingTime(); |
| 203 | |
| 204 | /** |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 205 | * Sets holding time. |
| 206 | * |
| 207 | * @param holdingTime holding time |
| 208 | */ |
| 209 | void setHoldingTime(int holdingTime); |
| 210 | |
| 211 | /** |
mohamed rahil | 8ea09d4 | 2016-04-19 20:47:21 +0530 | [diff] [blame] | 212 | * Returns priority. |
| 213 | * |
| 214 | * @return priority |
| 215 | */ |
| 216 | int priority(); |
| 217 | |
| 218 | /** |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 219 | * Sets priority. |
| 220 | * |
| 221 | * @param priority priority |
| 222 | */ |
| 223 | void setPriority(int priority); |
| 224 | |
| 225 | /** |
tejeshwer degala | 3fe1ed5 | 2016-04-22 17:04:01 +0530 | [diff] [blame] | 226 | * Returns hello interval. |
| 227 | * |
| 228 | * @return hello interval |
| 229 | */ |
| 230 | public int helloInterval(); |
| 231 | |
| 232 | /** |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 233 | * Sets hello interval. |
| 234 | * |
| 235 | * @param helloInterval hello interval |
| 236 | */ |
| 237 | void setHelloInterval(int helloInterval); |
mohamed rahil | 8ea09d4 | 2016-04-19 20:47:21 +0530 | [diff] [blame] | 238 | |
| 239 | /** |
| 240 | * Starts the hello timer which sends hello packet every configured seconds. |
| 241 | * |
| 242 | * @param channel netty channel instance |
| 243 | */ |
| 244 | void startHelloSender(Channel channel); |
| 245 | |
| 246 | /** |
sunish vk | 4b5ce00 | 2016-05-09 20:18:35 +0530 | [diff] [blame] | 247 | * Stops the hello timer which sends hello packet every configured seconds. |
| 248 | */ |
| 249 | void stopHelloSender(); |
| 250 | |
| 251 | /** |
mohamed rahil | 8ea09d4 | 2016-04-19 20:47:21 +0530 | [diff] [blame] | 252 | * Processes an ISIS message which is received on this interface. |
| 253 | * |
| 254 | * @param isisMessage ISIS message instance |
| 255 | * @param isisLsdb ISIS LSDB instance |
| 256 | * @param channel channel instance |
| 257 | */ |
| 258 | void processIsisMessage(IsisMessage isisMessage, IsisLsdb isisLsdb, Channel channel); |
| 259 | |
| 260 | /** |
| 261 | * Returns the interface state. |
| 262 | * |
| 263 | * @return interface state |
| 264 | */ |
| 265 | IsisInterfaceState interfaceState(); |
| 266 | |
| 267 | /** |
| 268 | * Sets the interface state. |
| 269 | * |
| 270 | * @param interfaceState the interface state |
| 271 | */ |
| 272 | void setInterfaceState(IsisInterfaceState interfaceState); |
| 273 | |
| 274 | /** |
| 275 | * Returns the LSDB instance. |
| 276 | * |
| 277 | * @return LSDB instance |
| 278 | */ |
| 279 | IsisLsdb isisLsdb(); |
| 280 | |
| 281 | /** |
| 282 | * Returns intermediate system name. |
| 283 | * |
| 284 | * @return intermediate system name |
| 285 | */ |
| 286 | String intermediateSystemName(); |
| 287 | |
| 288 | /** |
| 289 | * Returns the ISIS neighbor instance if exists. |
| 290 | * |
| 291 | * @param isisNeighborMac mac address of the neighbor router |
| 292 | * @return ISIS neighbor instance if exists else null |
| 293 | */ |
| 294 | IsisNeighbor lookup(MacAddress isisNeighborMac); |
| 295 | |
| 296 | /** |
| 297 | * Returns circuit ID. |
| 298 | * |
| 299 | * @return circuit ID |
| 300 | */ |
| 301 | String circuitId(); |
| 302 | |
| 303 | /** |
| 304 | * Sets circuit ID. |
| 305 | * |
| 306 | * @param circuitId circuit ID |
| 307 | */ |
| 308 | void setCircuitId(String circuitId); |
tejeshwer degala | 3fe1ed5 | 2016-04-22 17:04:01 +0530 | [diff] [blame] | 309 | |
| 310 | /** |
| 311 | * Removes neighbor from the interface neighbor map. |
| 312 | * |
| 313 | * @param isisNeighbor ISIS neighbor instance |
| 314 | */ |
| 315 | void removeNeighbor(IsisNeighbor isisNeighbor); |
sunish vk | 4b5ce00 | 2016-05-09 20:18:35 +0530 | [diff] [blame] | 316 | |
| 317 | /** |
| 318 | * Removes all the neighbors. |
| 319 | */ |
| 320 | void removeNeighbors(); |
sunish vk | 7bdf4d4 | 2016-06-24 12:29:43 +0530 | [diff] [blame] | 321 | } |