blob: ca5befbd9e35def2c1db4c24200421637456b30c [file] [log] [blame]
jardineb5d44e2003-12-23 08:09:43 +00001/*
2 * IS-IS Rout(e)ing protocol - isis_circuit.h
3 *
4 * Copyright (C) 2001,2002 Sampo Saaristo
5 * Tampere University of Technology
6 * Institute of Communications Engineering
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public Licenseas published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
17
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 */
22#include <stdlib.h>
23#include <stdio.h>
24#include <ctype.h>
25#include <zebra.h>
hasso37da8c02004-05-19 11:38:40 +000026#ifdef GNU_LINUX
jardineb5d44e2003-12-23 08:09:43 +000027#include <net/ethernet.h>
hasso37da8c02004-05-19 11:38:40 +000028#else
29#include <netinet/if_ether.h>
30#endif
jardineb5d44e2003-12-23 08:09:43 +000031
32#include "log.h"
33#include "memory.h"
34#include "if.h"
35#include "linklist.h"
36#include "command.h"
37#include "thread.h"
38#include "hash.h"
39#include "prefix.h"
40#include "stream.h"
41
42#include "isisd/dict.h"
43#include "isisd/include-netbsd/iso.h"
44#include "isisd/isis_constants.h"
45#include "isisd/isis_common.h"
46#include "isisd/isis_circuit.h"
47#include "isisd/isis_tlv.h"
48#include "isisd/isis_lsp.h"
49#include "isisd/isis_pdu.h"
50#include "isisd/isis_network.h"
51#include "isisd/isis_misc.h"
52#include "isisd/isis_constants.h"
53#include "isisd/isis_adjacency.h"
54#include "isisd/isis_dr.h"
55#include "isisd/isis_flags.h"
56#include "isisd/isisd.h"
57#include "isisd/isis_csm.h"
58#include "isisd/isis_events.h"
59
60extern struct thread_master *master;
61extern struct isis *isis;
62
63struct isis_circuit *
64isis_circuit_new ()
65{
66 struct isis_circuit *circuit;
67 int i;
68
69 circuit = XMALLOC (MTYPE_ISIS_CIRCUIT, sizeof (struct isis_circuit));
hassof390d2c2004-09-10 20:48:21 +000070 if (circuit)
71 {
72 memset (circuit, 0, sizeof (struct isis_circuit));
73 /* set default metrics for circuit */
74 for (i = 0; i < 2; i++)
75 {
76 circuit->metrics[i].metric_default = DEFAULT_CIRCUIT_METRICS;
77 circuit->metrics[i].metric_expense = METRICS_UNSUPPORTED;
78 circuit->metrics[i].metric_error = METRICS_UNSUPPORTED;
79 circuit->metrics[i].metric_delay = METRICS_UNSUPPORTED;
80 }
jardineb5d44e2003-12-23 08:09:43 +000081 }
hassof390d2c2004-09-10 20:48:21 +000082 else
83 {
84 zlog_err ("Can't malloc isis circuit");
85 return NULL;
86 }
87
jardineb5d44e2003-12-23 08:09:43 +000088 return circuit;
89}
90
jardineb5d44e2003-12-23 08:09:43 +000091void
92isis_circuit_configure (struct isis_circuit *circuit, struct isis_area *area)
93{
94 int i;
95 circuit->area = area;
96 /*
97 * The level for the circuit is same as for the area, unless configured
98 * otherwise.
99 */
100 circuit->circuit_is_type = area->is_type;
101 /*
102 * Default values
103 */
hassof390d2c2004-09-10 20:48:21 +0000104 for (i = 0; i < 2; i++)
105 {
106 circuit->hello_interval[i] = HELLO_INTERVAL;
107 circuit->hello_multiplier[i] = HELLO_MULTIPLIER;
108 circuit->csnp_interval[i] = CSNP_INTERVAL;
109 circuit->psnp_interval[i] = PSNP_INTERVAL;
110 circuit->u.bc.priority[i] = DEFAULT_PRIORITY;
111 }
112 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
113 {
114 circuit->u.bc.adjdb[0] = list_new ();
115 circuit->u.bc.adjdb[1] = list_new ();
116 circuit->u.bc.pad_hellos = 1;
117 }
jardineb5d44e2003-12-23 08:09:43 +0000118 circuit->lsp_interval = LSP_INTERVAL;
119
120 /*
121 * Add the circuit into area
122 */
123 listnode_add (area->circuit_list, circuit);
124
125 circuit->idx = flags_get_index (&area->flags);
126 circuit->lsp_queue = list_new ();
127
128 return;
129}
130
hassof390d2c2004-09-10 20:48:21 +0000131void
jardineb5d44e2003-12-23 08:09:43 +0000132isis_circuit_deconfigure (struct isis_circuit *circuit,
hassof390d2c2004-09-10 20:48:21 +0000133 struct isis_area *area)
jardineb5d44e2003-12-23 08:09:43 +0000134{
hassof390d2c2004-09-10 20:48:21 +0000135
jardineb5d44e2003-12-23 08:09:43 +0000136 /* Remove circuit from area */
137 listnode_delete (area->circuit_list, circuit);
138 /* Free the index of SRM and SSN flags */
139 flags_free_index (&area->flags, circuit->idx);
140
141 return;
142}
143
144struct isis_circuit *
145circuit_lookup_by_ifp (struct interface *ifp, struct list *list)
146{
147 struct isis_circuit *circuit = NULL;
148 struct listnode *node;
hassof390d2c2004-09-10 20:48:21 +0000149
jardineb5d44e2003-12-23 08:09:43 +0000150 if (!list)
151 return NULL;
hassof390d2c2004-09-10 20:48:21 +0000152
153 for (node = listhead (list); node; nextnode (node))
154 {
155 circuit = getdata (node);
156 if (circuit->interface == ifp)
157 return circuit;
158 }
159
jardineb5d44e2003-12-23 08:09:43 +0000160 return NULL;
161}
162
163struct isis_circuit *
164circuit_scan_by_ifp (struct interface *ifp)
165{
166 struct isis_area *area;
167 struct listnode *node;
168 struct isis_circuit *circuit;
169
170 if (!isis->area_list)
171 return NULL;
172
hassof390d2c2004-09-10 20:48:21 +0000173 for (node = listhead (isis->area_list); node; nextnode (node))
174 {
175 area = getdata (node);
176 circuit = circuit_lookup_by_ifp (ifp, area->circuit_list);
177 if (circuit)
178 return circuit;
179 }
180
jardineb5d44e2003-12-23 08:09:43 +0000181 return circuit_lookup_by_ifp (ifp, isis->init_circ_list);
182}
183
184void
185isis_circuit_del (struct isis_circuit *circuit)
186{
187
188 if (!circuit)
189 return;
190
hassof390d2c2004-09-10 20:48:21 +0000191 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
192 {
193 /* destroy adjacency databases */
hasso46606872004-12-29 19:34:22 +0000194 if (circuit->u.bc.adjdb[0])
195 list_delete (circuit->u.bc.adjdb[0]);
196 if (circuit->u.bc.adjdb[1])
197 list_delete (circuit->u.bc.adjdb[1]);
hassof390d2c2004-09-10 20:48:21 +0000198 /* destroy neighbour lists */
199 if (circuit->u.bc.lan_neighs[0])
200 list_delete (circuit->u.bc.lan_neighs[0]);
201 if (circuit->u.bc.lan_neighs[1])
202 list_delete (circuit->u.bc.lan_neighs[1]);
203 /* destroy addresses */
204 }
jardineb5d44e2003-12-23 08:09:43 +0000205 if (circuit->ip_addrs)
206 list_delete (circuit->ip_addrs);
207#ifdef HAVE_IPV6
208 if (circuit->ipv6_link)
209 list_delete (circuit->ipv6_link);
210 if (circuit->ipv6_non_link)
211 list_delete (circuit->ipv6_non_link);
212#endif /* HAVE_IPV6 */
hassof390d2c2004-09-10 20:48:21 +0000213
jardineb5d44e2003-12-23 08:09:43 +0000214 /* and lastly the circuit itself */
215 XFREE (MTYPE_ISIS_CIRCUIT, circuit);
216
217 return;
218}
219
220void
hassof891f442004-09-14 13:54:30 +0000221isis_circuit_add_addr (struct isis_circuit *circuit,
222 struct connected *connected)
jardineb5d44e2003-12-23 08:09:43 +0000223{
224 struct prefix_ipv4 *ipv4;
hassof390d2c2004-09-10 20:48:21 +0000225 u_char buf[BUFSIZ];
jardineb5d44e2003-12-23 08:09:43 +0000226#ifdef HAVE_IPV6
227 struct prefix_ipv6 *ipv6;
228#endif /* HAVE_IPV6 */
hassof891f442004-09-14 13:54:30 +0000229
hassof390d2c2004-09-10 20:48:21 +0000230 if (!circuit->ip_addrs)
hassof891f442004-09-14 13:54:30 +0000231 circuit->ip_addrs = list_new ();
jardineb5d44e2003-12-23 08:09:43 +0000232#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000233 if (!circuit->ipv6_link)
hassof891f442004-09-14 13:54:30 +0000234 circuit->ipv6_link = list_new ();
hassof390d2c2004-09-10 20:48:21 +0000235 if (!circuit->ipv6_non_link)
hassof891f442004-09-14 13:54:30 +0000236 circuit->ipv6_non_link = list_new ();
jardineb5d44e2003-12-23 08:09:43 +0000237#endif /* HAVE_IPV6 */
238
239 memset (&buf, 0, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000240 if (connected->address->family == AF_INET)
hassof390d2c2004-09-10 20:48:21 +0000241 {
242 ipv4 = prefix_ipv4_new ();
hassof891f442004-09-14 13:54:30 +0000243 ipv4->prefixlen = connected->address->prefixlen;
244 ipv4->prefix = connected->address->u.prefix4;
hassof390d2c2004-09-10 20:48:21 +0000245 listnode_add (circuit->ip_addrs, ipv4);
hasso0dae85e2004-09-26 19:53:47 +0000246 if (circuit->area)
247 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000248
jardineb5d44e2003-12-23 08:09:43 +0000249#ifdef EXTREME_DEBUG
hassof891f442004-09-14 13:54:30 +0000250 prefix2str (connected->address, buf, BUFSIZ);
hasso529d65b2004-12-24 00:14:50 +0000251 zlog_debug ("Added IP address %s to circuit %d", buf,
hassof390d2c2004-09-10 20:48:21 +0000252 circuit->circuit_id);
253#endif /* EXTREME_DEBUG */
jardineb5d44e2003-12-23 08:09:43 +0000254 }
hassof390d2c2004-09-10 20:48:21 +0000255#ifdef HAVE_IPV6
hassof891f442004-09-14 13:54:30 +0000256 if (connected->address->family == AF_INET6)
hassof390d2c2004-09-10 20:48:21 +0000257 {
258 ipv6 = prefix_ipv6_new ();
hassof891f442004-09-14 13:54:30 +0000259 ipv6->prefixlen = connected->address->prefixlen;
260 ipv6->prefix = connected->address->u.prefix6;
261
hassof390d2c2004-09-10 20:48:21 +0000262 if (IN6_IS_ADDR_LINKLOCAL (&ipv6->prefix))
hassof891f442004-09-14 13:54:30 +0000263 listnode_add (circuit->ipv6_link, ipv6);
hassof390d2c2004-09-10 20:48:21 +0000264 else
hassof891f442004-09-14 13:54:30 +0000265 listnode_add (circuit->ipv6_non_link, ipv6);
hasso0dae85e2004-09-26 19:53:47 +0000266 if (circuit->area)
267 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000268
jardineb5d44e2003-12-23 08:09:43 +0000269#ifdef EXTREME_DEBUG
hassof891f442004-09-14 13:54:30 +0000270 prefix2str (connected->address, buf, BUFSIZ);
hasso529d65b2004-12-24 00:14:50 +0000271 zlog_debug ("Added IPv6 address %s to circuit %d", buf,
hassof390d2c2004-09-10 20:48:21 +0000272 circuit->circuit_id);
273#endif /* EXTREME_DEBUG */
274 }
jardineb5d44e2003-12-23 08:09:43 +0000275#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000276 return;
277}
278
279void
280isis_circuit_del_addr (struct isis_circuit *circuit,
hassof390d2c2004-09-10 20:48:21 +0000281 struct connected *connected)
jardineb5d44e2003-12-23 08:09:43 +0000282{
hassof891f442004-09-14 13:54:30 +0000283 struct prefix_ipv4 *ipv4, *ip = NULL;
284 struct listnode *node;
285 int found = 0;
286 u_char buf[BUFSIZ];
287#ifdef HAVE_IPV6
288 struct prefix_ipv6 *ipv6, *ip6 = NULL;
289#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000290
hassof891f442004-09-14 13:54:30 +0000291 memset (&buf, 0, BUFSIZ);
292 if (connected->address->family == AF_INET)
293 {
294 ipv4 = prefix_ipv4_new ();
295 ipv4->prefixlen = connected->address->prefixlen;
296 ipv4->prefix = connected->address->u.prefix4;
297
298 for (node = listhead (circuit->ip_addrs); node; nextnode (node))
299 {
300 ip = getdata (node);
301 if (prefix_same ((struct prefix *) ip, (struct prefix *) &ipv4))
302 break;
303 }
304
305 if (ip)
306 {
307 listnode_delete (circuit->ip_addrs, ip);
hasso0dae85e2004-09-26 19:53:47 +0000308 if (circuit->area)
309 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000310 }
311 else
312 {
hassof7c43dc2004-09-26 16:24:14 +0000313 prefix2str (connected->address, (char *)buf, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000314 zlog_warn("Nonexitant ip address %s removal attempt from circuit \
315 %d", buf, circuit->circuit_id);
316 }
317 }
318#ifdef HAVE_IPV6
319 if (connected->address->family == AF_INET6)
320 {
321 ipv6 = prefix_ipv6_new ();
322 ipv6->prefixlen = connected->address->prefixlen;
323 ipv6->prefix = connected->address->u.prefix6;
324
325 if (IN6_IS_ADDR_LINKLOCAL (&ipv6->prefix))
326 {
327 for (node = listhead (circuit->ipv6_link); node; nextnode (node))
328 {
329 ip6 = getdata (node);
330 if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6))
331 break;
332 }
333 if (ip6)
334 {
335 listnode_delete (circuit->ipv6_link, ip6);
336 found = 1;
337 }
338 }
339 else
340 {
341 for (node = listhead (circuit->ipv6_non_link); node; nextnode (node))
342 {
343 ip6 = getdata (node);
344 if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6))
345 break;
346 }
347 if (ip6)
348 {
349 listnode_delete (circuit->ipv6_non_link, ip6);
350 found = 1;
351 }
352 }
353
354 if (!found)
355 {
hassof7c43dc2004-09-26 16:24:14 +0000356 prefix2str (connected->address, (char *)buf, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000357 zlog_warn("Nonexitant ip address %s removal attempt from \
358 circuit %d", buf, circuit->circuit_id);
359 }
360 else
hasso0dae85e2004-09-26 19:53:47 +0000361 if (circuit->area)
362 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000363 }
364#endif /* HAVE_IPV6 */
365 return;
jardineb5d44e2003-12-23 08:09:43 +0000366}
367
368void
369isis_circuit_if_add (struct isis_circuit *circuit, struct interface *ifp)
370{
371 struct listnode *node;
372 struct connected *conn;
373
374 circuit->interface = ifp;
375 ifp->info = circuit;
hassof390d2c2004-09-10 20:48:21 +0000376
377 circuit->circuit_id = ifp->ifindex % 255; /* FIXME: Why not ? */
jardineb5d44e2003-12-23 08:09:43 +0000378
379 /* isis_circuit_update_addrs (circuit, ifp); */
380
hassof390d2c2004-09-10 20:48:21 +0000381 if (if_is_broadcast (ifp))
382 {
383 circuit->circ_type = CIRCUIT_T_BROADCAST;
384 /*
385 * Get the Hardware Address
386 */
jardineb5d44e2003-12-23 08:09:43 +0000387#ifdef HAVE_SOCKADDR_DL
hassof390d2c2004-09-10 20:48:21 +0000388 if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN)
389 zlog_warn ("unsupported link layer");
390 else
391 memcpy (circuit->u.bc.snpa, LLADDR (&circuit->interface->sdl),
392 ETH_ALEN);
jardineb5d44e2003-12-23 08:09:43 +0000393#else
hassof390d2c2004-09-10 20:48:21 +0000394 if (circuit->interface->hw_addr_len != ETH_ALEN)
395 {
396 zlog_warn ("unsupported link layer");
397 }
398 else
399 {
400 memcpy (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN);
401 }
jardineb5d44e2003-12-23 08:09:43 +0000402#ifdef EXTREME_DEGUG
hasso529d65b2004-12-24 00:14:50 +0000403 zlog_debug ("isis_circuit_if_add: if_id %d, isomtu %d snpa %s",
hassof390d2c2004-09-10 20:48:21 +0000404 circuit->interface->ifindex, ISO_MTU (circuit),
405 snpa_print (circuit->u.bc.snpa));
jardineb5d44e2003-12-23 08:09:43 +0000406
407#endif /* EXTREME_DEBUG */
hassof390d2c2004-09-10 20:48:21 +0000408#endif /* HAVE_SOCKADDR_DL */
409 }
410 else if (if_is_pointopoint (ifp))
411 {
412 circuit->circ_type = CIRCUIT_T_P2P;
413 }
414 else
415 {
416 zlog_warn ("isis_circuit_if_add: unsupported media");
417 }
418
419 for (node = ifp->connected ? listhead (ifp->connected) : NULL; node;
420 nextnode (node))
421 {
422 conn = getdata (node);
423 isis_circuit_add_addr (circuit, conn);
424 }
jardineb5d44e2003-12-23 08:09:43 +0000425
426 return;
427}
428
429void
hassof390d2c2004-09-10 20:48:21 +0000430isis_circuit_update_params (struct isis_circuit *circuit,
431 struct interface *ifp)
jardineb5d44e2003-12-23 08:09:43 +0000432{
hasso46606872004-12-29 19:34:22 +0000433 /* HT: It can happen at the moment during interface up event because we
434 * actually delete circuit during interface down event. Should be really
435 * cleaned up. TODO */
436 /* assert (circuit); */
437 if (!circuit)
438 return;
hassof390d2c2004-09-10 20:48:21 +0000439
440 if (circuit->circuit_id != ifp->ifindex)
441 {
442 zlog_warn ("changing circuit_id %d->%d", circuit->circuit_id,
443 ifp->ifindex);
444 circuit->circuit_id = ifp->ifindex % 255;
445 }
jardineb5d44e2003-12-23 08:09:43 +0000446
447 /* FIXME: Why is this needed? shouldn't we compare to the area's mtu */
448 /* Ofer, this was here in case someone changes the mtu (e.g. with ifconfig)
449 The areas MTU is the minimum of mtu's of circuits in the area
450 now we can't catch the change
451 if (circuit->mtu != ifp->mtu) {
452 zlog_warn ("changing circuit mtu %d->%d", circuit->mtu,
453 ifp->mtu);
454 circuit->mtu = ifp->mtu;
455 }
hassof390d2c2004-09-10 20:48:21 +0000456 */
jardineb5d44e2003-12-23 08:09:43 +0000457 /*
458 * Get the Hardware Address
459 */
460#ifdef HAVE_SOCKADDR_DL
461 if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN)
jardineb5d44e2003-12-23 08:09:43 +0000462 zlog_warn ("unsupported link layer");
hassof390d2c2004-09-10 20:48:21 +0000463 else
464 memcpy (circuit->u.bc.snpa, LLADDR (&circuit->interface->sdl), ETH_ALEN);
465#else
466 if (circuit->interface->hw_addr_len != ETH_ALEN)
467 {
468 zlog_warn ("unsupported link layer");
jardineb5d44e2003-12-23 08:09:43 +0000469 }
hassof390d2c2004-09-10 20:48:21 +0000470 else
471 {
472 if (memcmp (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN))
473 {
474 zlog_warn ("changing circuit snpa %s->%s",
475 snpa_print (circuit->u.bc.snpa),
476 snpa_print (circuit->interface->hw_addr));
477 }
478 }
479#endif
jardineb5d44e2003-12-23 08:09:43 +0000480
hassof390d2c2004-09-10 20:48:21 +0000481 if (if_is_broadcast (ifp))
482 {
483 circuit->circ_type = CIRCUIT_T_BROADCAST;
484 }
485 else if (if_is_pointopoint (ifp))
486 {
487 circuit->circ_type = CIRCUIT_T_P2P;
488 }
489 else
490 {
491 zlog_warn ("isis_circuit_update_params: unsupported media");
492 }
jardineb5d44e2003-12-23 08:09:43 +0000493
jardineb5d44e2003-12-23 08:09:43 +0000494 return;
495}
496
497void
hassof390d2c2004-09-10 20:48:21 +0000498isis_circuit_if_del (struct isis_circuit *circuit)
jardineb5d44e2003-12-23 08:09:43 +0000499{
500 circuit->interface->info = NULL;
501 circuit->interface = NULL;
hassof390d2c2004-09-10 20:48:21 +0000502
jardineb5d44e2003-12-23 08:09:43 +0000503 return;
504}
505
506void
507isis_circuit_up (struct isis_circuit *circuit)
508{
jardineb5d44e2003-12-23 08:09:43 +0000509
hassof390d2c2004-09-10 20:48:21 +0000510 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
511 {
512 if (circuit->area->min_bcast_mtu == 0 ||
513 ISO_MTU (circuit) < circuit->area->min_bcast_mtu)
514 circuit->area->min_bcast_mtu = ISO_MTU (circuit);
515 /*
516 * ISO 10589 - 8.4.1 Enabling of broadcast circuits
517 */
jardineb5d44e2003-12-23 08:09:43 +0000518
hassof390d2c2004-09-10 20:48:21 +0000519 /* initilizing the hello sending threads
520 * for a broadcast IF
521 */
jardineb5d44e2003-12-23 08:09:43 +0000522
hassof390d2c2004-09-10 20:48:21 +0000523 /* 8.4.1 a) commence sending of IIH PDUs */
524
525 if (circuit->circuit_is_type & IS_LEVEL_1)
526 {
527 thread_add_event (master, send_lan_l1_hello, circuit, 0);
528 circuit->u.bc.lan_neighs[0] = list_new ();
529 }
530
531 if (circuit->circuit_is_type & IS_LEVEL_2)
532 {
533 thread_add_event (master, send_lan_l2_hello, circuit, 0);
534 circuit->u.bc.lan_neighs[1] = list_new ();
535 }
536
537 /* 8.4.1 b) FIXME: solicit ES - 8.4.6 */
538 /* 8.4.1 c) FIXME: listen for ESH PDUs */
539
540 /* 8.4.1 d) */
541 /* dr election will commence in... */
542 if (circuit->circuit_is_type & IS_LEVEL_1)
543 THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[0], isis_run_dr_l1,
hassobf731012004-09-17 07:59:57 +0000544 circuit, 2 * circuit->hello_interval[0]);
hassof390d2c2004-09-10 20:48:21 +0000545 if (circuit->circuit_is_type & IS_LEVEL_2)
546 THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[1], isis_run_dr_l2,
hassobf731012004-09-17 07:59:57 +0000547 circuit, 2 * circuit->hello_interval[1]);
jardineb5d44e2003-12-23 08:09:43 +0000548 }
hassof390d2c2004-09-10 20:48:21 +0000549 else
550 {
551 /* initializing the hello send threads
552 * for a ptp IF
553 */
554 thread_add_event (master, send_p2p_hello, circuit, 0);
jardineb5d44e2003-12-23 08:09:43 +0000555
jardineb5d44e2003-12-23 08:09:43 +0000556 }
557
jardineb5d44e2003-12-23 08:09:43 +0000558 /* initializing PSNP timers */
hassof390d2c2004-09-10 20:48:21 +0000559 if (circuit->circuit_is_type & IS_LEVEL_1)
560 {
561 THREAD_TIMER_ON (master, circuit->t_send_psnp[0], send_l1_psnp, circuit,
562 isis_jitter (circuit->psnp_interval[0], PSNP_JITTER));
563 }
564
565 if (circuit->circuit_is_type & IS_LEVEL_2)
566 {
567 THREAD_TIMER_ON (master, circuit->t_send_psnp[1], send_l2_psnp, circuit,
568 isis_jitter (circuit->psnp_interval[1], PSNP_JITTER));
569 }
570
jardineb5d44e2003-12-23 08:09:43 +0000571 /* initialize the circuit streams */
572 if (circuit->rcv_stream == NULL)
hassof390d2c2004-09-10 20:48:21 +0000573 circuit->rcv_stream = stream_new (ISO_MTU (circuit));
jardineb5d44e2003-12-23 08:09:43 +0000574
575 if (circuit->snd_stream == NULL)
hassof390d2c2004-09-10 20:48:21 +0000576 circuit->snd_stream = stream_new (ISO_MTU (circuit));
jardineb5d44e2003-12-23 08:09:43 +0000577
578 /* unified init for circuits */
579 isis_sock_init (circuit);
580
581#ifdef GNU_LINUX
hassof390d2c2004-09-10 20:48:21 +0000582 THREAD_READ_ON (master, circuit->t_read, isis_receive, circuit,
583 circuit->fd);
jardineb5d44e2003-12-23 08:09:43 +0000584#else
hassof390d2c2004-09-10 20:48:21 +0000585 THREAD_TIMER_ON (master, circuit->t_read, isis_receive, circuit,
586 circuit->fd);
jardineb5d44e2003-12-23 08:09:43 +0000587#endif
588 return;
589}
590
591void
592isis_circuit_down (struct isis_circuit *circuit)
593{
hassof390d2c2004-09-10 20:48:21 +0000594 /* Cancel all active threads -- FIXME: wrong place */
hassod70f99e2004-02-11 20:26:31 +0000595 /* HT: Read thread if GNU_LINUX, TIMER thread otherwise. */
hassof390d2c2004-09-10 20:48:21 +0000596 THREAD_OFF (circuit->t_read);
597 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
598 {
599 THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[0]);
600 THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[1]);
hassof891f442004-09-14 13:54:30 +0000601 THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[0]);
602 THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[1]);
hassof390d2c2004-09-10 20:48:21 +0000603 }
604 else if (circuit->circ_type == CIRCUIT_T_P2P)
605 {
606 THREAD_TIMER_OFF (circuit->u.p2p.t_send_p2p_hello);
607 }
jardineb5d44e2003-12-23 08:09:43 +0000608 /* close the socket */
609 close (circuit->fd);
610
611 return;
612}
613
614void
615circuit_update_nlpids (struct isis_circuit *circuit)
616{
617 circuit->nlpids.count = 0;
hassof390d2c2004-09-10 20:48:21 +0000618
619 if (circuit->ip_router)
620 {
621 circuit->nlpids.nlpids[0] = NLPID_IP;
622 circuit->nlpids.count++;
623 }
jardineb5d44e2003-12-23 08:09:43 +0000624#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000625 if (circuit->ipv6_router)
626 {
627 circuit->nlpids.nlpids[circuit->nlpids.count] = NLPID_IPV6;
628 circuit->nlpids.count++;
629 }
jardineb5d44e2003-12-23 08:09:43 +0000630#endif /* HAVE_IPV6 */
631 return;
632}
633
634int
hassof390d2c2004-09-10 20:48:21 +0000635isis_interface_config_write (struct vty *vty)
jardineb5d44e2003-12-23 08:09:43 +0000636{
637
638 int write = 0;
hasso52dc7ee2004-09-23 19:18:23 +0000639 struct listnode *node;
640 struct listnode *node2;
jardineb5d44e2003-12-23 08:09:43 +0000641 struct interface *ifp;
642 struct isis_area *area;
643 struct isis_circuit *c;
jardineb5d44e2003-12-23 08:09:43 +0000644 int i;
jardineb5d44e2003-12-23 08:09:43 +0000645
jardineb5d44e2003-12-23 08:09:43 +0000646 LIST_LOOP (iflist, ifp, node)
647 {
648 /* IF name */
hassof390d2c2004-09-10 20:48:21 +0000649 vty_out (vty, "interface %s%s", ifp->name, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000650 write++;
651 /* IF desc */
hassof390d2c2004-09-10 20:48:21 +0000652 if (ifp->desc)
653 {
654 vty_out (vty, " description %s%s", ifp->desc, VTY_NEWLINE);
655 write++;
656 }
jardineb5d44e2003-12-23 08:09:43 +0000657 /* ISIS Circuit */
658 LIST_LOOP (isis->area_list, area, node2)
659 {
660 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +0000661 if (c)
662 {
663 if (c->ip_router)
664 {
665 vty_out (vty, " ip router isis %s%s", area->area_tag,
666 VTY_NEWLINE);
667 write++;
668 }
jardineb5d44e2003-12-23 08:09:43 +0000669#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000670 if (c->ipv6_router)
671 {
672 vty_out (vty, " ipv6 router isis %s%s", area->area_tag,
673 VTY_NEWLINE);
674 write++;
675 }
jardineb5d44e2003-12-23 08:09:43 +0000676#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000677
hassof390d2c2004-09-10 20:48:21 +0000678 /* ISIS - circuit type */
679 if (c->circuit_is_type == IS_LEVEL_1)
680 {
681 vty_out (vty, " isis circuit-type level-1%s", VTY_NEWLINE);
682 write++;
683 }
684 else
685 {
686 if (c->circuit_is_type == IS_LEVEL_2)
687 {
688 vty_out (vty, " isis circuit-type level-2-only%s",
689 VTY_NEWLINE);
690 write++;
691 }
692 }
jardineb5d44e2003-12-23 08:09:43 +0000693
hassof390d2c2004-09-10 20:48:21 +0000694 /* ISIS - CSNP interval - FIXME: compare to cisco */
695 if (c->csnp_interval[0] == c->csnp_interval[1])
696 {
697 if (c->csnp_interval[0] != CSNP_INTERVAL)
698 {
699 vty_out (vty, " isis csnp-interval %d%s",
700 c->csnp_interval[0], VTY_NEWLINE);
701 write++;
702 }
703 }
704 else
705 {
706 for (i = 0; i < 2; i++)
707 {
708 if (c->csnp_interval[1] != CSNP_INTERVAL)
709 {
710 vty_out (vty, " isis csnp-interval %d level-%d%s",
711 c->csnp_interval[1], i + 1, VTY_NEWLINE);
712 write++;
713 }
714 }
715 }
jardineb5d44e2003-12-23 08:09:43 +0000716
hassof390d2c2004-09-10 20:48:21 +0000717 /* ISIS - Hello padding - Defaults to true so only display if false */
718 if (c->circ_type == CIRCUIT_T_BROADCAST && !c->u.bc.pad_hellos)
719 {
720 vty_out (vty, " no isis hello padding%s", VTY_NEWLINE);
721 write++;
722 }
jardineb5d44e2003-12-23 08:09:43 +0000723
hassof390d2c2004-09-10 20:48:21 +0000724 /* ISIS - Hello interval - FIXME: compare to cisco */
725 if (c->hello_interval[0] == c->hello_interval[1])
726 {
727 if (c->hello_interval[0] != HELLO_INTERVAL)
728 {
729 vty_out (vty, " isis hello-interval %d%s",
730 c->hello_interval[0], VTY_NEWLINE);
731 write++;
732 }
733 }
734 else
735 {
736 for (i = 0; i < 2; i++)
737 {
738 if (c->hello_interval[i] != HELLO_INTERVAL)
739 {
740 if (c->hello_interval[i] == HELLO_MINIMAL)
741 {
742 vty_out (vty,
743 " isis hello-interval minimal level-%d%s",
744 i + 1, VTY_NEWLINE);
745 }
746 else
747 {
748 vty_out (vty, " isis hello-interval %d level-%d%s",
749 c->hello_interval[i], i + 1, VTY_NEWLINE);
750 }
751 write++;
752 }
753 }
754 }
jardineb5d44e2003-12-23 08:09:43 +0000755
hassof390d2c2004-09-10 20:48:21 +0000756 /* ISIS - Hello Multiplier */
757 if (c->hello_multiplier[0] == c->hello_multiplier[1])
758 {
759 if (c->hello_multiplier[0] != HELLO_MULTIPLIER)
760 {
761 vty_out (vty, " isis hello-multiplier %d%s",
762 c->hello_multiplier[0], VTY_NEWLINE);
763 write++;
764 }
765 }
766 else
767 {
768 for (i = 0; i < 2; i++)
769 {
770 if (c->hello_multiplier[i] != HELLO_MULTIPLIER)
771 {
772 vty_out (vty, " isis hello-multiplier %d level-%d%s",
773 c->hello_multiplier[i], i + 1, VTY_NEWLINE);
774 write++;
775 }
776 }
777 }
778 /* ISIS - Priority */
779 if (c->circ_type == CIRCUIT_T_BROADCAST)
780 {
781 if (c->u.bc.priority[0] == c->u.bc.priority[1])
782 {
783 if (c->u.bc.priority[0] != DEFAULT_PRIORITY)
784 {
785 vty_out (vty, " isis priority %d%s",
786 c->u.bc.priority[0], VTY_NEWLINE);
787 write++;
788 }
789 }
790 else
791 {
792 for (i = 0; i < 2; i++)
793 {
794 if (c->u.bc.priority[i] != DEFAULT_PRIORITY)
795 {
796 vty_out (vty, " isis priority %d level-%d%s",
797 c->u.bc.priority[i], i + 1, VTY_NEWLINE);
798 write++;
799 }
800 }
801 }
802 }
803 /* ISIS - Metric */
804 if (c->metrics[0].metric_default == c->metrics[1].metric_default)
805 {
806 if (c->metrics[0].metric_default != DEFAULT_CIRCUIT_METRICS)
807 {
808 vty_out (vty, " isis metric %d%s",
809 c->metrics[0].metric_default, VTY_NEWLINE);
810 write++;
811 }
812 }
813 else
814 {
815 for (i = 0; i < 2; i++)
816 {
817 if (c->metrics[i].metric_default != DEFAULT_CIRCUIT_METRICS)
818 {
819 vty_out (vty, " isis metric %d level-%d%s",
820 c->metrics[i].metric_default, i + 1,
821 VTY_NEWLINE);
822 write++;
823 }
824 }
825 }
jardineb5d44e2003-12-23 08:09:43 +0000826
hassof390d2c2004-09-10 20:48:21 +0000827 }
jardineb5d44e2003-12-23 08:09:43 +0000828 }
hassof390d2c2004-09-10 20:48:21 +0000829 vty_out (vty, "!%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000830 }
hassof390d2c2004-09-10 20:48:21 +0000831
jardineb5d44e2003-12-23 08:09:43 +0000832 return write;
833}
jardineb5d44e2003-12-23 08:09:43 +0000834
835DEFUN (ip_router_isis,
836 ip_router_isis_cmd,
837 "ip router isis WORD",
838 "Interface Internet Protocol config commands\n"
839 "IP router interface commands\n"
840 "IS-IS Routing for IP\n"
hassof390d2c2004-09-10 20:48:21 +0000841 "Routing process tag\n")
jardineb5d44e2003-12-23 08:09:43 +0000842{
843 struct isis_circuit *c;
844 struct interface *ifp;
845 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000846
847 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000848 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +0000849
jardineb5d44e2003-12-23 08:09:43 +0000850 area = isis_area_lookup (argv[0]);
851
852 /* Prevent more than one circuit per interface */
853 if (area)
854 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +0000855 else
856 c = NULL;
857 if (c && (ifp->info != NULL))
858 {
jardineb5d44e2003-12-23 08:09:43 +0000859#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000860 if (c->ipv6_router == 0)
861 {
jardineb5d44e2003-12-23 08:09:43 +0000862#endif /* HAVE_IPV6 */
hassof390d2c2004-09-10 20:48:21 +0000863 vty_out (vty, "ISIS circuit is already defined%s", VTY_NEWLINE);
864 return CMD_WARNING;
jardineb5d44e2003-12-23 08:09:43 +0000865#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000866 }
867#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000868 }
hassof390d2c2004-09-10 20:48:21 +0000869
jardineb5d44e2003-12-23 08:09:43 +0000870 /* this is here for ciscopability */
hassof390d2c2004-09-10 20:48:21 +0000871 if (!area)
872 {
873 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
874 return CMD_WARNING;
875 }
jardineb5d44e2003-12-23 08:09:43 +0000876
hassof390d2c2004-09-10 20:48:21 +0000877 if (!c)
878 {
879 c = circuit_lookup_by_ifp (ifp, isis->init_circ_list);
880 c = isis_csm_state_change (ISIS_ENABLE, c, area);
881 c->interface = ifp; /* this is automatic */
882 ifp->info = c; /* hardly related to the FSM */
883 }
jardineb5d44e2003-12-23 08:09:43 +0000884
hassof390d2c2004-09-10 20:48:21 +0000885 if (!c)
jardineb5d44e2003-12-23 08:09:43 +0000886 return CMD_WARNING;
887
888 c->ip_router = 1;
889 area->ip_circuits++;
890 circuit_update_nlpids (c);
891
892 vty->node = INTERFACE_NODE;
hassof390d2c2004-09-10 20:48:21 +0000893
jardineb5d44e2003-12-23 08:09:43 +0000894 return CMD_SUCCESS;
895}
896
897DEFUN (no_ip_router_isis,
898 no_ip_router_isis_cmd,
899 "no ip router isis WORD",
900 NO_STR
901 "Interface Internet Protocol config commands\n"
902 "IP router interface commands\n"
903 "IS-IS Routing for IP\n"
hassof390d2c2004-09-10 20:48:21 +0000904 "Routing process tag\n")
jardineb5d44e2003-12-23 08:09:43 +0000905{
906 struct isis_circuit *circuit = NULL;
907 struct interface *ifp;
908 struct isis_area *area;
909 struct listnode *node;
910
hassof390d2c2004-09-10 20:48:21 +0000911 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000912 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +0000913
jardineb5d44e2003-12-23 08:09:43 +0000914 area = isis_area_lookup (argv[0]);
hassof390d2c2004-09-10 20:48:21 +0000915 if (!area)
916 {
917 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
918 return CMD_WARNING;
919 }
jardineb5d44e2003-12-23 08:09:43 +0000920 LIST_LOOP (area->circuit_list, circuit, node)
921 if (circuit->interface == ifp)
922 break;
hassof390d2c2004-09-10 20:48:21 +0000923 if (!circuit)
924 {
925 vty_out (vty, "Can't find ISIS interface %s", VTY_NEWLINE);
926 return CMD_WARNING;
927 }
jardineb5d44e2003-12-23 08:09:43 +0000928 circuit->ip_router = 0;
929 area->ip_circuits--;
930#ifdef HAVE_IPV6
931 if (circuit->ipv6_router == 0)
932#endif
933 isis_csm_state_change (ISIS_DISABLE, circuit, area);
hassof390d2c2004-09-10 20:48:21 +0000934
jardineb5d44e2003-12-23 08:09:43 +0000935 return CMD_SUCCESS;
936}
937
938DEFUN (isis_circuit_type,
939 isis_circuit_type_cmd,
940 "isis circuit-type (level-1|level-1-2|level-2-only)",
941 "IS-IS commands\n"
942 "Configure circuit type for interface\n"
943 "Level-1 only adjacencies are formed\n"
944 "Level-1-2 adjacencies are formed\n"
hassof390d2c2004-09-10 20:48:21 +0000945 "Level-2 only adjacencies are formed\n")
jardineb5d44e2003-12-23 08:09:43 +0000946{
947 struct isis_circuit *circuit;
948 struct interface *ifp;
949 int circuit_t;
950 int is_type;
hassof390d2c2004-09-10 20:48:21 +0000951
952 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000953 circuit = ifp->info;
954 /* UGLY - will remove l8r */
hassof390d2c2004-09-10 20:48:21 +0000955 if (circuit == NULL)
956 {
957 return CMD_WARNING;
958 }
jardineb5d44e2003-12-23 08:09:43 +0000959
hasso13c48f72004-09-10 21:19:13 +0000960 /* XXX what to do when ip_router_isis is not executed */
961 if (circuit->area == NULL)
962 return CMD_WARNING;
963
jardineb5d44e2003-12-23 08:09:43 +0000964 assert (circuit);
965
hassof7c43dc2004-09-26 16:24:14 +0000966 circuit_t = string2circuit_t ((u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +0000967
hassof390d2c2004-09-10 20:48:21 +0000968 if (!circuit_t)
969 {
970 vty_out (vty, "Unknown circuit-type %s", VTY_NEWLINE);
971 return CMD_SUCCESS;
972 }
973
jardineb5d44e2003-12-23 08:09:43 +0000974 is_type = circuit->area->is_type;
975 if (is_type == IS_LEVEL_1_AND_2 || is_type == circuit_t)
hassof390d2c2004-09-10 20:48:21 +0000976 isis_event_circuit_type_change (circuit, circuit_t);
977 else
978 {
979 vty_out (vty, "invalid circuit level for area %s.%s",
980 circuit->area->area_tag, VTY_NEWLINE);
981 }
982
jardineb5d44e2003-12-23 08:09:43 +0000983 return CMD_SUCCESS;
984}
985
986DEFUN (no_isis_circuit_type,
987 no_isis_circuit_type_cmd,
988 "no isis circuit-type (level-1|level-1-2|level-2-only)",
989 NO_STR
990 "IS-IS commands\n"
991 "Configure circuit type for interface\n"
992 "Level-1 only adjacencies are formed\n"
993 "Level-1-2 adjacencies are formed\n"
hassof390d2c2004-09-10 20:48:21 +0000994 "Level-2 only adjacencies are formed\n")
jardineb5d44e2003-12-23 08:09:43 +0000995{
996 struct isis_circuit *circuit;
997 struct interface *ifp;
jardineb5d44e2003-12-23 08:09:43 +0000998
hassof390d2c2004-09-10 20:48:21 +0000999 ifp = vty->index;
1000 circuit = ifp->info;
1001 if (circuit == NULL)
1002 {
1003 return CMD_WARNING;
1004 }
1005
1006 assert (circuit);
1007
jardineb5d44e2003-12-23 08:09:43 +00001008 /*
1009 * Set the circuits level to its default value which is that of the area
1010 */
1011 isis_event_circuit_type_change (circuit, circuit->area->is_type);
hassof390d2c2004-09-10 20:48:21 +00001012
jardineb5d44e2003-12-23 08:09:43 +00001013 return CMD_SUCCESS;
1014}
1015
1016DEFUN (isis_passwd,
1017 isis_passwd_cmd,
1018 "isis password WORD",
1019 "IS-IS commands\n"
1020 "Configure the authentication password for interface\n"
1021 "Password\n")
1022{
1023 struct isis_circuit *circuit;
1024 struct interface *ifp;
1025 int len;
hassof390d2c2004-09-10 20:48:21 +00001026
1027 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001028 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001029 if (circuit == NULL)
1030 {
1031 return CMD_WARNING;
1032 }
1033
jardineb5d44e2003-12-23 08:09:43 +00001034 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001035 if (len > 254)
1036 {
1037 vty_out (vty, "Too long circuit password (>254)%s", VTY_NEWLINE);
1038 return CMD_WARNING;
1039 }
jardineb5d44e2003-12-23 08:09:43 +00001040 circuit->passwd.len = len;
1041 circuit->passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001042 strncpy ((char *)circuit->passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001043
jardineb5d44e2003-12-23 08:09:43 +00001044 return CMD_SUCCESS;
1045}
1046
1047DEFUN (no_isis_passwd,
1048 no_isis_passwd_cmd,
1049 "no isis password",
1050 NO_STR
1051 "IS-IS commands\n"
1052 "Configure the authentication password for interface\n")
1053{
1054 struct isis_circuit *circuit;
1055 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001056
1057 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001058 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001059 if (circuit == NULL)
1060 {
1061 return CMD_WARNING;
1062 }
1063
jardineb5d44e2003-12-23 08:09:43 +00001064 memset (&circuit->passwd, 0, sizeof (struct isis_passwd));
hassof390d2c2004-09-10 20:48:21 +00001065
jardineb5d44e2003-12-23 08:09:43 +00001066 return CMD_SUCCESS;
1067}
1068
1069
1070DEFUN (isis_priority,
1071 isis_priority_cmd,
1072 "isis priority <0-127>",
1073 "IS-IS commands\n"
1074 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001075 "Priority value\n")
jardineb5d44e2003-12-23 08:09:43 +00001076{
1077 struct isis_circuit *circuit;
1078 struct interface *ifp;
1079 int prio;
hassof390d2c2004-09-10 20:48:21 +00001080
1081 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001082 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001083 if (circuit == NULL)
1084 {
1085 return CMD_WARNING;
1086 }
jardineb5d44e2003-12-23 08:09:43 +00001087 assert (circuit);
1088
1089 prio = atoi (argv[0]);
1090
1091 circuit->u.bc.priority[0] = prio;
1092 circuit->u.bc.priority[1] = prio;
hassof390d2c2004-09-10 20:48:21 +00001093
jardineb5d44e2003-12-23 08:09:43 +00001094 return CMD_SUCCESS;
1095}
1096
1097DEFUN (no_isis_priority,
1098 no_isis_priority_cmd,
1099 "no isis priority",
1100 NO_STR
1101 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001102 "Set priority for Designated Router election\n")
jardineb5d44e2003-12-23 08:09:43 +00001103{
1104 struct isis_circuit *circuit;
1105 struct interface *ifp;
1106
hassof390d2c2004-09-10 20:48:21 +00001107 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001108 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001109 if (circuit == NULL)
1110 {
1111 return CMD_WARNING;
1112 }
jardineb5d44e2003-12-23 08:09:43 +00001113 assert (circuit);
1114
1115 circuit->u.bc.priority[0] = DEFAULT_PRIORITY;
1116 circuit->u.bc.priority[1] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001117
jardineb5d44e2003-12-23 08:09:43 +00001118 return CMD_SUCCESS;
1119}
1120
1121ALIAS (no_isis_priority,
1122 no_isis_priority_arg_cmd,
1123 "no isis priority <0-127>",
1124 NO_STR
1125 "IS-IS commands\n"
1126 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001127 "Priority value\n")
jardineb5d44e2003-12-23 08:09:43 +00001128
1129DEFUN (isis_priority_l1,
1130 isis_priority_l1_cmd,
hassof390d2c2004-09-10 20:48:21 +00001131 "isis priority <0-127> level-1",
jardineb5d44e2003-12-23 08:09:43 +00001132 "IS-IS commands\n"
1133 "Set priority for Designated Router election\n"
1134 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001135 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001136{
1137 struct isis_circuit *circuit;
1138 struct interface *ifp;
1139 int prio;
hassof390d2c2004-09-10 20:48:21 +00001140
1141 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001142 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001143 if (circuit == NULL)
1144 {
1145 return CMD_WARNING;
1146 }
jardineb5d44e2003-12-23 08:09:43 +00001147 assert (circuit);
1148
1149 prio = atoi (argv[0]);
1150
1151 circuit->u.bc.priority[0] = prio;
hassof390d2c2004-09-10 20:48:21 +00001152
jardineb5d44e2003-12-23 08:09:43 +00001153 return CMD_SUCCESS;
1154}
1155
1156DEFUN (no_isis_priority_l1,
1157 no_isis_priority_l1_cmd,
1158 "no isis priority level-1",
1159 NO_STR
1160 "IS-IS commands\n"
1161 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001162 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001163{
1164 struct isis_circuit *circuit;
1165 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001166
1167 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001168 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001169 if (circuit == NULL)
1170 {
1171 return CMD_WARNING;
1172 }
jardineb5d44e2003-12-23 08:09:43 +00001173 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001174
jardineb5d44e2003-12-23 08:09:43 +00001175 circuit->u.bc.priority[0] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001176
jardineb5d44e2003-12-23 08:09:43 +00001177 return CMD_SUCCESS;
1178}
1179
1180ALIAS (no_isis_priority_l1,
1181 no_isis_priority_l1_arg_cmd,
1182 "no isis priority <0-127> level-1",
1183 NO_STR
1184 "IS-IS commands\n"
1185 "Set priority for Designated Router election\n"
1186 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001187 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001188
1189DEFUN (isis_priority_l2,
1190 isis_priority_l2_cmd,
hassof390d2c2004-09-10 20:48:21 +00001191 "isis priority <0-127> level-2",
jardineb5d44e2003-12-23 08:09:43 +00001192 "IS-IS commands\n"
1193 "Set priority for Designated Router election\n"
1194 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001195 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001196{
1197 struct isis_circuit *circuit;
1198 struct interface *ifp;
1199 int prio;
hassof390d2c2004-09-10 20:48:21 +00001200
1201 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001202 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001203 if (circuit == NULL)
1204 {
1205 return CMD_WARNING;
1206 }
jardineb5d44e2003-12-23 08:09:43 +00001207 assert (circuit);
1208
1209 prio = atoi (argv[0]);
1210
1211 circuit->u.bc.priority[1] = prio;
hassof390d2c2004-09-10 20:48:21 +00001212
jardineb5d44e2003-12-23 08:09:43 +00001213 return CMD_SUCCESS;
1214}
1215
1216DEFUN (no_isis_priority_l2,
1217 no_isis_priority_l2_cmd,
1218 "no isis priority level-2",
1219 NO_STR
1220 "IS-IS commands\n"
1221 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001222 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001223{
1224 struct isis_circuit *circuit;
1225 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001226
1227 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001228 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001229 if (circuit == NULL)
1230 {
1231 return CMD_WARNING;
1232 }
jardineb5d44e2003-12-23 08:09:43 +00001233 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001234
jardineb5d44e2003-12-23 08:09:43 +00001235 circuit->u.bc.priority[1] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001236
jardineb5d44e2003-12-23 08:09:43 +00001237 return CMD_SUCCESS;
1238}
1239
1240ALIAS (no_isis_priority_l2,
1241 no_isis_priority_l2_arg_cmd,
1242 "no isis priority <0-127> level-2",
1243 NO_STR
1244 "IS-IS commands\n"
1245 "Set priority for Designated Router election\n"
1246 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001247 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001248
1249/* Metric command */
hassof390d2c2004-09-10 20:48:21 +00001250 DEFUN (isis_metric,
jardineb5d44e2003-12-23 08:09:43 +00001251 isis_metric_cmd,
1252 "isis metric <0-63>",
1253 "IS-IS commands\n"
1254 "Set default metric for circuit\n"
hassof390d2c2004-09-10 20:48:21 +00001255 "Default metric value\n")
jardineb5d44e2003-12-23 08:09:43 +00001256{
1257 struct isis_circuit *circuit;
1258 struct interface *ifp;
1259 int met;
1260
hassof390d2c2004-09-10 20:48:21 +00001261 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001262 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001263 if (circuit == NULL)
1264 {
1265 return CMD_WARNING;
1266 }
jardineb5d44e2003-12-23 08:09:43 +00001267 assert (circuit);
1268
1269 met = atoi (argv[0]);
1270
1271 circuit->metrics[0].metric_default = met;
1272 circuit->metrics[1].metric_default = met;
1273
1274 return CMD_SUCCESS;
1275}
1276
1277DEFUN (no_isis_metric,
1278 no_isis_metric_cmd,
1279 "no isis metric",
1280 NO_STR
1281 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001282 "Set default metric for circuit\n")
jardineb5d44e2003-12-23 08:09:43 +00001283{
1284 struct isis_circuit *circuit;
1285 struct interface *ifp;
1286
hassof390d2c2004-09-10 20:48:21 +00001287 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001288 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001289 if (circuit == NULL)
1290 {
1291 return CMD_WARNING;
1292 }
jardineb5d44e2003-12-23 08:09:43 +00001293 assert (circuit);
1294
1295 circuit->metrics[0].metric_default = DEFAULT_CIRCUIT_METRICS;
1296 circuit->metrics[1].metric_default = DEFAULT_CIRCUIT_METRICS;
1297
1298 return CMD_SUCCESS;
1299}
1300
1301ALIAS (no_isis_metric,
1302 no_isis_metric_arg_cmd,
1303 "no isis metric <0-127>",
1304 NO_STR
1305 "IS-IS commands\n"
1306 "Set default metric for circuit\n"
hassof390d2c2004-09-10 20:48:21 +00001307 "Default metric value\n")
1308
jardineb5d44e2003-12-23 08:09:43 +00001309/* end of metrics */
hassof390d2c2004-09-10 20:48:21 +00001310 DEFUN (isis_hello_interval,
jardineb5d44e2003-12-23 08:09:43 +00001311 isis_hello_interval_cmd,
1312 "isis hello-interval (<1-65535>|minimal)",
1313 "IS-IS commands\n"
1314 "Set Hello interval\n"
1315 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00001316 "Holdtime 1 seconds, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00001317{
1318 struct isis_circuit *circuit;
1319 struct interface *ifp;
1320 int interval;
1321 char c;
1322
hassof390d2c2004-09-10 20:48:21 +00001323 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001324 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001325 if (circuit == NULL)
1326 {
1327 return CMD_WARNING;
1328 }
1329 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001330 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001331 if (isdigit ((int) c))
1332 {
1333 interval = atoi (argv[0]);
1334 }
1335 else
1336 interval = HELLO_MINIMAL; /* FIXME: should be calculated */
jardineb5d44e2003-12-23 08:09:43 +00001337
hassof390d2c2004-09-10 20:48:21 +00001338 circuit->hello_interval[0] = (u_int16_t) interval;
1339 circuit->hello_interval[1] = (u_int16_t) interval;
1340
jardineb5d44e2003-12-23 08:09:43 +00001341 return CMD_SUCCESS;
1342}
1343
1344DEFUN (no_isis_hello_interval,
1345 no_isis_hello_interval_cmd,
1346 "no isis hello-interval",
1347 NO_STR
1348 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001349 "Set Hello interval\n")
jardineb5d44e2003-12-23 08:09:43 +00001350{
1351 struct isis_circuit *circuit;
1352 struct interface *ifp;
1353
hassof390d2c2004-09-10 20:48:21 +00001354 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001355 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001356 if (circuit == NULL)
1357 {
1358 return CMD_WARNING;
1359 }
jardineb5d44e2003-12-23 08:09:43 +00001360 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001361
hassof390d2c2004-09-10 20:48:21 +00001362
1363 circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
jardineb5d44e2003-12-23 08:09:43 +00001364 circuit->hello_interval[1] = HELLO_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001365
jardineb5d44e2003-12-23 08:09:43 +00001366 return CMD_SUCCESS;
1367}
1368
1369ALIAS (no_isis_hello_interval,
1370 no_isis_hello_interval_arg_cmd,
1371 "no isis hello-interval (<1-65535>|minimal)",
1372 NO_STR
1373 "IS-IS commands\n"
1374 "Set Hello interval\n"
1375 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00001376 "Holdtime 1 second, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00001377
1378DEFUN (isis_hello_interval_l1,
1379 isis_hello_interval_l1_cmd,
1380 "isis hello-interval (<1-65535>|minimal) level-1",
1381 "IS-IS commands\n"
1382 "Set Hello interval\n"
1383 "Hello interval value\n"
1384 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001385 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001386{
1387 struct isis_circuit *circuit;
1388 struct interface *ifp;
1389 long interval;
1390 char c;
1391
hassof390d2c2004-09-10 20:48:21 +00001392 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001393 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001394 if (circuit == NULL)
1395 {
1396 return CMD_WARNING;
1397 }
jardineb5d44e2003-12-23 08:09:43 +00001398 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001399
jardineb5d44e2003-12-23 08:09:43 +00001400 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001401 if (isdigit ((int) c))
1402 {
1403 interval = atoi (argv[0]);
1404 }
1405 else
jardineb5d44e2003-12-23 08:09:43 +00001406 interval = HELLO_MINIMAL;
1407
hassof390d2c2004-09-10 20:48:21 +00001408 circuit->hello_interval[0] = (u_int16_t) interval;
1409
jardineb5d44e2003-12-23 08:09:43 +00001410 return CMD_SUCCESS;
1411}
1412
1413DEFUN (no_isis_hello_interval_l1,
1414 no_isis_hello_interval_l1_cmd,
1415 "no isis hello-interval level-1",
1416 NO_STR
1417 "IS-IS commands\n"
1418 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00001419 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001420{
1421 struct isis_circuit *circuit;
1422 struct interface *ifp;
1423
hassof390d2c2004-09-10 20:48:21 +00001424 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001425 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001426 if (circuit == NULL)
1427 {
1428 return CMD_WARNING;
1429 }
jardineb5d44e2003-12-23 08:09:43 +00001430 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001431
hassof390d2c2004-09-10 20:48:21 +00001432
1433 circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
1434
jardineb5d44e2003-12-23 08:09:43 +00001435 return CMD_SUCCESS;
1436}
1437
1438ALIAS (no_isis_hello_interval_l1,
1439 no_isis_hello_interval_l1_arg_cmd,
1440 "no isis hello-interval (<1-65535>|minimal) level-1",
1441 NO_STR
1442 "IS-IS commands\n"
1443 "Set Hello interval\n"
1444 "Hello interval value\n"
1445 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001446 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001447
1448DEFUN (isis_hello_interval_l2,
1449 isis_hello_interval_l2_cmd,
1450 "isis hello-interval (<1-65535>|minimal) level-2",
1451 "IS-IS commands\n"
1452 "Set Hello interval\n"
1453 "Hello interval value\n"
1454 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001455 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001456{
1457 struct isis_circuit *circuit;
1458 struct interface *ifp;
1459 long interval;
1460 char c;
1461
hassof390d2c2004-09-10 20:48:21 +00001462 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001463 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001464 if (circuit == NULL)
1465 {
1466 return CMD_WARNING;
1467 }
jardineb5d44e2003-12-23 08:09:43 +00001468 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001469
jardineb5d44e2003-12-23 08:09:43 +00001470 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001471 if (isdigit ((int) c))
1472 {
1473 interval = atoi (argv[0]);
1474 }
1475 else
jardineb5d44e2003-12-23 08:09:43 +00001476 interval = HELLO_MINIMAL;
1477
hassof390d2c2004-09-10 20:48:21 +00001478 circuit->hello_interval[1] = (u_int16_t) interval;
1479
jardineb5d44e2003-12-23 08:09:43 +00001480 return CMD_SUCCESS;
1481}
1482
1483DEFUN (no_isis_hello_interval_l2,
1484 no_isis_hello_interval_l2_cmd,
1485 "no isis hello-interval level-2",
1486 NO_STR
1487 "IS-IS commands\n"
1488 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00001489 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001490{
1491 struct isis_circuit *circuit;
1492 struct interface *ifp;
1493
hassof390d2c2004-09-10 20:48:21 +00001494 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001495 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001496 if (circuit == NULL)
1497 {
1498 return CMD_WARNING;
1499 }
jardineb5d44e2003-12-23 08:09:43 +00001500 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001501
hassof390d2c2004-09-10 20:48:21 +00001502
1503 circuit->hello_interval[1] = HELLO_INTERVAL; /* Default is 1 sec. */
1504
jardineb5d44e2003-12-23 08:09:43 +00001505 return CMD_SUCCESS;
1506}
1507
1508ALIAS (no_isis_hello_interval_l2,
1509 no_isis_hello_interval_l2_arg_cmd,
1510 "no isis hello-interval (<1-65535>|minimal) level-2",
1511 NO_STR
1512 "IS-IS commands\n"
1513 "Set Hello interval\n"
1514 "Hello interval value\n"
1515 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001516 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001517
1518DEFUN (isis_hello_multiplier,
1519 isis_hello_multiplier_cmd,
1520 "isis hello-multiplier <3-1000>",
1521 "IS-IS commands\n"
1522 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001523 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00001524{
1525 struct isis_circuit *circuit;
1526 struct interface *ifp;
1527 int mult;
hassof390d2c2004-09-10 20:48:21 +00001528
1529 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001530 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001531 if (circuit == NULL)
1532 {
1533 return CMD_WARNING;
1534 }
jardineb5d44e2003-12-23 08:09:43 +00001535 assert (circuit);
1536
1537 mult = atoi (argv[0]);
1538
hassof390d2c2004-09-10 20:48:21 +00001539 circuit->hello_multiplier[0] = (u_int16_t) mult;
1540 circuit->hello_multiplier[1] = (u_int16_t) mult;
1541
jardineb5d44e2003-12-23 08:09:43 +00001542 return CMD_SUCCESS;
1543}
1544
1545DEFUN (no_isis_hello_multiplier,
1546 no_isis_hello_multiplier_cmd,
1547 "no isis hello-multiplier",
1548 NO_STR
1549 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001550 "Set multiplier for Hello holding time\n")
jardineb5d44e2003-12-23 08:09:43 +00001551{
1552 struct isis_circuit *circuit;
1553 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001554
1555 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001556 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001557 if (circuit == NULL)
1558 {
1559 return CMD_WARNING;
1560 }
jardineb5d44e2003-12-23 08:09:43 +00001561 assert (circuit);
1562
1563 circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1564 circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1565
1566 return CMD_SUCCESS;
1567}
1568
1569ALIAS (no_isis_hello_multiplier,
1570 no_isis_hello_multiplier_arg_cmd,
1571 "no isis hello-multiplier <3-1000>",
1572 NO_STR
1573 "IS-IS commands\n"
1574 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001575 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00001576
1577DEFUN (isis_hello_multiplier_l1,
1578 isis_hello_multiplier_l1_cmd,
1579 "isis hello-multiplier <3-1000> level-1",
1580 "IS-IS commands\n"
1581 "Set multiplier for Hello holding time\n"
1582 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001583 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001584{
1585 struct isis_circuit *circuit;
1586 struct interface *ifp;
1587 int mult;
hassof390d2c2004-09-10 20:48:21 +00001588
1589 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001590 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001591 if (circuit == NULL)
1592 {
1593 return CMD_WARNING;
1594 }
jardineb5d44e2003-12-23 08:09:43 +00001595 assert (circuit);
1596
1597 mult = atoi (argv[0]);
1598
hassof390d2c2004-09-10 20:48:21 +00001599 circuit->hello_multiplier[0] = (u_int16_t) mult;
1600
jardineb5d44e2003-12-23 08:09:43 +00001601 return CMD_SUCCESS;
1602}
1603
1604DEFUN (no_isis_hello_multiplier_l1,
1605 no_isis_hello_multiplier_l1_cmd,
1606 "no isis hello-multiplier level-1",
1607 NO_STR
1608 "IS-IS commands\n"
1609 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001610 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001611{
1612 struct isis_circuit *circuit;
1613 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001614
1615 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001616 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001617 if (circuit == NULL)
1618 {
1619 return CMD_WARNING;
1620 }
jardineb5d44e2003-12-23 08:09:43 +00001621 assert (circuit);
1622
1623 circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1624
1625 return CMD_SUCCESS;
1626}
1627
1628ALIAS (no_isis_hello_multiplier_l1,
1629 no_isis_hello_multiplier_l1_arg_cmd,
1630 "no isis hello-multiplier <3-1000> level-1",
1631 NO_STR
1632 "IS-IS commands\n"
1633 "Set multiplier for Hello holding time\n"
1634 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001635 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001636
1637DEFUN (isis_hello_multiplier_l2,
1638 isis_hello_multiplier_l2_cmd,
1639 "isis hello-multiplier <3-1000> level-2",
1640 "IS-IS commands\n"
1641 "Set multiplier for Hello holding time\n"
1642 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001643 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001644{
1645 struct isis_circuit *circuit;
1646 struct interface *ifp;
1647 int mult;
hassof390d2c2004-09-10 20:48:21 +00001648
1649 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001650 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001651 if (circuit == NULL)
1652 {
1653 return CMD_WARNING;
1654 }
jardineb5d44e2003-12-23 08:09:43 +00001655 assert (circuit);
1656
1657 mult = atoi (argv[0]);
1658
hassof390d2c2004-09-10 20:48:21 +00001659 circuit->hello_multiplier[1] = (u_int16_t) mult;
1660
jardineb5d44e2003-12-23 08:09:43 +00001661 return CMD_SUCCESS;
1662}
1663
1664DEFUN (no_isis_hello_multiplier_l2,
1665 no_isis_hello_multiplier_l2_cmd,
1666 "no isis hello-multiplier level-2",
1667 NO_STR
1668 "IS-IS commands\n"
1669 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001670 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001671{
1672 struct isis_circuit *circuit;
1673 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001674
1675 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001676 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001677 if (circuit == NULL)
1678 {
1679 return CMD_WARNING;
1680 }
jardineb5d44e2003-12-23 08:09:43 +00001681 assert (circuit);
1682
1683 circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1684
1685 return CMD_SUCCESS;
1686}
1687
1688ALIAS (no_isis_hello_multiplier_l2,
1689 no_isis_hello_multiplier_l2_arg_cmd,
1690 "no isis hello-multiplier <3-1000> level-2",
1691 NO_STR
1692 "IS-IS commands\n"
1693 "Set multiplier for Hello holding time\n"
1694 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001695 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001696
1697DEFUN (isis_hello,
1698 isis_hello_cmd,
1699 "isis hello padding",
1700 "IS-IS commands\n"
1701 "Add padding to IS-IS hello packets\n"
1702 "Pad hello packets\n"
1703 "<cr>\n")
1704{
1705 struct interface *ifp;
1706 struct isis_circuit *circuit;
hassof390d2c2004-09-10 20:48:21 +00001707
1708 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001709 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001710 if (circuit == NULL)
1711 {
1712 return CMD_WARNING;
1713 }
jardineb5d44e2003-12-23 08:09:43 +00001714 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001715
jardineb5d44e2003-12-23 08:09:43 +00001716 circuit->u.bc.pad_hellos = 1;
hassof390d2c2004-09-10 20:48:21 +00001717
jardineb5d44e2003-12-23 08:09:43 +00001718 return CMD_SUCCESS;
1719}
1720
jardineb5d44e2003-12-23 08:09:43 +00001721DEFUN (no_isis_hello,
1722 no_isis_hello_cmd,
1723 "no isis hello padding",
1724 NO_STR
1725 "IS-IS commands\n"
1726 "Add padding to IS-IS hello packets\n"
1727 "Pad hello packets\n"
1728 "<cr>\n")
1729{
1730 struct isis_circuit *circuit;
1731 struct interface *ifp;
1732
hassof390d2c2004-09-10 20:48:21 +00001733 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001734 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001735 if (circuit == NULL)
1736 {
1737 return CMD_WARNING;
1738 }
jardineb5d44e2003-12-23 08:09:43 +00001739 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001740
jardineb5d44e2003-12-23 08:09:43 +00001741 circuit->u.bc.pad_hellos = 0;
hassof390d2c2004-09-10 20:48:21 +00001742
jardineb5d44e2003-12-23 08:09:43 +00001743 return CMD_SUCCESS;
1744}
1745
1746DEFUN (csnp_interval,
1747 csnp_interval_cmd,
1748 "isis csnp-interval <0-65535>",
1749 "IS-IS commands\n"
1750 "Set CSNP interval in seconds\n"
1751 "CSNP interval value\n")
1752{
1753 struct isis_circuit *circuit;
1754 struct interface *ifp;
1755 unsigned long interval;
1756
hassof390d2c2004-09-10 20:48:21 +00001757 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001758 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001759 if (circuit == NULL)
1760 {
1761 return CMD_WARNING;
1762 }
jardineb5d44e2003-12-23 08:09:43 +00001763 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001764
jardineb5d44e2003-12-23 08:09:43 +00001765 interval = atol (argv[0]);
1766
hassof390d2c2004-09-10 20:48:21 +00001767 circuit->csnp_interval[0] = (u_int16_t) interval;
1768 circuit->csnp_interval[1] = (u_int16_t) interval;
1769
jardineb5d44e2003-12-23 08:09:43 +00001770 return CMD_SUCCESS;
1771}
1772
1773DEFUN (no_csnp_interval,
1774 no_csnp_interval_cmd,
1775 "no isis csnp-interval",
1776 NO_STR
1777 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001778 "Set CSNP interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001779{
1780 struct isis_circuit *circuit;
1781 struct interface *ifp;
1782
hassof390d2c2004-09-10 20:48:21 +00001783 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001784 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001785 if (circuit == NULL)
1786 {
1787 return CMD_WARNING;
1788 }
jardineb5d44e2003-12-23 08:09:43 +00001789 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001790
jardineb5d44e2003-12-23 08:09:43 +00001791 circuit->csnp_interval[0] = CSNP_INTERVAL;
1792 circuit->csnp_interval[1] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001793
jardineb5d44e2003-12-23 08:09:43 +00001794 return CMD_SUCCESS;
1795}
1796
1797ALIAS (no_csnp_interval,
1798 no_csnp_interval_arg_cmd,
1799 "no isis csnp-interval <0-65535>",
1800 NO_STR
1801 "IS-IS commands\n"
1802 "Set CSNP interval in seconds\n"
1803 "CSNP interval value\n")
1804
jardineb5d44e2003-12-23 08:09:43 +00001805DEFUN (csnp_interval_l1,
1806 csnp_interval_l1_cmd,
1807 "isis csnp-interval <0-65535> level-1",
1808 "IS-IS commands\n"
1809 "Set CSNP interval in seconds\n"
1810 "CSNP interval value\n"
1811 "Specify interval for level-1 CSNPs\n")
1812{
1813 struct isis_circuit *circuit;
1814 struct interface *ifp;
1815 unsigned long interval;
1816
hassof390d2c2004-09-10 20:48:21 +00001817 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001818 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001819 if (circuit == NULL)
1820 {
1821 return CMD_WARNING;
1822 }
jardineb5d44e2003-12-23 08:09:43 +00001823 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001824
jardineb5d44e2003-12-23 08:09:43 +00001825 interval = atol (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001826
1827 circuit->csnp_interval[0] = (u_int16_t) interval;
1828
jardineb5d44e2003-12-23 08:09:43 +00001829 return CMD_SUCCESS;
1830}
1831
1832DEFUN (no_csnp_interval_l1,
1833 no_csnp_interval_l1_cmd,
1834 "no isis csnp-interval level-1",
1835 NO_STR
1836 "IS-IS commands\n"
1837 "Set CSNP interval in seconds\n"
1838 "Specify interval for level-1 CSNPs\n")
1839{
1840 struct isis_circuit *circuit;
1841 struct interface *ifp;
1842
hassof390d2c2004-09-10 20:48:21 +00001843 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001844 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001845 if (circuit == NULL)
1846 {
1847 return CMD_WARNING;
1848 }
jardineb5d44e2003-12-23 08:09:43 +00001849 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001850
jardineb5d44e2003-12-23 08:09:43 +00001851 circuit->csnp_interval[0] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001852
jardineb5d44e2003-12-23 08:09:43 +00001853 return CMD_SUCCESS;
1854}
1855
1856ALIAS (no_csnp_interval_l1,
1857 no_csnp_interval_l1_arg_cmd,
1858 "no isis csnp-interval <0-65535> level-1",
1859 NO_STR
1860 "IS-IS commands\n"
1861 "Set CSNP interval in seconds\n"
1862 "CSNP interval value\n"
1863 "Specify interval for level-1 CSNPs\n")
1864
jardineb5d44e2003-12-23 08:09:43 +00001865DEFUN (csnp_interval_l2,
1866 csnp_interval_l2_cmd,
1867 "isis csnp-interval <0-65535> level-2",
1868 "IS-IS commands\n"
1869 "Set CSNP interval in seconds\n"
1870 "CSNP interval value\n"
1871 "Specify interval for level-2 CSNPs\n")
1872{
1873 struct isis_circuit *circuit;
1874 struct interface *ifp;
1875 unsigned long interval;
1876
hassof390d2c2004-09-10 20:48:21 +00001877 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001878 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001879 if (circuit == NULL)
1880 {
1881 return CMD_WARNING;
1882 }
jardineb5d44e2003-12-23 08:09:43 +00001883 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001884
jardineb5d44e2003-12-23 08:09:43 +00001885 interval = atol (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001886
1887 circuit->csnp_interval[1] = (u_int16_t) interval;
1888
jardineb5d44e2003-12-23 08:09:43 +00001889 return CMD_SUCCESS;
1890}
1891
1892DEFUN (no_csnp_interval_l2,
1893 no_csnp_interval_l2_cmd,
1894 "no isis csnp-interval level-2",
1895 NO_STR
1896 "IS-IS commands\n"
1897 "Set CSNP interval in seconds\n"
1898 "Specify interval for level-2 CSNPs\n")
1899{
1900 struct isis_circuit *circuit;
1901 struct interface *ifp;
1902
hassof390d2c2004-09-10 20:48:21 +00001903 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001904 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001905 if (circuit == NULL)
1906 {
1907 return CMD_WARNING;
1908 }
jardineb5d44e2003-12-23 08:09:43 +00001909 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001910
jardineb5d44e2003-12-23 08:09:43 +00001911 circuit->csnp_interval[1] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001912
jardineb5d44e2003-12-23 08:09:43 +00001913 return CMD_SUCCESS;
1914}
1915
1916ALIAS (no_csnp_interval_l2,
1917 no_csnp_interval_l2_arg_cmd,
1918 "no isis csnp-interval <0-65535> level-2",
1919 NO_STR
1920 "IS-IS commands\n"
1921 "Set CSNP interval in seconds\n"
1922 "CSNP interval value\n"
1923 "Specify interval for level-2 CSNPs\n")
1924
jardineb5d44e2003-12-23 08:09:43 +00001925#ifdef HAVE_IPV6
1926DEFUN (ipv6_router_isis,
1927 ipv6_router_isis_cmd,
1928 "ipv6 router isis WORD",
1929 "IPv6 interface subcommands\n"
1930 "IPv6 Router interface commands\n"
1931 "IS-IS Routing for IPv6\n"
1932 "Routing process tag\n")
1933{
1934 struct isis_circuit *c;
1935 struct interface *ifp;
1936 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001937
1938 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001939 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +00001940
jardineb5d44e2003-12-23 08:09:43 +00001941 area = isis_area_lookup (argv[0]);
1942
1943 /* Prevent more than one circuit per interface */
1944 if (area)
1945 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +00001946 else
1947 c = NULL;
1948
1949 if (c && (ifp->info != NULL))
1950 {
1951 if (c->ipv6_router == 1)
1952 {
1953 vty_out (vty, "ISIS circuit is already defined for IPv6%s",
1954 VTY_NEWLINE);
1955 return CMD_WARNING;
1956 }
jardineb5d44e2003-12-23 08:09:43 +00001957 }
jardineb5d44e2003-12-23 08:09:43 +00001958
1959 /* this is here for ciscopability */
hassof390d2c2004-09-10 20:48:21 +00001960 if (!area)
1961 {
1962 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
1963 return CMD_WARNING;
1964 }
jardineb5d44e2003-12-23 08:09:43 +00001965
hassof390d2c2004-09-10 20:48:21 +00001966 if (!c)
1967 {
1968 c = circuit_lookup_by_ifp (ifp, isis->init_circ_list);
1969 c = isis_csm_state_change (ISIS_ENABLE, c, area);
1970 c->interface = ifp;
1971 ifp->info = c;
1972 }
jardineb5d44e2003-12-23 08:09:43 +00001973
hassof390d2c2004-09-10 20:48:21 +00001974 if (!c)
jardineb5d44e2003-12-23 08:09:43 +00001975 return CMD_WARNING;
1976
1977 c->ipv6_router = 1;
1978 area->ipv6_circuits++;
1979 circuit_update_nlpids (c);
1980
1981 vty->node = INTERFACE_NODE;
1982
1983 return CMD_SUCCESS;
1984}
1985
1986DEFUN (no_ipv6_router_isis,
1987 no_ipv6_router_isis_cmd,
1988 "no ipv6 router isis WORD",
1989 NO_STR
1990 "IPv6 interface subcommands\n"
1991 "IPv6 Router interface commands\n"
1992 "IS-IS Routing for IPv6\n"
1993 "Routing process tag\n")
1994{
1995 struct isis_circuit *c;
1996 struct interface *ifp;
1997 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001998
1999 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +00002000 /* UGLY - will remove l8r
2001 if (circuit == NULL) {
hassof390d2c2004-09-10 20:48:21 +00002002 return CMD_WARNING;
2003 } */
jardineb5d44e2003-12-23 08:09:43 +00002004 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +00002005
jardineb5d44e2003-12-23 08:09:43 +00002006 area = isis_area_lookup (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00002007 if (!area)
2008 {
2009 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
2010 return CMD_WARNING;
2011 }
2012
jardineb5d44e2003-12-23 08:09:43 +00002013 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
2014 if (!c)
2015 return CMD_WARNING;
2016
2017 c->ipv6_router = 0;
2018 area->ipv6_circuits--;
2019 if (c->ip_router == 0)
2020 isis_csm_state_change (ISIS_DISABLE, c, area);
2021
2022 return CMD_SUCCESS;
2023}
hassof390d2c2004-09-10 20:48:21 +00002024#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +00002025
hassof390d2c2004-09-10 20:48:21 +00002026struct cmd_node interface_node = {
jardineb5d44e2003-12-23 08:09:43 +00002027 INTERFACE_NODE,
2028 "%s(config-if)# ",
2029 1,
2030};
2031
jardineb5d44e2003-12-23 08:09:43 +00002032int
2033isis_if_new_hook (struct interface *ifp)
2034{
2035/* FIXME: Discuss if the circuit should be created here
2036 ifp->info = XMALLOC (MTYPE_ISIS_IF_INFO, sizeof (struct isis_if_info)); */
2037 ifp->info = NULL;
2038 return 0;
2039}
2040
2041int
2042isis_if_delete_hook (struct interface *ifp)
2043{
2044/* FIXME: Discuss if the circuit should be created here
2045 XFREE (MTYPE_ISIS_IF_INFO, ifp->info);*/
2046 ifp->info = NULL;
2047 return 0;
2048}
2049
jardineb5d44e2003-12-23 08:09:43 +00002050void
2051isis_circuit_init ()
2052{
jardineb5d44e2003-12-23 08:09:43 +00002053 /* Initialize Zebra interface data structure */
2054 if_init ();
2055 if_add_hook (IF_NEW_HOOK, isis_if_new_hook);
2056 if_add_hook (IF_DELETE_HOOK, isis_if_delete_hook);
2057
2058 /* Install interface node */
2059 install_node (&interface_node, isis_interface_config_write);
2060 install_element (CONFIG_NODE, &interface_cmd);
2061
2062 install_default (INTERFACE_NODE);
2063 install_element (INTERFACE_NODE, &interface_desc_cmd);
2064 install_element (INTERFACE_NODE, &no_interface_desc_cmd);
2065
2066 install_element (INTERFACE_NODE, &ip_router_isis_cmd);
2067 install_element (INTERFACE_NODE, &no_ip_router_isis_cmd);
2068
2069 install_element (INTERFACE_NODE, &isis_circuit_type_cmd);
2070 install_element (INTERFACE_NODE, &no_isis_circuit_type_cmd);
2071
2072 install_element (INTERFACE_NODE, &isis_passwd_cmd);
2073 install_element (INTERFACE_NODE, &no_isis_passwd_cmd);
2074
2075 install_element (INTERFACE_NODE, &isis_priority_cmd);
2076 install_element (INTERFACE_NODE, &no_isis_priority_cmd);
2077 install_element (INTERFACE_NODE, &no_isis_priority_arg_cmd);
2078 install_element (INTERFACE_NODE, &isis_priority_l1_cmd);
2079 install_element (INTERFACE_NODE, &no_isis_priority_l1_cmd);
2080 install_element (INTERFACE_NODE, &no_isis_priority_l1_arg_cmd);
2081 install_element (INTERFACE_NODE, &isis_priority_l2_cmd);
2082 install_element (INTERFACE_NODE, &no_isis_priority_l2_cmd);
2083 install_element (INTERFACE_NODE, &no_isis_priority_l2_arg_cmd);
2084
2085 install_element (INTERFACE_NODE, &isis_metric_cmd);
2086 install_element (INTERFACE_NODE, &no_isis_metric_cmd);
2087 install_element (INTERFACE_NODE, &no_isis_metric_arg_cmd);
2088
2089 install_element (INTERFACE_NODE, &isis_hello_interval_cmd);
2090 install_element (INTERFACE_NODE, &no_isis_hello_interval_cmd);
2091 install_element (INTERFACE_NODE, &no_isis_hello_interval_arg_cmd);
2092 install_element (INTERFACE_NODE, &isis_hello_interval_l1_cmd);
2093 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_cmd);
2094 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_arg_cmd);
2095 install_element (INTERFACE_NODE, &isis_hello_interval_l2_cmd);
2096 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_cmd);
2097 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_arg_cmd);
2098
2099 install_element (INTERFACE_NODE, &isis_hello_multiplier_cmd);
2100 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_cmd);
2101 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_arg_cmd);
2102 install_element (INTERFACE_NODE, &isis_hello_multiplier_l1_cmd);
2103 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_cmd);
2104 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_arg_cmd);
2105 install_element (INTERFACE_NODE, &isis_hello_multiplier_l2_cmd);
2106 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_cmd);
2107 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_arg_cmd);
2108
2109 install_element (INTERFACE_NODE, &isis_hello_cmd);
2110 install_element (INTERFACE_NODE, &no_isis_hello_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002111 install_element (INTERFACE_NODE, &csnp_interval_cmd);
2112 install_element (INTERFACE_NODE, &no_csnp_interval_cmd);
2113 install_element (INTERFACE_NODE, &no_csnp_interval_arg_cmd);
2114 install_element (INTERFACE_NODE, &csnp_interval_l1_cmd);
2115 install_element (INTERFACE_NODE, &no_csnp_interval_l1_cmd);
2116 install_element (INTERFACE_NODE, &no_csnp_interval_l1_arg_cmd);
2117 install_element (INTERFACE_NODE, &csnp_interval_l2_cmd);
2118 install_element (INTERFACE_NODE, &no_csnp_interval_l2_cmd);
2119 install_element (INTERFACE_NODE, &no_csnp_interval_l2_arg_cmd);
2120
2121#ifdef HAVE_IPV6
2122 install_element (INTERFACE_NODE, &ipv6_router_isis_cmd);
2123 install_element (INTERFACE_NODE, &no_ipv6_router_isis_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002124#endif
jardineb5d44e2003-12-23 08:09:43 +00002125}