blob: 9a62fad547abdc24909db187004c14b2b9c6cf29 [file] [log] [blame]
sunish vk30637eb2016-02-16 15:19:32 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
sunish vk30637eb2016-02-16 15:19:32 +05303 *
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 */
16package org.onosproject.ospf.controller;
17
18import org.jboss.netty.channel.Channel;
19import org.onlab.packet.Ip4Address;
20
21import java.util.Map;
22
23/**
24 * Represents an OSPF neighbor.
25 */
26public 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
sunish vk30637eb2016-02-16 15:19:32 +0530161 */
Ray Milkey019fba42018-01-31 14:07:47 -0800162 void badLSReq(Channel ch);
sunish vk30637eb2016-02-16 15:19:32 +0530163
164 /**
165 * Gets the LS request list.
166 *
167 * @return LS request list
168 */
169 Map getLsReqList();
170
171 /**
172 * Gets the reTxList instance.
173 *
174 * @return reTxList instance
175 */
176 Map getReTxList();
177
178 /**
179 * Gets if the neighbor is opaque enabled or not.
180 *
181 * @return true if the neighbor is opaque enabled else false.
182 */
183 public boolean isOpaqueCapable();
184
185 /**
186 * Gets the neighbor's state.
187 *
188 * @return neighbor's state
189 */
190 OspfNeighborState getState();
sunishvkf7c56552016-07-18 16:02:39 +0530191
192 /**
193 * Starts the inactivity timer.
194 */
195 void startInactivityTimeCheck();
196
197 /**
198 * Stops the inactivity timer.
199 */
200 void stopInactivityTimeCheck();
201
202 /**
203 * Sets router dead interval.
204 *
205 * @param routerDeadInterval router dead interval
206 */
207 void setRouterDeadInterval(int routerDeadInterval);
208
209 /**
210 * Stops the flooding timer.
211 */
212 void stopFloodingTimer();
213
214 /**
215 * Stops the Dd Retransmission executor task.
216 */
217 void stopRxMtDdTimer();
218
219 /**
220 * Stops Ls request retransmission executor task.
221 */
222 void stopRxMtLsrTimer();
sunish vk30637eb2016-02-16 15:19:32 +0530223}