blob: d80c208f94e363c8cba555a494d42005b76aa14a [file] [log] [blame]
Kiran Ramachandrac92a1222016-03-30 13:05:31 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Kiran Ramachandrac92a1222016-03-30 13:05:31 +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.isis.controller;
17
mohamed rahil8ea09d42016-04-19 20:47:21 +053018import org.jboss.netty.channel.Channel;
19import org.onlab.packet.Ip4Address;
20import org.onlab.packet.MacAddress;
21
22import java.util.Set;
23
Kiran Ramachandrac92a1222016-03-30 13:05:31 +053024/**
25 * Representation of an ISIS interface.
26 */
27public interface IsisInterface {
28
29 /**
mohamed rahil8ea09d42016-04-19 20:47:21 +053030 * Returns interface index.
31 *
32 * @return interface index
33 */
34 int interfaceIndex();
35
36 /**
Kiran Ramachandrac92a1222016-03-30 13:05:31 +053037 * Sets interface index.
38 *
39 * @param interfaceIndex interface index
40 */
41 void setInterfaceIndex(int interfaceIndex);
42
43 /**
mohamed rahil8ea09d42016-04-19 20:47:21 +053044 * 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 Ramachandrac92a1222016-03-30 13:05:31 +053086 * Sets intermediate system name.
87 *
88 * @param intermediateSystemName intermediate system name
89 */
90 void setIntermediateSystemName(String intermediateSystemName);
91
92 /**
mohamed rahil8ea09d42016-04-19 20:47:21 +053093 * Returns system ID.
94 *
95 * @return systemID system ID
96 */
97 String systemId();
98
99 /**
Kiran Ramachandrac92a1222016-03-30 13:05:31 +0530100 * Sets system ID.
101 *
102 * @param systemId system ID
103 */
104 void setSystemId(String systemId);
105
106 /**
mohamed rahil8ea09d42016-04-19 20:47:21 +0530107 * Returns LAN ID.
108 *
109 * @return LAN ID
110 */
111 String l1LanId();
112
113 /**
Kiran Ramachandrac92a1222016-03-30 13:05:31 +0530114 * Sets LAN ID.
115 *
116 * @param lanId LAN ID
117 */
mohamed rahil8ea09d42016-04-19 20:47:21 +0530118 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 Ramachandrac92a1222016-03-30 13:05:31 +0530133
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 rahil8ea09d42016-04-19 20:47:21 +0530149 * Returns reserved packet circuit type.
150 *
151 * @return reserved packet circuit type
152 */
153 int reservedPacketCircuitType();
154
155 /**
Kiran Ramachandrac92a1222016-03-30 13:05:31 +0530156 * Sets reserved packet circuit type.
157 *
158 * @param reservedPacketCircuitType reserved packet circuit type
159 */
160 void setReservedPacketCircuitType(int reservedPacketCircuitType);
161
162 /**
mohamed rahil8ea09d42016-04-19 20:47:21 +0530163 * Returns point to point or broadcast.
164 *
165 * @return 1 if point to point, 2 broadcast
166 */
167 IsisNetworkType networkType();
168
169 /**
Kiran Ramachandrac92a1222016-03-30 13:05:31 +0530170 * Sets point to point.
171 *
mohamed rahil8ea09d42016-04-19 20:47:21 +0530172 * @param networkType point to point
Kiran Ramachandrac92a1222016-03-30 13:05:31 +0530173 */
mohamed rahil8ea09d42016-04-19 20:47:21 +0530174 void setNetworkType(IsisNetworkType networkType);
175
176 /**
177 * Returns area address.
178 *
179 * @return area address
180 */
181 String areaAddress();
Kiran Ramachandrac92a1222016-03-30 13:05:31 +0530182
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 rahil8ea09d42016-04-19 20:47:21 +0530198 * Returns holding time.
199 *
200 * @return holding time
201 */
202 int holdingTime();
203
204 /**
Kiran Ramachandrac92a1222016-03-30 13:05:31 +0530205 * Sets holding time.
206 *
207 * @param holdingTime holding time
208 */
209 void setHoldingTime(int holdingTime);
210
211 /**
mohamed rahil8ea09d42016-04-19 20:47:21 +0530212 * Returns priority.
213 *
214 * @return priority
215 */
216 int priority();
217
218 /**
Kiran Ramachandrac92a1222016-03-30 13:05:31 +0530219 * Sets priority.
220 *
221 * @param priority priority
222 */
223 void setPriority(int priority);
224
225 /**
tejeshwer degala3fe1ed52016-04-22 17:04:01 +0530226 * Returns hello interval.
227 *
228 * @return hello interval
229 */
230 public int helloInterval();
231
232 /**
Kiran Ramachandrac92a1222016-03-30 13:05:31 +0530233 * Sets hello interval.
234 *
235 * @param helloInterval hello interval
236 */
237 void setHelloInterval(int helloInterval);
mohamed rahil8ea09d42016-04-19 20:47:21 +0530238
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 vk4b5ce002016-05-09 20:18:35 +0530247 * Stops the hello timer which sends hello packet every configured seconds.
248 */
249 void stopHelloSender();
250
251 /**
mohamed rahil8ea09d42016-04-19 20:47:21 +0530252 * 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 degala3fe1ed52016-04-22 17:04:01 +0530309
310 /**
311 * Removes neighbor from the interface neighbor map.
312 *
313 * @param isisNeighbor ISIS neighbor instance
314 */
315 void removeNeighbor(IsisNeighbor isisNeighbor);
sunish vk4b5ce002016-05-09 20:18:35 +0530316
317 /**
318 * Removes all the neighbors.
319 */
320 void removeNeighbors();
sunish vk7bdf4d42016-06-24 12:29:43 +0530321}