ospfd: Tighten up the connected check for redistribution
[jleu-quagga.git] / isisd / isisd.c
blob1e84a1cedb6732594242f5c93c2f298eaf787ca9
1 /*
2 * IS-IS Rout(e)ing protocol - isisd.c
4 * Copyright (C) 2001,2002 Sampo Saaristo
5 * Tampere University of Technology
6 * Institute of Communications Engineering
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.
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.
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.
23 #include <zebra.h>
25 #include "thread.h"
26 #include "vty.h"
27 #include "command.h"
28 #include "log.h"
29 #include "memory.h"
30 #include "linklist.h"
31 #include "if.h"
32 #include "hash.h"
33 #include "stream.h"
34 #include "prefix.h"
35 #include "table.h"
37 #include "isisd/dict.h"
38 #include "isisd/include-netbsd/iso.h"
39 #include "isisd/isis_constants.h"
40 #include "isisd/isis_common.h"
41 #include "isisd/isis_circuit.h"
42 #include "isisd/isis_flags.h"
43 #include "isisd/isisd.h"
44 #include "isisd/isis_dynhn.h"
45 #include "isisd/isis_adjacency.h"
46 #include "isisd/isis_pdu.h"
47 #include "isisd/isis_misc.h"
48 #include "isisd/isis_constants.h"
49 #include "isisd/isis_tlv.h"
50 #include "isisd/isis_lsp.h"
51 #include "isisd/isis_spf.h"
52 #include "isisd/isis_route.h"
53 #include "isisd/isis_zebra.h"
54 #include "isisd/isis_events.h"
56 #ifdef TOPOLOGY_GENERATE
57 #include "spgrid.h"
58 u_char DEFAULT_TOPOLOGY_BASEIS[6] = { 0xFE, 0xED, 0xFE, 0xED, 0x00, 0x00 };
59 #endif /* TOPOLOGY_GENERATE */
61 struct isis *isis = NULL;
62 extern struct thread_master *master;
65 * Prototypes.
67 void isis_new(unsigned long);
68 struct isis_area *isis_area_create(void);
69 int isis_area_get(struct vty *, const char *);
70 int isis_area_destroy(struct vty *, const char *);
71 int area_net_title(struct vty *, const u_char *);
72 int area_clear_net_title(struct vty *, const u_char *);
73 int show_clns_neigh(struct vty *, char);
74 void print_debug(struct vty *, int, int);
75 int isis_config_write(struct vty *);
79 void
80 isis_new (unsigned long process_id)
82 isis = XCALLOC (MTYPE_ISIS, sizeof (struct isis));
84 * Default values
86 isis->max_area_addrs = 3;
88 isis->process_id = process_id;
89 isis->area_list = list_new ();
90 isis->init_circ_list = list_new ();
91 isis->uptime = time (NULL);
92 isis->nexthops = list_new ();
93 #ifdef HAVE_IPV6
94 isis->nexthops6 = list_new ();
95 #endif /* HAVE_IPV6 */
97 * uncomment the next line for full debugs
99 /* isis->debugs = 0xFFFF; */
102 struct isis_area *
103 isis_area_create ()
105 struct isis_area *area;
107 area = XCALLOC (MTYPE_ISIS_AREA, sizeof (struct isis_area));
110 * The first instance is level-1-2 rest are level-1, unless otherwise
111 * configured
113 if (listcount (isis->area_list) > 0)
114 area->is_type = IS_LEVEL_1;
115 else
116 area->is_type = IS_LEVEL_1_AND_2;
118 * intialize the databases
120 area->lspdb[0] = lsp_db_init ();
121 area->lspdb[1] = lsp_db_init ();
123 spftree_area_init (area);
124 area->route_table[0] = route_table_init ();
125 area->route_table[1] = route_table_init ();
126 #ifdef HAVE_IPV6
127 area->route_table6[0] = route_table_init ();
128 area->route_table6[1] = route_table_init ();
129 #endif /* HAVE_IPV6 */
130 area->circuit_list = list_new ();
131 area->area_addrs = list_new ();
132 THREAD_TIMER_ON (master, area->t_tick, lsp_tick, area, 1);
133 flags_initialize (&area->flags);
135 * Default values
137 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200 */
138 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200 */
139 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
140 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
141 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900 */
142 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900 */
143 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
144 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
145 area->dynhostname = 1;
146 area->oldmetric = 1;
147 area->lsp_frag_threshold = 90;
148 #ifdef TOPOLOGY_GENERATE
149 memcpy (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS, ISIS_SYS_ID_LEN);
150 #endif /* TOPOLOGY_GENERATE */
152 /* FIXME: Think of a better way... */
153 area->min_bcast_mtu = 1497;
155 return area;
158 struct isis_area *
159 isis_area_lookup (const char *area_tag)
161 struct isis_area *area;
162 struct listnode *node;
164 for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
165 if ((area->area_tag == NULL && area_tag == NULL) ||
166 (area->area_tag && area_tag
167 && strcmp (area->area_tag, area_tag) == 0))
168 return area;
170 return NULL;
174 isis_area_get (struct vty *vty, const char *area_tag)
176 struct isis_area *area;
178 area = isis_area_lookup (area_tag);
180 if (area)
182 vty->node = ISIS_NODE;
183 vty->index = area;
184 return CMD_SUCCESS;
187 area = isis_area_create ();
188 area->area_tag = strdup (area_tag);
189 listnode_add (isis->area_list, area);
191 if (isis->debugs & DEBUG_EVENTS)
192 zlog_debug ("New IS-IS area instance %s", area->area_tag);
194 vty->node = ISIS_NODE;
195 vty->index = area;
197 return CMD_SUCCESS;
201 isis_area_destroy (struct vty *vty, const char *area_tag)
203 struct isis_area *area;
204 struct listnode *node, *nnode;
205 struct isis_circuit *circuit;
207 area = isis_area_lookup (area_tag);
209 if (area == NULL)
211 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
212 return CMD_WARNING;
215 if (area->circuit_list)
217 for (ALL_LIST_ELEMENTS (area->circuit_list, node, nnode, circuit))
219 /* The fact that it's in circuit_list means that it was configured */
220 isis_circuit_deconfigure (circuit, area);
221 isis_circuit_del (circuit);
224 list_delete (area->circuit_list);
226 listnode_delete (isis->area_list, area);
227 THREAD_TIMER_OFF (area->t_tick);
228 if (area->t_remove_aged)
229 thread_cancel (area->t_remove_aged);
230 THREAD_TIMER_OFF (area->t_lsp_refresh[0]);
231 THREAD_TIMER_OFF (area->t_lsp_refresh[1]);
233 XFREE (MTYPE_ISIS_AREA, area);
235 return CMD_SUCCESS;
239 area_net_title (struct vty *vty, const u_char *net_title)
241 struct isis_area *area;
242 struct area_addr *addr;
243 struct area_addr *addrp;
244 struct listnode *node;
246 u_char buff[255];
247 area = vty->index;
249 if (!area)
251 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
252 return CMD_WARNING;
255 /* We check that we are not over the maximal number of addresses */
256 if (listcount (area->area_addrs) >= isis->max_area_addrs)
258 vty_out (vty, "Maximum of area addresses (%d) already reached %s",
259 isis->max_area_addrs, VTY_NEWLINE);
260 return CMD_WARNING;
263 addr = XMALLOC (MTYPE_ISIS_AREA_ADDR, sizeof (struct area_addr));
264 addr->addr_len = dotformat2buff (buff, net_title);
265 memcpy (addr->area_addr, buff, addr->addr_len);
266 #ifdef EXTREME_DEBUG
267 zlog_debug ("added area address %s for area %s (address length %d)",
268 net_title, area->area_tag, addr->addr_len);
269 #endif /* EXTREME_DEBUG */
270 if (addr->addr_len < 8 || addr->addr_len > 20)
272 zlog_warn ("area address must be at least 8..20 octets long (%d)",
273 addr->addr_len);
274 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
275 return CMD_WARNING;
278 if (isis->sysid_set == 0)
281 * First area address - get the SystemID for this router
283 memcpy (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN), ISIS_SYS_ID_LEN);
284 isis->sysid_set = 1;
285 if (isis->debugs & DEBUG_EVENTS)
286 zlog_debug ("Router has SystemID %s", sysid_print (isis->sysid));
288 else
291 * Check that the SystemID portions match
293 if (memcmp (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN),
294 ISIS_SYS_ID_LEN))
296 vty_out (vty,
297 "System ID must not change when defining additional area"
298 " addresses%s", VTY_NEWLINE);
299 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
300 return CMD_WARNING;
303 /* now we see that we don't already have this address */
304 for (ALL_LIST_ELEMENTS_RO (area->area_addrs, node, addrp))
306 if ((addrp->addr_len + ISIS_SYS_ID_LEN + 1) != (addr->addr_len))
307 continue;
308 if (!memcmp (addrp->area_addr, addr->area_addr, addr->addr_len))
310 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
311 return CMD_SUCCESS; /* silent fail */
317 * Forget the systemID part of the address
319 addr->addr_len -= (ISIS_SYS_ID_LEN + 1);
320 listnode_add (area->area_addrs, addr);
322 /* only now we can safely generate our LSPs for this area */
323 if (listcount (area->area_addrs) > 0)
325 lsp_l1_generate (area);
326 lsp_l2_generate (area);
329 return CMD_SUCCESS;
333 area_clear_net_title (struct vty *vty, const u_char *net_title)
335 struct isis_area *area;
336 struct area_addr addr, *addrp = NULL;
337 struct listnode *node;
338 u_char buff[255];
340 area = vty->index;
341 if (!area)
343 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
344 return CMD_WARNING;
347 addr.addr_len = dotformat2buff (buff, net_title);
348 if (addr.addr_len < 8 || addr.addr_len > 20)
350 vty_out (vty, "Unsupported area address length %d, should be 8...20 %s",
351 addr.addr_len, VTY_NEWLINE);
352 return CMD_WARNING;
355 memcpy (addr.area_addr, buff, (int) addr.addr_len);
357 for (ALL_LIST_ELEMENTS_RO (area->area_addrs, node, addrp))
358 if (addrp->addr_len == addr.addr_len &&
359 !memcmp (addrp->area_addr, addr.area_addr, addr.addr_len))
360 break;
362 if (!addrp)
364 vty_out (vty, "No area address %s for area %s %s", net_title,
365 area->area_tag, VTY_NEWLINE);
366 return CMD_WARNING;
369 listnode_delete (area->area_addrs, addrp);
371 return CMD_SUCCESS;
375 * 'show clns neighbors' command
379 show_clns_neigh (struct vty *vty, char detail)
381 struct listnode *anode, *cnode;
382 struct isis_area *area;
383 struct isis_circuit *circuit;
384 struct list *db;
385 int i;
387 if (!isis)
389 vty_out (vty, "IS-IS Routing Process not enabled%s", VTY_NEWLINE);
390 return CMD_SUCCESS;
393 for (ALL_LIST_ELEMENTS_RO (isis->area_list, anode, area))
395 vty_out (vty, "Area %s:%s", area->area_tag, VTY_NEWLINE);
397 if (detail == ISIS_UI_LEVEL_BRIEF)
398 vty_out (vty, " System Id Interface L State "
399 "Holdtime SNPA%s", VTY_NEWLINE);
401 for (ALL_LIST_ELEMENTS_RO (area->circuit_list, cnode, circuit))
403 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
405 for (i = 0; i < 2; i++)
407 db = circuit->u.bc.adjdb[i];
408 if (db && db->count)
410 if (detail == ISIS_UI_LEVEL_BRIEF)
411 isis_adjdb_iterate (db,
412 (void (*)
413 (struct isis_adjacency *,
414 void *)) isis_adj_print_vty,
415 vty);
416 if (detail == ISIS_UI_LEVEL_DETAIL)
417 isis_adjdb_iterate (db,
418 (void (*)
419 (struct isis_adjacency *,
420 void *))
421 isis_adj_print_vty_detail, vty);
422 if (detail == ISIS_UI_LEVEL_EXTENSIVE)
423 isis_adjdb_iterate (db,
424 (void (*)
425 (struct isis_adjacency *,
426 void *))
427 isis_adj_print_vty_extensive,
428 vty);
432 else if (circuit->circ_type == CIRCUIT_T_P2P &&
433 circuit->u.p2p.neighbor)
435 if (detail == ISIS_UI_LEVEL_BRIEF)
436 isis_adj_p2p_print_vty (circuit->u.p2p.neighbor, vty);
437 if (detail == ISIS_UI_LEVEL_DETAIL)
438 isis_adj_p2p_print_vty_detail (circuit->u.p2p.neighbor, vty);
439 if (detail == ISIS_UI_LEVEL_EXTENSIVE)
440 isis_adj_p2p_print_vty_extensive (circuit->u.p2p.neighbor,
441 vty);
446 return CMD_SUCCESS;
449 DEFUN (show_clns_neighbors,
450 show_clns_neighbors_cmd,
451 "show clns neighbors",
452 SHOW_STR
453 "clns network information\n"
454 "CLNS neighbor adjacencies\n")
456 return show_clns_neigh (vty, ISIS_UI_LEVEL_BRIEF);
459 ALIAS (show_clns_neighbors,
460 show_isis_neighbors_cmd,
461 "show isis neighbors",
462 SHOW_STR
463 "IS-IS network information\n"
464 "IS-IS neighbor adjacencies\n")
466 DEFUN (show_clns_neighbors_detail,
467 show_clns_neighbors_detail_cmd,
468 "show clns neighbors detail",
469 SHOW_STR
470 "clns network information\n"
471 "CLNS neighbor adjacencies\n"
472 "show detailed information\n")
474 return show_clns_neigh (vty, ISIS_UI_LEVEL_DETAIL);
477 ALIAS (show_clns_neighbors_detail,
478 show_isis_neighbors_detail_cmd,
479 "show isis neighbors detail",
480 SHOW_STR
481 "IS-IS network information\n"
482 "IS-IS neighbor adjacencies\n"
483 "show detailed information\n")
485 * 'isis debug', 'show debugging'
487 void
488 print_debug (struct vty *vty, int flags, int onoff)
490 char onoffs[4];
491 if (onoff)
492 strcpy (onoffs, "on");
493 else
494 strcpy (onoffs, "off");
496 if (flags & DEBUG_ADJ_PACKETS)
497 vty_out (vty, "IS-IS Adjacency related packets debugging is %s%s", onoffs,
498 VTY_NEWLINE);
499 if (flags & DEBUG_CHECKSUM_ERRORS)
500 vty_out (vty, "IS-IS checksum errors debugging is %s%s", onoffs,
501 VTY_NEWLINE);
502 if (flags & DEBUG_LOCAL_UPDATES)
503 vty_out (vty, "IS-IS local updates debugging is %s%s", onoffs,
504 VTY_NEWLINE);
505 if (flags & DEBUG_PROTOCOL_ERRORS)
506 vty_out (vty, "IS-IS protocol errors debugging is %s%s", onoffs,
507 VTY_NEWLINE);
508 if (flags & DEBUG_SNP_PACKETS)
509 vty_out (vty, "IS-IS CSNP/PSNP packets debugging is %s%s", onoffs,
510 VTY_NEWLINE);
511 if (flags & DEBUG_SPF_EVENTS)
512 vty_out (vty, "IS-IS SPF events debugging is %s%s", onoffs, VTY_NEWLINE);
513 if (flags & DEBUG_SPF_STATS)
514 vty_out (vty, "IS-IS SPF Timing and Statistics Data debugging is %s%s",
515 onoffs, VTY_NEWLINE);
516 if (flags & DEBUG_SPF_TRIGGERS)
517 vty_out (vty, "IS-IS SPF triggering events debugging is %s%s", onoffs,
518 VTY_NEWLINE);
519 if (flags & DEBUG_UPDATE_PACKETS)
520 vty_out (vty, "IS-IS Update related packet debugging is %s%s", onoffs,
521 VTY_NEWLINE);
522 if (flags & DEBUG_RTE_EVENTS)
523 vty_out (vty, "IS-IS Route related debuggin is %s%s", onoffs,
524 VTY_NEWLINE);
525 if (flags & DEBUG_EVENTS)
526 vty_out (vty, "IS-IS Event debugging is %s%s", onoffs, VTY_NEWLINE);
530 DEFUN (show_debugging,
531 show_debugging_cmd,
532 "show debugging",
533 SHOW_STR
534 "State of each debugging option\n")
536 vty_out (vty, "IS-IS:%s", VTY_NEWLINE);
537 print_debug (vty, isis->debugs, 1);
538 return CMD_SUCCESS;
541 /* Debug node. */
542 static struct cmd_node debug_node = {
543 DEBUG_NODE,
548 static int
549 config_write_debug (struct vty *vty)
551 int write = 0;
552 int flags = isis->debugs;
554 if (flags & DEBUG_ADJ_PACKETS)
556 vty_out (vty, "debug isis adj-packets%s", VTY_NEWLINE);
557 write++;
559 if (flags & DEBUG_CHECKSUM_ERRORS)
561 vty_out (vty, "debug isis checksum-errors%s", VTY_NEWLINE);
562 write++;
564 if (flags & DEBUG_LOCAL_UPDATES)
566 vty_out (vty, "debug isis local-updates%s", VTY_NEWLINE);
567 write++;
569 if (flags & DEBUG_PROTOCOL_ERRORS)
571 vty_out (vty, "debug isis protocol-errors%s", VTY_NEWLINE);
572 write++;
574 if (flags & DEBUG_SNP_PACKETS)
576 vty_out (vty, "debug isis snp-packets%s", VTY_NEWLINE);
577 write++;
579 if (flags & DEBUG_SPF_EVENTS)
581 vty_out (vty, "debug isis spf-events%s", VTY_NEWLINE);
582 write++;
584 if (flags & DEBUG_SPF_STATS)
586 vty_out (vty, "debug isis spf-statistics%s", VTY_NEWLINE);
587 write++;
589 if (flags & DEBUG_SPF_TRIGGERS)
591 vty_out (vty, "debug isis spf-triggers%s", VTY_NEWLINE);
592 write++;
594 if (flags & DEBUG_UPDATE_PACKETS)
596 vty_out (vty, "debug isis update-packets%s", VTY_NEWLINE);
597 write++;
599 if (flags & DEBUG_RTE_EVENTS)
601 vty_out (vty, "debug isis route-events%s", VTY_NEWLINE);
602 write++;
604 if (flags & DEBUG_EVENTS)
606 vty_out (vty, "debug isis events%s", VTY_NEWLINE);
607 write++;
610 return write;
613 DEFUN (debug_isis_adj,
614 debug_isis_adj_cmd,
615 "debug isis adj-packets",
616 DEBUG_STR
617 "IS-IS information\n"
618 "IS-IS Adjacency related packets\n")
620 isis->debugs |= DEBUG_ADJ_PACKETS;
621 print_debug (vty, DEBUG_ADJ_PACKETS, 1);
623 return CMD_SUCCESS;
626 DEFUN (no_debug_isis_adj,
627 no_debug_isis_adj_cmd,
628 "no debug isis adj-packets",
629 UNDEBUG_STR
630 "IS-IS information\n"
631 "IS-IS Adjacency related packets\n")
633 isis->debugs &= ~DEBUG_ADJ_PACKETS;
634 print_debug (vty, DEBUG_ADJ_PACKETS, 0);
636 return CMD_SUCCESS;
639 DEFUN (debug_isis_csum,
640 debug_isis_csum_cmd,
641 "debug isis checksum-errors",
642 DEBUG_STR
643 "IS-IS information\n"
644 "IS-IS LSP checksum errors\n")
646 isis->debugs |= DEBUG_CHECKSUM_ERRORS;
647 print_debug (vty, DEBUG_CHECKSUM_ERRORS, 1);
649 return CMD_SUCCESS;
652 DEFUN (no_debug_isis_csum,
653 no_debug_isis_csum_cmd,
654 "no debug isis checksum-errors",
655 UNDEBUG_STR
656 "IS-IS information\n"
657 "IS-IS LSP checksum errors\n")
659 isis->debugs &= ~DEBUG_CHECKSUM_ERRORS;
660 print_debug (vty, DEBUG_CHECKSUM_ERRORS, 0);
662 return CMD_SUCCESS;
665 DEFUN (debug_isis_lupd,
666 debug_isis_lupd_cmd,
667 "debug isis local-updates",
668 DEBUG_STR
669 "IS-IS information\n"
670 "IS-IS local update packets\n")
672 isis->debugs |= DEBUG_LOCAL_UPDATES;
673 print_debug (vty, DEBUG_LOCAL_UPDATES, 1);
675 return CMD_SUCCESS;
678 DEFUN (no_debug_isis_lupd,
679 no_debug_isis_lupd_cmd,
680 "no debug isis local-updates",
681 UNDEBUG_STR
682 "IS-IS information\n"
683 "IS-IS local update packets\n")
685 isis->debugs &= ~DEBUG_LOCAL_UPDATES;
686 print_debug (vty, DEBUG_LOCAL_UPDATES, 0);
688 return CMD_SUCCESS;
691 DEFUN (debug_isis_err,
692 debug_isis_err_cmd,
693 "debug isis protocol-errors",
694 DEBUG_STR
695 "IS-IS information\n"
696 "IS-IS LSP protocol errors\n")
698 isis->debugs |= DEBUG_PROTOCOL_ERRORS;
699 print_debug (vty, DEBUG_PROTOCOL_ERRORS, 1);
701 return CMD_SUCCESS;
704 DEFUN (no_debug_isis_err,
705 no_debug_isis_err_cmd,
706 "no debug isis protocol-errors",
707 UNDEBUG_STR
708 "IS-IS information\n"
709 "IS-IS LSP protocol errors\n")
711 isis->debugs &= ~DEBUG_PROTOCOL_ERRORS;
712 print_debug (vty, DEBUG_PROTOCOL_ERRORS, 0);
714 return CMD_SUCCESS;
717 DEFUN (debug_isis_snp,
718 debug_isis_snp_cmd,
719 "debug isis snp-packets",
720 DEBUG_STR
721 "IS-IS information\n"
722 "IS-IS CSNP/PSNP packets\n")
724 isis->debugs |= DEBUG_SNP_PACKETS;
725 print_debug (vty, DEBUG_SNP_PACKETS, 1);
727 return CMD_SUCCESS;
730 DEFUN (no_debug_isis_snp,
731 no_debug_isis_snp_cmd,
732 "no debug isis snp-packets",
733 UNDEBUG_STR
734 "IS-IS information\n"
735 "IS-IS CSNP/PSNP packets\n")
737 isis->debugs &= ~DEBUG_SNP_PACKETS;
738 print_debug (vty, DEBUG_SNP_PACKETS, 0);
740 return CMD_SUCCESS;
743 DEFUN (debug_isis_upd,
744 debug_isis_upd_cmd,
745 "debug isis update-packets",
746 DEBUG_STR
747 "IS-IS information\n"
748 "IS-IS Update related packets\n")
750 isis->debugs |= DEBUG_UPDATE_PACKETS;
751 print_debug (vty, DEBUG_UPDATE_PACKETS, 1);
753 return CMD_SUCCESS;
756 DEFUN (no_debug_isis_upd,
757 no_debug_isis_upd_cmd,
758 "no debug isis update-packets",
759 UNDEBUG_STR
760 "IS-IS information\n"
761 "IS-IS Update related packets\n")
763 isis->debugs &= ~DEBUG_UPDATE_PACKETS;
764 print_debug (vty, DEBUG_UPDATE_PACKETS, 0);
766 return CMD_SUCCESS;
769 DEFUN (debug_isis_spfevents,
770 debug_isis_spfevents_cmd,
771 "debug isis spf-events",
772 DEBUG_STR
773 "IS-IS information\n"
774 "IS-IS Shortest Path First Events\n")
776 isis->debugs |= DEBUG_SPF_EVENTS;
777 print_debug (vty, DEBUG_SPF_EVENTS, 1);
779 return CMD_SUCCESS;
782 DEFUN (no_debug_isis_spfevents,
783 no_debug_isis_spfevents_cmd,
784 "no debug isis spf-events",
785 UNDEBUG_STR
786 "IS-IS information\n"
787 "IS-IS Shortest Path First Events\n")
789 isis->debugs &= ~DEBUG_SPF_EVENTS;
790 print_debug (vty, DEBUG_SPF_EVENTS, 0);
792 return CMD_SUCCESS;
796 DEFUN (debug_isis_spfstats,
797 debug_isis_spfstats_cmd,
798 "debug isis spf-statistics ",
799 DEBUG_STR
800 "IS-IS information\n"
801 "IS-IS SPF Timing and Statistic Data\n")
803 isis->debugs |= DEBUG_SPF_STATS;
804 print_debug (vty, DEBUG_SPF_STATS, 1);
806 return CMD_SUCCESS;
809 DEFUN (no_debug_isis_spfstats,
810 no_debug_isis_spfstats_cmd,
811 "no debug isis spf-statistics",
812 UNDEBUG_STR
813 "IS-IS information\n"
814 "IS-IS SPF Timing and Statistic Data\n")
816 isis->debugs &= ~DEBUG_SPF_STATS;
817 print_debug (vty, DEBUG_SPF_STATS, 0);
819 return CMD_SUCCESS;
822 DEFUN (debug_isis_spftrigg,
823 debug_isis_spftrigg_cmd,
824 "debug isis spf-triggers",
825 DEBUG_STR
826 "IS-IS information\n"
827 "IS-IS SPF triggering events\n")
829 isis->debugs |= DEBUG_SPF_TRIGGERS;
830 print_debug (vty, DEBUG_SPF_TRIGGERS, 1);
832 return CMD_SUCCESS;
835 DEFUN (no_debug_isis_spftrigg,
836 no_debug_isis_spftrigg_cmd,
837 "no debug isis spf-triggers",
838 UNDEBUG_STR
839 "IS-IS information\n"
840 "IS-IS SPF triggering events\n")
842 isis->debugs &= ~DEBUG_SPF_TRIGGERS;
843 print_debug (vty, DEBUG_SPF_TRIGGERS, 0);
845 return CMD_SUCCESS;
848 DEFUN (debug_isis_rtevents,
849 debug_isis_rtevents_cmd,
850 "debug isis route-events",
851 DEBUG_STR
852 "IS-IS information\n"
853 "IS-IS Route related events\n")
855 isis->debugs |= DEBUG_RTE_EVENTS;
856 print_debug (vty, DEBUG_RTE_EVENTS, 1);
858 return CMD_SUCCESS;
861 DEFUN (no_debug_isis_rtevents,
862 no_debug_isis_rtevents_cmd,
863 "no debug isis route-events",
864 UNDEBUG_STR
865 "IS-IS information\n"
866 "IS-IS Route related events\n")
868 isis->debugs &= ~DEBUG_RTE_EVENTS;
869 print_debug (vty, DEBUG_RTE_EVENTS, 0);
871 return CMD_SUCCESS;
874 DEFUN (debug_isis_events,
875 debug_isis_events_cmd,
876 "debug isis events",
877 DEBUG_STR
878 "IS-IS information\n"
879 "IS-IS Events\n")
881 isis->debugs |= DEBUG_EVENTS;
882 print_debug (vty, DEBUG_EVENTS, 1);
884 return CMD_SUCCESS;
887 DEFUN (no_debug_isis_events,
888 no_debug_isis_events_cmd,
889 "no debug isis events",
890 UNDEBUG_STR
891 "IS-IS information\n"
892 "IS-IS Events\n")
894 isis->debugs &= ~DEBUG_EVENTS;
895 print_debug (vty, DEBUG_EVENTS, 0);
897 return CMD_SUCCESS;
900 DEFUN (show_hostname,
901 show_hostname_cmd,
902 "show isis hostname",
903 SHOW_STR
904 "IS-IS information\n"
905 "IS-IS Dynamic hostname mapping\n")
907 dynhn_print_all (vty);
909 return CMD_SUCCESS;
912 DEFUN (show_database,
913 show_database_cmd,
914 "show isis database",
915 SHOW_STR "IS-IS information\n" "IS-IS link state database\n")
917 struct listnode *node;
918 struct isis_area *area;
919 int level, lsp_count;
921 if (isis->area_list->count == 0)
922 return CMD_SUCCESS;
924 for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
926 vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null",
927 VTY_NEWLINE);
928 for (level = 0; level < ISIS_LEVELS; level++)
930 if (area->lspdb[level] && dict_count (area->lspdb[level]) > 0)
932 vty_out (vty, "IS-IS Level-%d link-state database:%s",
933 level + 1, VTY_NEWLINE);
935 lsp_count = lsp_print_all (vty, area->lspdb[level],
936 ISIS_UI_LEVEL_BRIEF,
937 area->dynhostname);
939 vty_out (vty, "%s %u LSPs%s%s",
940 VTY_NEWLINE, lsp_count, VTY_NEWLINE, VTY_NEWLINE);
945 return CMD_SUCCESS;
948 DEFUN (show_database_detail,
949 show_database_detail_cmd,
950 "show isis database detail",
951 SHOW_STR
952 "IS-IS information\n"
953 "IS-IS link state database\n")
955 struct listnode *node;
956 struct isis_area *area;
957 int level, lsp_count;
959 if (isis->area_list->count == 0)
960 return CMD_SUCCESS;
962 for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
964 vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null",
965 VTY_NEWLINE);
966 for (level = 0; level < ISIS_LEVELS; level++)
968 if (area->lspdb[level] && dict_count (area->lspdb[level]) > 0)
970 vty_out (vty, "IS-IS Level-%d Link State Database:%s",
971 level + 1, VTY_NEWLINE);
973 lsp_count = lsp_print_all (vty, area->lspdb[level],
974 ISIS_UI_LEVEL_DETAIL,
975 area->dynhostname);
977 vty_out (vty, "%s %u LSPs%s%s",
978 VTY_NEWLINE, lsp_count, VTY_NEWLINE, VTY_NEWLINE);
983 return CMD_SUCCESS;
987 * 'router isis' command
989 DEFUN (router_isis,
990 router_isis_cmd,
991 "router isis WORD",
992 ROUTER_STR
993 "ISO IS-IS\n"
994 "ISO Routing area tag")
996 return isis_area_get (vty, argv[0]);
1000 *'no router isis' command
1002 DEFUN (no_router_isis,
1003 no_router_isis_cmd,
1004 "no router isis WORD",
1005 "no\n" ROUTER_STR "ISO IS-IS\n" "ISO Routing area tag")
1007 return isis_area_destroy (vty, argv[0]);
1011 * 'net' command
1013 DEFUN (net,
1014 net_cmd,
1015 "net WORD",
1016 "A Network Entity Title for this process (OSI only)\n"
1017 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
1019 return area_net_title (vty, argv[0]);
1023 * 'no net' command
1025 DEFUN (no_net,
1026 no_net_cmd,
1027 "no net WORD",
1028 NO_STR
1029 "A Network Entity Title for this process (OSI only)\n"
1030 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
1032 return area_clear_net_title (vty, argv[0]);
1035 DEFUN (area_passwd,
1036 area_passwd_cmd,
1037 "area-password WORD",
1038 "Configure the authentication password for an area\n"
1039 "Area password\n")
1041 struct isis_area *area;
1042 int len;
1044 area = vty->index;
1046 if (!area)
1048 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1049 return CMD_WARNING;
1052 len = strlen (argv[0]);
1053 if (len > 254)
1055 vty_out (vty, "Too long area password (>254)%s", VTY_NEWLINE);
1056 return CMD_WARNING;
1058 area->area_passwd.len = (u_char) len;
1059 area->area_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
1060 strncpy ((char *)area->area_passwd.passwd, argv[0], 255);
1062 if (argc > 1)
1064 SET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND);
1065 if (strncmp(argv[1], "v", 1) == 0)
1066 SET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1067 else
1068 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1070 else
1072 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND);
1073 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1076 return CMD_SUCCESS;
1079 ALIAS (area_passwd,
1080 area_passwd_snpauth_cmd,
1081 "area-password WORD authenticate snp (send-only|validate)",
1082 "Configure the authentication password for an area\n"
1083 "Area password\n"
1084 "Authentication\n"
1085 "SNP PDUs\n"
1086 "Send but do not check PDUs on receiving\n"
1087 "Send and check PDUs on receiving\n");
1089 DEFUN (no_area_passwd,
1090 no_area_passwd_cmd,
1091 "no area-password",
1092 NO_STR
1093 "Configure the authentication password for an area\n")
1095 struct isis_area *area;
1097 area = vty->index;
1099 if (!area)
1101 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1102 return CMD_WARNING;
1105 memset (&area->area_passwd, 0, sizeof (struct isis_passwd));
1107 return CMD_SUCCESS;
1110 DEFUN (domain_passwd,
1111 domain_passwd_cmd,
1112 "domain-password WORD",
1113 "Set the authentication password for a routing domain\n"
1114 "Routing domain password\n")
1116 struct isis_area *area;
1117 int len;
1119 area = vty->index;
1121 if (!area)
1123 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1124 return CMD_WARNING;
1127 len = strlen (argv[0]);
1128 if (len > 254)
1130 vty_out (vty, "Too long area password (>254)%s", VTY_NEWLINE);
1131 return CMD_WARNING;
1133 area->domain_passwd.len = (u_char) len;
1134 area->domain_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
1135 strncpy ((char *)area->domain_passwd.passwd, argv[0], 255);
1137 if (argc > 1)
1139 SET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND);
1140 if (strncmp(argv[1], "v", 1) == 0)
1141 SET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1142 else
1143 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1145 else
1147 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND);
1148 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1151 return CMD_SUCCESS;
1154 ALIAS (domain_passwd,
1155 domain_passwd_snpauth_cmd,
1156 "domain-password WORD authenticate snp (send-only|validate)",
1157 "Set the authentication password for a routing domain\n"
1158 "Routing domain password\n"
1159 "Authentication\n"
1160 "SNP PDUs\n"
1161 "Send but do not check PDUs on receiving\n"
1162 "Send and check PDUs on receiving\n");
1164 DEFUN (no_domain_passwd,
1165 no_domain_passwd_cmd,
1166 "no domain-password WORD",
1167 NO_STR
1168 "Set the authentication password for a routing domain\n")
1170 struct isis_area *area;
1172 area = vty->index;
1174 if (!area)
1176 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1177 return CMD_WARNING;
1180 memset (&area->domain_passwd, 0, sizeof (struct isis_passwd));
1182 return CMD_SUCCESS;
1185 DEFUN (is_type,
1186 is_type_cmd,
1187 "is-type (level-1|level-1-2|level-2-only)",
1188 "IS Level for this routing process (OSI only)\n"
1189 "Act as a station router only\n"
1190 "Act as both a station router and an area router\n"
1191 "Act as an area router only\n")
1193 struct isis_area *area;
1194 int type;
1196 area = vty->index;
1198 if (!area)
1200 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1201 return CMD_WARNING;
1204 type = string2circuit_t (argv[0]);
1205 if (!type)
1207 vty_out (vty, "Unknown IS level %s", VTY_NEWLINE);
1208 return CMD_SUCCESS;
1211 isis_event_system_type_change (area, type);
1213 return CMD_SUCCESS;
1216 DEFUN (no_is_type,
1217 no_is_type_cmd,
1218 "no is-type (level-1|level-1-2|level-2-only)",
1219 NO_STR
1220 "IS Level for this routing process (OSI only)\n"
1221 "Act as a station router only\n"
1222 "Act as both a station router and an area router\n"
1223 "Act as an area router only\n")
1225 struct isis_area *area;
1226 int type;
1228 area = vty->index;
1229 assert (area);
1232 * Put the is-type back to default. Which is level-1-2 on first
1233 * circuit for the area level-1 for the rest
1235 if (listgetdata (listhead (isis->area_list)) == area)
1236 type = IS_LEVEL_1_AND_2;
1237 else
1238 type = IS_LEVEL_1;
1240 isis_event_system_type_change (area, type);
1242 return CMD_SUCCESS;
1245 DEFUN (lsp_gen_interval,
1246 lsp_gen_interval_cmd,
1247 "lsp-gen-interval <1-120>",
1248 "Minimum interval between regenerating same LSP\n"
1249 "Minimum interval in seconds\n")
1251 struct isis_area *area;
1252 uint16_t interval;
1254 area = vty->index;
1255 assert (area);
1257 interval = atoi (argv[0]);
1258 area->lsp_gen_interval[0] = interval;
1259 area->lsp_gen_interval[1] = interval;
1261 return CMD_SUCCESS;
1264 DEFUN (no_lsp_gen_interval,
1265 no_lsp_gen_interval_cmd,
1266 "no lsp-gen-interval",
1267 NO_STR
1268 "Minimum interval between regenerating same LSP\n")
1270 struct isis_area *area;
1272 area = vty->index;
1273 assert (area);
1275 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
1276 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
1278 return CMD_SUCCESS;
1281 ALIAS (no_lsp_gen_interval,
1282 no_lsp_gen_interval_arg_cmd,
1283 "no lsp-gen-interval <1-120>",
1284 NO_STR
1285 "Minimum interval between regenerating same LSP\n"
1286 "Minimum interval in seconds\n")
1288 DEFUN (lsp_gen_interval_l1,
1289 lsp_gen_interval_l1_cmd,
1290 "lsp-gen-interval level-1 <1-120>",
1291 "Minimum interval between regenerating same LSP\n"
1292 "Set interval for level 1 only\n"
1293 "Minimum interval in seconds\n")
1295 struct isis_area *area;
1296 uint16_t interval;
1298 area = vty->index;
1299 assert (area);
1301 interval = atoi (argv[0]);
1302 area->lsp_gen_interval[0] = interval;
1304 return CMD_SUCCESS;
1307 DEFUN (no_lsp_gen_interval_l1,
1308 no_lsp_gen_interval_l1_cmd,
1309 "no lsp-gen-interval level-1",
1310 NO_STR
1311 "Minimum interval between regenerating same LSP\n"
1312 "Set interval for level 1 only\n")
1314 struct isis_area *area;
1316 area = vty->index;
1317 assert (area);
1319 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
1321 return CMD_SUCCESS;
1324 ALIAS (no_lsp_gen_interval_l1,
1325 no_lsp_gen_interval_l1_arg_cmd,
1326 "no lsp-gen-interval level-1 <1-120>",
1327 NO_STR
1328 "Minimum interval between regenerating same LSP\n"
1329 "Set interval for level 1 only\n"
1330 "Minimum interval in seconds\n")
1332 DEFUN (lsp_gen_interval_l2,
1333 lsp_gen_interval_l2_cmd,
1334 "lsp-gen-interval level-2 <1-120>",
1335 "Minimum interval between regenerating same LSP\n"
1336 "Set interval for level 2 only\n"
1337 "Minimum interval in seconds\n")
1339 struct isis_area *area;
1340 int interval;
1342 area = vty->index;
1343 assert (area);
1345 interval = atoi (argv[0]);
1346 area->lsp_gen_interval[1] = interval;
1348 return CMD_SUCCESS;
1351 DEFUN (no_lsp_gen_interval_l2,
1352 no_lsp_gen_interval_l2_cmd,
1353 "no lsp-gen-interval level-2",
1354 NO_STR
1355 "Minimum interval between regenerating same LSP\n"
1356 "Set interval for level 2 only\n")
1358 struct isis_area *area;
1359 int interval;
1361 area = vty->index;
1362 assert (area);
1364 interval = atoi (argv[0]);
1365 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
1367 return CMD_SUCCESS;
1370 ALIAS (no_lsp_gen_interval_l2,
1371 no_lsp_gen_interval_l2_arg_cmd,
1372 "no lsp-gen-interval level-2 <1-120>",
1373 NO_STR
1374 "Minimum interval between regenerating same LSP\n"
1375 "Set interval for level 2 only\n"
1376 "Minimum interval in seconds\n")
1378 DEFUN (metric_style,
1379 metric_style_cmd,
1380 "metric-style (narrow|transition|wide)",
1381 "Use old-style (ISO 10589) or new-style packet formats\n"
1382 "Use old style of TLVs with narrow metric\n"
1383 "Send and accept both styles of TLVs during transition\n"
1384 "Use new style of TLVs to carry wider metric\n")
1386 struct isis_area *area;
1388 area = vty->index;
1389 assert (area);
1391 if (strncmp (argv[0], "w", 1) == 0)
1393 area->newmetric = 1;
1394 area->oldmetric = 0;
1396 else if (strncmp (argv[0], "t", 1) == 0)
1398 area->newmetric = 1;
1399 area->oldmetric = 1;
1401 else if (strncmp (argv[0], "n", 1) == 0)
1403 area->newmetric = 0;
1404 area->oldmetric = 1;
1407 return CMD_SUCCESS;
1410 DEFUN (no_metric_style,
1411 no_metric_style_cmd,
1412 "no metric-style",
1413 NO_STR
1414 "Use old-style (ISO 10589) or new-style packet formats\n")
1416 struct isis_area *area;
1418 area = vty->index;
1419 assert (area);
1421 /* Default is narrow metric. */
1422 area->newmetric = 0;
1423 area->oldmetric = 1;
1425 return CMD_SUCCESS;
1428 DEFUN (dynamic_hostname,
1429 dynamic_hostname_cmd,
1430 "hostname dynamic",
1431 "Dynamic hostname for IS-IS\n"
1432 "Dynamic hostname\n")
1434 struct isis_area *area;
1436 area = vty->index;
1437 assert (area);
1439 area->dynhostname = 1;
1441 return CMD_SUCCESS;
1444 DEFUN (no_dynamic_hostname,
1445 no_dynamic_hostname_cmd,
1446 "no hostname dynamic",
1447 NO_STR
1448 "Dynamic hostname for IS-IS\n"
1449 "Dynamic hostname\n")
1451 struct isis_area *area;
1453 area = vty->index;
1454 assert (area);
1456 area->dynhostname = 0;
1458 return CMD_SUCCESS;
1461 DEFUN (spf_interval,
1462 spf_interval_cmd,
1463 "spf-interval <1-120>",
1464 "Minimum interval between SPF calculations\n"
1465 "Minimum interval between consecutive SPFs in seconds\n")
1467 struct isis_area *area;
1468 u_int16_t interval;
1470 area = vty->index;
1471 interval = atoi (argv[0]);
1472 area->min_spf_interval[0] = interval;
1473 area->min_spf_interval[1] = interval;
1475 return CMD_SUCCESS;
1478 DEFUN (no_spf_interval,
1479 no_spf_interval_cmd,
1480 "no spf-interval",
1481 NO_STR
1482 "Minimum interval between SPF calculations\n")
1484 struct isis_area *area;
1486 area = vty->index;
1488 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
1489 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
1491 return CMD_SUCCESS;
1494 ALIAS (no_spf_interval,
1495 no_spf_interval_arg_cmd,
1496 "no spf-interval <1-120>",
1497 NO_STR
1498 "Minimum interval between SPF calculations\n"
1499 "Minimum interval between consecutive SPFs in seconds\n")
1501 DEFUN (spf_interval_l1,
1502 spf_interval_l1_cmd,
1503 "spf-interval level-1 <1-120>",
1504 "Minimum interval between SPF calculations\n"
1505 "Set interval for level 1 only\n"
1506 "Minimum interval between consecutive SPFs in seconds\n")
1508 struct isis_area *area;
1509 u_int16_t interval;
1511 area = vty->index;
1512 interval = atoi (argv[0]);
1513 area->min_spf_interval[0] = interval;
1515 return CMD_SUCCESS;
1518 DEFUN (no_spf_interval_l1,
1519 no_spf_interval_l1_cmd,
1520 "no spf-interval level-1",
1521 NO_STR
1522 "Minimum interval between SPF calculations\n"
1523 "Set interval for level 1 only\n")
1525 struct isis_area *area;
1527 area = vty->index;
1529 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
1531 return CMD_SUCCESS;
1534 ALIAS (no_spf_interval,
1535 no_spf_interval_l1_arg_cmd,
1536 "no spf-interval level-1 <1-120>",
1537 NO_STR
1538 "Minimum interval between SPF calculations\n"
1539 "Set interval for level 1 only\n"
1540 "Minimum interval between consecutive SPFs in seconds\n")
1542 DEFUN (spf_interval_l2,
1543 spf_interval_l2_cmd,
1544 "spf-interval level-2 <1-120>",
1545 "Minimum interval between SPF calculations\n"
1546 "Set interval for level 2 only\n"
1547 "Minimum interval between consecutive SPFs in seconds\n")
1549 struct isis_area *area;
1550 u_int16_t interval;
1552 area = vty->index;
1553 interval = atoi (argv[0]);
1554 area->min_spf_interval[1] = interval;
1556 return CMD_SUCCESS;
1559 DEFUN (no_spf_interval_l2,
1560 no_spf_interval_l2_cmd,
1561 "no spf-interval level-2",
1562 NO_STR
1563 "Minimum interval between SPF calculations\n"
1564 "Set interval for level 2 only\n")
1566 struct isis_area *area;
1568 area = vty->index;
1570 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
1572 return CMD_SUCCESS;
1575 ALIAS (no_spf_interval,
1576 no_spf_interval_l2_arg_cmd,
1577 "no spf-interval level-2 <1-120>",
1578 NO_STR
1579 "Minimum interval between SPF calculations\n"
1580 "Set interval for level 2 only\n"
1581 "Minimum interval between consecutive SPFs in seconds\n")
1583 #ifdef TOPOLOGY_GENERATE
1584 DEFUN (topology_generate_grid,
1585 topology_generate_grid_cmd,
1586 "topology generate grid <1-100> <1-100> <1-65000> [param] [param] "
1587 "[param]",
1588 "Topology generation for IS-IS\n"
1589 "Topology generation\n"
1590 "Grid topology\n"
1591 "X parameter of the grid\n"
1592 "Y parameter of the grid\n"
1593 "Random seed\n"
1594 "Optional param 1\n"
1595 "Optional param 2\n"
1596 "Optional param 3\n"
1597 "Topology\n")
1599 struct isis_area *area;
1601 area = vty->index;
1602 assert (area);
1604 if (!spgrid_check_params (vty, argc, argv))
1606 if (area->topology)
1607 list_delete (area->topology);
1608 area->topology = list_new ();
1609 memcpy (area->top_params, vty->buf, 200);
1610 gen_spgrid_topology (vty, area->topology);
1611 remove_topology_lsps (area);
1612 generate_topology_lsps (area);
1613 /* Regenerate L1 LSP to get two way connection to the generated
1614 * topology. */
1615 lsp_regenerate_schedule (area);
1618 return CMD_SUCCESS;
1621 DEFUN (show_isis_generated_topology,
1622 show_isis_generated_topology_cmd,
1623 "show isis generated-topologies",
1624 SHOW_STR
1625 "CLNS network information\n"
1626 "Show generated topologies\n")
1628 struct isis_area *area;
1629 struct listnode *node;
1630 struct listnode *node2;
1631 struct arc *arc;
1633 for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
1635 if (!area->topology)
1636 continue;
1638 vty_out (vty, "Topology for isis area: %s%s", area->area_tag,
1639 VTY_NEWLINE);
1640 vty_out (vty, "From node To node Distance%s", VTY_NEWLINE);
1642 for (ALL_LIST_ELEMENTS_RO (area->topology, node2, arc))
1643 vty_out (vty, "%9ld %11ld %12ld%s", arc->from_node, arc->to_node,
1644 arc->distance, VTY_NEWLINE);
1646 return CMD_SUCCESS;
1649 /* Base IS for topology generation. */
1650 DEFUN (topology_baseis,
1651 topology_baseis_cmd,
1652 "topology base-is WORD",
1653 "Topology generation for IS-IS\n"
1654 "A Network IS Base for this topology\n"
1655 "XXXX.XXXX.XXXX Network entity title (NET)\n")
1657 struct isis_area *area;
1658 u_char buff[ISIS_SYS_ID_LEN];
1660 area = vty->index;
1661 assert (area);
1663 if (sysid2buff (buff, argv[0]))
1664 sysid2buff (area->topology_baseis, argv[0]);
1666 return CMD_SUCCESS;
1669 DEFUN (no_topology_baseis,
1670 no_topology_baseis_cmd,
1671 "no topology base-is WORD",
1672 NO_STR
1673 "Topology generation for IS-IS\n"
1674 "A Network IS Base for this topology\n"
1675 "XXXX.XXXX.XXXX Network entity title (NET)\n")
1677 struct isis_area *area;
1679 area = vty->index;
1680 assert (area);
1682 memcpy (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS, ISIS_SYS_ID_LEN);
1683 return CMD_SUCCESS;
1686 ALIAS (no_topology_baseis,
1687 no_topology_baseis_noid_cmd,
1688 "no topology base-is",
1689 NO_STR
1690 "Topology generation for IS-IS\n"
1691 "A Network IS Base for this topology\n")
1693 DEFUN (topology_basedynh,
1694 topology_basedynh_cmd,
1695 "topology base-dynh WORD",
1696 "Topology generation for IS-IS\n"
1697 "Dynamic hostname base for this topology\n"
1698 "Dynamic hostname base\n")
1700 struct isis_area *area;
1702 area = vty->index;
1703 assert (area);
1705 /* I hope that it's enough. */
1706 area->topology_basedynh = strndup (argv[0], 16);
1707 return CMD_SUCCESS;
1709 #endif /* TOPOLOGY_GENERATE */
1711 DEFUN (lsp_lifetime,
1712 lsp_lifetime_cmd,
1713 "lsp-lifetime <380-65535>",
1714 "Maximum LSP lifetime\n"
1715 "LSP lifetime in seconds\n")
1717 struct isis_area *area;
1718 uint16_t interval;
1720 area = vty->index;
1721 assert (area);
1723 interval = atoi (argv[0]);
1725 if (interval < ISIS_MIN_LSP_LIFETIME)
1727 vty_out (vty, "LSP lifetime (%us) below %us%s",
1728 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
1730 return CMD_WARNING;
1734 area->max_lsp_lifetime[0] = interval;
1735 area->max_lsp_lifetime[1] = interval;
1736 area->lsp_refresh[0] = interval - 300;
1737 area->lsp_refresh[1] = interval - 300;
1739 if (area->t_lsp_refresh[0])
1741 thread_cancel (area->t_lsp_refresh[0]);
1742 thread_execute (master, lsp_refresh_l1, area, 0);
1745 if (area->t_lsp_refresh[1])
1747 thread_cancel (area->t_lsp_refresh[1]);
1748 thread_execute (master, lsp_refresh_l2, area, 0);
1752 return CMD_SUCCESS;
1755 DEFUN (no_lsp_lifetime,
1756 no_lsp_lifetime_cmd,
1757 "no lsp-lifetime",
1758 NO_STR
1759 "LSP lifetime in seconds\n")
1761 struct isis_area *area;
1763 area = vty->index;
1764 assert (area);
1766 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200s */
1767 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200s */
1768 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900s */
1769 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900s */
1771 return CMD_SUCCESS;
1774 ALIAS (no_lsp_lifetime,
1775 no_lsp_lifetime_arg_cmd,
1776 "no lsp-lifetime <380-65535>",
1777 NO_STR
1778 "Maximum LSP lifetime\n"
1779 "LSP lifetime in seconds\n")
1781 DEFUN (lsp_lifetime_l1,
1782 lsp_lifetime_l1_cmd,
1783 "lsp-lifetime level-1 <380-65535>",
1784 "Maximum LSP lifetime for Level 1 only\n"
1785 "LSP lifetime for Level 1 only in seconds\n")
1787 struct isis_area *area;
1788 uint16_t interval;
1790 area = vty->index;
1791 assert (area);
1793 interval = atoi (argv[0]);
1795 if (interval < ISIS_MIN_LSP_LIFETIME)
1797 vty_out (vty, "Level-1 LSP lifetime (%us) below %us%s",
1798 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
1800 return CMD_WARNING;
1804 area->max_lsp_lifetime[0] = interval;
1805 area->lsp_refresh[0] = interval - 300;
1807 return CMD_SUCCESS;
1810 DEFUN (no_lsp_lifetime_l1,
1811 no_lsp_lifetime_l1_cmd,
1812 "no lsp-lifetime level-1",
1813 NO_STR
1814 "LSP lifetime for Level 1 only in seconds\n")
1816 struct isis_area *area;
1818 area = vty->index;
1819 assert (area);
1821 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200s */
1822 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900s */
1824 return CMD_SUCCESS;
1827 ALIAS (no_lsp_lifetime_l1,
1828 no_lsp_lifetime_l1_arg_cmd,
1829 "no lsp-lifetime level-1 <380-65535>",
1830 NO_STR
1831 "Maximum LSP lifetime for Level 1 only\n"
1832 "LSP lifetime for Level 1 only in seconds\n")
1834 DEFUN (lsp_lifetime_l2,
1835 lsp_lifetime_l2_cmd,
1836 "lsp-lifetime level-2 <380-65535>",
1837 "Maximum LSP lifetime for Level 2 only\n"
1838 "LSP lifetime for Level 2 only in seconds\n")
1840 struct isis_area *area;
1841 uint16_t interval;
1843 area = vty->index;
1844 assert (area);
1846 interval = atoi (argv[0]);
1848 if (interval < ISIS_MIN_LSP_LIFETIME)
1850 vty_out (vty, "Level-2 LSP lifetime (%us) below %us%s",
1851 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
1853 return CMD_WARNING;
1856 area->max_lsp_lifetime[1] = interval;
1857 area->lsp_refresh[1] = interval - 300;
1859 return CMD_SUCCESS;
1862 DEFUN (no_lsp_lifetime_l2,
1863 no_lsp_lifetime_l2_cmd,
1864 "no lsp-lifetime level-2",
1865 NO_STR
1866 "LSP lifetime for Level 2 only in seconds\n")
1868 struct isis_area *area;
1870 area = vty->index;
1871 assert (area);
1873 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200s */
1874 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900s */
1876 return CMD_SUCCESS;
1879 ALIAS (no_lsp_lifetime_l2,
1880 no_lsp_lifetime_l2_arg_cmd,
1881 "no lsp-lifetime level-2 <380-65535>",
1882 NO_STR
1883 "Maximum LSP lifetime for Level 2 only\n"
1884 "LSP lifetime for Level 2 only in seconds\n")
1886 /* IS-IS configuration write function */
1888 isis_config_write (struct vty *vty)
1890 int write = 0;
1892 if (isis != NULL)
1894 struct isis_area *area;
1895 struct listnode *node, *node2;
1897 for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
1899 /* ISIS - Area name */
1900 vty_out (vty, "router isis %s%s", area->area_tag, VTY_NEWLINE);
1901 write++;
1902 /* ISIS - Net */
1903 if (listcount (area->area_addrs) > 0)
1905 struct area_addr *area_addr;
1906 for (ALL_LIST_ELEMENTS_RO (area->area_addrs, node2, area_addr))
1908 vty_out (vty, " net %s%s",
1909 isonet_print (area_addr->area_addr,
1910 area_addr->addr_len + ISIS_SYS_ID_LEN +
1911 1), VTY_NEWLINE);
1912 write++;
1915 /* ISIS - Dynamic hostname - Defaults to true so only display if
1916 * false. */
1917 if (!area->dynhostname)
1919 vty_out (vty, " no hostname dynamic%s", VTY_NEWLINE);
1920 write++;
1922 /* ISIS - Metric-Style - when true displays wide */
1923 if (area->newmetric)
1925 if (!area->oldmetric)
1926 vty_out (vty, " metric-style wide%s", VTY_NEWLINE);
1927 else
1928 vty_out (vty, " metric-style transition%s", VTY_NEWLINE);
1929 write++;
1932 /* ISIS - Area is-type (level-1-2 is default) */
1933 if (area->is_type == IS_LEVEL_1)
1935 vty_out (vty, " is-type level-1%s", VTY_NEWLINE);
1936 write++;
1938 else
1940 if (area->is_type == IS_LEVEL_2)
1942 vty_out (vty, " is-type level-2-only%s", VTY_NEWLINE);
1943 write++;
1946 /* ISIS - Lsp generation interval */
1947 if (area->lsp_gen_interval[0] == area->lsp_gen_interval[1])
1949 if (area->lsp_gen_interval[0] != LSP_GEN_INTERVAL_DEFAULT)
1951 vty_out (vty, " lsp-gen-interval %d%s",
1952 area->lsp_gen_interval[0], VTY_NEWLINE);
1953 write++;
1956 else
1958 if (area->lsp_gen_interval[0] != LSP_GEN_INTERVAL_DEFAULT)
1960 vty_out (vty, " lsp-gen-interval level-1 %d%s",
1961 area->lsp_gen_interval[0], VTY_NEWLINE);
1962 write++;
1964 if (area->lsp_gen_interval[1] != LSP_GEN_INTERVAL_DEFAULT)
1966 vty_out (vty, " lsp-gen-interval level-2 %d%s",
1967 area->lsp_gen_interval[1], VTY_NEWLINE);
1968 write++;
1971 /* ISIS - LSP lifetime */
1972 if (area->max_lsp_lifetime[0] == area->max_lsp_lifetime[1])
1974 if (area->max_lsp_lifetime[0] != MAX_AGE)
1976 vty_out (vty, " lsp-lifetime %u%s", area->max_lsp_lifetime[0],
1977 VTY_NEWLINE);
1978 write++;
1981 else
1983 if (area->max_lsp_lifetime[0] != MAX_AGE)
1985 vty_out (vty, " lsp-lifetime level-1 %u%s",
1986 area->max_lsp_lifetime[0], VTY_NEWLINE);
1987 write++;
1989 if (area->max_lsp_lifetime[1] != MAX_AGE)
1991 vty_out (vty, " lsp-lifetime level-2 %u%s",
1992 area->max_lsp_lifetime[1], VTY_NEWLINE);
1993 write++;
1996 /* Minimum SPF interval. */
1997 if (area->min_spf_interval[0] == area->min_spf_interval[1])
1999 if (area->min_spf_interval[0] != MINIMUM_SPF_INTERVAL)
2001 vty_out (vty, " spf-interval %d%s",
2002 area->min_spf_interval[0], VTY_NEWLINE);
2003 write++;
2006 else
2008 if (area->min_spf_interval[0] != MINIMUM_SPF_INTERVAL)
2010 vty_out (vty, " spf-interval level-1 %d%s",
2011 area->min_spf_interval[0], VTY_NEWLINE);
2012 write++;
2014 if (area->min_spf_interval[1] != MINIMUM_SPF_INTERVAL)
2016 vty_out (vty, " spf-interval level-2 %d%s",
2017 area->min_spf_interval[1], VTY_NEWLINE);
2018 write++;
2021 /* Authentication passwords. */
2022 if (area->area_passwd.len > 0)
2024 vty_out(vty, " area-password %s", area->area_passwd.passwd);
2025 if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND))
2027 vty_out(vty, " authenticate snp ");
2028 if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV))
2029 vty_out(vty, "validate");
2030 else
2031 vty_out(vty, "send-only");
2033 vty_out(vty, "%s", VTY_NEWLINE);
2034 write++;
2036 if (area->domain_passwd.len > 0)
2038 vty_out(vty, " domain-password %s", area->domain_passwd.passwd);
2039 if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND))
2041 vty_out(vty, " authenticate snp ");
2042 if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV))
2043 vty_out(vty, "validate");
2044 else
2045 vty_out(vty, "send-only");
2047 vty_out(vty, "%s", VTY_NEWLINE);
2048 write++;
2051 #ifdef TOPOLOGY_GENERATE
2052 if (memcmp (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS,
2053 ISIS_SYS_ID_LEN))
2055 vty_out (vty, " topology base-is %s%s",
2056 sysid_print (area->topology_baseis), VTY_NEWLINE);
2057 write++;
2059 if (area->topology_basedynh)
2061 vty_out (vty, " topology base-dynh %s%s",
2062 area->topology_basedynh, VTY_NEWLINE);
2063 write++;
2065 /* We save the whole command line here. */
2066 if (strlen(area->top_params))
2068 vty_out (vty, " %s%s", area->top_params, VTY_NEWLINE);
2069 write++;
2071 #endif /* TOPOLOGY_GENERATE */
2076 return write;
2079 static struct cmd_node isis_node = {
2080 ISIS_NODE,
2081 "%s(config-router)# ",
2085 void
2086 isis_init ()
2088 /* Install IS-IS top node */
2089 install_node (&isis_node, isis_config_write);
2091 install_element (VIEW_NODE, &show_clns_neighbors_cmd);
2092 install_element (VIEW_NODE, &show_isis_neighbors_cmd);
2093 install_element (VIEW_NODE, &show_clns_neighbors_detail_cmd);
2094 install_element (VIEW_NODE, &show_isis_neighbors_detail_cmd);
2096 install_element (VIEW_NODE, &show_hostname_cmd);
2097 install_element (VIEW_NODE, &show_database_cmd);
2098 install_element (VIEW_NODE, &show_database_detail_cmd);
2100 install_element (ENABLE_NODE, &show_clns_neighbors_cmd);
2101 install_element (ENABLE_NODE, &show_isis_neighbors_cmd);
2102 install_element (ENABLE_NODE, &show_clns_neighbors_detail_cmd);
2103 install_element (ENABLE_NODE, &show_isis_neighbors_detail_cmd);
2105 install_element (ENABLE_NODE, &show_hostname_cmd);
2106 install_element (ENABLE_NODE, &show_database_cmd);
2107 install_element (ENABLE_NODE, &show_database_detail_cmd);
2108 install_element (ENABLE_NODE, &show_debugging_cmd);
2110 install_node (&debug_node, config_write_debug);
2112 install_element (ENABLE_NODE, &debug_isis_adj_cmd);
2113 install_element (ENABLE_NODE, &no_debug_isis_adj_cmd);
2114 install_element (ENABLE_NODE, &debug_isis_csum_cmd);
2115 install_element (ENABLE_NODE, &no_debug_isis_csum_cmd);
2116 install_element (ENABLE_NODE, &debug_isis_lupd_cmd);
2117 install_element (ENABLE_NODE, &no_debug_isis_lupd_cmd);
2118 install_element (ENABLE_NODE, &debug_isis_err_cmd);
2119 install_element (ENABLE_NODE, &no_debug_isis_err_cmd);
2120 install_element (ENABLE_NODE, &debug_isis_snp_cmd);
2121 install_element (ENABLE_NODE, &no_debug_isis_snp_cmd);
2122 install_element (ENABLE_NODE, &debug_isis_upd_cmd);
2123 install_element (ENABLE_NODE, &no_debug_isis_upd_cmd);
2124 install_element (ENABLE_NODE, &debug_isis_spfevents_cmd);
2125 install_element (ENABLE_NODE, &no_debug_isis_spfevents_cmd);
2126 install_element (ENABLE_NODE, &debug_isis_spfstats_cmd);
2127 install_element (ENABLE_NODE, &no_debug_isis_spfstats_cmd);
2128 install_element (ENABLE_NODE, &debug_isis_spftrigg_cmd);
2129 install_element (ENABLE_NODE, &no_debug_isis_spftrigg_cmd);
2130 install_element (ENABLE_NODE, &debug_isis_rtevents_cmd);
2131 install_element (ENABLE_NODE, &no_debug_isis_rtevents_cmd);
2132 install_element (ENABLE_NODE, &debug_isis_events_cmd);
2133 install_element (ENABLE_NODE, &no_debug_isis_events_cmd);
2135 install_element (CONFIG_NODE, &debug_isis_adj_cmd);
2136 install_element (CONFIG_NODE, &no_debug_isis_adj_cmd);
2137 install_element (CONFIG_NODE, &debug_isis_csum_cmd);
2138 install_element (CONFIG_NODE, &no_debug_isis_csum_cmd);
2139 install_element (CONFIG_NODE, &debug_isis_lupd_cmd);
2140 install_element (CONFIG_NODE, &no_debug_isis_lupd_cmd);
2141 install_element (CONFIG_NODE, &debug_isis_err_cmd);
2142 install_element (CONFIG_NODE, &no_debug_isis_err_cmd);
2143 install_element (CONFIG_NODE, &debug_isis_snp_cmd);
2144 install_element (CONFIG_NODE, &no_debug_isis_snp_cmd);
2145 install_element (CONFIG_NODE, &debug_isis_upd_cmd);
2146 install_element (CONFIG_NODE, &no_debug_isis_upd_cmd);
2147 install_element (CONFIG_NODE, &debug_isis_spfevents_cmd);
2148 install_element (CONFIG_NODE, &no_debug_isis_spfevents_cmd);
2149 install_element (CONFIG_NODE, &debug_isis_spfstats_cmd);
2150 install_element (CONFIG_NODE, &no_debug_isis_spfstats_cmd);
2151 install_element (CONFIG_NODE, &debug_isis_spftrigg_cmd);
2152 install_element (CONFIG_NODE, &no_debug_isis_spftrigg_cmd);
2153 install_element (CONFIG_NODE, &debug_isis_rtevents_cmd);
2154 install_element (CONFIG_NODE, &no_debug_isis_rtevents_cmd);
2155 install_element (CONFIG_NODE, &debug_isis_events_cmd);
2156 install_element (CONFIG_NODE, &no_debug_isis_events_cmd);
2158 install_element (CONFIG_NODE, &router_isis_cmd);
2159 install_element (CONFIG_NODE, &no_router_isis_cmd);
2161 install_default (ISIS_NODE);
2163 install_element (ISIS_NODE, &net_cmd);
2164 install_element (ISIS_NODE, &no_net_cmd);
2166 install_element (ISIS_NODE, &is_type_cmd);
2167 install_element (ISIS_NODE, &no_is_type_cmd);
2169 install_element (ISIS_NODE, &area_passwd_cmd);
2170 install_element (ISIS_NODE, &area_passwd_snpauth_cmd);
2171 install_element (ISIS_NODE, &no_area_passwd_cmd);
2173 install_element (ISIS_NODE, &domain_passwd_cmd);
2174 install_element (ISIS_NODE, &domain_passwd_snpauth_cmd);
2175 install_element (ISIS_NODE, &no_domain_passwd_cmd);
2177 install_element (ISIS_NODE, &lsp_gen_interval_cmd);
2178 install_element (ISIS_NODE, &no_lsp_gen_interval_cmd);
2179 install_element (ISIS_NODE, &no_lsp_gen_interval_arg_cmd);
2180 install_element (ISIS_NODE, &lsp_gen_interval_l1_cmd);
2181 install_element (ISIS_NODE, &no_lsp_gen_interval_l1_cmd);
2182 install_element (ISIS_NODE, &no_lsp_gen_interval_l1_arg_cmd);
2183 install_element (ISIS_NODE, &lsp_gen_interval_l2_cmd);
2184 install_element (ISIS_NODE, &no_lsp_gen_interval_l2_cmd);
2185 install_element (ISIS_NODE, &no_lsp_gen_interval_l2_arg_cmd);
2187 install_element (ISIS_NODE, &spf_interval_cmd);
2188 install_element (ISIS_NODE, &no_spf_interval_cmd);
2189 install_element (ISIS_NODE, &no_spf_interval_arg_cmd);
2190 install_element (ISIS_NODE, &spf_interval_l1_cmd);
2191 install_element (ISIS_NODE, &no_spf_interval_l1_cmd);
2192 install_element (ISIS_NODE, &no_spf_interval_l1_arg_cmd);
2193 install_element (ISIS_NODE, &spf_interval_l2_cmd);
2194 install_element (ISIS_NODE, &no_spf_interval_l2_cmd);
2195 install_element (ISIS_NODE, &no_spf_interval_l2_arg_cmd);
2197 install_element (ISIS_NODE, &lsp_lifetime_cmd);
2198 install_element (ISIS_NODE, &no_lsp_lifetime_cmd);
2199 install_element (ISIS_NODE, &no_lsp_lifetime_arg_cmd);
2200 install_element (ISIS_NODE, &lsp_lifetime_l1_cmd);
2201 install_element (ISIS_NODE, &no_lsp_lifetime_l1_cmd);
2202 install_element (ISIS_NODE, &no_lsp_lifetime_l1_arg_cmd);
2203 install_element (ISIS_NODE, &lsp_lifetime_l2_cmd);
2204 install_element (ISIS_NODE, &no_lsp_lifetime_l2_cmd);
2205 install_element (ISIS_NODE, &no_lsp_lifetime_l2_arg_cmd);
2207 install_element (ISIS_NODE, &dynamic_hostname_cmd);
2208 install_element (ISIS_NODE, &no_dynamic_hostname_cmd);
2210 install_element (ISIS_NODE, &metric_style_cmd);
2211 install_element (ISIS_NODE, &no_metric_style_cmd);
2212 #ifdef TOPOLOGY_GENERATE
2213 install_element (ISIS_NODE, &topology_generate_grid_cmd);
2214 install_element (ISIS_NODE, &topology_baseis_cmd);
2215 install_element (ISIS_NODE, &topology_basedynh_cmd);
2216 install_element (ISIS_NODE, &no_topology_baseis_cmd);
2217 install_element (ISIS_NODE, &no_topology_baseis_noid_cmd);
2218 install_element (VIEW_NODE, &show_isis_generated_topology_cmd);
2219 install_element (ENABLE_NODE, &show_isis_generated_topology_cmd);
2220 #endif /* TOPOLOGY_GENERATE */
2222 isis_new (0);
2223 isis_circuit_init ();
2224 isis_zebra_init ();
2225 isis_spf_cmds_init ();