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)
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
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.
25 #include <net/ethernet.h>
39 #include "isisd/dict.h"
40 #include "isisd/include-netbsd/iso.h"
41 #include "isisd/isis_constants.h"
42 #include "isisd/isis_common.h"
43 #include "isisd/isis_circuit.h"
44 #include "isisd/isis_flags.h"
45 #include "isisd/isisd.h"
46 #include "isisd/isis_dynhn.h"
47 #include "isisd/isis_adjacency.h"
48 #include "isisd/isis_pdu.h"
49 #include "isisd/isis_misc.h"
50 #include "isisd/isis_constants.h"
51 #include "isisd/isis_tlv.h"
52 #include "isisd/isis_lsp.h"
53 #include "isisd/isis_spf.h"
54 #include "isisd/isis_route.h"
55 #include "isisd/isis_zebra.h"
56 #include "isisd/isis_events.h"
58 #ifdef TOPOLOGY_GENERATE
60 u_char DEFAULT_TOPOLOGY_BASEIS
[6] = {0xFE, 0xED, 0xFE, 0xED, 0x00, 0x00};
61 #endif /* TOPOLOGY_GENERATE */
64 struct isis
*isis
= NULL
;
65 struct thread_master
*master
;
69 isis_new (unsigned long process_id
)
72 isis
= XMALLOC (MTYPE_ISIS
, sizeof(struct isis
));
73 bzero (isis
, sizeof (struct isis
));
77 isis
->max_area_addrs
= 3;
79 isis
->process_id
= process_id
;
80 isis
->area_list
= list_new ();
81 isis
->init_circ_list
= list_new ();
82 isis
->uptime
= time (NULL
);
83 isis
->nexthops
= list_new ();
85 isis
->nexthops6
= list_new ();
86 #endif /* HAVE_IPV6 */
88 * uncomment the next line for full debugs
90 /* isis->debugs = 0xFFFF; */
97 struct isis_area
*area
;
99 area
= XMALLOC (MTYPE_ISIS_AREA
, sizeof (struct isis_area
));
100 memset (area
, 0, sizeof (struct isis_area
));
103 * The first instance is level-1-2 rest are level-1, unless otherwise
106 if (listcount (isis
->area_list
) > 0)
107 area
->is_type
= IS_LEVEL_1
;
109 area
->is_type
= IS_LEVEL_1_AND_2
;
111 * intialize the databases
113 area
->lspdb
[0] = lsp_db_init ();
114 area
->lspdb
[1] = lsp_db_init ();
116 spftree_area_init (area
);
117 area
->route_table
= route_table_init ();
119 area
->route_table6
= route_table_init ();
120 #endif /* HAVE_IPV6 */
121 area
->circuit_list
= list_new ();
122 area
->area_addrs
= list_new ();
123 THREAD_TIMER_ON(master
, area
->t_tick
, lsp_tick
, area
, 1);
124 area
->flags
.maxindex
= -1;
128 area
->max_lsp_lifetime
[0] = MAX_AGE
; /* 1200 */
129 area
->max_lsp_lifetime
[1] = MAX_AGE
; /* 1200 */
130 area
->lsp_gen_interval
[0] = LSP_GEN_INTERVAL_DEFAULT
;
131 area
->lsp_gen_interval
[1] = LSP_GEN_INTERVAL_DEFAULT
;
132 area
->lsp_refresh
[0] = MAX_LSP_GEN_INTERVAL
; /* 900 */
133 area
->lsp_refresh
[1] = MAX_LSP_GEN_INTERVAL
; /* 900 */
134 area
->min_spf_interval
[0] = MINIMUM_SPF_INTERVAL
;
135 area
->min_spf_interval
[1] = MINIMUM_SPF_INTERVAL
;
136 area
->dynhostname
= 1;
137 area
->lsp_frag_threshold
= 90;
138 #ifdef TOPOLOGY_GENERATE
139 memcpy (area
->topology_baseis
, DEFAULT_TOPOLOGY_BASEIS
, ISIS_SYS_ID_LEN
);
140 #endif /* TOPOLOGY_GENERATE */
142 /* FIXME: Think of a better way... */
143 area
->min_bcast_mtu
= 1497;
149 isis_area_lookup (char *area_tag
)
151 struct isis_area
*area
;
152 struct listnode
*node
;
154 LIST_LOOP (isis
->area_list
, area
, node
)
155 if ((area
->area_tag
== NULL
&& area_tag
== NULL
) ||
156 (area
->area_tag
&& area_tag
&& strcmp (area
->area_tag
, area_tag
) == 0))
163 isis_area_get (struct vty
*vty
, char *area_tag
)
166 struct isis_area
*area
;
168 area
= isis_area_lookup (area_tag
);
171 vty
->node
= ISIS_NODE
;
176 area
= isis_area_create ();
177 area
->area_tag
= strdup (area_tag
);
178 listnode_add (isis
->area_list
, area
);
180 zlog_info ("new IS-IS area instance %s", area
->area_tag
);
182 vty
->node
= ISIS_NODE
;
189 isis_area_destroy (struct vty
*vty
, char *area_tag
)
192 struct isis_area
*area
;
193 struct listnode
*node
;
194 struct isis_circuit
*circuit
;
196 area
= isis_area_lookup (area_tag
);
199 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
203 if (area
->circuit_list
) {
204 node
= listhead (area
->circuit_list
);
206 circuit
= getdata (node
);
208 isis_circuit_del (circuit
);
210 list_delete (area
->circuit_list
);
212 listnode_delete (isis
->area_list
, area
);
213 THREAD_TIMER_OFF(area
->t_tick
);
214 if (area
->t_remove_aged
)
215 thread_cancel (area
->t_remove_aged
);
216 THREAD_TIMER_OFF(area
->t_lsp_refresh
[0]);
217 THREAD_TIMER_OFF(area
->t_lsp_refresh
[1]);
219 XFREE (MTYPE_ISIS_AREA
, area
);
225 area_net_title (struct vty
*vty
, char *net_title
)
228 struct isis_area
*area
;
229 struct area_addr
*addr
;
230 struct area_addr
*addrp
;
231 struct listnode
*node
;
237 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
241 /* We check that we are not over the maximal number of addresses */
242 if (listcount (area
->area_addrs
) >= isis
->max_area_addrs
) {
243 vty_out (vty
, "Maximum of area addresses (%d) already reached %s",
244 isis
->max_area_addrs
, VTY_NEWLINE
);
248 addr
= XMALLOC (MTYPE_ISIS_AREA_ADDR
, sizeof (struct area_addr
));
249 addr
->addr_len
= dotformat2buff (buff
, net_title
);
250 memcpy (addr
->area_addr
, buff
, addr
->addr_len
);
252 zlog_info ("added area address %s for area %s (address length %d)",
253 net_title
, area
->area_tag
, addr
->addr_len
);
254 #endif /* EXTREME_DEBUG */
255 if (addr
->addr_len
< 8 || addr
->addr_len
> 20) {
256 zlog_warn ("area address must be at least 8..20 octets long (%d)",
258 XFREE (MTYPE_ISIS_AREA_ADDR
, addr
);
262 if (isis
->sysid_set
== 0) {
264 * First area address - get the SystemID for this router
266 memcpy (isis
->sysid
, GETSYSID(addr
, ISIS_SYS_ID_LEN
), ISIS_SYS_ID_LEN
);
268 zlog_info ("Router has SystemID %s", sysid_print (isis
->sysid
));
271 * Check that the SystemID portions match
273 if (memcmp (isis
->sysid
, GETSYSID(addr
, ISIS_SYS_ID_LEN
),
275 vty_out (vty
, "System ID must not change when defining additional area"
276 " addresses%s", VTY_NEWLINE
);
277 XFREE (MTYPE_ISIS_AREA_ADDR
, addr
);
281 /* now we see that we don't already have this address */
282 LIST_LOOP (area
->area_addrs
, addrp
, node
) {
283 if ((addrp
->addr_len
+ ISIS_SYS_ID_LEN
+ 1) == (addr
->addr_len
)) {
284 if (!memcmp (addrp
->area_addr
, addr
->area_addr
,addr
->addr_len
)) {
285 XFREE (MTYPE_ISIS_AREA_ADDR
, addr
);
286 return CMD_SUCCESS
; /* silent fail */
293 * Forget the systemID part of the address
295 addr
->addr_len
-= (ISIS_SYS_ID_LEN
+ 1);
296 listnode_add (area
->area_addrs
, addr
);
298 /* only now we can safely generate our LSPs for this area */
299 if (listcount(area
->area_addrs
) > 0) {
300 lsp_l1_generate (area
);
301 lsp_l2_generate (area
);
308 area_clear_net_title (struct vty
*vty
, char *net_title
)
310 struct isis_area
*area
;
311 struct area_addr addr
, *addrp
= NULL
;
312 struct listnode
*node
;
317 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
321 addr
.addr_len
= dotformat2buff (buff
, net_title
);
322 if (addr
.addr_len
< 8 || addr
.addr_len
> 20) {
323 vty_out (vty
, "Unsupported area address length %d, should be 8...20 %s",
324 addr
.addr_len
, VTY_NEWLINE
);
328 memcpy(addr
.area_addr
, buff
, (int)addr
.addr_len
);
330 LIST_LOOP (area
->area_addrs
, addrp
, node
)
331 if (addrp
->addr_len
== addr
.addr_len
&&
332 !memcmp (addrp
->area_addr
, addr
.area_addr
, addr
.addr_len
))
336 vty_out (vty
, "No area address %s for area %s %s", net_title
,
337 area
->area_tag
, VTY_NEWLINE
);
341 listnode_delete (area
->area_addrs
, addrp
);
348 * 'show clns neighbors' command
352 show_clns_neigh (struct vty
*vty
, char detail
)
354 struct listnode
*node_area
, *node_circ
;
355 struct isis_area
*area
;
356 struct isis_circuit
*circuit
;
361 vty_out (vty
, "IS-IS Routing Process not enabled%s", VTY_NEWLINE
);
365 for (node_area
= listhead (isis
->area_list
); node_area
;
366 nextnode (node_area
)) {
367 area
= getdata (node_area
);
368 vty_out (vty
, "Area %s:%s", area
->area_tag
, VTY_NEWLINE
);
370 if (detail
==ISIS_UI_LEVEL_BRIEF
)
371 vty_out (vty
, " System Id Interface L State "
372 "Holdtime SNPA%s", VTY_NEWLINE
);
374 for (node_circ
= listhead (area
->circuit_list
); node_circ
;
375 nextnode (node_circ
)) {
376 circuit
= getdata (node_circ
);
377 if (circuit
->circ_type
== CIRCUIT_T_BROADCAST
) {
378 for (i
= 0; i
< 2; i
++) {
379 db
= circuit
->u
.bc
.adjdb
[i
];
380 if (db
&& db
->count
) {
381 if (detail
== ISIS_UI_LEVEL_BRIEF
)
382 isis_adjdb_iterate (db
, (void (*) (struct isis_adjacency
*,
384 isis_adj_print_vty
, vty
);
385 if (detail
== ISIS_UI_LEVEL_DETAIL
)
386 isis_adjdb_iterate (db
, (void (*) (struct isis_adjacency
*,
388 isis_adj_print_vty_detail
, vty
);
389 if (detail
== ISIS_UI_LEVEL_EXTENSIVE
)
390 isis_adjdb_iterate (db
, (void (*) (struct isis_adjacency
*,
392 isis_adj_print_vty_extensive
, vty
);
395 } else if (circuit
->circ_type
== CIRCUIT_T_P2P
&&
396 circuit
->u
.p2p
.neighbor
) {
397 if (detail
==ISIS_UI_LEVEL_BRIEF
)
398 isis_adj_p2p_print_vty (circuit
->u
.p2p
.neighbor
, vty
);
399 if (detail
==ISIS_UI_LEVEL_DETAIL
)
400 isis_adj_p2p_print_vty_detail (circuit
->u
.p2p
.neighbor
, vty
);
401 if (detail
==ISIS_UI_LEVEL_EXTENSIVE
)
402 isis_adj_p2p_print_vty_extensive (circuit
->u
.p2p
.neighbor
, vty
);
410 DEFUN (show_clns_neighbors
,
411 show_clns_neighbors_cmd
,
412 "show clns neighbors",
414 "clns network information\n"
415 "CLNS neighbor adjacencies\n")
417 return show_clns_neigh(vty
, ISIS_UI_LEVEL_BRIEF
);
420 ALIAS (show_clns_neighbors
,
421 show_isis_neighbors_cmd
,
422 "show isis neighbors",
424 "IS-IS network information\n"
425 "IS-IS neighbor adjacencies\n")
427 DEFUN (show_clns_neighbors_detail
,
428 show_clns_neighbors_detail_cmd
,
429 "show clns neighbors detail",
431 "clns network information\n"
432 "CLNS neighbor adjacencies\n"
433 "show detailed information\n")
435 return show_clns_neigh(vty
, ISIS_UI_LEVEL_DETAIL
);
438 ALIAS (show_clns_neighbors_detail
,
439 show_isis_neighbors_detail_cmd
,
440 "show isis neighbors detail",
442 "IS-IS network information\n"
443 "IS-IS neighbor adjacencies\n"
444 "show detailed information\n")
447 * 'isis debug', 'show debugging'
451 print_debug (struct vty
*vty
, int flags
, int onoff
)
455 strcpy (onoffs
,"on");
457 strcpy (onoffs
,"off");
459 if (flags
& DEBUG_ADJ_PACKETS
)
460 vty_out (vty
,"IS-IS Adjacency related packets debugging is %s%s", onoffs
,
462 if (flags
& DEBUG_CHECKSUM_ERRORS
)
463 vty_out (vty
,"IS-IS checksum errors debugging is %s%s", onoffs
,
465 if (flags
& DEBUG_LOCAL_UPDATES
)
466 vty_out (vty
,"IS-IS local updates debugging is %s%s", onoffs
,
468 if (flags
& DEBUG_PROTOCOL_ERRORS
)
469 vty_out (vty
,"IS-IS protocol errors debugging is %s%s", onoffs
,
471 if (flags
& DEBUG_SNP_PACKETS
)
472 vty_out (vty
,"IS-IS CSNP/PSNP packets debugging is %s%s", onoffs
,
474 if (flags
& DEBUG_SPF_EVENTS
)
475 vty_out (vty
,"IS-IS SPF events debugging is %s%s", onoffs
,
477 if (flags
& DEBUG_SPF_STATS
)
478 vty_out (vty
,"IS-IS SPF Timing and Statistics Data debugging is %s%s",
479 onoffs
, VTY_NEWLINE
);
480 if (flags
& DEBUG_SPF_TRIGGERS
)
481 vty_out (vty
,"IS-IS SPF triggering events debugging is %s%s", onoffs
,
483 if (flags
& DEBUG_UPDATE_PACKETS
)
484 vty_out (vty
,"IS-IS Update related packet debugging is %s%s", onoffs
,
486 if (flags
& DEBUG_RTE_EVENTS
)
487 vty_out (vty
,"IS-IS Route related debuggin is %s%s", onoffs
,
489 if (flags
& DEBUG_EVENTS
)
490 vty_out (vty
,"IS-IS Event debugging is %s%s", onoffs
,
495 DEFUN (show_debugging
,
499 "State of each debugging option\n")
501 vty_out (vty
,"IS-IS:%s", VTY_NEWLINE
);
502 print_debug (vty
, isis
->debugs
, 1);
507 static struct cmd_node debug_node
=
515 config_write_debug (struct vty
*vty
)
518 int flags
= isis
->debugs
;
520 if (flags
& DEBUG_ADJ_PACKETS
) {
521 vty_out (vty
, "debug isis adj-packets%s",
525 if (flags
& DEBUG_CHECKSUM_ERRORS
) {
526 vty_out (vty
, "debug isis checksum-errors%s",
530 if (flags
& DEBUG_LOCAL_UPDATES
) {
531 vty_out (vty
, "debug isis local-updates%s",
535 if (flags
& DEBUG_PROTOCOL_ERRORS
) {
536 vty_out (vty
, "debug isis protocol-errors%s",
540 if (flags
& DEBUG_SNP_PACKETS
) {
541 vty_out (vty
, "debug isis snp-packets%s",
545 if (flags
& DEBUG_SPF_EVENTS
) {
546 vty_out (vty
, "debug isis spf-events%s",
550 if (flags
& DEBUG_SPF_STATS
) {
551 vty_out (vty
, "debug isis spf-statistics%s",
555 if (flags
& DEBUG_SPF_TRIGGERS
) {
556 vty_out (vty
, "debug isis spf-triggers%s",
560 if (flags
& DEBUG_UPDATE_PACKETS
) {
561 vty_out (vty
, "debug isis update-packets%s",
565 if (flags
& DEBUG_RTE_EVENTS
) {
566 vty_out (vty
, "debug isis route-events%s",
570 if (flags
& DEBUG_EVENTS
) {
571 vty_out (vty
, "debug isis events%s",
579 DEFUN (debug_isis_adj
,
581 "debug isis adj-packets",
583 "IS-IS information\n"
584 "IS-IS Adjacency related packets\n"
587 isis
->debugs
|= DEBUG_ADJ_PACKETS
;
588 print_debug (vty
,DEBUG_ADJ_PACKETS
,1);
593 DEFUN (no_debug_isis_adj
,
594 no_debug_isis_adj_cmd
,
595 "no debug isis adj-packets",
597 "IS-IS information\n"
598 "IS-IS Adjacency related packets\n"
602 isis
->debugs
&= ~DEBUG_ADJ_PACKETS
;
603 print_debug (vty
, DEBUG_ADJ_PACKETS
, 0);
609 DEFUN (debug_isis_csum
,
611 "debug isis checksum-errors",
613 "IS-IS information\n"
614 "IS-IS LSP checksum errors\n"
617 isis
->debugs
|= DEBUG_CHECKSUM_ERRORS
;
618 print_debug (vty
, DEBUG_CHECKSUM_ERRORS
, 1);
623 DEFUN (no_debug_isis_csum
,
624 no_debug_isis_csum_cmd
,
625 "no debug isis checksum-errors",
627 "IS-IS information\n"
628 "IS-IS LSP checksum errors\n"
631 isis
->debugs
&= ~DEBUG_CHECKSUM_ERRORS
;
632 print_debug (vty
, DEBUG_CHECKSUM_ERRORS
, 0);
637 DEFUN (debug_isis_lupd
,
639 "debug isis local-updates",
641 "IS-IS information\n"
642 "IS-IS local update packets\n"
645 isis
->debugs
|= DEBUG_LOCAL_UPDATES
;
646 print_debug (vty
, DEBUG_LOCAL_UPDATES
, 1);
651 DEFUN (no_debug_isis_lupd
,
652 no_debug_isis_lupd_cmd
,
653 "no debug isis local-updates",
655 "IS-IS information\n"
656 "IS-IS local update packets\n"
659 isis
->debugs
&= ~DEBUG_LOCAL_UPDATES
;
660 print_debug (vty
, DEBUG_LOCAL_UPDATES
, 0);
665 DEFUN (debug_isis_err
,
667 "debug isis protocol-errors",
669 "IS-IS information\n"
670 "IS-IS LSP protocol errors\n"
673 isis
->debugs
|= DEBUG_PROTOCOL_ERRORS
;
674 print_debug (vty
, DEBUG_PROTOCOL_ERRORS
, 1);
679 DEFUN (no_debug_isis_err
,
680 no_debug_isis_err_cmd
,
681 "no debug isis protocol-errors",
683 "IS-IS information\n"
684 "IS-IS LSP protocol errors\n"
687 isis
->debugs
&= ~DEBUG_PROTOCOL_ERRORS
;
688 print_debug (vty
, DEBUG_PROTOCOL_ERRORS
, 0);
693 DEFUN (debug_isis_snp
,
695 "debug isis snp-packets",
697 "IS-IS information\n"
698 "IS-IS CSNP/PSNP packets\n"
701 isis
->debugs
|= DEBUG_SNP_PACKETS
;
702 print_debug (vty
, DEBUG_SNP_PACKETS
, 1);
707 DEFUN (no_debug_isis_snp
,
708 no_debug_isis_snp_cmd
,
709 "no debug isis snp-packets",
711 "IS-IS information\n"
712 "IS-IS CSNP/PSNP packets\n"
715 isis
->debugs
&= ~DEBUG_SNP_PACKETS
;
716 print_debug (vty
, DEBUG_SNP_PACKETS
, 0);
723 DEFUN (debug_isis_upd
,
725 "debug isis update-packets",
727 "IS-IS information\n"
728 "IS-IS Update related packets\n"
731 isis
->debugs
|= DEBUG_UPDATE_PACKETS
;
732 print_debug (vty
, DEBUG_UPDATE_PACKETS
, 1);
737 DEFUN (no_debug_isis_upd
,
738 no_debug_isis_upd_cmd
,
739 "no debug isis update-packets",
741 "IS-IS information\n"
742 "IS-IS Update related packets\n"
745 isis
->debugs
&= ~DEBUG_UPDATE_PACKETS
;
746 print_debug (vty
, DEBUG_UPDATE_PACKETS
, 0);
752 DEFUN (debug_isis_spfevents
,
753 debug_isis_spfevents_cmd
,
754 "debug isis spf-events",
756 "IS-IS information\n"
757 "IS-IS Shortest Path First Events\n"
760 isis
->debugs
|= DEBUG_SPF_EVENTS
;
761 print_debug (vty
, DEBUG_SPF_EVENTS
, 1);
766 DEFUN (no_debug_isis_spfevents
,
767 no_debug_isis_spfevents_cmd
,
768 "no debug isis spf-events",
770 "IS-IS information\n"
771 "IS-IS Shortest Path First Events\n"
774 isis
->debugs
&= ~DEBUG_SPF_EVENTS
;
775 print_debug (vty
, DEBUG_SPF_EVENTS
, 0);
781 DEFUN (debug_isis_spfstats
,
782 debug_isis_spfstats_cmd
,
783 "debug isis spf-statistics ",
785 "IS-IS information\n"
786 "IS-IS SPF Timing and Statistic Data\n"
789 isis
->debugs
|= DEBUG_SPF_STATS
;
790 print_debug (vty
, DEBUG_SPF_STATS
, 1);
795 DEFUN (no_debug_isis_spfstats
,
796 no_debug_isis_spfstats_cmd
,
797 "no debug isis spf-statistics",
799 "IS-IS information\n"
800 "IS-IS SPF Timing and Statistic Data\n"
803 isis
->debugs
&= ~DEBUG_SPF_STATS
;
804 print_debug (vty
, DEBUG_SPF_STATS
, 0);
809 DEFUN (debug_isis_spftrigg
,
810 debug_isis_spftrigg_cmd
,
811 "debug isis spf-triggers",
813 "IS-IS information\n"
814 "IS-IS SPF triggering events\n"
817 isis
->debugs
|= DEBUG_SPF_TRIGGERS
;
818 print_debug (vty
, DEBUG_SPF_TRIGGERS
, 1);
823 DEFUN (no_debug_isis_spftrigg
,
824 no_debug_isis_spftrigg_cmd
,
825 "no debug isis spf-triggers",
827 "IS-IS information\n"
828 "IS-IS SPF triggering events\n"
831 isis
->debugs
&= ~DEBUG_SPF_TRIGGERS
;
832 print_debug (vty
, DEBUG_SPF_TRIGGERS
, 0);
837 DEFUN (debug_isis_rtevents
,
838 debug_isis_rtevents_cmd
,
839 "debug isis route-events",
841 "IS-IS information\n"
842 "IS-IS Route related events\n"
845 isis
->debugs
|= DEBUG_RTE_EVENTS
;
846 print_debug (vty
, DEBUG_RTE_EVENTS
, 1);
851 DEFUN (no_debug_isis_rtevents
,
852 no_debug_isis_rtevents_cmd
,
853 "no debug isis route-events",
855 "IS-IS information\n"
856 "IS-IS Route related events\n"
859 isis
->debugs
&= ~DEBUG_RTE_EVENTS
;
860 print_debug (vty
, DEBUG_RTE_EVENTS
, 0);
865 DEFUN (debug_isis_events
,
866 debug_isis_events_cmd
,
869 "IS-IS information\n"
873 isis
->debugs
|= DEBUG_EVENTS
;
874 print_debug (vty
, DEBUG_EVENTS
, 1);
879 DEFUN (no_debug_isis_events
,
880 no_debug_isis_events_cmd
,
881 "no debug isis events",
883 "IS-IS information\n"
887 isis
->debugs
&= ~DEBUG_EVENTS
;
888 print_debug (vty
, DEBUG_EVENTS
, 0);
894 DEFUN (show_hostname
,
896 "show isis hostname",
898 "IS-IS information\n"
899 "IS-IS Dynamic hostname mapping\n")
901 dynhn_print_all (vty
);
907 DEFUN (show_database
,
909 "show isis database",
911 "IS-IS information\n"
912 "IS-IS link state database\n")
914 struct listnode
*node
;
915 struct isis_area
*area
;
918 if (isis
->area_list
->count
== 0)
921 for (node
= listhead (isis
->area_list
); node
; nextnode (node
)) {
922 area
= getdata (node
);
923 vty_out (vty
, "Area %s:%s", area
->area_tag
? area
->area_tag
: "null",
925 for (level
=0;level
<ISIS_LEVELS
;level
++) {
926 if (area
->lspdb
[level
] && dict_count (area
->lspdb
[level
]) > 0) {
927 vty_out (vty
,"IS-IS Level-%d link-state database:%s", level
+1,
930 lsp_count
= lsp_print_all (vty
, area
->lspdb
[level
],
934 vty_out (vty
,"%s %u LSPs%s%s",
947 DEFUN (show_database_detail
,
948 show_database_detail_cmd
,
949 "show isis database detail",
951 "IS-IS information\n"
952 "IS-IS link state database\n")
954 struct listnode
*node
;
955 struct isis_area
*area
;
956 int level
, lsp_count
;
958 if (isis
->area_list
->count
== 0)
961 for (node
= listhead (isis
->area_list
); node
; nextnode (node
)) {
962 area
= getdata (node
);
963 vty_out (vty
, "Area %s:%s", area
->area_tag
? area
->area_tag
: "null",
965 for (level
=0;level
<ISIS_LEVELS
;level
++) {
966 if (area
->lspdb
[level
] && dict_count (area
->lspdb
[level
]) > 0) {
967 vty_out (vty
,"IS-IS Level-%d Link State Database:%s", level
+1,
970 lsp_count
= lsp_print_all (vty
, area
->lspdb
[level
],
971 ISIS_UI_LEVEL_DETAIL
,
974 vty_out (vty
,"%s %u LSPs%s%s",
987 * 'router isis' command
994 "ISO Routing area tag")
997 return isis_area_get (vty
, argv
[0]);
1002 *'no router isis' command
1004 DEFUN (no_router_isis
,
1006 "no router isis WORD",
1010 "ISO Routing area tag")
1013 return isis_area_destroy (vty
, argv
[0]);
1022 "A Network Entity Title for this process (OSI only)\n"
1023 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n" )
1025 return area_net_title (vty
, argv
[0]);
1036 "A Network Entity Title for this process (OSI only)\n"
1037 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n" )
1039 return area_clear_net_title (vty
, argv
[0]);
1044 "area-password WORD",
1045 "Configure the authentication password for an area\n"
1048 struct isis_area
*area
;
1054 vty_out (vty
, "Cant find IS-IS instance%s", VTY_NEWLINE
);
1058 len
= strlen (argv
[0]);
1060 vty_out (vty
, "Too long area password (>254)%s", VTY_NEWLINE
);
1063 area
->area_passwd
.len
= (u_char
)len
;
1064 area
->area_passwd
.type
= ISIS_PASSWD_TYPE_CLEARTXT
;
1065 strncpy (area
->area_passwd
.passwd
, argv
[0], 255);
1070 DEFUN (no_area_passwd
,
1074 "Configure the authentication password for an area\n")
1076 struct isis_area
*area
;
1081 vty_out (vty
, "Cant find IS-IS instance%s", VTY_NEWLINE
);
1085 memset (&area
->area_passwd
, 0, sizeof (struct isis_passwd
));
1091 DEFUN (domain_passwd
,
1093 "domain-password WORD",
1094 "Set the authentication password for a routing domain\n"
1095 "Routing domain password\n" )
1097 struct isis_area
*area
;
1103 vty_out (vty
, "Cant find IS-IS instance%s", VTY_NEWLINE
);
1107 len
= strlen (argv
[0]);
1109 vty_out (vty
, "Too long area password (>254)%s", VTY_NEWLINE
);
1112 area
->domain_passwd
.len
= (u_char
)len
;
1113 area
->domain_passwd
.type
= ISIS_PASSWD_TYPE_CLEARTXT
;
1114 strncpy (area
->domain_passwd
.passwd
, argv
[0], 255);
1120 DEFUN (no_domain_passwd
,
1121 no_domain_passwd_cmd
,
1122 "no domain-password WORD",
1124 "Set the authentication password for a routing domain\n")
1126 struct isis_area
*area
;
1131 vty_out (vty
, "Cant find IS-IS instance%s", VTY_NEWLINE
);
1135 memset (&area
->domain_passwd
, 0, sizeof (struct isis_passwd
));
1142 "is-type (level-1|level-1-2|level-2-only)",
1143 "IS Level for this routing process (OSI only)\n"
1144 "Act as a station router only\n"
1145 "Act as both a station router and an area router\n"
1146 "Act as an area router only\n")
1148 struct isis_area
*area
;
1154 vty_out (vty
, "Cant find IS-IS instance%s", VTY_NEWLINE
);
1158 type
= string2circuit_t (argv
[0]);
1160 vty_out (vty
, "Unknown IS level %s", VTY_NEWLINE
);
1164 isis_event_system_type_change (area
, type
);
1171 "no is-type (level-1|level-1-2|level-2-only)",
1173 "IS Level for this routing process (OSI only)\n"
1174 "Act as a station router only\n"
1175 "Act as both a station router and an area router\n"
1176 "Act as an area router only\n")
1179 struct isis_area
*area
;
1186 * Put the is-type back to default. Which is level-1-2 on first
1187 * circuit for the area level-1 for the rest
1189 if (getdata (listhead (isis
->area_list
)) == area
)
1190 type
= IS_LEVEL_1_AND_2
;
1194 isis_event_system_type_change (area
, type
);
1199 DEFUN (lsp_gen_interval
,
1200 lsp_gen_interval_cmd
,
1201 "lsp-gen-interval <1-120>",
1202 "Minimum interval between regenerating same LSP\n"
1203 "Minimum interval in seconds\n")
1205 struct isis_area
*area
;
1211 interval
= atoi (argv
[0]);
1212 area
->lsp_gen_interval
[0] = interval
;
1213 area
->lsp_gen_interval
[1] = interval
;
1218 DEFUN (no_lsp_gen_interval
,
1219 no_lsp_gen_interval_cmd
,
1220 "no lsp-gen-interval",
1222 "Minimum interval between regenerating same LSP\n"
1225 struct isis_area
*area
;
1230 area
->lsp_gen_interval
[0] = LSP_GEN_INTERVAL_DEFAULT
;
1231 area
->lsp_gen_interval
[1] = LSP_GEN_INTERVAL_DEFAULT
;
1236 ALIAS (no_lsp_gen_interval
,
1237 no_lsp_gen_interval_arg_cmd
,
1238 "no lsp-gen-interval <1-120>",
1240 "Minimum interval between regenerating same LSP\n"
1241 "Minimum interval in seconds\n"
1244 DEFUN (lsp_gen_interval_l1
,
1245 lsp_gen_interval_l1_cmd
,
1246 "lsp-gen-interval level-1 <1-120>",
1247 "Minimum interval between regenerating same LSP\n"
1248 "Set interval for level 1 only\n"
1249 "Minimum interval in seconds\n"
1252 struct isis_area
*area
;
1258 interval
= atoi (argv
[0]);
1259 area
->lsp_gen_interval
[0] = interval
;
1264 DEFUN (no_lsp_gen_interval_l1
,
1265 no_lsp_gen_interval_l1_cmd
,
1266 "no lsp-gen-interval level-1",
1268 "Minimum interval between regenerating same LSP\n"
1269 "Set interval for level 1 only\n"
1273 struct isis_area
*area
;
1278 area
->lsp_gen_interval
[0] = LSP_GEN_INTERVAL_DEFAULT
;
1283 ALIAS (no_lsp_gen_interval_l1
,
1284 no_lsp_gen_interval_l1_arg_cmd
,
1285 "no lsp-gen-interval level-1 <1-120>",
1287 "Minimum interval between regenerating same LSP\n"
1288 "Set interval for level 1 only\n"
1289 "Minimum interval in seconds\n"
1293 DEFUN (lsp_gen_interval_l2
,
1294 lsp_gen_interval_l2_cmd
,
1295 "lsp-gen-interval level-2 <1-120>",
1296 "Minimum interval between regenerating same LSP\n"
1297 "Set interval for level 2 only\n"
1298 "Minimum interval in seconds\n"
1301 struct isis_area
*area
;
1307 interval
= atoi (argv
[0]);
1308 area
->lsp_gen_interval
[1] = interval
;
1313 DEFUN (no_lsp_gen_interval_l2
,
1314 no_lsp_gen_interval_l2_cmd
,
1315 "no lsp-gen-interval level-2",
1317 "Minimum interval between regenerating same LSP\n"
1318 "Set interval for level 2 only\n"
1321 struct isis_area
*area
;
1327 interval
= atoi (argv
[0]);
1328 area
->lsp_gen_interval
[1] = LSP_GEN_INTERVAL_DEFAULT
;
1333 ALIAS (no_lsp_gen_interval_l2
,
1334 no_lsp_gen_interval_l2_arg_cmd
,
1335 "no lsp-gen-interval level-2 <1-120>",
1337 "Minimum interval between regenerating same LSP\n"
1338 "Set interval for level 2 only\n"
1339 "Minimum interval in seconds\n"
1343 DEFUN (metric_style
,
1345 "metric-style (narrow|wide)",
1346 "Use old-style (ISO 10589) or new-style packet formats\n"
1347 "Use old style of TLVs with narrow metric\n"
1348 "Use new style of TLVs to carry wider metric\n")
1350 struct isis_area
*area
;
1354 if (!strcmp(argv
[0],"wide"))
1355 area
->newmetric
= 1;
1357 area
->newmetric
= 0;
1362 DEFUN (no_metric_style
,
1363 no_metric_style_cmd
,
1364 "no metric-style (narrow|wide)",
1366 "Use old-style (ISO 10589) or new-style packet formats\n"
1367 "Use old style of TLVs with narrow metric\n"
1368 "Use new style of TLVs to carry wider metric\n")
1370 struct isis_area
*area
;
1375 if (!strcmp(argv
[0],"wide"))
1376 area
->newmetric
= 0;
1378 area
->newmetric
= 1;
1383 DEFUN (dynamic_hostname
,
1384 dynamic_hostname_cmd
,
1386 "Dynamic hostname for IS-IS\n"
1387 "Dynamic hostname\n")
1389 struct isis_area
*area
;
1394 area
->dynhostname
= 1;
1399 DEFUN (no_dynamic_hostname
,
1400 no_dynamic_hostname_cmd
,
1401 "no hostname dynamic",
1403 "Dynamic hostname for IS-IS\n"
1404 "Dynamic hostname\n")
1406 struct isis_area
*area
;
1411 area
->dynhostname
= 0;
1416 DEFUN (spf_interval
,
1418 "spf-interval <1-120>",
1419 "Minimum interval between SPF calculations\n"
1420 "Minimum interval between consecutive SPFs in seconds\n")
1422 struct isis_area
*area
;
1426 interval
= atoi (argv
[0]);
1427 area
->min_spf_interval
[0] = interval
;
1428 area
->min_spf_interval
[1] = interval
;
1433 DEFUN (no_spf_interval
,
1434 no_spf_interval_cmd
,
1437 "Minimum interval between SPF calculations\n"
1440 struct isis_area
*area
;
1444 area
->min_spf_interval
[0] = MINIMUM_SPF_INTERVAL
;
1445 area
->min_spf_interval
[1] = MINIMUM_SPF_INTERVAL
;
1450 ALIAS (no_spf_interval
,
1451 no_spf_interval_arg_cmd
,
1452 "no spf-interval <1-120>",
1454 "Minimum interval between SPF calculations\n"
1455 "Minimum interval between consecutive SPFs in seconds\n"
1458 DEFUN (spf_interval_l1
,
1459 spf_interval_l1_cmd
,
1460 "spf-interval level-1 <1-120>",
1461 "Minimum interval between SPF calculations\n"
1462 "Set interval for level 1 only\n"
1463 "Minimum interval between consecutive SPFs in seconds\n")
1465 struct isis_area
*area
;
1469 interval
= atoi (argv
[0]);
1470 area
->min_spf_interval
[0] = interval
;
1475 DEFUN (no_spf_interval_l1
,
1476 no_spf_interval_l1_cmd
,
1477 "no spf-interval level-1",
1479 "Minimum interval between SPF calculations\n"
1480 "Set interval for level 1 only\n")
1482 struct isis_area
*area
;
1486 area
->min_spf_interval
[0] = MINIMUM_SPF_INTERVAL
;
1491 ALIAS (no_spf_interval
,
1492 no_spf_interval_l1_arg_cmd
,
1493 "no spf-interval level-1 <1-120>",
1495 "Minimum interval between SPF calculations\n"
1496 "Set interval for level 1 only\n"
1497 "Minimum interval between consecutive SPFs in seconds\n")
1499 DEFUN (spf_interval_l2
,
1500 spf_interval_l2_cmd
,
1501 "spf-interval level-2 <1-120>",
1502 "Minimum interval between SPF calculations\n"
1503 "Set interval for level 2 only\n"
1504 "Minimum interval between consecutive SPFs in seconds\n")
1506 struct isis_area
*area
;
1510 interval
= atoi (argv
[0]);
1511 area
->min_spf_interval
[1] = interval
;
1516 DEFUN (no_spf_interval_l2
,
1517 no_spf_interval_l2_cmd
,
1518 "no spf-interval level-2",
1520 "Minimum interval between SPF calculations\n"
1521 "Set interval for level 2 only\n")
1523 struct isis_area
*area
;
1527 area
->min_spf_interval
[1] = MINIMUM_SPF_INTERVAL
;
1532 ALIAS (no_spf_interval
,
1533 no_spf_interval_l2_arg_cmd
,
1534 "no spf-interval level-2 <1-120>",
1536 "Minimum interval between SPF calculations\n"
1537 "Set interval for level 2 only\n"
1538 "Minimum interval between consecutive SPFs in seconds\n")
1541 #ifdef TOPOLOGY_GENERATE
1542 DEFUN (topology_generate_grid
,
1543 topology_generate_grid_cmd
,
1544 "topology generate grid <1-100> <1-100> <1-65000> [param] [param] "
1546 "Topology for IS-IS\n"
1547 "Topology for IS-IS\n"
1548 "Topology grid for IS-IS\n"
1549 "X parameter of the grid\n"
1550 "Y parameter of the grid\n"
1552 "Optional param 1\n"
1553 "Optional param 2\n"
1554 "Optional param 3\n"
1557 struct isis_area
*area
;
1562 if (!spgrid_check_params (vty
, argc
, argv
)) {
1564 list_delete (area
->topology
);
1565 area
->topology
= list_new();
1566 memcpy(area
->top_params
,vty
->buf
,200);
1567 gen_spgrid_topology (vty
, area
->topology
);
1568 remove_topology_lsps (area
);
1569 generate_topology_lsps (area
);
1575 DEFUN (show_isis_topology
,
1576 show_isis_topology_cmd
,
1577 "show isis topology",
1579 "clns network information\n"
1580 "CLNS neighbor adjacencies\n")
1582 struct isis_area
*area
;
1583 struct listnode
*node
;
1584 struct listnode
*node2
;
1586 LIST_LOOP (isis
->area_list
, area
, node
) {
1587 if (area
->topology
) {
1588 vty_out (vty
, "Topology for isis area:%s%s",area
->area_tag
, VTY_NEWLINE
);
1589 LIST_LOOP (area
->topology
, arc
, node2
) {
1590 vty_out (vty
, "a %ld %ld %ld%s",arc
->from_node
, arc
->to_node
,
1591 arc
->distance
, VTY_NEWLINE
);
1599 * 'topology base-is' command
1601 DEFUN (topology_baseis
,
1602 topology_baseis_cmd
,
1603 "topology base-is WORD",
1604 "Topology for IS-IS\n"
1605 "Topology for IS-IS\n"
1606 "A Network IS Base for this topology"
1607 "XX.XXXX.XXXX.XX Network entity title (NET)\n" )
1609 struct isis_area
*area
;
1610 u_char buff
[ISIS_SYS_ID_LEN
];
1615 if (sysid2buff (buff
, argv
[0])) {
1616 sysid2buff (area
->topology_baseis
, argv
[0]);
1625 DEFUN (no_topology_baseis
,
1626 no_topology_baseis_cmd
,
1627 "no topology base-is WORD",
1629 "A Network Entity Title for this process (OSI only)"
1630 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n" )
1632 struct isis_area
*area
;
1637 memcpy(area
->topology_baseis
, DEFAULT_TOPOLOGY_BASEIS
, ISIS_SYS_ID_LEN
);
1641 #endif /* TOPOLOGY_GENERATE */
1643 DEFUN (lsp_lifetime
,
1645 "lsp-lifetime <380-65535>",
1646 "Maximum LSP lifetime\n"
1647 "LSP lifetime in seconds\n"
1650 struct isis_area
*area
;
1656 interval
= atoi (argv
[0]);
1658 if (interval
< ISIS_MIN_LSP_LIFETIME
) {
1659 vty_out (vty
, "LSP lifetime (%us) below %us%s",
1661 ISIS_MIN_LSP_LIFETIME
,
1668 area
->max_lsp_lifetime
[0] = interval
;
1669 area
->max_lsp_lifetime
[1] = interval
;
1670 area
->lsp_refresh
[0] = interval
-300;
1671 area
->lsp_refresh
[1] = interval
-300;
1673 if (area
->t_lsp_refresh
[0]) {
1674 thread_cancel (area
->t_lsp_refresh
[0]);
1675 thread_execute (master
, lsp_refresh_l1
, area
, 0);
1678 if (area
->t_lsp_refresh
[1]) {
1679 thread_cancel (area
->t_lsp_refresh
[1]);
1680 thread_execute (master
, lsp_refresh_l2
, area
, 0);
1687 DEFUN (no_lsp_lifetime
,
1688 no_lsp_lifetime_cmd
,
1691 "LSP lifetime in seconds\n"
1694 struct isis_area
*area
;
1699 area
->max_lsp_lifetime
[0] = MAX_AGE
; /* 1200s */
1700 area
->max_lsp_lifetime
[1] = MAX_AGE
; /* 1200s */
1701 area
->lsp_refresh
[0] = MAX_LSP_GEN_INTERVAL
; /* 900s */
1702 area
->lsp_refresh
[1] = MAX_LSP_GEN_INTERVAL
; /* 900s */
1707 ALIAS (no_lsp_lifetime
,
1708 no_lsp_lifetime_arg_cmd
,
1709 "no lsp-lifetime <380-65535>",
1711 "Maximum LSP lifetime\n"
1712 "LSP lifetime in seconds\n"
1715 DEFUN (lsp_lifetime_l1
,
1716 lsp_lifetime_l1_cmd
,
1717 "lsp-lifetime level-1 <380-65535>",
1718 "Maximum LSP lifetime for Level 1 only\n"
1719 "LSP lifetime for Level 1 only in seconds\n"
1722 struct isis_area
*area
;
1728 interval
= atoi (argv
[0]);
1730 if (interval
< ISIS_MIN_LSP_LIFETIME
) {
1731 vty_out (vty
, "Level-1 LSP lifetime (%us) below %us%s",
1733 ISIS_MIN_LSP_LIFETIME
,
1740 area
->max_lsp_lifetime
[0] = interval
;
1741 area
->lsp_refresh
[0] = interval
-300;
1746 DEFUN (no_lsp_lifetime_l1
,
1747 no_lsp_lifetime_l1_cmd
,
1748 "no lsp-lifetime level-1",
1750 "LSP lifetime for Level 1 only in seconds\n"
1753 struct isis_area
*area
;
1758 area
->max_lsp_lifetime
[0] = MAX_AGE
; /* 1200s */
1759 area
->lsp_refresh
[0] = MAX_LSP_GEN_INTERVAL
; /* 900s */
1764 ALIAS (no_lsp_lifetime_l1
,
1765 no_lsp_lifetime_l1_arg_cmd
,
1766 "no lsp-lifetime level-1 <380-65535>",
1768 "Maximum LSP lifetime for Level 1 only\n"
1769 "LSP lifetime for Level 1 only in seconds\n"
1772 DEFUN (lsp_lifetime_l2
,
1773 lsp_lifetime_l2_cmd
,
1774 "lsp-lifetime level-2 <380-65535>",
1775 "Maximum LSP lifetime for Level 2 only\n"
1776 "LSP lifetime for Level 2 only in seconds\n"
1779 struct isis_area
*area
;
1785 interval
= atoi (argv
[0]);
1787 if (interval
< ISIS_MIN_LSP_LIFETIME
) {
1788 vty_out (vty
, "Level-2 LSP lifetime (%us) below %us%s",
1790 ISIS_MIN_LSP_LIFETIME
,
1797 area
->max_lsp_lifetime
[1] = interval
;
1798 area
->lsp_refresh
[1] = interval
- 300;
1803 DEFUN (no_lsp_lifetime_l2
,
1804 no_lsp_lifetime_l2_cmd
,
1805 "no lsp-lifetime level-2",
1807 "LSP lifetime for Level 2 only in seconds\n"
1810 struct isis_area
*area
;
1815 area
->max_lsp_lifetime
[1] = MAX_AGE
; /* 1200s */
1816 area
->lsp_refresh
[1] = MAX_LSP_GEN_INTERVAL
; /* 900s */
1821 ALIAS (no_lsp_lifetime_l2
,
1822 no_lsp_lifetime_l2_arg_cmd
,
1823 "no lsp-lifetime level-2 <380-65535>",
1825 "Maximum LSP lifetime for Level 2 only\n"
1826 "LSP lifetime for Level 2 only in seconds\n"
1832 /* IS-IS configuration write function */
1834 isis_config_write (struct vty
*vty
)
1839 struct isis_area
*area
;
1840 struct listnode
*node
;
1841 struct listnode
*node2
;
1843 LIST_LOOP (isis
->area_list
, area
, node
) {
1844 /* ISIS - Area name */
1845 vty_out (vty
, "router isis %s%s",area
->area_tag
, VTY_NEWLINE
);
1848 if (listcount (area
->area_addrs
) > 0) {
1849 struct area_addr
*area_addr
;
1850 LIST_LOOP (area
->area_addrs
, area_addr
, node2
) {
1851 vty_out (vty
, " net %s%s",
1852 isonet_print (area_addr
->area_addr
,
1853 area_addr
->addr_len
+ ISIS_SYS_ID_LEN
+ 1),
1858 /* ISIS - Dynamic hostname - Defaults to true so only display if false*/
1859 if (!area
->dynhostname
) {
1860 vty_out (vty
, " no hostname dynamic%s", VTY_NEWLINE
);
1863 /* ISIS - Metric-Style - when true displays wide */
1864 if (area
->newmetric
) {
1865 vty_out (vty
, " metric-style wide%s", VTY_NEWLINE
);
1868 /* ISIS - Area is-type (level-1-2 is default) */
1869 if (area
->is_type
== IS_LEVEL_1
) {
1870 vty_out (vty
, " is-type level-1%s", VTY_NEWLINE
);
1872 } else {if (area
->is_type
== IS_LEVEL_2
) {
1873 vty_out (vty
, " is-type level-2-only%s", VTY_NEWLINE
);
1876 /* ISIS - Lsp generation interval */
1877 if (area
->lsp_gen_interval
[0] == area
->lsp_gen_interval
[1]) {
1878 if (area
->lsp_gen_interval
[0] != LSP_GEN_INTERVAL_DEFAULT
) {
1879 vty_out (vty
, " lsp-gen-interval %d%s", area
->lsp_gen_interval
[0],
1883 if (area
->lsp_gen_interval
[0] != LSP_GEN_INTERVAL_DEFAULT
) {
1884 vty_out (vty
, " lsp-gen-interval level-1 %d%s",
1885 area
->lsp_gen_interval
[0], VTY_NEWLINE
);
1888 if (area
->lsp_gen_interval
[1] != LSP_GEN_INTERVAL_DEFAULT
) {
1889 vty_out (vty
, " lsp-gen-interval level-2 %d%s",
1890 area
->lsp_gen_interval
[1], VTY_NEWLINE
);
1894 /* ISIS - LSP lifetime */
1895 if (area
->max_lsp_lifetime
[0] == area
->max_lsp_lifetime
[1]) {
1896 if (area
->max_lsp_lifetime
[0] != MAX_AGE
) {
1897 vty_out (vty
, " lsp-lifetime %u%s", area
->max_lsp_lifetime
[0],
1901 if (area
->max_lsp_lifetime
[0] != MAX_AGE
) {
1902 vty_out (vty
, " lsp-lifetime level-1 %u%s", area
->max_lsp_lifetime
[0],
1906 if (area
->max_lsp_lifetime
[1] != MAX_AGE
) {
1907 vty_out (vty
, " lsp-lifetime level-2 %u%s", area
->max_lsp_lifetime
[1],
1912 #ifdef TOPOLOGY_GENERATE
1913 /* seems we save the whole command line here */
1914 if (area
->top_params
) {
1915 vty_out (vty
, " %s%s",area
->top_params
, VTY_NEWLINE
);
1919 if (memcmp(area
->topology_baseis
, DEFAULT_TOPOLOGY_BASEIS
,
1921 vty_out (vty
, " topology base_is %s%s",
1922 sysid_print (area
->topology_baseis
), VTY_NEWLINE
);
1926 #endif /* TOPOLOGY_GENERATE */
1933 struct cmd_node isis_node
=
1936 "%s(config-router)# ",
1944 /* Install IS-IS top node */
1945 install_node (&isis_node
, isis_config_write
);
1947 install_element (VIEW_NODE
, &show_clns_neighbors_cmd
);
1948 install_element (VIEW_NODE
, &show_isis_neighbors_cmd
);
1949 install_element (VIEW_NODE
, &show_clns_neighbors_detail_cmd
);
1950 install_element (VIEW_NODE
, &show_isis_neighbors_detail_cmd
);
1952 install_element (VIEW_NODE
, &show_hostname_cmd
);
1953 install_element (VIEW_NODE
, &show_database_cmd
);
1954 install_element (VIEW_NODE
, &show_database_detail_cmd
);
1956 install_element (ENABLE_NODE
, &show_clns_neighbors_cmd
);
1957 install_element (ENABLE_NODE
, &show_isis_neighbors_cmd
);
1958 install_element (ENABLE_NODE
, &show_clns_neighbors_detail_cmd
);
1959 install_element (ENABLE_NODE
, &show_isis_neighbors_detail_cmd
);
1961 install_element (ENABLE_NODE
, &show_hostname_cmd
);
1962 install_element (ENABLE_NODE
, &show_database_cmd
);
1963 install_element (ENABLE_NODE
, &show_database_detail_cmd
);
1964 install_element (ENABLE_NODE
, &show_debugging_cmd
);
1966 install_node(&debug_node
, config_write_debug
);
1968 install_element (ENABLE_NODE
, &debug_isis_adj_cmd
);
1969 install_element (ENABLE_NODE
, &no_debug_isis_adj_cmd
);
1970 install_element (ENABLE_NODE
, &debug_isis_csum_cmd
);
1971 install_element (ENABLE_NODE
, &no_debug_isis_csum_cmd
);
1972 install_element (ENABLE_NODE
, &debug_isis_lupd_cmd
);
1973 install_element (ENABLE_NODE
, &no_debug_isis_lupd_cmd
);
1974 install_element (ENABLE_NODE
, &debug_isis_err_cmd
);
1975 install_element (ENABLE_NODE
, &no_debug_isis_err_cmd
);
1976 install_element (ENABLE_NODE
, &debug_isis_snp_cmd
);
1977 install_element (ENABLE_NODE
, &no_debug_isis_snp_cmd
);
1978 install_element (ENABLE_NODE
, &debug_isis_upd_cmd
);
1979 install_element (ENABLE_NODE
, &no_debug_isis_upd_cmd
);
1980 install_element (ENABLE_NODE
, &debug_isis_spfevents_cmd
);
1981 install_element (ENABLE_NODE
, &no_debug_isis_spfevents_cmd
);
1982 install_element (ENABLE_NODE
, &debug_isis_spfstats_cmd
);
1983 install_element (ENABLE_NODE
, &no_debug_isis_spfstats_cmd
);
1984 install_element (ENABLE_NODE
, &debug_isis_spftrigg_cmd
);
1985 install_element (ENABLE_NODE
, &no_debug_isis_spftrigg_cmd
);
1986 install_element (ENABLE_NODE
, &debug_isis_rtevents_cmd
);
1987 install_element (ENABLE_NODE
, &no_debug_isis_rtevents_cmd
);
1988 install_element (ENABLE_NODE
, &debug_isis_events_cmd
);
1989 install_element (ENABLE_NODE
, &no_debug_isis_events_cmd
);
1991 install_element (CONFIG_NODE
, &debug_isis_adj_cmd
);
1992 install_element (CONFIG_NODE
, &no_debug_isis_adj_cmd
);
1993 install_element (CONFIG_NODE
, &debug_isis_csum_cmd
);
1994 install_element (CONFIG_NODE
, &no_debug_isis_csum_cmd
);
1995 install_element (CONFIG_NODE
, &debug_isis_lupd_cmd
);
1996 install_element (CONFIG_NODE
, &no_debug_isis_lupd_cmd
);
1997 install_element (CONFIG_NODE
, &debug_isis_err_cmd
);
1998 install_element (CONFIG_NODE
, &no_debug_isis_err_cmd
);
1999 install_element (CONFIG_NODE
, &debug_isis_snp_cmd
);
2000 install_element (CONFIG_NODE
, &no_debug_isis_snp_cmd
);
2001 install_element (CONFIG_NODE
, &debug_isis_upd_cmd
);
2002 install_element (CONFIG_NODE
, &no_debug_isis_upd_cmd
);
2003 install_element (CONFIG_NODE
, &debug_isis_spfevents_cmd
);
2004 install_element (CONFIG_NODE
, &no_debug_isis_spfevents_cmd
);
2005 install_element (CONFIG_NODE
, &debug_isis_spfstats_cmd
);
2006 install_element (CONFIG_NODE
, &no_debug_isis_spfstats_cmd
);
2007 install_element (CONFIG_NODE
, &debug_isis_spftrigg_cmd
);
2008 install_element (CONFIG_NODE
, &no_debug_isis_spftrigg_cmd
);
2009 install_element (CONFIG_NODE
, &debug_isis_rtevents_cmd
);
2010 install_element (CONFIG_NODE
, &no_debug_isis_rtevents_cmd
);
2011 install_element (CONFIG_NODE
, &debug_isis_events_cmd
);
2012 install_element (CONFIG_NODE
, &no_debug_isis_events_cmd
);
2014 install_element (CONFIG_NODE
, &router_isis_cmd
);
2015 install_element (CONFIG_NODE
, &no_router_isis_cmd
);
2017 install_default (ISIS_NODE
);
2019 install_element (ISIS_NODE
, &net_cmd
);
2020 install_element (ISIS_NODE
, &no_net_cmd
);
2022 install_element (ISIS_NODE
, &is_type_cmd
);
2023 install_element (ISIS_NODE
, &no_is_type_cmd
);
2025 install_element (ISIS_NODE
, &area_passwd_cmd
);
2026 install_element (ISIS_NODE
, &no_area_passwd_cmd
);
2028 install_element (ISIS_NODE
, &domain_passwd_cmd
);
2029 install_element (ISIS_NODE
, &no_domain_passwd_cmd
);
2031 install_element (ISIS_NODE
, &lsp_gen_interval_cmd
);
2032 install_element (ISIS_NODE
, &no_lsp_gen_interval_cmd
);
2033 install_element (ISIS_NODE
, &no_lsp_gen_interval_arg_cmd
);
2034 install_element (ISIS_NODE
, &lsp_gen_interval_l1_cmd
);
2035 install_element (ISIS_NODE
, &no_lsp_gen_interval_l1_cmd
);
2036 install_element (ISIS_NODE
, &no_lsp_gen_interval_l1_arg_cmd
);
2037 install_element (ISIS_NODE
, &lsp_gen_interval_l2_cmd
);
2038 install_element (ISIS_NODE
, &no_lsp_gen_interval_l2_cmd
);
2039 install_element (ISIS_NODE
, &no_lsp_gen_interval_l2_arg_cmd
);
2041 install_element (ISIS_NODE
, &spf_interval_cmd
);
2042 install_element (ISIS_NODE
, &no_spf_interval_cmd
);
2043 install_element (ISIS_NODE
, &no_spf_interval_arg_cmd
);
2044 install_element (ISIS_NODE
, &spf_interval_l1_cmd
);
2045 install_element (ISIS_NODE
, &no_spf_interval_l1_cmd
);
2046 install_element (ISIS_NODE
, &no_spf_interval_l1_arg_cmd
);
2047 install_element (ISIS_NODE
, &spf_interval_l2_cmd
);
2048 install_element (ISIS_NODE
, &no_spf_interval_l2_cmd
);
2049 install_element (ISIS_NODE
, &no_spf_interval_l2_arg_cmd
);
2051 install_element (ISIS_NODE
, &lsp_lifetime_cmd
);
2052 install_element (ISIS_NODE
, &no_lsp_lifetime_cmd
);
2053 install_element (ISIS_NODE
, &no_lsp_lifetime_arg_cmd
);
2054 install_element (ISIS_NODE
, &lsp_lifetime_l1_cmd
);
2055 install_element (ISIS_NODE
, &no_lsp_lifetime_l1_cmd
);
2056 install_element (ISIS_NODE
, &no_lsp_lifetime_l1_arg_cmd
);
2057 install_element (ISIS_NODE
, &lsp_lifetime_l2_cmd
);
2058 install_element (ISIS_NODE
, &no_lsp_lifetime_l2_cmd
);
2059 install_element (ISIS_NODE
, &no_lsp_lifetime_l2_arg_cmd
);
2061 install_element (ISIS_NODE
, &dynamic_hostname_cmd
);
2062 install_element (ISIS_NODE
, &no_dynamic_hostname_cmd
);
2064 install_element (ISIS_NODE
, &metric_style_cmd
);
2065 install_element (ISIS_NODE
, &no_metric_style_cmd
);
2066 #ifdef TOPOLOGY_GENERATE
2067 install_element (ISIS_NODE
, &topology_generate_grid_cmd
);
2068 install_element (ISIS_NODE
, &topology_baseis_cmd
);
2069 install_element (ISIS_NODE
, &no_topology_baseis_cmd
);
2070 install_element (VIEW_NODE
, &show_isis_topology_cmd
);
2071 install_element (ENABLE_NODE
, &show_isis_topology_cmd
);
2072 #endif /* TOPOLOGY_GENERATE */
2075 isis_circuit_init ();
2077 isis_spf_cmds_init ();