blob: 2ba74075d2c6f8b67e62a26d9b7739c673b9755a [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 */
194 list_delete (circuit->u.bc.adjdb[0]);
195 list_delete (circuit->u.bc.adjdb[1]);
196 /* destroy neighbour lists */
197 if (circuit->u.bc.lan_neighs[0])
198 list_delete (circuit->u.bc.lan_neighs[0]);
199 if (circuit->u.bc.lan_neighs[1])
200 list_delete (circuit->u.bc.lan_neighs[1]);
201 /* destroy addresses */
202 }
jardineb5d44e2003-12-23 08:09:43 +0000203 if (circuit->ip_addrs)
204 list_delete (circuit->ip_addrs);
205#ifdef HAVE_IPV6
206 if (circuit->ipv6_link)
207 list_delete (circuit->ipv6_link);
208 if (circuit->ipv6_non_link)
209 list_delete (circuit->ipv6_non_link);
210#endif /* HAVE_IPV6 */
hassof390d2c2004-09-10 20:48:21 +0000211
jardineb5d44e2003-12-23 08:09:43 +0000212 /* and lastly the circuit itself */
213 XFREE (MTYPE_ISIS_CIRCUIT, circuit);
214
215 return;
216}
217
218void
hassof891f442004-09-14 13:54:30 +0000219isis_circuit_add_addr (struct isis_circuit *circuit,
220 struct connected *connected)
jardineb5d44e2003-12-23 08:09:43 +0000221{
222 struct prefix_ipv4 *ipv4;
hassof390d2c2004-09-10 20:48:21 +0000223 u_char buf[BUFSIZ];
jardineb5d44e2003-12-23 08:09:43 +0000224#ifdef HAVE_IPV6
225 struct prefix_ipv6 *ipv6;
226#endif /* HAVE_IPV6 */
hassof891f442004-09-14 13:54:30 +0000227
hassof390d2c2004-09-10 20:48:21 +0000228 if (!circuit->ip_addrs)
hassof891f442004-09-14 13:54:30 +0000229 circuit->ip_addrs = list_new ();
jardineb5d44e2003-12-23 08:09:43 +0000230#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000231 if (!circuit->ipv6_link)
hassof891f442004-09-14 13:54:30 +0000232 circuit->ipv6_link = list_new ();
hassof390d2c2004-09-10 20:48:21 +0000233 if (!circuit->ipv6_non_link)
hassof891f442004-09-14 13:54:30 +0000234 circuit->ipv6_non_link = list_new ();
jardineb5d44e2003-12-23 08:09:43 +0000235#endif /* HAVE_IPV6 */
236
237 memset (&buf, 0, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000238 if (connected->address->family == AF_INET)
hassof390d2c2004-09-10 20:48:21 +0000239 {
240 ipv4 = prefix_ipv4_new ();
hassof891f442004-09-14 13:54:30 +0000241 ipv4->prefixlen = connected->address->prefixlen;
242 ipv4->prefix = connected->address->u.prefix4;
hassof390d2c2004-09-10 20:48:21 +0000243 listnode_add (circuit->ip_addrs, ipv4);
hasso0dae85e2004-09-26 19:53:47 +0000244 if (circuit->area)
245 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000246
jardineb5d44e2003-12-23 08:09:43 +0000247#ifdef EXTREME_DEBUG
hassof891f442004-09-14 13:54:30 +0000248 prefix2str (connected->address, buf, BUFSIZ);
hassof390d2c2004-09-10 20:48:21 +0000249 zlog_info ("Added IP address %s to circuit %d", buf,
250 circuit->circuit_id);
251#endif /* EXTREME_DEBUG */
jardineb5d44e2003-12-23 08:09:43 +0000252 }
hassof390d2c2004-09-10 20:48:21 +0000253#ifdef HAVE_IPV6
hassof891f442004-09-14 13:54:30 +0000254 if (connected->address->family == AF_INET6)
hassof390d2c2004-09-10 20:48:21 +0000255 {
256 ipv6 = prefix_ipv6_new ();
hassof891f442004-09-14 13:54:30 +0000257 ipv6->prefixlen = connected->address->prefixlen;
258 ipv6->prefix = connected->address->u.prefix6;
259
hassof390d2c2004-09-10 20:48:21 +0000260 if (IN6_IS_ADDR_LINKLOCAL (&ipv6->prefix))
hassof891f442004-09-14 13:54:30 +0000261 listnode_add (circuit->ipv6_link, ipv6);
hassof390d2c2004-09-10 20:48:21 +0000262 else
hassof891f442004-09-14 13:54:30 +0000263 listnode_add (circuit->ipv6_non_link, ipv6);
hasso0dae85e2004-09-26 19:53:47 +0000264 if (circuit->area)
265 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000266
jardineb5d44e2003-12-23 08:09:43 +0000267#ifdef EXTREME_DEBUG
hassof891f442004-09-14 13:54:30 +0000268 prefix2str (connected->address, buf, BUFSIZ);
hassof390d2c2004-09-10 20:48:21 +0000269 zlog_info ("Added IPv6 address %s to circuit %d", buf,
270 circuit->circuit_id);
271#endif /* EXTREME_DEBUG */
272 }
jardineb5d44e2003-12-23 08:09:43 +0000273#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000274 return;
275}
276
277void
278isis_circuit_del_addr (struct isis_circuit *circuit,
hassof390d2c2004-09-10 20:48:21 +0000279 struct connected *connected)
jardineb5d44e2003-12-23 08:09:43 +0000280{
hassof891f442004-09-14 13:54:30 +0000281 struct prefix_ipv4 *ipv4, *ip = NULL;
282 struct listnode *node;
283 int found = 0;
284 u_char buf[BUFSIZ];
285#ifdef HAVE_IPV6
286 struct prefix_ipv6 *ipv6, *ip6 = NULL;
287#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000288
hassof891f442004-09-14 13:54:30 +0000289 memset (&buf, 0, BUFSIZ);
290 if (connected->address->family == AF_INET)
291 {
292 ipv4 = prefix_ipv4_new ();
293 ipv4->prefixlen = connected->address->prefixlen;
294 ipv4->prefix = connected->address->u.prefix4;
295
296 for (node = listhead (circuit->ip_addrs); node; nextnode (node))
297 {
298 ip = getdata (node);
299 if (prefix_same ((struct prefix *) ip, (struct prefix *) &ipv4))
300 break;
301 }
302
303 if (ip)
304 {
305 listnode_delete (circuit->ip_addrs, ip);
hasso0dae85e2004-09-26 19:53:47 +0000306 if (circuit->area)
307 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000308 }
309 else
310 {
hassof7c43dc2004-09-26 16:24:14 +0000311 prefix2str (connected->address, (char *)buf, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000312 zlog_warn("Nonexitant ip address %s removal attempt from circuit \
313 %d", buf, circuit->circuit_id);
314 }
315 }
316#ifdef HAVE_IPV6
317 if (connected->address->family == AF_INET6)
318 {
319 ipv6 = prefix_ipv6_new ();
320 ipv6->prefixlen = connected->address->prefixlen;
321 ipv6->prefix = connected->address->u.prefix6;
322
323 if (IN6_IS_ADDR_LINKLOCAL (&ipv6->prefix))
324 {
325 for (node = listhead (circuit->ipv6_link); node; nextnode (node))
326 {
327 ip6 = getdata (node);
328 if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6))
329 break;
330 }
331 if (ip6)
332 {
333 listnode_delete (circuit->ipv6_link, ip6);
334 found = 1;
335 }
336 }
337 else
338 {
339 for (node = listhead (circuit->ipv6_non_link); node; nextnode (node))
340 {
341 ip6 = getdata (node);
342 if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6))
343 break;
344 }
345 if (ip6)
346 {
347 listnode_delete (circuit->ipv6_non_link, ip6);
348 found = 1;
349 }
350 }
351
352 if (!found)
353 {
hassof7c43dc2004-09-26 16:24:14 +0000354 prefix2str (connected->address, (char *)buf, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000355 zlog_warn("Nonexitant ip address %s removal attempt from \
356 circuit %d", buf, circuit->circuit_id);
357 }
358 else
hasso0dae85e2004-09-26 19:53:47 +0000359 if (circuit->area)
360 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000361 }
362#endif /* HAVE_IPV6 */
363 return;
jardineb5d44e2003-12-23 08:09:43 +0000364}
365
366void
367isis_circuit_if_add (struct isis_circuit *circuit, struct interface *ifp)
368{
369 struct listnode *node;
370 struct connected *conn;
371
372 circuit->interface = ifp;
373 ifp->info = circuit;
hassof390d2c2004-09-10 20:48:21 +0000374
375 circuit->circuit_id = ifp->ifindex % 255; /* FIXME: Why not ? */
jardineb5d44e2003-12-23 08:09:43 +0000376
377 /* isis_circuit_update_addrs (circuit, ifp); */
378
hassof390d2c2004-09-10 20:48:21 +0000379 if (if_is_broadcast (ifp))
380 {
381 circuit->circ_type = CIRCUIT_T_BROADCAST;
382 /*
383 * Get the Hardware Address
384 */
jardineb5d44e2003-12-23 08:09:43 +0000385#ifdef HAVE_SOCKADDR_DL
hassof390d2c2004-09-10 20:48:21 +0000386 if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN)
387 zlog_warn ("unsupported link layer");
388 else
389 memcpy (circuit->u.bc.snpa, LLADDR (&circuit->interface->sdl),
390 ETH_ALEN);
jardineb5d44e2003-12-23 08:09:43 +0000391#else
hassof390d2c2004-09-10 20:48:21 +0000392 if (circuit->interface->hw_addr_len != ETH_ALEN)
393 {
394 zlog_warn ("unsupported link layer");
395 }
396 else
397 {
398 memcpy (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN);
399 }
jardineb5d44e2003-12-23 08:09:43 +0000400#ifdef EXTREME_DEGUG
hassof390d2c2004-09-10 20:48:21 +0000401 zlog_info ("isis_circuit_if_add: if_id %d, isomtu %d snpa %s",
402 circuit->interface->ifindex, ISO_MTU (circuit),
403 snpa_print (circuit->u.bc.snpa));
jardineb5d44e2003-12-23 08:09:43 +0000404
405#endif /* EXTREME_DEBUG */
hassof390d2c2004-09-10 20:48:21 +0000406#endif /* HAVE_SOCKADDR_DL */
407 }
408 else if (if_is_pointopoint (ifp))
409 {
410 circuit->circ_type = CIRCUIT_T_P2P;
411 }
412 else
413 {
414 zlog_warn ("isis_circuit_if_add: unsupported media");
415 }
416
417 for (node = ifp->connected ? listhead (ifp->connected) : NULL; node;
418 nextnode (node))
419 {
420 conn = getdata (node);
421 isis_circuit_add_addr (circuit, conn);
422 }
jardineb5d44e2003-12-23 08:09:43 +0000423
424 return;
425}
426
427void
hassof390d2c2004-09-10 20:48:21 +0000428isis_circuit_update_params (struct isis_circuit *circuit,
429 struct interface *ifp)
jardineb5d44e2003-12-23 08:09:43 +0000430{
431 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +0000432
433 if (circuit->circuit_id != ifp->ifindex)
434 {
435 zlog_warn ("changing circuit_id %d->%d", circuit->circuit_id,
436 ifp->ifindex);
437 circuit->circuit_id = ifp->ifindex % 255;
438 }
jardineb5d44e2003-12-23 08:09:43 +0000439
440 /* FIXME: Why is this needed? shouldn't we compare to the area's mtu */
441 /* Ofer, this was here in case someone changes the mtu (e.g. with ifconfig)
442 The areas MTU is the minimum of mtu's of circuits in the area
443 now we can't catch the change
444 if (circuit->mtu != ifp->mtu) {
445 zlog_warn ("changing circuit mtu %d->%d", circuit->mtu,
446 ifp->mtu);
447 circuit->mtu = ifp->mtu;
448 }
hassof390d2c2004-09-10 20:48:21 +0000449 */
jardineb5d44e2003-12-23 08:09:43 +0000450 /*
451 * Get the Hardware Address
452 */
453#ifdef HAVE_SOCKADDR_DL
454 if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN)
jardineb5d44e2003-12-23 08:09:43 +0000455 zlog_warn ("unsupported link layer");
hassof390d2c2004-09-10 20:48:21 +0000456 else
457 memcpy (circuit->u.bc.snpa, LLADDR (&circuit->interface->sdl), ETH_ALEN);
458#else
459 if (circuit->interface->hw_addr_len != ETH_ALEN)
460 {
461 zlog_warn ("unsupported link layer");
jardineb5d44e2003-12-23 08:09:43 +0000462 }
hassof390d2c2004-09-10 20:48:21 +0000463 else
464 {
465 if (memcmp (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN))
466 {
467 zlog_warn ("changing circuit snpa %s->%s",
468 snpa_print (circuit->u.bc.snpa),
469 snpa_print (circuit->interface->hw_addr));
470 }
471 }
472#endif
jardineb5d44e2003-12-23 08:09:43 +0000473
hassof390d2c2004-09-10 20:48:21 +0000474 if (if_is_broadcast (ifp))
475 {
476 circuit->circ_type = CIRCUIT_T_BROADCAST;
477 }
478 else if (if_is_pointopoint (ifp))
479 {
480 circuit->circ_type = CIRCUIT_T_P2P;
481 }
482 else
483 {
484 zlog_warn ("isis_circuit_update_params: unsupported media");
485 }
jardineb5d44e2003-12-23 08:09:43 +0000486
jardineb5d44e2003-12-23 08:09:43 +0000487 return;
488}
489
490void
hassof390d2c2004-09-10 20:48:21 +0000491isis_circuit_if_del (struct isis_circuit *circuit)
jardineb5d44e2003-12-23 08:09:43 +0000492{
493 circuit->interface->info = NULL;
494 circuit->interface = NULL;
hassof390d2c2004-09-10 20:48:21 +0000495
jardineb5d44e2003-12-23 08:09:43 +0000496 return;
497}
498
499void
500isis_circuit_up (struct isis_circuit *circuit)
501{
jardineb5d44e2003-12-23 08:09:43 +0000502
hassof390d2c2004-09-10 20:48:21 +0000503 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
504 {
505 if (circuit->area->min_bcast_mtu == 0 ||
506 ISO_MTU (circuit) < circuit->area->min_bcast_mtu)
507 circuit->area->min_bcast_mtu = ISO_MTU (circuit);
508 /*
509 * ISO 10589 - 8.4.1 Enabling of broadcast circuits
510 */
jardineb5d44e2003-12-23 08:09:43 +0000511
hassof390d2c2004-09-10 20:48:21 +0000512 /* initilizing the hello sending threads
513 * for a broadcast IF
514 */
jardineb5d44e2003-12-23 08:09:43 +0000515
hassof390d2c2004-09-10 20:48:21 +0000516 /* 8.4.1 a) commence sending of IIH PDUs */
517
518 if (circuit->circuit_is_type & IS_LEVEL_1)
519 {
520 thread_add_event (master, send_lan_l1_hello, circuit, 0);
521 circuit->u.bc.lan_neighs[0] = list_new ();
522 }
523
524 if (circuit->circuit_is_type & IS_LEVEL_2)
525 {
526 thread_add_event (master, send_lan_l2_hello, circuit, 0);
527 circuit->u.bc.lan_neighs[1] = list_new ();
528 }
529
530 /* 8.4.1 b) FIXME: solicit ES - 8.4.6 */
531 /* 8.4.1 c) FIXME: listen for ESH PDUs */
532
533 /* 8.4.1 d) */
534 /* dr election will commence in... */
535 if (circuit->circuit_is_type & IS_LEVEL_1)
536 THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[0], isis_run_dr_l1,
hassobf731012004-09-17 07:59:57 +0000537 circuit, 2 * circuit->hello_interval[0]);
hassof390d2c2004-09-10 20:48:21 +0000538 if (circuit->circuit_is_type & IS_LEVEL_2)
539 THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[1], isis_run_dr_l2,
hassobf731012004-09-17 07:59:57 +0000540 circuit, 2 * circuit->hello_interval[1]);
jardineb5d44e2003-12-23 08:09:43 +0000541 }
hassof390d2c2004-09-10 20:48:21 +0000542 else
543 {
544 /* initializing the hello send threads
545 * for a ptp IF
546 */
547 thread_add_event (master, send_p2p_hello, circuit, 0);
jardineb5d44e2003-12-23 08:09:43 +0000548
jardineb5d44e2003-12-23 08:09:43 +0000549 }
550
jardineb5d44e2003-12-23 08:09:43 +0000551 /* initializing PSNP timers */
hassof390d2c2004-09-10 20:48:21 +0000552 if (circuit->circuit_is_type & IS_LEVEL_1)
553 {
554 THREAD_TIMER_ON (master, circuit->t_send_psnp[0], send_l1_psnp, circuit,
555 isis_jitter (circuit->psnp_interval[0], PSNP_JITTER));
556 }
557
558 if (circuit->circuit_is_type & IS_LEVEL_2)
559 {
560 THREAD_TIMER_ON (master, circuit->t_send_psnp[1], send_l2_psnp, circuit,
561 isis_jitter (circuit->psnp_interval[1], PSNP_JITTER));
562 }
563
jardineb5d44e2003-12-23 08:09:43 +0000564 /* initialize the circuit streams */
565 if (circuit->rcv_stream == NULL)
hassof390d2c2004-09-10 20:48:21 +0000566 circuit->rcv_stream = stream_new (ISO_MTU (circuit));
jardineb5d44e2003-12-23 08:09:43 +0000567
568 if (circuit->snd_stream == NULL)
hassof390d2c2004-09-10 20:48:21 +0000569 circuit->snd_stream = stream_new (ISO_MTU (circuit));
jardineb5d44e2003-12-23 08:09:43 +0000570
571 /* unified init for circuits */
572 isis_sock_init (circuit);
573
574#ifdef GNU_LINUX
hassof390d2c2004-09-10 20:48:21 +0000575 THREAD_READ_ON (master, circuit->t_read, isis_receive, circuit,
576 circuit->fd);
jardineb5d44e2003-12-23 08:09:43 +0000577#else
hassof390d2c2004-09-10 20:48:21 +0000578 THREAD_TIMER_ON (master, circuit->t_read, isis_receive, circuit,
579 circuit->fd);
jardineb5d44e2003-12-23 08:09:43 +0000580#endif
581 return;
582}
583
584void
585isis_circuit_down (struct isis_circuit *circuit)
586{
hassof390d2c2004-09-10 20:48:21 +0000587 /* Cancel all active threads -- FIXME: wrong place */
hassod70f99e2004-02-11 20:26:31 +0000588 /* HT: Read thread if GNU_LINUX, TIMER thread otherwise. */
hassof390d2c2004-09-10 20:48:21 +0000589 THREAD_OFF (circuit->t_read);
590 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
591 {
592 THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[0]);
593 THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[1]);
hassof891f442004-09-14 13:54:30 +0000594 THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[0]);
595 THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[1]);
hassof390d2c2004-09-10 20:48:21 +0000596 }
597 else if (circuit->circ_type == CIRCUIT_T_P2P)
598 {
599 THREAD_TIMER_OFF (circuit->u.p2p.t_send_p2p_hello);
600 }
jardineb5d44e2003-12-23 08:09:43 +0000601 /* close the socket */
602 close (circuit->fd);
603
604 return;
605}
606
607void
608circuit_update_nlpids (struct isis_circuit *circuit)
609{
610 circuit->nlpids.count = 0;
hassof390d2c2004-09-10 20:48:21 +0000611
612 if (circuit->ip_router)
613 {
614 circuit->nlpids.nlpids[0] = NLPID_IP;
615 circuit->nlpids.count++;
616 }
jardineb5d44e2003-12-23 08:09:43 +0000617#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000618 if (circuit->ipv6_router)
619 {
620 circuit->nlpids.nlpids[circuit->nlpids.count] = NLPID_IPV6;
621 circuit->nlpids.count++;
622 }
jardineb5d44e2003-12-23 08:09:43 +0000623#endif /* HAVE_IPV6 */
624 return;
625}
626
627int
hassof390d2c2004-09-10 20:48:21 +0000628isis_interface_config_write (struct vty *vty)
jardineb5d44e2003-12-23 08:09:43 +0000629{
630
631 int write = 0;
hasso52dc7ee2004-09-23 19:18:23 +0000632 struct listnode *node;
633 struct listnode *node2;
jardineb5d44e2003-12-23 08:09:43 +0000634 struct interface *ifp;
635 struct isis_area *area;
636 struct isis_circuit *c;
jardineb5d44e2003-12-23 08:09:43 +0000637 int i;
jardineb5d44e2003-12-23 08:09:43 +0000638
jardineb5d44e2003-12-23 08:09:43 +0000639 LIST_LOOP (iflist, ifp, node)
640 {
641 /* IF name */
hassof390d2c2004-09-10 20:48:21 +0000642 vty_out (vty, "interface %s%s", ifp->name, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000643 write++;
644 /* IF desc */
hassof390d2c2004-09-10 20:48:21 +0000645 if (ifp->desc)
646 {
647 vty_out (vty, " description %s%s", ifp->desc, VTY_NEWLINE);
648 write++;
649 }
jardineb5d44e2003-12-23 08:09:43 +0000650 /* ISIS Circuit */
651 LIST_LOOP (isis->area_list, area, node2)
652 {
653 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +0000654 if (c)
655 {
656 if (c->ip_router)
657 {
658 vty_out (vty, " ip router isis %s%s", area->area_tag,
659 VTY_NEWLINE);
660 write++;
661 }
jardineb5d44e2003-12-23 08:09:43 +0000662#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000663 if (c->ipv6_router)
664 {
665 vty_out (vty, " ipv6 router isis %s%s", area->area_tag,
666 VTY_NEWLINE);
667 write++;
668 }
jardineb5d44e2003-12-23 08:09:43 +0000669#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000670
hassof390d2c2004-09-10 20:48:21 +0000671 /* ISIS - circuit type */
672 if (c->circuit_is_type == IS_LEVEL_1)
673 {
674 vty_out (vty, " isis circuit-type level-1%s", VTY_NEWLINE);
675 write++;
676 }
677 else
678 {
679 if (c->circuit_is_type == IS_LEVEL_2)
680 {
681 vty_out (vty, " isis circuit-type level-2-only%s",
682 VTY_NEWLINE);
683 write++;
684 }
685 }
jardineb5d44e2003-12-23 08:09:43 +0000686
hassof390d2c2004-09-10 20:48:21 +0000687 /* ISIS - CSNP interval - FIXME: compare to cisco */
688 if (c->csnp_interval[0] == c->csnp_interval[1])
689 {
690 if (c->csnp_interval[0] != CSNP_INTERVAL)
691 {
692 vty_out (vty, " isis csnp-interval %d%s",
693 c->csnp_interval[0], VTY_NEWLINE);
694 write++;
695 }
696 }
697 else
698 {
699 for (i = 0; i < 2; i++)
700 {
701 if (c->csnp_interval[1] != CSNP_INTERVAL)
702 {
703 vty_out (vty, " isis csnp-interval %d level-%d%s",
704 c->csnp_interval[1], i + 1, VTY_NEWLINE);
705 write++;
706 }
707 }
708 }
jardineb5d44e2003-12-23 08:09:43 +0000709
hassof390d2c2004-09-10 20:48:21 +0000710 /* ISIS - Hello padding - Defaults to true so only display if false */
711 if (c->circ_type == CIRCUIT_T_BROADCAST && !c->u.bc.pad_hellos)
712 {
713 vty_out (vty, " no isis hello padding%s", VTY_NEWLINE);
714 write++;
715 }
jardineb5d44e2003-12-23 08:09:43 +0000716
hassof390d2c2004-09-10 20:48:21 +0000717 /* ISIS - Hello interval - FIXME: compare to cisco */
718 if (c->hello_interval[0] == c->hello_interval[1])
719 {
720 if (c->hello_interval[0] != HELLO_INTERVAL)
721 {
722 vty_out (vty, " isis hello-interval %d%s",
723 c->hello_interval[0], VTY_NEWLINE);
724 write++;
725 }
726 }
727 else
728 {
729 for (i = 0; i < 2; i++)
730 {
731 if (c->hello_interval[i] != HELLO_INTERVAL)
732 {
733 if (c->hello_interval[i] == HELLO_MINIMAL)
734 {
735 vty_out (vty,
736 " isis hello-interval minimal level-%d%s",
737 i + 1, VTY_NEWLINE);
738 }
739 else
740 {
741 vty_out (vty, " isis hello-interval %d level-%d%s",
742 c->hello_interval[i], i + 1, VTY_NEWLINE);
743 }
744 write++;
745 }
746 }
747 }
jardineb5d44e2003-12-23 08:09:43 +0000748
hassof390d2c2004-09-10 20:48:21 +0000749 /* ISIS - Hello Multiplier */
750 if (c->hello_multiplier[0] == c->hello_multiplier[1])
751 {
752 if (c->hello_multiplier[0] != HELLO_MULTIPLIER)
753 {
754 vty_out (vty, " isis hello-multiplier %d%s",
755 c->hello_multiplier[0], VTY_NEWLINE);
756 write++;
757 }
758 }
759 else
760 {
761 for (i = 0; i < 2; i++)
762 {
763 if (c->hello_multiplier[i] != HELLO_MULTIPLIER)
764 {
765 vty_out (vty, " isis hello-multiplier %d level-%d%s",
766 c->hello_multiplier[i], i + 1, VTY_NEWLINE);
767 write++;
768 }
769 }
770 }
771 /* ISIS - Priority */
772 if (c->circ_type == CIRCUIT_T_BROADCAST)
773 {
774 if (c->u.bc.priority[0] == c->u.bc.priority[1])
775 {
776 if (c->u.bc.priority[0] != DEFAULT_PRIORITY)
777 {
778 vty_out (vty, " isis priority %d%s",
779 c->u.bc.priority[0], VTY_NEWLINE);
780 write++;
781 }
782 }
783 else
784 {
785 for (i = 0; i < 2; i++)
786 {
787 if (c->u.bc.priority[i] != DEFAULT_PRIORITY)
788 {
789 vty_out (vty, " isis priority %d level-%d%s",
790 c->u.bc.priority[i], i + 1, VTY_NEWLINE);
791 write++;
792 }
793 }
794 }
795 }
796 /* ISIS - Metric */
797 if (c->metrics[0].metric_default == c->metrics[1].metric_default)
798 {
799 if (c->metrics[0].metric_default != DEFAULT_CIRCUIT_METRICS)
800 {
801 vty_out (vty, " isis metric %d%s",
802 c->metrics[0].metric_default, VTY_NEWLINE);
803 write++;
804 }
805 }
806 else
807 {
808 for (i = 0; i < 2; i++)
809 {
810 if (c->metrics[i].metric_default != DEFAULT_CIRCUIT_METRICS)
811 {
812 vty_out (vty, " isis metric %d level-%d%s",
813 c->metrics[i].metric_default, i + 1,
814 VTY_NEWLINE);
815 write++;
816 }
817 }
818 }
jardineb5d44e2003-12-23 08:09:43 +0000819
hassof390d2c2004-09-10 20:48:21 +0000820 }
jardineb5d44e2003-12-23 08:09:43 +0000821 }
hassof390d2c2004-09-10 20:48:21 +0000822 vty_out (vty, "!%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000823 }
hassof390d2c2004-09-10 20:48:21 +0000824
jardineb5d44e2003-12-23 08:09:43 +0000825 return write;
826}
jardineb5d44e2003-12-23 08:09:43 +0000827
828DEFUN (ip_router_isis,
829 ip_router_isis_cmd,
830 "ip router isis WORD",
831 "Interface Internet Protocol config commands\n"
832 "IP router interface commands\n"
833 "IS-IS Routing for IP\n"
hassof390d2c2004-09-10 20:48:21 +0000834 "Routing process tag\n")
jardineb5d44e2003-12-23 08:09:43 +0000835{
836 struct isis_circuit *c;
837 struct interface *ifp;
838 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000839
840 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000841 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +0000842
jardineb5d44e2003-12-23 08:09:43 +0000843 area = isis_area_lookup (argv[0]);
844
845 /* Prevent more than one circuit per interface */
846 if (area)
847 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +0000848 else
849 c = NULL;
850 if (c && (ifp->info != NULL))
851 {
jardineb5d44e2003-12-23 08:09:43 +0000852#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000853 if (c->ipv6_router == 0)
854 {
jardineb5d44e2003-12-23 08:09:43 +0000855#endif /* HAVE_IPV6 */
hassof390d2c2004-09-10 20:48:21 +0000856 vty_out (vty, "ISIS circuit is already defined%s", VTY_NEWLINE);
857 return CMD_WARNING;
jardineb5d44e2003-12-23 08:09:43 +0000858#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000859 }
860#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000861 }
hassof390d2c2004-09-10 20:48:21 +0000862
jardineb5d44e2003-12-23 08:09:43 +0000863 /* this is here for ciscopability */
hassof390d2c2004-09-10 20:48:21 +0000864 if (!area)
865 {
866 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
867 return CMD_WARNING;
868 }
jardineb5d44e2003-12-23 08:09:43 +0000869
hassof390d2c2004-09-10 20:48:21 +0000870 if (!c)
871 {
872 c = circuit_lookup_by_ifp (ifp, isis->init_circ_list);
873 c = isis_csm_state_change (ISIS_ENABLE, c, area);
874 c->interface = ifp; /* this is automatic */
875 ifp->info = c; /* hardly related to the FSM */
876 }
jardineb5d44e2003-12-23 08:09:43 +0000877
hassof390d2c2004-09-10 20:48:21 +0000878 if (!c)
jardineb5d44e2003-12-23 08:09:43 +0000879 return CMD_WARNING;
880
881 c->ip_router = 1;
882 area->ip_circuits++;
883 circuit_update_nlpids (c);
884
885 vty->node = INTERFACE_NODE;
hassof390d2c2004-09-10 20:48:21 +0000886
jardineb5d44e2003-12-23 08:09:43 +0000887 return CMD_SUCCESS;
888}
889
890DEFUN (no_ip_router_isis,
891 no_ip_router_isis_cmd,
892 "no ip router isis WORD",
893 NO_STR
894 "Interface Internet Protocol config commands\n"
895 "IP router interface commands\n"
896 "IS-IS Routing for IP\n"
hassof390d2c2004-09-10 20:48:21 +0000897 "Routing process tag\n")
jardineb5d44e2003-12-23 08:09:43 +0000898{
899 struct isis_circuit *circuit = NULL;
900 struct interface *ifp;
901 struct isis_area *area;
902 struct listnode *node;
903
hassof390d2c2004-09-10 20:48:21 +0000904 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000905 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +0000906
jardineb5d44e2003-12-23 08:09:43 +0000907 area = isis_area_lookup (argv[0]);
hassof390d2c2004-09-10 20:48:21 +0000908 if (!area)
909 {
910 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
911 return CMD_WARNING;
912 }
jardineb5d44e2003-12-23 08:09:43 +0000913 LIST_LOOP (area->circuit_list, circuit, node)
914 if (circuit->interface == ifp)
915 break;
hassof390d2c2004-09-10 20:48:21 +0000916 if (!circuit)
917 {
918 vty_out (vty, "Can't find ISIS interface %s", VTY_NEWLINE);
919 return CMD_WARNING;
920 }
jardineb5d44e2003-12-23 08:09:43 +0000921 circuit->ip_router = 0;
922 area->ip_circuits--;
923#ifdef HAVE_IPV6
924 if (circuit->ipv6_router == 0)
925#endif
926 isis_csm_state_change (ISIS_DISABLE, circuit, area);
hassof390d2c2004-09-10 20:48:21 +0000927
jardineb5d44e2003-12-23 08:09:43 +0000928 return CMD_SUCCESS;
929}
930
931DEFUN (isis_circuit_type,
932 isis_circuit_type_cmd,
933 "isis circuit-type (level-1|level-1-2|level-2-only)",
934 "IS-IS commands\n"
935 "Configure circuit type for interface\n"
936 "Level-1 only adjacencies are formed\n"
937 "Level-1-2 adjacencies are formed\n"
hassof390d2c2004-09-10 20:48:21 +0000938 "Level-2 only adjacencies are formed\n")
jardineb5d44e2003-12-23 08:09:43 +0000939{
940 struct isis_circuit *circuit;
941 struct interface *ifp;
942 int circuit_t;
943 int is_type;
hassof390d2c2004-09-10 20:48:21 +0000944
945 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000946 circuit = ifp->info;
947 /* UGLY - will remove l8r */
hassof390d2c2004-09-10 20:48:21 +0000948 if (circuit == NULL)
949 {
950 return CMD_WARNING;
951 }
jardineb5d44e2003-12-23 08:09:43 +0000952
hasso13c48f72004-09-10 21:19:13 +0000953 /* XXX what to do when ip_router_isis is not executed */
954 if (circuit->area == NULL)
955 return CMD_WARNING;
956
jardineb5d44e2003-12-23 08:09:43 +0000957 assert (circuit);
958
hassof7c43dc2004-09-26 16:24:14 +0000959 circuit_t = string2circuit_t ((u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +0000960
hassof390d2c2004-09-10 20:48:21 +0000961 if (!circuit_t)
962 {
963 vty_out (vty, "Unknown circuit-type %s", VTY_NEWLINE);
964 return CMD_SUCCESS;
965 }
966
jardineb5d44e2003-12-23 08:09:43 +0000967 is_type = circuit->area->is_type;
968 if (is_type == IS_LEVEL_1_AND_2 || is_type == circuit_t)
hassof390d2c2004-09-10 20:48:21 +0000969 isis_event_circuit_type_change (circuit, circuit_t);
970 else
971 {
972 vty_out (vty, "invalid circuit level for area %s.%s",
973 circuit->area->area_tag, VTY_NEWLINE);
974 }
975
jardineb5d44e2003-12-23 08:09:43 +0000976 return CMD_SUCCESS;
977}
978
979DEFUN (no_isis_circuit_type,
980 no_isis_circuit_type_cmd,
981 "no isis circuit-type (level-1|level-1-2|level-2-only)",
982 NO_STR
983 "IS-IS commands\n"
984 "Configure circuit type for interface\n"
985 "Level-1 only adjacencies are formed\n"
986 "Level-1-2 adjacencies are formed\n"
hassof390d2c2004-09-10 20:48:21 +0000987 "Level-2 only adjacencies are formed\n")
jardineb5d44e2003-12-23 08:09:43 +0000988{
989 struct isis_circuit *circuit;
990 struct interface *ifp;
jardineb5d44e2003-12-23 08:09:43 +0000991
hassof390d2c2004-09-10 20:48:21 +0000992 ifp = vty->index;
993 circuit = ifp->info;
994 if (circuit == NULL)
995 {
996 return CMD_WARNING;
997 }
998
999 assert (circuit);
1000
jardineb5d44e2003-12-23 08:09:43 +00001001 /*
1002 * Set the circuits level to its default value which is that of the area
1003 */
1004 isis_event_circuit_type_change (circuit, circuit->area->is_type);
hassof390d2c2004-09-10 20:48:21 +00001005
jardineb5d44e2003-12-23 08:09:43 +00001006 return CMD_SUCCESS;
1007}
1008
1009DEFUN (isis_passwd,
1010 isis_passwd_cmd,
1011 "isis password WORD",
1012 "IS-IS commands\n"
1013 "Configure the authentication password for interface\n"
1014 "Password\n")
1015{
1016 struct isis_circuit *circuit;
1017 struct interface *ifp;
1018 int len;
hassof390d2c2004-09-10 20:48:21 +00001019
1020 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001021 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001022 if (circuit == NULL)
1023 {
1024 return CMD_WARNING;
1025 }
1026
jardineb5d44e2003-12-23 08:09:43 +00001027 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001028 if (len > 254)
1029 {
1030 vty_out (vty, "Too long circuit password (>254)%s", VTY_NEWLINE);
1031 return CMD_WARNING;
1032 }
jardineb5d44e2003-12-23 08:09:43 +00001033 circuit->passwd.len = len;
1034 circuit->passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001035 strncpy ((char *)circuit->passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001036
jardineb5d44e2003-12-23 08:09:43 +00001037 return CMD_SUCCESS;
1038}
1039
1040DEFUN (no_isis_passwd,
1041 no_isis_passwd_cmd,
1042 "no isis password",
1043 NO_STR
1044 "IS-IS commands\n"
1045 "Configure the authentication password for interface\n")
1046{
1047 struct isis_circuit *circuit;
1048 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001049
1050 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001051 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001052 if (circuit == NULL)
1053 {
1054 return CMD_WARNING;
1055 }
1056
jardineb5d44e2003-12-23 08:09:43 +00001057 memset (&circuit->passwd, 0, sizeof (struct isis_passwd));
hassof390d2c2004-09-10 20:48:21 +00001058
jardineb5d44e2003-12-23 08:09:43 +00001059 return CMD_SUCCESS;
1060}
1061
1062
1063DEFUN (isis_priority,
1064 isis_priority_cmd,
1065 "isis priority <0-127>",
1066 "IS-IS commands\n"
1067 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001068 "Priority value\n")
jardineb5d44e2003-12-23 08:09:43 +00001069{
1070 struct isis_circuit *circuit;
1071 struct interface *ifp;
1072 int prio;
hassof390d2c2004-09-10 20:48:21 +00001073
1074 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001075 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001076 if (circuit == NULL)
1077 {
1078 return CMD_WARNING;
1079 }
jardineb5d44e2003-12-23 08:09:43 +00001080 assert (circuit);
1081
1082 prio = atoi (argv[0]);
1083
1084 circuit->u.bc.priority[0] = prio;
1085 circuit->u.bc.priority[1] = prio;
hassof390d2c2004-09-10 20:48:21 +00001086
jardineb5d44e2003-12-23 08:09:43 +00001087 return CMD_SUCCESS;
1088}
1089
1090DEFUN (no_isis_priority,
1091 no_isis_priority_cmd,
1092 "no isis priority",
1093 NO_STR
1094 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001095 "Set priority for Designated Router election\n")
jardineb5d44e2003-12-23 08:09:43 +00001096{
1097 struct isis_circuit *circuit;
1098 struct interface *ifp;
1099
hassof390d2c2004-09-10 20:48:21 +00001100 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001101 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001102 if (circuit == NULL)
1103 {
1104 return CMD_WARNING;
1105 }
jardineb5d44e2003-12-23 08:09:43 +00001106 assert (circuit);
1107
1108 circuit->u.bc.priority[0] = DEFAULT_PRIORITY;
1109 circuit->u.bc.priority[1] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001110
jardineb5d44e2003-12-23 08:09:43 +00001111 return CMD_SUCCESS;
1112}
1113
1114ALIAS (no_isis_priority,
1115 no_isis_priority_arg_cmd,
1116 "no isis priority <0-127>",
1117 NO_STR
1118 "IS-IS commands\n"
1119 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001120 "Priority value\n")
jardineb5d44e2003-12-23 08:09:43 +00001121
1122DEFUN (isis_priority_l1,
1123 isis_priority_l1_cmd,
hassof390d2c2004-09-10 20:48:21 +00001124 "isis priority <0-127> level-1",
jardineb5d44e2003-12-23 08:09:43 +00001125 "IS-IS commands\n"
1126 "Set priority for Designated Router election\n"
1127 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001128 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001129{
1130 struct isis_circuit *circuit;
1131 struct interface *ifp;
1132 int prio;
hassof390d2c2004-09-10 20:48:21 +00001133
1134 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001135 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001136 if (circuit == NULL)
1137 {
1138 return CMD_WARNING;
1139 }
jardineb5d44e2003-12-23 08:09:43 +00001140 assert (circuit);
1141
1142 prio = atoi (argv[0]);
1143
1144 circuit->u.bc.priority[0] = prio;
hassof390d2c2004-09-10 20:48:21 +00001145
jardineb5d44e2003-12-23 08:09:43 +00001146 return CMD_SUCCESS;
1147}
1148
1149DEFUN (no_isis_priority_l1,
1150 no_isis_priority_l1_cmd,
1151 "no isis priority level-1",
1152 NO_STR
1153 "IS-IS commands\n"
1154 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001155 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001156{
1157 struct isis_circuit *circuit;
1158 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001159
1160 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001161 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001162 if (circuit == NULL)
1163 {
1164 return CMD_WARNING;
1165 }
jardineb5d44e2003-12-23 08:09:43 +00001166 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001167
jardineb5d44e2003-12-23 08:09:43 +00001168 circuit->u.bc.priority[0] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001169
jardineb5d44e2003-12-23 08:09:43 +00001170 return CMD_SUCCESS;
1171}
1172
1173ALIAS (no_isis_priority_l1,
1174 no_isis_priority_l1_arg_cmd,
1175 "no isis priority <0-127> level-1",
1176 NO_STR
1177 "IS-IS commands\n"
1178 "Set priority for Designated Router election\n"
1179 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001180 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001181
1182DEFUN (isis_priority_l2,
1183 isis_priority_l2_cmd,
hassof390d2c2004-09-10 20:48:21 +00001184 "isis priority <0-127> level-2",
jardineb5d44e2003-12-23 08:09:43 +00001185 "IS-IS commands\n"
1186 "Set priority for Designated Router election\n"
1187 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001188 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001189{
1190 struct isis_circuit *circuit;
1191 struct interface *ifp;
1192 int prio;
hassof390d2c2004-09-10 20:48:21 +00001193
1194 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001195 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001196 if (circuit == NULL)
1197 {
1198 return CMD_WARNING;
1199 }
jardineb5d44e2003-12-23 08:09:43 +00001200 assert (circuit);
1201
1202 prio = atoi (argv[0]);
1203
1204 circuit->u.bc.priority[1] = prio;
hassof390d2c2004-09-10 20:48:21 +00001205
jardineb5d44e2003-12-23 08:09:43 +00001206 return CMD_SUCCESS;
1207}
1208
1209DEFUN (no_isis_priority_l2,
1210 no_isis_priority_l2_cmd,
1211 "no isis priority level-2",
1212 NO_STR
1213 "IS-IS commands\n"
1214 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001215 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001216{
1217 struct isis_circuit *circuit;
1218 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001219
1220 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001221 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001222 if (circuit == NULL)
1223 {
1224 return CMD_WARNING;
1225 }
jardineb5d44e2003-12-23 08:09:43 +00001226 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001227
jardineb5d44e2003-12-23 08:09:43 +00001228 circuit->u.bc.priority[1] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001229
jardineb5d44e2003-12-23 08:09:43 +00001230 return CMD_SUCCESS;
1231}
1232
1233ALIAS (no_isis_priority_l2,
1234 no_isis_priority_l2_arg_cmd,
1235 "no isis priority <0-127> level-2",
1236 NO_STR
1237 "IS-IS commands\n"
1238 "Set priority for Designated Router election\n"
1239 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001240 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001241
1242/* Metric command */
hassof390d2c2004-09-10 20:48:21 +00001243 DEFUN (isis_metric,
jardineb5d44e2003-12-23 08:09:43 +00001244 isis_metric_cmd,
1245 "isis metric <0-63>",
1246 "IS-IS commands\n"
1247 "Set default metric for circuit\n"
hassof390d2c2004-09-10 20:48:21 +00001248 "Default metric value\n")
jardineb5d44e2003-12-23 08:09:43 +00001249{
1250 struct isis_circuit *circuit;
1251 struct interface *ifp;
1252 int met;
1253
hassof390d2c2004-09-10 20:48:21 +00001254 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001255 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001256 if (circuit == NULL)
1257 {
1258 return CMD_WARNING;
1259 }
jardineb5d44e2003-12-23 08:09:43 +00001260 assert (circuit);
1261
1262 met = atoi (argv[0]);
1263
1264 circuit->metrics[0].metric_default = met;
1265 circuit->metrics[1].metric_default = met;
1266
1267 return CMD_SUCCESS;
1268}
1269
1270DEFUN (no_isis_metric,
1271 no_isis_metric_cmd,
1272 "no isis metric",
1273 NO_STR
1274 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001275 "Set default metric for circuit\n")
jardineb5d44e2003-12-23 08:09:43 +00001276{
1277 struct isis_circuit *circuit;
1278 struct interface *ifp;
1279
hassof390d2c2004-09-10 20:48:21 +00001280 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001281 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001282 if (circuit == NULL)
1283 {
1284 return CMD_WARNING;
1285 }
jardineb5d44e2003-12-23 08:09:43 +00001286 assert (circuit);
1287
1288 circuit->metrics[0].metric_default = DEFAULT_CIRCUIT_METRICS;
1289 circuit->metrics[1].metric_default = DEFAULT_CIRCUIT_METRICS;
1290
1291 return CMD_SUCCESS;
1292}
1293
1294ALIAS (no_isis_metric,
1295 no_isis_metric_arg_cmd,
1296 "no isis metric <0-127>",
1297 NO_STR
1298 "IS-IS commands\n"
1299 "Set default metric for circuit\n"
hassof390d2c2004-09-10 20:48:21 +00001300 "Default metric value\n")
1301
jardineb5d44e2003-12-23 08:09:43 +00001302/* end of metrics */
hassof390d2c2004-09-10 20:48:21 +00001303 DEFUN (isis_hello_interval,
jardineb5d44e2003-12-23 08:09:43 +00001304 isis_hello_interval_cmd,
1305 "isis hello-interval (<1-65535>|minimal)",
1306 "IS-IS commands\n"
1307 "Set Hello interval\n"
1308 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00001309 "Holdtime 1 seconds, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00001310{
1311 struct isis_circuit *circuit;
1312 struct interface *ifp;
1313 int interval;
1314 char c;
1315
hassof390d2c2004-09-10 20:48:21 +00001316 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001317 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001318 if (circuit == NULL)
1319 {
1320 return CMD_WARNING;
1321 }
1322 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001323 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001324 if (isdigit ((int) c))
1325 {
1326 interval = atoi (argv[0]);
1327 }
1328 else
1329 interval = HELLO_MINIMAL; /* FIXME: should be calculated */
jardineb5d44e2003-12-23 08:09:43 +00001330
hassof390d2c2004-09-10 20:48:21 +00001331 circuit->hello_interval[0] = (u_int16_t) interval;
1332 circuit->hello_interval[1] = (u_int16_t) interval;
1333
jardineb5d44e2003-12-23 08:09:43 +00001334 return CMD_SUCCESS;
1335}
1336
1337DEFUN (no_isis_hello_interval,
1338 no_isis_hello_interval_cmd,
1339 "no isis hello-interval",
1340 NO_STR
1341 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001342 "Set Hello interval\n")
jardineb5d44e2003-12-23 08:09:43 +00001343{
1344 struct isis_circuit *circuit;
1345 struct interface *ifp;
1346
hassof390d2c2004-09-10 20:48:21 +00001347 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001348 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001349 if (circuit == NULL)
1350 {
1351 return CMD_WARNING;
1352 }
jardineb5d44e2003-12-23 08:09:43 +00001353 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001354
hassof390d2c2004-09-10 20:48:21 +00001355
1356 circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
jardineb5d44e2003-12-23 08:09:43 +00001357 circuit->hello_interval[1] = HELLO_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001358
jardineb5d44e2003-12-23 08:09:43 +00001359 return CMD_SUCCESS;
1360}
1361
1362ALIAS (no_isis_hello_interval,
1363 no_isis_hello_interval_arg_cmd,
1364 "no isis hello-interval (<1-65535>|minimal)",
1365 NO_STR
1366 "IS-IS commands\n"
1367 "Set Hello interval\n"
1368 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00001369 "Holdtime 1 second, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00001370
1371DEFUN (isis_hello_interval_l1,
1372 isis_hello_interval_l1_cmd,
1373 "isis hello-interval (<1-65535>|minimal) level-1",
1374 "IS-IS commands\n"
1375 "Set Hello interval\n"
1376 "Hello interval value\n"
1377 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001378 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001379{
1380 struct isis_circuit *circuit;
1381 struct interface *ifp;
1382 long interval;
1383 char c;
1384
hassof390d2c2004-09-10 20:48:21 +00001385 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001386 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001387 if (circuit == NULL)
1388 {
1389 return CMD_WARNING;
1390 }
jardineb5d44e2003-12-23 08:09:43 +00001391 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001392
jardineb5d44e2003-12-23 08:09:43 +00001393 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001394 if (isdigit ((int) c))
1395 {
1396 interval = atoi (argv[0]);
1397 }
1398 else
jardineb5d44e2003-12-23 08:09:43 +00001399 interval = HELLO_MINIMAL;
1400
hassof390d2c2004-09-10 20:48:21 +00001401 circuit->hello_interval[0] = (u_int16_t) interval;
1402
jardineb5d44e2003-12-23 08:09:43 +00001403 return CMD_SUCCESS;
1404}
1405
1406DEFUN (no_isis_hello_interval_l1,
1407 no_isis_hello_interval_l1_cmd,
1408 "no isis hello-interval level-1",
1409 NO_STR
1410 "IS-IS commands\n"
1411 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00001412 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001413{
1414 struct isis_circuit *circuit;
1415 struct interface *ifp;
1416
hassof390d2c2004-09-10 20:48:21 +00001417 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001418 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001419 if (circuit == NULL)
1420 {
1421 return CMD_WARNING;
1422 }
jardineb5d44e2003-12-23 08:09:43 +00001423 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001424
hassof390d2c2004-09-10 20:48:21 +00001425
1426 circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
1427
jardineb5d44e2003-12-23 08:09:43 +00001428 return CMD_SUCCESS;
1429}
1430
1431ALIAS (no_isis_hello_interval_l1,
1432 no_isis_hello_interval_l1_arg_cmd,
1433 "no isis hello-interval (<1-65535>|minimal) level-1",
1434 NO_STR
1435 "IS-IS commands\n"
1436 "Set Hello interval\n"
1437 "Hello interval value\n"
1438 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001439 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001440
1441DEFUN (isis_hello_interval_l2,
1442 isis_hello_interval_l2_cmd,
1443 "isis hello-interval (<1-65535>|minimal) level-2",
1444 "IS-IS commands\n"
1445 "Set Hello interval\n"
1446 "Hello interval value\n"
1447 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001448 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001449{
1450 struct isis_circuit *circuit;
1451 struct interface *ifp;
1452 long interval;
1453 char c;
1454
hassof390d2c2004-09-10 20:48:21 +00001455 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001456 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001457 if (circuit == NULL)
1458 {
1459 return CMD_WARNING;
1460 }
jardineb5d44e2003-12-23 08:09:43 +00001461 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001462
jardineb5d44e2003-12-23 08:09:43 +00001463 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001464 if (isdigit ((int) c))
1465 {
1466 interval = atoi (argv[0]);
1467 }
1468 else
jardineb5d44e2003-12-23 08:09:43 +00001469 interval = HELLO_MINIMAL;
1470
hassof390d2c2004-09-10 20:48:21 +00001471 circuit->hello_interval[1] = (u_int16_t) interval;
1472
jardineb5d44e2003-12-23 08:09:43 +00001473 return CMD_SUCCESS;
1474}
1475
1476DEFUN (no_isis_hello_interval_l2,
1477 no_isis_hello_interval_l2_cmd,
1478 "no isis hello-interval level-2",
1479 NO_STR
1480 "IS-IS commands\n"
1481 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00001482 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001483{
1484 struct isis_circuit *circuit;
1485 struct interface *ifp;
1486
hassof390d2c2004-09-10 20:48:21 +00001487 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001488 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001489 if (circuit == NULL)
1490 {
1491 return CMD_WARNING;
1492 }
jardineb5d44e2003-12-23 08:09:43 +00001493 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001494
hassof390d2c2004-09-10 20:48:21 +00001495
1496 circuit->hello_interval[1] = HELLO_INTERVAL; /* Default is 1 sec. */
1497
jardineb5d44e2003-12-23 08:09:43 +00001498 return CMD_SUCCESS;
1499}
1500
1501ALIAS (no_isis_hello_interval_l2,
1502 no_isis_hello_interval_l2_arg_cmd,
1503 "no isis hello-interval (<1-65535>|minimal) level-2",
1504 NO_STR
1505 "IS-IS commands\n"
1506 "Set Hello interval\n"
1507 "Hello interval value\n"
1508 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001509 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001510
1511DEFUN (isis_hello_multiplier,
1512 isis_hello_multiplier_cmd,
1513 "isis hello-multiplier <3-1000>",
1514 "IS-IS commands\n"
1515 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001516 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00001517{
1518 struct isis_circuit *circuit;
1519 struct interface *ifp;
1520 int mult;
hassof390d2c2004-09-10 20:48:21 +00001521
1522 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001523 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001524 if (circuit == NULL)
1525 {
1526 return CMD_WARNING;
1527 }
jardineb5d44e2003-12-23 08:09:43 +00001528 assert (circuit);
1529
1530 mult = atoi (argv[0]);
1531
hassof390d2c2004-09-10 20:48:21 +00001532 circuit->hello_multiplier[0] = (u_int16_t) mult;
1533 circuit->hello_multiplier[1] = (u_int16_t) mult;
1534
jardineb5d44e2003-12-23 08:09:43 +00001535 return CMD_SUCCESS;
1536}
1537
1538DEFUN (no_isis_hello_multiplier,
1539 no_isis_hello_multiplier_cmd,
1540 "no isis hello-multiplier",
1541 NO_STR
1542 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001543 "Set multiplier for Hello holding time\n")
jardineb5d44e2003-12-23 08:09:43 +00001544{
1545 struct isis_circuit *circuit;
1546 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001547
1548 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001549 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001550 if (circuit == NULL)
1551 {
1552 return CMD_WARNING;
1553 }
jardineb5d44e2003-12-23 08:09:43 +00001554 assert (circuit);
1555
1556 circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1557 circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1558
1559 return CMD_SUCCESS;
1560}
1561
1562ALIAS (no_isis_hello_multiplier,
1563 no_isis_hello_multiplier_arg_cmd,
1564 "no isis hello-multiplier <3-1000>",
1565 NO_STR
1566 "IS-IS commands\n"
1567 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001568 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00001569
1570DEFUN (isis_hello_multiplier_l1,
1571 isis_hello_multiplier_l1_cmd,
1572 "isis hello-multiplier <3-1000> level-1",
1573 "IS-IS commands\n"
1574 "Set multiplier for Hello holding time\n"
1575 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001576 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001577{
1578 struct isis_circuit *circuit;
1579 struct interface *ifp;
1580 int mult;
hassof390d2c2004-09-10 20:48:21 +00001581
1582 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001583 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001584 if (circuit == NULL)
1585 {
1586 return CMD_WARNING;
1587 }
jardineb5d44e2003-12-23 08:09:43 +00001588 assert (circuit);
1589
1590 mult = atoi (argv[0]);
1591
hassof390d2c2004-09-10 20:48:21 +00001592 circuit->hello_multiplier[0] = (u_int16_t) mult;
1593
jardineb5d44e2003-12-23 08:09:43 +00001594 return CMD_SUCCESS;
1595}
1596
1597DEFUN (no_isis_hello_multiplier_l1,
1598 no_isis_hello_multiplier_l1_cmd,
1599 "no isis hello-multiplier level-1",
1600 NO_STR
1601 "IS-IS commands\n"
1602 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001603 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001604{
1605 struct isis_circuit *circuit;
1606 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001607
1608 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001609 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001610 if (circuit == NULL)
1611 {
1612 return CMD_WARNING;
1613 }
jardineb5d44e2003-12-23 08:09:43 +00001614 assert (circuit);
1615
1616 circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1617
1618 return CMD_SUCCESS;
1619}
1620
1621ALIAS (no_isis_hello_multiplier_l1,
1622 no_isis_hello_multiplier_l1_arg_cmd,
1623 "no isis hello-multiplier <3-1000> level-1",
1624 NO_STR
1625 "IS-IS commands\n"
1626 "Set multiplier for Hello holding time\n"
1627 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001628 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001629
1630DEFUN (isis_hello_multiplier_l2,
1631 isis_hello_multiplier_l2_cmd,
1632 "isis hello-multiplier <3-1000> level-2",
1633 "IS-IS commands\n"
1634 "Set multiplier for Hello holding time\n"
1635 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001636 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001637{
1638 struct isis_circuit *circuit;
1639 struct interface *ifp;
1640 int mult;
hassof390d2c2004-09-10 20:48:21 +00001641
1642 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001643 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001644 if (circuit == NULL)
1645 {
1646 return CMD_WARNING;
1647 }
jardineb5d44e2003-12-23 08:09:43 +00001648 assert (circuit);
1649
1650 mult = atoi (argv[0]);
1651
hassof390d2c2004-09-10 20:48:21 +00001652 circuit->hello_multiplier[1] = (u_int16_t) mult;
1653
jardineb5d44e2003-12-23 08:09:43 +00001654 return CMD_SUCCESS;
1655}
1656
1657DEFUN (no_isis_hello_multiplier_l2,
1658 no_isis_hello_multiplier_l2_cmd,
1659 "no isis hello-multiplier level-2",
1660 NO_STR
1661 "IS-IS commands\n"
1662 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001663 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001664{
1665 struct isis_circuit *circuit;
1666 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001667
1668 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001669 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001670 if (circuit == NULL)
1671 {
1672 return CMD_WARNING;
1673 }
jardineb5d44e2003-12-23 08:09:43 +00001674 assert (circuit);
1675
1676 circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1677
1678 return CMD_SUCCESS;
1679}
1680
1681ALIAS (no_isis_hello_multiplier_l2,
1682 no_isis_hello_multiplier_l2_arg_cmd,
1683 "no isis hello-multiplier <3-1000> level-2",
1684 NO_STR
1685 "IS-IS commands\n"
1686 "Set multiplier for Hello holding time\n"
1687 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001688 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001689
1690DEFUN (isis_hello,
1691 isis_hello_cmd,
1692 "isis hello padding",
1693 "IS-IS commands\n"
1694 "Add padding to IS-IS hello packets\n"
1695 "Pad hello packets\n"
1696 "<cr>\n")
1697{
1698 struct interface *ifp;
1699 struct isis_circuit *circuit;
hassof390d2c2004-09-10 20:48:21 +00001700
1701 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001702 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001703 if (circuit == NULL)
1704 {
1705 return CMD_WARNING;
1706 }
jardineb5d44e2003-12-23 08:09:43 +00001707 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001708
jardineb5d44e2003-12-23 08:09:43 +00001709 circuit->u.bc.pad_hellos = 1;
hassof390d2c2004-09-10 20:48:21 +00001710
jardineb5d44e2003-12-23 08:09:43 +00001711 return CMD_SUCCESS;
1712}
1713
jardineb5d44e2003-12-23 08:09:43 +00001714DEFUN (no_isis_hello,
1715 no_isis_hello_cmd,
1716 "no isis hello padding",
1717 NO_STR
1718 "IS-IS commands\n"
1719 "Add padding to IS-IS hello packets\n"
1720 "Pad hello packets\n"
1721 "<cr>\n")
1722{
1723 struct isis_circuit *circuit;
1724 struct interface *ifp;
1725
hassof390d2c2004-09-10 20:48:21 +00001726 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001727 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001728 if (circuit == NULL)
1729 {
1730 return CMD_WARNING;
1731 }
jardineb5d44e2003-12-23 08:09:43 +00001732 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001733
jardineb5d44e2003-12-23 08:09:43 +00001734 circuit->u.bc.pad_hellos = 0;
hassof390d2c2004-09-10 20:48:21 +00001735
jardineb5d44e2003-12-23 08:09:43 +00001736 return CMD_SUCCESS;
1737}
1738
1739DEFUN (csnp_interval,
1740 csnp_interval_cmd,
1741 "isis csnp-interval <0-65535>",
1742 "IS-IS commands\n"
1743 "Set CSNP interval in seconds\n"
1744 "CSNP interval value\n")
1745{
1746 struct isis_circuit *circuit;
1747 struct interface *ifp;
1748 unsigned long interval;
1749
hassof390d2c2004-09-10 20:48:21 +00001750 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001751 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001752 if (circuit == NULL)
1753 {
1754 return CMD_WARNING;
1755 }
jardineb5d44e2003-12-23 08:09:43 +00001756 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001757
jardineb5d44e2003-12-23 08:09:43 +00001758 interval = atol (argv[0]);
1759
hassof390d2c2004-09-10 20:48:21 +00001760 circuit->csnp_interval[0] = (u_int16_t) interval;
1761 circuit->csnp_interval[1] = (u_int16_t) interval;
1762
jardineb5d44e2003-12-23 08:09:43 +00001763 return CMD_SUCCESS;
1764}
1765
1766DEFUN (no_csnp_interval,
1767 no_csnp_interval_cmd,
1768 "no isis csnp-interval",
1769 NO_STR
1770 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001771 "Set CSNP interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001772{
1773 struct isis_circuit *circuit;
1774 struct interface *ifp;
1775
hassof390d2c2004-09-10 20:48:21 +00001776 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001777 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001778 if (circuit == NULL)
1779 {
1780 return CMD_WARNING;
1781 }
jardineb5d44e2003-12-23 08:09:43 +00001782 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001783
jardineb5d44e2003-12-23 08:09:43 +00001784 circuit->csnp_interval[0] = CSNP_INTERVAL;
1785 circuit->csnp_interval[1] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001786
jardineb5d44e2003-12-23 08:09:43 +00001787 return CMD_SUCCESS;
1788}
1789
1790ALIAS (no_csnp_interval,
1791 no_csnp_interval_arg_cmd,
1792 "no isis csnp-interval <0-65535>",
1793 NO_STR
1794 "IS-IS commands\n"
1795 "Set CSNP interval in seconds\n"
1796 "CSNP interval value\n")
1797
jardineb5d44e2003-12-23 08:09:43 +00001798DEFUN (csnp_interval_l1,
1799 csnp_interval_l1_cmd,
1800 "isis csnp-interval <0-65535> level-1",
1801 "IS-IS commands\n"
1802 "Set CSNP interval in seconds\n"
1803 "CSNP interval value\n"
1804 "Specify interval for level-1 CSNPs\n")
1805{
1806 struct isis_circuit *circuit;
1807 struct interface *ifp;
1808 unsigned long interval;
1809
hassof390d2c2004-09-10 20:48:21 +00001810 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001811 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001812 if (circuit == NULL)
1813 {
1814 return CMD_WARNING;
1815 }
jardineb5d44e2003-12-23 08:09:43 +00001816 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001817
jardineb5d44e2003-12-23 08:09:43 +00001818 interval = atol (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001819
1820 circuit->csnp_interval[0] = (u_int16_t) interval;
1821
jardineb5d44e2003-12-23 08:09:43 +00001822 return CMD_SUCCESS;
1823}
1824
1825DEFUN (no_csnp_interval_l1,
1826 no_csnp_interval_l1_cmd,
1827 "no isis csnp-interval level-1",
1828 NO_STR
1829 "IS-IS commands\n"
1830 "Set CSNP interval in seconds\n"
1831 "Specify interval for level-1 CSNPs\n")
1832{
1833 struct isis_circuit *circuit;
1834 struct interface *ifp;
1835
hassof390d2c2004-09-10 20:48:21 +00001836 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001837 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001838 if (circuit == NULL)
1839 {
1840 return CMD_WARNING;
1841 }
jardineb5d44e2003-12-23 08:09:43 +00001842 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001843
jardineb5d44e2003-12-23 08:09:43 +00001844 circuit->csnp_interval[0] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001845
jardineb5d44e2003-12-23 08:09:43 +00001846 return CMD_SUCCESS;
1847}
1848
1849ALIAS (no_csnp_interval_l1,
1850 no_csnp_interval_l1_arg_cmd,
1851 "no isis csnp-interval <0-65535> level-1",
1852 NO_STR
1853 "IS-IS commands\n"
1854 "Set CSNP interval in seconds\n"
1855 "CSNP interval value\n"
1856 "Specify interval for level-1 CSNPs\n")
1857
jardineb5d44e2003-12-23 08:09:43 +00001858DEFUN (csnp_interval_l2,
1859 csnp_interval_l2_cmd,
1860 "isis csnp-interval <0-65535> level-2",
1861 "IS-IS commands\n"
1862 "Set CSNP interval in seconds\n"
1863 "CSNP interval value\n"
1864 "Specify interval for level-2 CSNPs\n")
1865{
1866 struct isis_circuit *circuit;
1867 struct interface *ifp;
1868 unsigned long interval;
1869
hassof390d2c2004-09-10 20:48:21 +00001870 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001871 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001872 if (circuit == NULL)
1873 {
1874 return CMD_WARNING;
1875 }
jardineb5d44e2003-12-23 08:09:43 +00001876 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001877
jardineb5d44e2003-12-23 08:09:43 +00001878 interval = atol (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001879
1880 circuit->csnp_interval[1] = (u_int16_t) interval;
1881
jardineb5d44e2003-12-23 08:09:43 +00001882 return CMD_SUCCESS;
1883}
1884
1885DEFUN (no_csnp_interval_l2,
1886 no_csnp_interval_l2_cmd,
1887 "no isis csnp-interval level-2",
1888 NO_STR
1889 "IS-IS commands\n"
1890 "Set CSNP interval in seconds\n"
1891 "Specify interval for level-2 CSNPs\n")
1892{
1893 struct isis_circuit *circuit;
1894 struct interface *ifp;
1895
hassof390d2c2004-09-10 20:48:21 +00001896 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001897 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001898 if (circuit == NULL)
1899 {
1900 return CMD_WARNING;
1901 }
jardineb5d44e2003-12-23 08:09:43 +00001902 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001903
jardineb5d44e2003-12-23 08:09:43 +00001904 circuit->csnp_interval[1] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001905
jardineb5d44e2003-12-23 08:09:43 +00001906 return CMD_SUCCESS;
1907}
1908
1909ALIAS (no_csnp_interval_l2,
1910 no_csnp_interval_l2_arg_cmd,
1911 "no isis csnp-interval <0-65535> level-2",
1912 NO_STR
1913 "IS-IS commands\n"
1914 "Set CSNP interval in seconds\n"
1915 "CSNP interval value\n"
1916 "Specify interval for level-2 CSNPs\n")
1917
jardineb5d44e2003-12-23 08:09:43 +00001918#ifdef HAVE_IPV6
1919DEFUN (ipv6_router_isis,
1920 ipv6_router_isis_cmd,
1921 "ipv6 router isis WORD",
1922 "IPv6 interface subcommands\n"
1923 "IPv6 Router interface commands\n"
1924 "IS-IS Routing for IPv6\n"
1925 "Routing process tag\n")
1926{
1927 struct isis_circuit *c;
1928 struct interface *ifp;
1929 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001930
1931 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001932 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +00001933
jardineb5d44e2003-12-23 08:09:43 +00001934 area = isis_area_lookup (argv[0]);
1935
1936 /* Prevent more than one circuit per interface */
1937 if (area)
1938 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +00001939 else
1940 c = NULL;
1941
1942 if (c && (ifp->info != NULL))
1943 {
1944 if (c->ipv6_router == 1)
1945 {
1946 vty_out (vty, "ISIS circuit is already defined for IPv6%s",
1947 VTY_NEWLINE);
1948 return CMD_WARNING;
1949 }
jardineb5d44e2003-12-23 08:09:43 +00001950 }
jardineb5d44e2003-12-23 08:09:43 +00001951
1952 /* this is here for ciscopability */
hassof390d2c2004-09-10 20:48:21 +00001953 if (!area)
1954 {
1955 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
1956 return CMD_WARNING;
1957 }
jardineb5d44e2003-12-23 08:09:43 +00001958
hassof390d2c2004-09-10 20:48:21 +00001959 if (!c)
1960 {
1961 c = circuit_lookup_by_ifp (ifp, isis->init_circ_list);
1962 c = isis_csm_state_change (ISIS_ENABLE, c, area);
1963 c->interface = ifp;
1964 ifp->info = c;
1965 }
jardineb5d44e2003-12-23 08:09:43 +00001966
hassof390d2c2004-09-10 20:48:21 +00001967 if (!c)
jardineb5d44e2003-12-23 08:09:43 +00001968 return CMD_WARNING;
1969
1970 c->ipv6_router = 1;
1971 area->ipv6_circuits++;
1972 circuit_update_nlpids (c);
1973
1974 vty->node = INTERFACE_NODE;
1975
1976 return CMD_SUCCESS;
1977}
1978
1979DEFUN (no_ipv6_router_isis,
1980 no_ipv6_router_isis_cmd,
1981 "no ipv6 router isis WORD",
1982 NO_STR
1983 "IPv6 interface subcommands\n"
1984 "IPv6 Router interface commands\n"
1985 "IS-IS Routing for IPv6\n"
1986 "Routing process tag\n")
1987{
1988 struct isis_circuit *c;
1989 struct interface *ifp;
1990 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001991
1992 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001993 /* UGLY - will remove l8r
1994 if (circuit == NULL) {
hassof390d2c2004-09-10 20:48:21 +00001995 return CMD_WARNING;
1996 } */
jardineb5d44e2003-12-23 08:09:43 +00001997 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +00001998
jardineb5d44e2003-12-23 08:09:43 +00001999 area = isis_area_lookup (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00002000 if (!area)
2001 {
2002 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
2003 return CMD_WARNING;
2004 }
2005
jardineb5d44e2003-12-23 08:09:43 +00002006 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
2007 if (!c)
2008 return CMD_WARNING;
2009
2010 c->ipv6_router = 0;
2011 area->ipv6_circuits--;
2012 if (c->ip_router == 0)
2013 isis_csm_state_change (ISIS_DISABLE, c, area);
2014
2015 return CMD_SUCCESS;
2016}
hassof390d2c2004-09-10 20:48:21 +00002017#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +00002018
hassof390d2c2004-09-10 20:48:21 +00002019struct cmd_node interface_node = {
jardineb5d44e2003-12-23 08:09:43 +00002020 INTERFACE_NODE,
2021 "%s(config-if)# ",
2022 1,
2023};
2024
jardineb5d44e2003-12-23 08:09:43 +00002025int
2026isis_if_new_hook (struct interface *ifp)
2027{
2028/* FIXME: Discuss if the circuit should be created here
2029 ifp->info = XMALLOC (MTYPE_ISIS_IF_INFO, sizeof (struct isis_if_info)); */
2030 ifp->info = NULL;
2031 return 0;
2032}
2033
2034int
2035isis_if_delete_hook (struct interface *ifp)
2036{
2037/* FIXME: Discuss if the circuit should be created here
2038 XFREE (MTYPE_ISIS_IF_INFO, ifp->info);*/
2039 ifp->info = NULL;
2040 return 0;
2041}
2042
jardineb5d44e2003-12-23 08:09:43 +00002043void
2044isis_circuit_init ()
2045{
jardineb5d44e2003-12-23 08:09:43 +00002046 /* Initialize Zebra interface data structure */
2047 if_init ();
2048 if_add_hook (IF_NEW_HOOK, isis_if_new_hook);
2049 if_add_hook (IF_DELETE_HOOK, isis_if_delete_hook);
2050
2051 /* Install interface node */
2052 install_node (&interface_node, isis_interface_config_write);
2053 install_element (CONFIG_NODE, &interface_cmd);
2054
2055 install_default (INTERFACE_NODE);
2056 install_element (INTERFACE_NODE, &interface_desc_cmd);
2057 install_element (INTERFACE_NODE, &no_interface_desc_cmd);
2058
2059 install_element (INTERFACE_NODE, &ip_router_isis_cmd);
2060 install_element (INTERFACE_NODE, &no_ip_router_isis_cmd);
2061
2062 install_element (INTERFACE_NODE, &isis_circuit_type_cmd);
2063 install_element (INTERFACE_NODE, &no_isis_circuit_type_cmd);
2064
2065 install_element (INTERFACE_NODE, &isis_passwd_cmd);
2066 install_element (INTERFACE_NODE, &no_isis_passwd_cmd);
2067
2068 install_element (INTERFACE_NODE, &isis_priority_cmd);
2069 install_element (INTERFACE_NODE, &no_isis_priority_cmd);
2070 install_element (INTERFACE_NODE, &no_isis_priority_arg_cmd);
2071 install_element (INTERFACE_NODE, &isis_priority_l1_cmd);
2072 install_element (INTERFACE_NODE, &no_isis_priority_l1_cmd);
2073 install_element (INTERFACE_NODE, &no_isis_priority_l1_arg_cmd);
2074 install_element (INTERFACE_NODE, &isis_priority_l2_cmd);
2075 install_element (INTERFACE_NODE, &no_isis_priority_l2_cmd);
2076 install_element (INTERFACE_NODE, &no_isis_priority_l2_arg_cmd);
2077
2078 install_element (INTERFACE_NODE, &isis_metric_cmd);
2079 install_element (INTERFACE_NODE, &no_isis_metric_cmd);
2080 install_element (INTERFACE_NODE, &no_isis_metric_arg_cmd);
2081
2082 install_element (INTERFACE_NODE, &isis_hello_interval_cmd);
2083 install_element (INTERFACE_NODE, &no_isis_hello_interval_cmd);
2084 install_element (INTERFACE_NODE, &no_isis_hello_interval_arg_cmd);
2085 install_element (INTERFACE_NODE, &isis_hello_interval_l1_cmd);
2086 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_cmd);
2087 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_arg_cmd);
2088 install_element (INTERFACE_NODE, &isis_hello_interval_l2_cmd);
2089 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_cmd);
2090 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_arg_cmd);
2091
2092 install_element (INTERFACE_NODE, &isis_hello_multiplier_cmd);
2093 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_cmd);
2094 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_arg_cmd);
2095 install_element (INTERFACE_NODE, &isis_hello_multiplier_l1_cmd);
2096 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_cmd);
2097 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_arg_cmd);
2098 install_element (INTERFACE_NODE, &isis_hello_multiplier_l2_cmd);
2099 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_cmd);
2100 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_arg_cmd);
2101
2102 install_element (INTERFACE_NODE, &isis_hello_cmd);
2103 install_element (INTERFACE_NODE, &no_isis_hello_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002104 install_element (INTERFACE_NODE, &csnp_interval_cmd);
2105 install_element (INTERFACE_NODE, &no_csnp_interval_cmd);
2106 install_element (INTERFACE_NODE, &no_csnp_interval_arg_cmd);
2107 install_element (INTERFACE_NODE, &csnp_interval_l1_cmd);
2108 install_element (INTERFACE_NODE, &no_csnp_interval_l1_cmd);
2109 install_element (INTERFACE_NODE, &no_csnp_interval_l1_arg_cmd);
2110 install_element (INTERFACE_NODE, &csnp_interval_l2_cmd);
2111 install_element (INTERFACE_NODE, &no_csnp_interval_l2_cmd);
2112 install_element (INTERFACE_NODE, &no_csnp_interval_l2_arg_cmd);
2113
2114#ifdef HAVE_IPV6
2115 install_element (INTERFACE_NODE, &ipv6_router_isis_cmd);
2116 install_element (INTERFACE_NODE, &no_ipv6_router_isis_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002117#endif
jardineb5d44e2003-12-23 08:09:43 +00002118}