sunish vk | 30637eb | 2016-02-16 15:19:32 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
sunish vk | 30637eb | 2016-02-16 15:19:32 +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.ospf.controller; |
| 17 | |
| 18 | import org.jboss.netty.channel.Channel; |
| 19 | import org.onlab.packet.Ip4Address; |
| 20 | |
| 21 | import java.util.Map; |
| 22 | |
| 23 | /** |
| 24 | * Represents an OSPF neighbor. |
| 25 | */ |
| 26 | public interface OspfNbr { |
| 27 | |
| 28 | /** |
| 29 | * Gets neighbor's id. |
| 30 | * |
| 31 | * @return neighbor's id |
| 32 | */ |
| 33 | public Ip4Address neighborId(); |
| 34 | |
| 35 | /** |
| 36 | * Gets router priority. |
| 37 | * |
| 38 | * @return router priority |
| 39 | */ |
| 40 | public int routerPriority(); |
| 41 | |
| 42 | /** |
| 43 | * Gets the IP address of this neighbor. |
| 44 | * |
| 45 | * @return the IP address of this neighbor |
| 46 | */ |
| 47 | public Ip4Address neighborIpAddr(); |
| 48 | |
| 49 | /** |
| 50 | * Gets the neighbor's DR address. |
| 51 | * |
| 52 | * @return neighbor's DR address |
| 53 | */ |
| 54 | public Ip4Address neighborDr(); |
| 55 | |
| 56 | /** |
| 57 | * Gets the neighbor's BDR address. |
| 58 | * |
| 59 | * @return neighbor's BDR address |
| 60 | */ |
| 61 | Ip4Address neighborBdr(); |
| 62 | |
| 63 | /** |
| 64 | * Determines whether an adjacency should be established/maintained with the neighbor. |
| 65 | * |
| 66 | * @param ch netty channel instance |
| 67 | */ |
| 68 | void adjOk(Channel ch); |
| 69 | |
| 70 | /** |
| 71 | * Gets the pending re transmit list as a map. |
| 72 | * |
| 73 | * @return pending re transmit list as a map |
| 74 | */ |
| 75 | Map<String, OspfLsa> getPendingReTxList(); |
| 76 | |
| 77 | /** |
| 78 | * Sets the neighbor's id. |
| 79 | * |
| 80 | * @param neighborId neighbor's id |
| 81 | */ |
| 82 | void setNeighborId(Ip4Address neighborId); |
| 83 | |
| 84 | /** |
| 85 | * Sets the neighbor's BDR address. |
| 86 | * |
| 87 | * @param neighborBdr neighbor's BDR address |
| 88 | */ |
| 89 | void setNeighborBdr(Ip4Address neighborBdr); |
| 90 | |
| 91 | /** |
| 92 | * Sets the neighbor's DR address. |
| 93 | * |
| 94 | * @param neighborDr neighbor's DR address |
| 95 | */ |
| 96 | void setNeighborDr(Ip4Address neighborDr); |
| 97 | |
| 98 | /** |
| 99 | * Sets router priority. |
| 100 | * |
| 101 | * @param routerPriority router priority |
| 102 | */ |
| 103 | void setRouterPriority(int routerPriority); |
| 104 | |
| 105 | /** |
| 106 | * Sets the neighbor is opaque enabled or not. |
| 107 | * |
| 108 | * @param isOpaqueCapable true if the neighbor is opaque enabled else false |
| 109 | */ |
| 110 | void setIsOpaqueCapable(boolean isOpaqueCapable); |
| 111 | |
| 112 | /** |
| 113 | * Sets neighbor is master or not. |
| 114 | * |
| 115 | * @param isMaster neighbor is master or not |
| 116 | */ |
| 117 | void setIsMaster(int isMaster); |
| 118 | |
| 119 | /** |
| 120 | * Gets the DD sequence number. |
| 121 | * |
| 122 | * @return DD sequence number |
| 123 | */ |
| 124 | long ddSeqNum(); |
| 125 | |
| 126 | /** |
| 127 | * Sets the DD sequence number. |
| 128 | * |
| 129 | * @param ddSeqNum DD sequence number |
| 130 | */ |
| 131 | void setDdSeqNum(long ddSeqNum); |
| 132 | |
| 133 | /** |
| 134 | * Gets neighbor is master or not. |
| 135 | * |
| 136 | * @return true if neighbor is master else false |
| 137 | */ |
| 138 | int isMaster(); |
| 139 | |
| 140 | /** |
| 141 | * Gets the options value. |
| 142 | * |
| 143 | * @return options value |
| 144 | */ |
| 145 | int options(); |
| 146 | |
| 147 | /** |
| 148 | * Sets the options value. |
| 149 | * |
| 150 | * @param options options value |
| 151 | */ |
| 152 | void setOptions(int options); |
| 153 | |
| 154 | /** |
| 155 | * An invalid request for LSA has been received. |
| 156 | * This indicates an error in the Database Exchange process. Actions to be performed |
| 157 | * are the same as in seqNumMismatch. In addition, stop the possibly activated |
| 158 | * retransmission timer. |
| 159 | * |
| 160 | * @param ch netty channel instance |
| 161 | * @throws Exception might throw exception |
| 162 | */ |
| 163 | void badLSReq(Channel ch) throws Exception; |
| 164 | |
| 165 | /** |
| 166 | * Gets the LS request list. |
| 167 | * |
| 168 | * @return LS request list |
| 169 | */ |
| 170 | Map getLsReqList(); |
| 171 | |
| 172 | /** |
| 173 | * Gets the reTxList instance. |
| 174 | * |
| 175 | * @return reTxList instance |
| 176 | */ |
| 177 | Map getReTxList(); |
| 178 | |
| 179 | /** |
| 180 | * Gets if the neighbor is opaque enabled or not. |
| 181 | * |
| 182 | * @return true if the neighbor is opaque enabled else false. |
| 183 | */ |
| 184 | public boolean isOpaqueCapable(); |
| 185 | |
| 186 | /** |
| 187 | * Gets the neighbor's state. |
| 188 | * |
| 189 | * @return neighbor's state |
| 190 | */ |
| 191 | OspfNeighborState getState(); |
sunishvk | f7c5655 | 2016-07-18 16:02:39 +0530 | [diff] [blame^] | 192 | |
| 193 | /** |
| 194 | * Starts the inactivity timer. |
| 195 | */ |
| 196 | void startInactivityTimeCheck(); |
| 197 | |
| 198 | /** |
| 199 | * Stops the inactivity timer. |
| 200 | */ |
| 201 | void stopInactivityTimeCheck(); |
| 202 | |
| 203 | /** |
| 204 | * Sets router dead interval. |
| 205 | * |
| 206 | * @param routerDeadInterval router dead interval |
| 207 | */ |
| 208 | void setRouterDeadInterval(int routerDeadInterval); |
| 209 | |
| 210 | /** |
| 211 | * Stops the flooding timer. |
| 212 | */ |
| 213 | void stopFloodingTimer(); |
| 214 | |
| 215 | /** |
| 216 | * Stops the Dd Retransmission executor task. |
| 217 | */ |
| 218 | void stopRxMtDdTimer(); |
| 219 | |
| 220 | /** |
| 221 | * Stops Ls request retransmission executor task. |
| 222 | */ |
| 223 | void stopRxMtLsrTimer(); |
sunish vk | 30637eb | 2016-02-16 15:19:32 +0530 | [diff] [blame] | 224 | } |