blob: 3ac712299fc000a19ba39ee53b2c0d56c50d9214 [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 /**
198 * Sets link state packet ID.
199 *
200 * @param lspId link state packet ID
201 */
202 void setLspId(String lspId);
203
204 /**
mohamed rahil8ea09d42016-04-19 20:47:21 +0530205 * Returns holding time.
206 *
207 * @return holding time
208 */
209 int holdingTime();
210
211 /**
Kiran Ramachandrac92a1222016-03-30 13:05:31 +0530212 * Sets holding time.
213 *
214 * @param holdingTime holding time
215 */
216 void setHoldingTime(int holdingTime);
217
218 /**
mohamed rahil8ea09d42016-04-19 20:47:21 +0530219 * Returns priority.
220 *
221 * @return priority
222 */
223 int priority();
224
225 /**
Kiran Ramachandrac92a1222016-03-30 13:05:31 +0530226 * Sets priority.
227 *
228 * @param priority priority
229 */
230 void setPriority(int priority);
231
232 /**
tejeshwer degala3fe1ed52016-04-22 17:04:01 +0530233 * Returns hello interval.
234 *
235 * @return hello interval
236 */
237 public int helloInterval();
238
239 /**
Kiran Ramachandrac92a1222016-03-30 13:05:31 +0530240 * Sets hello interval.
241 *
242 * @param helloInterval hello interval
243 */
244 void setHelloInterval(int helloInterval);
mohamed rahil8ea09d42016-04-19 20:47:21 +0530245
246 /**
247 * Starts the hello timer which sends hello packet every configured seconds.
248 *
249 * @param channel netty channel instance
250 */
251 void startHelloSender(Channel channel);
252
253 /**
254 * Processes an ISIS message which is received on this interface.
255 *
256 * @param isisMessage ISIS message instance
257 * @param isisLsdb ISIS LSDB instance
258 * @param channel channel instance
259 */
260 void processIsisMessage(IsisMessage isisMessage, IsisLsdb isisLsdb, Channel channel);
261
262 /**
263 * Returns the interface state.
264 *
265 * @return interface state
266 */
267 IsisInterfaceState interfaceState();
268
269 /**
270 * Sets the interface state.
271 *
272 * @param interfaceState the interface state
273 */
274 void setInterfaceState(IsisInterfaceState interfaceState);
275
276 /**
277 * Returns the LSDB instance.
278 *
279 * @return LSDB instance
280 */
281 IsisLsdb isisLsdb();
282
283 /**
284 * Returns intermediate system name.
285 *
286 * @return intermediate system name
287 */
288 String intermediateSystemName();
289
290 /**
291 * Returns the ISIS neighbor instance if exists.
292 *
293 * @param isisNeighborMac mac address of the neighbor router
294 * @return ISIS neighbor instance if exists else null
295 */
296 IsisNeighbor lookup(MacAddress isisNeighborMac);
297
298 /**
299 * Returns circuit ID.
300 *
301 * @return circuit ID
302 */
303 String circuitId();
304
305 /**
306 * Sets circuit ID.
307 *
308 * @param circuitId circuit ID
309 */
310 void setCircuitId(String circuitId);
tejeshwer degala3fe1ed52016-04-22 17:04:01 +0530311
312 /**
313 * Removes neighbor from the interface neighbor map.
314 *
315 * @param isisNeighbor ISIS neighbor instance
316 */
317 void removeNeighbor(IsisNeighbor isisNeighbor);
mohamed rahil8ea09d42016-04-19 20:47:21 +0530318}