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.
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"
55 #include "isisd/isis_csm.h"
57 #ifdef TOPOLOGY_GENERATE
59 u_char DEFAULT_TOPOLOGY_BASEIS
[6] = { 0xFE, 0xED, 0xFE, 0xED, 0x00, 0x00 };
60 #endif /* TOPOLOGY_GENERATE */
62 struct isis
*isis
= NULL
;
63 extern struct thread_master
*master
;
68 void isis_new(unsigned long);
69 struct isis_area
*isis_area_create(void);
70 int isis_area_get(struct vty
*, const char *);
71 int isis_area_destroy(struct vty
*, const char *);
72 int area_net_title(struct vty
*, const u_char
*);
73 int area_clear_net_title(struct vty
*, const u_char
*);
74 int show_clns_neigh(struct vty
*, char);
75 void print_debug(struct vty
*, int, int);
76 int isis_config_write(struct vty
*);
81 isis_new (unsigned long process_id
)
83 isis
= XCALLOC (MTYPE_ISIS
, sizeof (struct isis
));
87 isis
->max_area_addrs
= 3;
89 isis
->process_id
= process_id
;
90 isis
->area_list
= list_new ();
91 isis
->init_circ_list
= list_new ();
92 isis
->uptime
= time (NULL
);
93 isis
->nexthops
= list_new ();
95 isis
->nexthops6
= list_new ();
96 #endif /* HAVE_IPV6 */
98 * uncomment the next line for full debugs
100 /* isis->debugs = 0xFFFF; */
106 struct isis_area
*area
;
108 area
= XCALLOC (MTYPE_ISIS_AREA
, sizeof (struct isis_area
));
111 * The first instance is level-1-2 rest are level-1, unless otherwise
114 if (listcount (isis
->area_list
) > 0)
115 area
->is_type
= IS_LEVEL_1
;
117 area
->is_type
= IS_LEVEL_1_AND_2
;
119 * intialize the databases
121 area
->lspdb
[0] = lsp_db_init ();
122 area
->lspdb
[1] = lsp_db_init ();
124 spftree_area_init (area
);
125 area
->route_table
[0] = route_table_init ();
126 area
->route_table
[1] = route_table_init ();
128 area
->route_table6
[0] = route_table_init ();
129 area
->route_table6
[1] = route_table_init ();
130 #endif /* HAVE_IPV6 */
131 area
->circuit_list
= list_new ();
132 area
->area_addrs
= list_new ();
133 THREAD_TIMER_ON (master
, area
->t_tick
, lsp_tick
, area
, 1);
134 flags_initialize (&area
->flags
);
138 area
->max_lsp_lifetime
[0] = MAX_AGE
; /* 1200 */
139 area
->max_lsp_lifetime
[1] = MAX_AGE
; /* 1200 */
140 area
->lsp_gen_interval
[0] = LSP_GEN_INTERVAL_DEFAULT
;
141 area
->lsp_gen_interval
[1] = LSP_GEN_INTERVAL_DEFAULT
;
142 area
->lsp_refresh
[0] = MAX_LSP_GEN_INTERVAL
; /* 900 */
143 area
->lsp_refresh
[1] = MAX_LSP_GEN_INTERVAL
; /* 900 */
144 area
->min_spf_interval
[0] = MINIMUM_SPF_INTERVAL
;
145 area
->min_spf_interval
[1] = MINIMUM_SPF_INTERVAL
;
146 area
->dynhostname
= 1;
148 area
->lsp_frag_threshold
= 90;
149 #ifdef TOPOLOGY_GENERATE
150 memcpy (area
->topology_baseis
, DEFAULT_TOPOLOGY_BASEIS
, ISIS_SYS_ID_LEN
);
151 #endif /* TOPOLOGY_GENERATE */
153 /* FIXME: Think of a better way... */
154 area
->min_bcast_mtu
= 1497;
160 isis_area_lookup (const char *area_tag
)
162 struct isis_area
*area
;
163 struct listnode
*node
;
165 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, node
, area
))
166 if ((area
->area_tag
== NULL
&& area_tag
== NULL
) ||
167 (area
->area_tag
&& area_tag
168 && strcmp (area
->area_tag
, area_tag
) == 0))
175 isis_area_get (struct vty
*vty
, const char *area_tag
)
177 struct isis_area
*area
;
179 area
= isis_area_lookup (area_tag
);
183 vty
->node
= ISIS_NODE
;
188 area
= isis_area_create ();
189 area
->area_tag
= strdup (area_tag
);
190 listnode_add (isis
->area_list
, area
);
192 if (isis
->debugs
& DEBUG_EVENTS
)
193 zlog_debug ("New IS-IS area instance %s", area
->area_tag
);
195 vty
->node
= ISIS_NODE
;
202 isis_area_destroy (struct vty
*vty
, const char *area_tag
)
204 struct isis_area
*area
;
205 struct listnode
*node
, *nnode
;
206 struct isis_circuit
*circuit
;
208 area
= isis_area_lookup (area_tag
);
212 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
216 if (area
->circuit_list
)
218 for (ALL_LIST_ELEMENTS (area
->circuit_list
, node
, nnode
, circuit
))
220 /* The fact that it's in circuit_list means that it was configured */
221 isis_csm_state_change (ISIS_DISABLE
, circuit
, area
);
222 isis_circuit_down (circuit
);
223 isis_circuit_deconfigure (circuit
, area
);
226 list_delete (area
->circuit_list
);
228 listnode_delete (isis
->area_list
, area
);
230 THREAD_TIMER_OFF (area
->t_tick
);
231 if (area
->t_remove_aged
)
232 thread_cancel (area
->t_remove_aged
);
233 THREAD_TIMER_OFF (area
->t_lsp_refresh
[0]);
234 THREAD_TIMER_OFF (area
->t_lsp_refresh
[1]);
236 THREAD_TIMER_OFF (area
->spftree
[0]->t_spf
);
237 THREAD_TIMER_OFF (area
->spftree
[1]->t_spf
);
239 THREAD_TIMER_OFF (area
->t_lsp_l1_regenerate
);
240 THREAD_TIMER_OFF (area
->t_lsp_l2_regenerate
);
242 XFREE (MTYPE_ISIS_AREA
, area
);
250 area_net_title (struct vty
*vty
, const u_char
*net_title
)
252 struct isis_area
*area
;
253 struct area_addr
*addr
;
254 struct area_addr
*addrp
;
255 struct listnode
*node
;
262 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
266 /* We check that we are not over the maximal number of addresses */
267 if (listcount (area
->area_addrs
) >= isis
->max_area_addrs
)
269 vty_out (vty
, "Maximum of area addresses (%d) already reached %s",
270 isis
->max_area_addrs
, VTY_NEWLINE
);
274 addr
= XMALLOC (MTYPE_ISIS_AREA_ADDR
, sizeof (struct area_addr
));
275 addr
->addr_len
= dotformat2buff (buff
, net_title
);
276 memcpy (addr
->area_addr
, buff
, addr
->addr_len
);
278 zlog_debug ("added area address %s for area %s (address length %d)",
279 net_title
, area
->area_tag
, addr
->addr_len
);
280 #endif /* EXTREME_DEBUG */
281 if (addr
->addr_len
< 8 || addr
->addr_len
> 20)
283 zlog_warn ("area address must be at least 8..20 octets long (%d)",
285 XFREE (MTYPE_ISIS_AREA_ADDR
, addr
);
289 if (isis
->sysid_set
== 0)
292 * First area address - get the SystemID for this router
294 memcpy (isis
->sysid
, GETSYSID (addr
, ISIS_SYS_ID_LEN
), ISIS_SYS_ID_LEN
);
296 if (isis
->debugs
& DEBUG_EVENTS
)
297 zlog_debug ("Router has SystemID %s", sysid_print (isis
->sysid
));
302 * Check that the SystemID portions match
304 if (memcmp (isis
->sysid
, GETSYSID (addr
, ISIS_SYS_ID_LEN
),
308 "System ID must not change when defining additional area"
309 " addresses%s", VTY_NEWLINE
);
310 XFREE (MTYPE_ISIS_AREA_ADDR
, addr
);
314 /* now we see that we don't already have this address */
315 for (ALL_LIST_ELEMENTS_RO (area
->area_addrs
, node
, addrp
))
317 if ((addrp
->addr_len
+ ISIS_SYS_ID_LEN
+ 1) != (addr
->addr_len
))
319 if (!memcmp (addrp
->area_addr
, addr
->area_addr
, addr
->addr_len
))
321 XFREE (MTYPE_ISIS_AREA_ADDR
, addr
);
322 return CMD_SUCCESS
; /* silent fail */
328 * Forget the systemID part of the address
330 addr
->addr_len
-= (ISIS_SYS_ID_LEN
+ 1);
331 listnode_add (area
->area_addrs
, addr
);
333 /* only now we can safely generate our LSPs for this area */
334 if (listcount (area
->area_addrs
) > 0)
336 lsp_l1_generate (area
);
337 lsp_l2_generate (area
);
344 area_clear_net_title (struct vty
*vty
, const u_char
*net_title
)
346 struct isis_area
*area
;
347 struct area_addr addr
, *addrp
= NULL
;
348 struct listnode
*node
;
354 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
358 addr
.addr_len
= dotformat2buff (buff
, net_title
);
359 if (addr
.addr_len
< 8 || addr
.addr_len
> 20)
361 vty_out (vty
, "Unsupported area address length %d, should be 8...20 %s",
362 addr
.addr_len
, VTY_NEWLINE
);
366 memcpy (addr
.area_addr
, buff
, (int) addr
.addr_len
);
368 for (ALL_LIST_ELEMENTS_RO (area
->area_addrs
, node
, addrp
))
369 if (addrp
->addr_len
== addr
.addr_len
&&
370 !memcmp (addrp
->area_addr
, addr
.area_addr
, addr
.addr_len
))
375 vty_out (vty
, "No area address %s for area %s %s", net_title
,
376 area
->area_tag
, VTY_NEWLINE
);
380 listnode_delete (area
->area_addrs
, addrp
);
386 * 'show clns neighbors' command
390 show_clns_neigh (struct vty
*vty
, char detail
)
392 struct listnode
*anode
, *cnode
;
393 struct isis_area
*area
;
394 struct isis_circuit
*circuit
;
400 vty_out (vty
, "IS-IS Routing Process not enabled%s", VTY_NEWLINE
);
404 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, anode
, area
))
406 vty_out (vty
, "Area %s:%s", area
->area_tag
, VTY_NEWLINE
);
408 if (detail
== ISIS_UI_LEVEL_BRIEF
)
409 vty_out (vty
, " System Id Interface L State "
410 "Holdtime SNPA%s", VTY_NEWLINE
);
412 for (ALL_LIST_ELEMENTS_RO (area
->circuit_list
, cnode
, circuit
))
414 if (circuit
->circ_type
== CIRCUIT_T_BROADCAST
)
416 for (i
= 0; i
< 2; i
++)
418 db
= circuit
->u
.bc
.adjdb
[i
];
421 if (detail
== ISIS_UI_LEVEL_BRIEF
)
422 isis_adjdb_iterate (db
,
424 (struct isis_adjacency
*,
425 void *)) isis_adj_print_vty
,
427 if (detail
== ISIS_UI_LEVEL_DETAIL
)
428 isis_adjdb_iterate (db
,
430 (struct isis_adjacency
*,
432 isis_adj_print_vty_detail
, vty
);
433 if (detail
== ISIS_UI_LEVEL_EXTENSIVE
)
434 isis_adjdb_iterate (db
,
436 (struct isis_adjacency
*,
438 isis_adj_print_vty_extensive
,
443 else if (circuit
->circ_type
== CIRCUIT_T_P2P
&&
444 circuit
->u
.p2p
.neighbor
)
446 if (detail
== ISIS_UI_LEVEL_BRIEF
)
447 isis_adj_p2p_print_vty (circuit
->u
.p2p
.neighbor
, vty
);
448 if (detail
== ISIS_UI_LEVEL_DETAIL
)
449 isis_adj_p2p_print_vty_detail (circuit
->u
.p2p
.neighbor
, vty
);
450 if (detail
== ISIS_UI_LEVEL_EXTENSIVE
)
451 isis_adj_p2p_print_vty_extensive (circuit
->u
.p2p
.neighbor
,
460 DEFUN (show_clns_neighbors
,
461 show_clns_neighbors_cmd
,
462 "show clns neighbors",
464 "clns network information\n"
465 "CLNS neighbor adjacencies\n")
467 return show_clns_neigh (vty
, ISIS_UI_LEVEL_BRIEF
);
470 ALIAS (show_clns_neighbors
,
471 show_isis_neighbors_cmd
,
472 "show isis neighbors",
474 "IS-IS network information\n"
475 "IS-IS neighbor adjacencies\n")
477 DEFUN (show_clns_neighbors_detail
,
478 show_clns_neighbors_detail_cmd
,
479 "show clns neighbors detail",
481 "clns network information\n"
482 "CLNS neighbor adjacencies\n"
483 "show detailed information\n")
485 return show_clns_neigh (vty
, ISIS_UI_LEVEL_DETAIL
);
488 ALIAS (show_clns_neighbors_detail
,
489 show_isis_neighbors_detail_cmd
,
490 "show isis neighbors detail",
492 "IS-IS network information\n"
493 "IS-IS neighbor adjacencies\n"
494 "show detailed information\n")
496 * 'isis debug', 'show debugging'
499 print_debug (struct vty
*vty
, int flags
, int onoff
)
503 strcpy (onoffs
, "on");
505 strcpy (onoffs
, "off");
507 if (flags
& DEBUG_ADJ_PACKETS
)
508 vty_out (vty
, "IS-IS Adjacency related packets debugging is %s%s", onoffs
,
510 if (flags
& DEBUG_CHECKSUM_ERRORS
)
511 vty_out (vty
, "IS-IS checksum errors debugging is %s%s", onoffs
,
513 if (flags
& DEBUG_LOCAL_UPDATES
)
514 vty_out (vty
, "IS-IS local updates debugging is %s%s", onoffs
,
516 if (flags
& DEBUG_PROTOCOL_ERRORS
)
517 vty_out (vty
, "IS-IS protocol errors debugging is %s%s", onoffs
,
519 if (flags
& DEBUG_SNP_PACKETS
)
520 vty_out (vty
, "IS-IS CSNP/PSNP packets debugging is %s%s", onoffs
,
522 if (flags
& DEBUG_SPF_EVENTS
)
523 vty_out (vty
, "IS-IS SPF events debugging is %s%s", onoffs
, VTY_NEWLINE
);
524 if (flags
& DEBUG_SPF_STATS
)
525 vty_out (vty
, "IS-IS SPF Timing and Statistics Data debugging is %s%s",
526 onoffs
, VTY_NEWLINE
);
527 if (flags
& DEBUG_SPF_TRIGGERS
)
528 vty_out (vty
, "IS-IS SPF triggering events debugging is %s%s", onoffs
,
530 if (flags
& DEBUG_UPDATE_PACKETS
)
531 vty_out (vty
, "IS-IS Update related packet debugging is %s%s", onoffs
,
533 if (flags
& DEBUG_RTE_EVENTS
)
534 vty_out (vty
, "IS-IS Route related debuggin is %s%s", onoffs
,
536 if (flags
& DEBUG_EVENTS
)
537 vty_out (vty
, "IS-IS Event debugging is %s%s", onoffs
, VTY_NEWLINE
);
541 DEFUN (show_debugging
,
545 "State of each debugging option\n")
547 vty_out (vty
, "IS-IS:%s", VTY_NEWLINE
);
548 print_debug (vty
, isis
->debugs
, 1);
553 static struct cmd_node debug_node
= {
560 config_write_debug (struct vty
*vty
)
563 int flags
= isis
->debugs
;
565 if (flags
& DEBUG_ADJ_PACKETS
)
567 vty_out (vty
, "debug isis adj-packets%s", VTY_NEWLINE
);
570 if (flags
& DEBUG_CHECKSUM_ERRORS
)
572 vty_out (vty
, "debug isis checksum-errors%s", VTY_NEWLINE
);
575 if (flags
& DEBUG_LOCAL_UPDATES
)
577 vty_out (vty
, "debug isis local-updates%s", VTY_NEWLINE
);
580 if (flags
& DEBUG_PROTOCOL_ERRORS
)
582 vty_out (vty
, "debug isis protocol-errors%s", VTY_NEWLINE
);
585 if (flags
& DEBUG_SNP_PACKETS
)
587 vty_out (vty
, "debug isis snp-packets%s", VTY_NEWLINE
);
590 if (flags
& DEBUG_SPF_EVENTS
)
592 vty_out (vty
, "debug isis spf-events%s", VTY_NEWLINE
);
595 if (flags
& DEBUG_SPF_STATS
)
597 vty_out (vty
, "debug isis spf-statistics%s", VTY_NEWLINE
);
600 if (flags
& DEBUG_SPF_TRIGGERS
)
602 vty_out (vty
, "debug isis spf-triggers%s", VTY_NEWLINE
);
605 if (flags
& DEBUG_UPDATE_PACKETS
)
607 vty_out (vty
, "debug isis update-packets%s", VTY_NEWLINE
);
610 if (flags
& DEBUG_RTE_EVENTS
)
612 vty_out (vty
, "debug isis route-events%s", VTY_NEWLINE
);
615 if (flags
& DEBUG_EVENTS
)
617 vty_out (vty
, "debug isis events%s", VTY_NEWLINE
);
624 DEFUN (debug_isis_adj
,
626 "debug isis adj-packets",
628 "IS-IS information\n"
629 "IS-IS Adjacency related packets\n")
631 isis
->debugs
|= DEBUG_ADJ_PACKETS
;
632 print_debug (vty
, DEBUG_ADJ_PACKETS
, 1);
637 DEFUN (no_debug_isis_adj
,
638 no_debug_isis_adj_cmd
,
639 "no debug isis adj-packets",
641 "IS-IS information\n"
642 "IS-IS Adjacency related packets\n")
644 isis
->debugs
&= ~DEBUG_ADJ_PACKETS
;
645 print_debug (vty
, DEBUG_ADJ_PACKETS
, 0);
650 DEFUN (debug_isis_csum
,
652 "debug isis checksum-errors",
654 "IS-IS information\n"
655 "IS-IS LSP checksum errors\n")
657 isis
->debugs
|= DEBUG_CHECKSUM_ERRORS
;
658 print_debug (vty
, DEBUG_CHECKSUM_ERRORS
, 1);
663 DEFUN (no_debug_isis_csum
,
664 no_debug_isis_csum_cmd
,
665 "no debug isis checksum-errors",
667 "IS-IS information\n"
668 "IS-IS LSP checksum errors\n")
670 isis
->debugs
&= ~DEBUG_CHECKSUM_ERRORS
;
671 print_debug (vty
, DEBUG_CHECKSUM_ERRORS
, 0);
676 DEFUN (debug_isis_lupd
,
678 "debug isis local-updates",
680 "IS-IS information\n"
681 "IS-IS local update packets\n")
683 isis
->debugs
|= DEBUG_LOCAL_UPDATES
;
684 print_debug (vty
, DEBUG_LOCAL_UPDATES
, 1);
689 DEFUN (no_debug_isis_lupd
,
690 no_debug_isis_lupd_cmd
,
691 "no debug isis local-updates",
693 "IS-IS information\n"
694 "IS-IS local update packets\n")
696 isis
->debugs
&= ~DEBUG_LOCAL_UPDATES
;
697 print_debug (vty
, DEBUG_LOCAL_UPDATES
, 0);
702 DEFUN (debug_isis_err
,
704 "debug isis protocol-errors",
706 "IS-IS information\n"
707 "IS-IS LSP protocol errors\n")
709 isis
->debugs
|= DEBUG_PROTOCOL_ERRORS
;
710 print_debug (vty
, DEBUG_PROTOCOL_ERRORS
, 1);
715 DEFUN (no_debug_isis_err
,
716 no_debug_isis_err_cmd
,
717 "no debug isis protocol-errors",
719 "IS-IS information\n"
720 "IS-IS LSP protocol errors\n")
722 isis
->debugs
&= ~DEBUG_PROTOCOL_ERRORS
;
723 print_debug (vty
, DEBUG_PROTOCOL_ERRORS
, 0);
728 DEFUN (debug_isis_snp
,
730 "debug isis snp-packets",
732 "IS-IS information\n"
733 "IS-IS CSNP/PSNP packets\n")
735 isis
->debugs
|= DEBUG_SNP_PACKETS
;
736 print_debug (vty
, DEBUG_SNP_PACKETS
, 1);
741 DEFUN (no_debug_isis_snp
,
742 no_debug_isis_snp_cmd
,
743 "no debug isis snp-packets",
745 "IS-IS information\n"
746 "IS-IS CSNP/PSNP packets\n")
748 isis
->debugs
&= ~DEBUG_SNP_PACKETS
;
749 print_debug (vty
, DEBUG_SNP_PACKETS
, 0);
754 DEFUN (debug_isis_upd
,
756 "debug isis update-packets",
758 "IS-IS information\n"
759 "IS-IS Update related packets\n")
761 isis
->debugs
|= DEBUG_UPDATE_PACKETS
;
762 print_debug (vty
, DEBUG_UPDATE_PACKETS
, 1);
767 DEFUN (no_debug_isis_upd
,
768 no_debug_isis_upd_cmd
,
769 "no debug isis update-packets",
771 "IS-IS information\n"
772 "IS-IS Update related packets\n")
774 isis
->debugs
&= ~DEBUG_UPDATE_PACKETS
;
775 print_debug (vty
, DEBUG_UPDATE_PACKETS
, 0);
780 DEFUN (debug_isis_spfevents
,
781 debug_isis_spfevents_cmd
,
782 "debug isis spf-events",
784 "IS-IS information\n"
785 "IS-IS Shortest Path First Events\n")
787 isis
->debugs
|= DEBUG_SPF_EVENTS
;
788 print_debug (vty
, DEBUG_SPF_EVENTS
, 1);
793 DEFUN (no_debug_isis_spfevents
,
794 no_debug_isis_spfevents_cmd
,
795 "no debug isis spf-events",
797 "IS-IS information\n"
798 "IS-IS Shortest Path First Events\n")
800 isis
->debugs
&= ~DEBUG_SPF_EVENTS
;
801 print_debug (vty
, DEBUG_SPF_EVENTS
, 0);
807 DEFUN (debug_isis_spfstats
,
808 debug_isis_spfstats_cmd
,
809 "debug isis spf-statistics ",
811 "IS-IS information\n"
812 "IS-IS SPF Timing and Statistic Data\n")
814 isis
->debugs
|= DEBUG_SPF_STATS
;
815 print_debug (vty
, DEBUG_SPF_STATS
, 1);
820 DEFUN (no_debug_isis_spfstats
,
821 no_debug_isis_spfstats_cmd
,
822 "no debug isis spf-statistics",
824 "IS-IS information\n"
825 "IS-IS SPF Timing and Statistic Data\n")
827 isis
->debugs
&= ~DEBUG_SPF_STATS
;
828 print_debug (vty
, DEBUG_SPF_STATS
, 0);
833 DEFUN (debug_isis_spftrigg
,
834 debug_isis_spftrigg_cmd
,
835 "debug isis spf-triggers",
837 "IS-IS information\n"
838 "IS-IS SPF triggering events\n")
840 isis
->debugs
|= DEBUG_SPF_TRIGGERS
;
841 print_debug (vty
, DEBUG_SPF_TRIGGERS
, 1);
846 DEFUN (no_debug_isis_spftrigg
,
847 no_debug_isis_spftrigg_cmd
,
848 "no debug isis spf-triggers",
850 "IS-IS information\n"
851 "IS-IS SPF triggering events\n")
853 isis
->debugs
&= ~DEBUG_SPF_TRIGGERS
;
854 print_debug (vty
, DEBUG_SPF_TRIGGERS
, 0);
859 DEFUN (debug_isis_rtevents
,
860 debug_isis_rtevents_cmd
,
861 "debug isis route-events",
863 "IS-IS information\n"
864 "IS-IS Route related events\n")
866 isis
->debugs
|= DEBUG_RTE_EVENTS
;
867 print_debug (vty
, DEBUG_RTE_EVENTS
, 1);
872 DEFUN (no_debug_isis_rtevents
,
873 no_debug_isis_rtevents_cmd
,
874 "no debug isis route-events",
876 "IS-IS information\n"
877 "IS-IS Route related events\n")
879 isis
->debugs
&= ~DEBUG_RTE_EVENTS
;
880 print_debug (vty
, DEBUG_RTE_EVENTS
, 0);
885 DEFUN (debug_isis_events
,
886 debug_isis_events_cmd
,
889 "IS-IS information\n"
892 isis
->debugs
|= DEBUG_EVENTS
;
893 print_debug (vty
, DEBUG_EVENTS
, 1);
898 DEFUN (no_debug_isis_events
,
899 no_debug_isis_events_cmd
,
900 "no debug isis events",
902 "IS-IS information\n"
905 isis
->debugs
&= ~DEBUG_EVENTS
;
906 print_debug (vty
, DEBUG_EVENTS
, 0);
911 DEFUN (show_hostname
,
913 "show isis hostname",
915 "IS-IS information\n"
916 "IS-IS Dynamic hostname mapping\n")
918 dynhn_print_all (vty
);
923 DEFUN (show_database
,
925 "show isis database",
926 SHOW_STR
"IS-IS information\n" "IS-IS link state database\n")
928 struct listnode
*node
;
929 struct isis_area
*area
;
930 int level
, lsp_count
;
932 if (isis
->area_list
->count
== 0)
935 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, node
, area
))
937 vty_out (vty
, "Area %s:%s", area
->area_tag
? area
->area_tag
: "null",
939 for (level
= 0; level
< ISIS_LEVELS
; level
++)
941 if (area
->lspdb
[level
] && dict_count (area
->lspdb
[level
]) > 0)
943 vty_out (vty
, "IS-IS Level-%d link-state database:%s",
944 level
+ 1, VTY_NEWLINE
);
946 lsp_count
= lsp_print_all (vty
, area
->lspdb
[level
],
950 vty_out (vty
, "%s %u LSPs%s%s",
951 VTY_NEWLINE
, lsp_count
, VTY_NEWLINE
, VTY_NEWLINE
);
959 DEFUN (show_database_detail
,
960 show_database_detail_cmd
,
961 "show isis database detail",
963 "IS-IS information\n"
964 "IS-IS link state database\n")
966 struct listnode
*node
;
967 struct isis_area
*area
;
968 int level
, lsp_count
;
970 if (isis
->area_list
->count
== 0)
973 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, node
, area
))
975 vty_out (vty
, "Area %s:%s", area
->area_tag
? area
->area_tag
: "null",
977 for (level
= 0; level
< ISIS_LEVELS
; level
++)
979 if (area
->lspdb
[level
] && dict_count (area
->lspdb
[level
]) > 0)
981 vty_out (vty
, "IS-IS Level-%d Link State Database:%s",
982 level
+ 1, VTY_NEWLINE
);
984 lsp_count
= lsp_print_all (vty
, area
->lspdb
[level
],
985 ISIS_UI_LEVEL_DETAIL
,
988 vty_out (vty
, "%s %u LSPs%s%s",
989 VTY_NEWLINE
, lsp_count
, VTY_NEWLINE
, VTY_NEWLINE
);
998 * 'router isis' command
1005 "ISO Routing area tag")
1007 return isis_area_get (vty
, argv
[0]);
1011 *'no router isis' command
1013 DEFUN (no_router_isis
,
1015 "no router isis WORD",
1016 "no\n" ROUTER_STR
"ISO IS-IS\n" "ISO Routing area tag")
1018 return isis_area_destroy (vty
, argv
[0]);
1027 "A Network Entity Title for this process (OSI only)\n"
1028 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
1030 return area_net_title (vty
, argv
[0]);
1040 "A Network Entity Title for this process (OSI only)\n"
1041 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
1043 return area_clear_net_title (vty
, argv
[0]);
1048 "area-password WORD",
1049 "Configure the authentication password for an area\n"
1052 struct isis_area
*area
;
1059 vty_out (vty
, "Cant find IS-IS instance%s", VTY_NEWLINE
);
1063 len
= strlen (argv
[0]);
1066 vty_out (vty
, "Too long area password (>254)%s", VTY_NEWLINE
);
1069 area
->area_passwd
.len
= (u_char
) len
;
1070 area
->area_passwd
.type
= ISIS_PASSWD_TYPE_CLEARTXT
;
1071 strncpy ((char *)area
->area_passwd
.passwd
, argv
[0], 255);
1075 SET_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_SEND
);
1076 if (strncmp(argv
[1], "v", 1) == 0)
1077 SET_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_RECV
);
1079 UNSET_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_RECV
);
1083 UNSET_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_SEND
);
1084 UNSET_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_RECV
);
1091 area_passwd_snpauth_cmd
,
1092 "area-password WORD authenticate snp (send-only|validate)",
1093 "Configure the authentication password for an area\n"
1097 "Send but do not check PDUs on receiving\n"
1098 "Send and check PDUs on receiving\n");
1100 DEFUN (no_area_passwd
,
1104 "Configure the authentication password for an area\n")
1106 struct isis_area
*area
;
1112 vty_out (vty
, "Cant find IS-IS instance%s", VTY_NEWLINE
);
1116 memset (&area
->area_passwd
, 0, sizeof (struct isis_passwd
));
1121 DEFUN (domain_passwd
,
1123 "domain-password WORD",
1124 "Set the authentication password for a routing domain\n"
1125 "Routing domain password\n")
1127 struct isis_area
*area
;
1134 vty_out (vty
, "Cant find IS-IS instance%s", VTY_NEWLINE
);
1138 len
= strlen (argv
[0]);
1141 vty_out (vty
, "Too long area password (>254)%s", VTY_NEWLINE
);
1144 area
->domain_passwd
.len
= (u_char
) len
;
1145 area
->domain_passwd
.type
= ISIS_PASSWD_TYPE_CLEARTXT
;
1146 strncpy ((char *)area
->domain_passwd
.passwd
, argv
[0], 255);
1150 SET_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_SEND
);
1151 if (strncmp(argv
[1], "v", 1) == 0)
1152 SET_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_RECV
);
1154 UNSET_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_RECV
);
1158 UNSET_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_SEND
);
1159 UNSET_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_RECV
);
1165 ALIAS (domain_passwd
,
1166 domain_passwd_snpauth_cmd
,
1167 "domain-password WORD authenticate snp (send-only|validate)",
1168 "Set the authentication password for a routing domain\n"
1169 "Routing domain password\n"
1172 "Send but do not check PDUs on receiving\n"
1173 "Send and check PDUs on receiving\n");
1175 DEFUN (no_domain_passwd
,
1176 no_domain_passwd_cmd
,
1177 "no domain-password WORD",
1179 "Set the authentication password for a routing domain\n")
1181 struct isis_area
*area
;
1187 vty_out (vty
, "Cant find IS-IS instance%s", VTY_NEWLINE
);
1191 memset (&area
->domain_passwd
, 0, sizeof (struct isis_passwd
));
1198 "is-type (level-1|level-1-2|level-2-only)",
1199 "IS Level for this routing process (OSI only)\n"
1200 "Act as a station router only\n"
1201 "Act as both a station router and an area router\n"
1202 "Act as an area router only\n")
1204 struct isis_area
*area
;
1211 vty_out (vty
, "Cant find IS-IS instance%s", VTY_NEWLINE
);
1215 type
= string2circuit_t (argv
[0]);
1218 vty_out (vty
, "Unknown IS level %s", VTY_NEWLINE
);
1222 isis_event_system_type_change (area
, type
);
1229 "no is-type (level-1|level-1-2|level-2-only)",
1231 "IS Level for this routing process (OSI only)\n"
1232 "Act as a station router only\n"
1233 "Act as both a station router and an area router\n"
1234 "Act as an area router only\n")
1236 struct isis_area
*area
;
1243 * Put the is-type back to default. Which is level-1-2 on first
1244 * circuit for the area level-1 for the rest
1246 if (listgetdata (listhead (isis
->area_list
)) == area
)
1247 type
= IS_LEVEL_1_AND_2
;
1251 isis_event_system_type_change (area
, type
);
1256 DEFUN (lsp_gen_interval
,
1257 lsp_gen_interval_cmd
,
1258 "lsp-gen-interval <1-120>",
1259 "Minimum interval between regenerating same LSP\n"
1260 "Minimum interval in seconds\n")
1262 struct isis_area
*area
;
1268 interval
= atoi (argv
[0]);
1269 area
->lsp_gen_interval
[0] = interval
;
1270 area
->lsp_gen_interval
[1] = interval
;
1275 DEFUN (no_lsp_gen_interval
,
1276 no_lsp_gen_interval_cmd
,
1277 "no lsp-gen-interval",
1279 "Minimum interval between regenerating same LSP\n")
1281 struct isis_area
*area
;
1286 area
->lsp_gen_interval
[0] = LSP_GEN_INTERVAL_DEFAULT
;
1287 area
->lsp_gen_interval
[1] = LSP_GEN_INTERVAL_DEFAULT
;
1292 ALIAS (no_lsp_gen_interval
,
1293 no_lsp_gen_interval_arg_cmd
,
1294 "no lsp-gen-interval <1-120>",
1296 "Minimum interval between regenerating same LSP\n"
1297 "Minimum interval in seconds\n")
1299 DEFUN (lsp_gen_interval_l1
,
1300 lsp_gen_interval_l1_cmd
,
1301 "lsp-gen-interval level-1 <1-120>",
1302 "Minimum interval between regenerating same LSP\n"
1303 "Set interval for level 1 only\n"
1304 "Minimum interval in seconds\n")
1306 struct isis_area
*area
;
1312 interval
= atoi (argv
[0]);
1313 area
->lsp_gen_interval
[0] = interval
;
1318 DEFUN (no_lsp_gen_interval_l1
,
1319 no_lsp_gen_interval_l1_cmd
,
1320 "no lsp-gen-interval level-1",
1322 "Minimum interval between regenerating same LSP\n"
1323 "Set interval for level 1 only\n")
1325 struct isis_area
*area
;
1330 area
->lsp_gen_interval
[0] = LSP_GEN_INTERVAL_DEFAULT
;
1335 ALIAS (no_lsp_gen_interval_l1
,
1336 no_lsp_gen_interval_l1_arg_cmd
,
1337 "no lsp-gen-interval level-1 <1-120>",
1339 "Minimum interval between regenerating same LSP\n"
1340 "Set interval for level 1 only\n"
1341 "Minimum interval in seconds\n")
1343 DEFUN (lsp_gen_interval_l2
,
1344 lsp_gen_interval_l2_cmd
,
1345 "lsp-gen-interval level-2 <1-120>",
1346 "Minimum interval between regenerating same LSP\n"
1347 "Set interval for level 2 only\n"
1348 "Minimum interval in seconds\n")
1350 struct isis_area
*area
;
1356 interval
= atoi (argv
[0]);
1357 area
->lsp_gen_interval
[1] = interval
;
1362 DEFUN (no_lsp_gen_interval_l2
,
1363 no_lsp_gen_interval_l2_cmd
,
1364 "no lsp-gen-interval level-2",
1366 "Minimum interval between regenerating same LSP\n"
1367 "Set interval for level 2 only\n")
1369 struct isis_area
*area
;
1375 interval
= atoi (argv
[0]);
1376 area
->lsp_gen_interval
[1] = LSP_GEN_INTERVAL_DEFAULT
;
1381 ALIAS (no_lsp_gen_interval_l2
,
1382 no_lsp_gen_interval_l2_arg_cmd
,
1383 "no lsp-gen-interval level-2 <1-120>",
1385 "Minimum interval between regenerating same LSP\n"
1386 "Set interval for level 2 only\n"
1387 "Minimum interval in seconds\n")
1389 DEFUN (metric_style
,
1391 "metric-style (narrow|transition|wide)",
1392 "Use old-style (ISO 10589) or new-style packet formats\n"
1393 "Use old style of TLVs with narrow metric\n"
1394 "Send and accept both styles of TLVs during transition\n"
1395 "Use new style of TLVs to carry wider metric\n")
1397 struct isis_area
*area
;
1402 if (strncmp (argv
[0], "w", 1) == 0)
1404 area
->newmetric
= 1;
1405 area
->oldmetric
= 0;
1407 else if (strncmp (argv
[0], "t", 1) == 0)
1409 area
->newmetric
= 1;
1410 area
->oldmetric
= 1;
1412 else if (strncmp (argv
[0], "n", 1) == 0)
1414 area
->newmetric
= 0;
1415 area
->oldmetric
= 1;
1421 DEFUN (no_metric_style
,
1422 no_metric_style_cmd
,
1425 "Use old-style (ISO 10589) or new-style packet formats\n")
1427 struct isis_area
*area
;
1432 /* Default is narrow metric. */
1433 area
->newmetric
= 0;
1434 area
->oldmetric
= 1;
1439 DEFUN (dynamic_hostname
,
1440 dynamic_hostname_cmd
,
1442 "Dynamic hostname for IS-IS\n"
1443 "Dynamic hostname\n")
1445 struct isis_area
*area
;
1450 area
->dynhostname
= 1;
1455 DEFUN (no_dynamic_hostname
,
1456 no_dynamic_hostname_cmd
,
1457 "no hostname dynamic",
1459 "Dynamic hostname for IS-IS\n"
1460 "Dynamic hostname\n")
1462 struct isis_area
*area
;
1467 area
->dynhostname
= 0;
1472 DEFUN (spf_interval
,
1474 "spf-interval <1-120>",
1475 "Minimum interval between SPF calculations\n"
1476 "Minimum interval between consecutive SPFs in seconds\n")
1478 struct isis_area
*area
;
1482 interval
= atoi (argv
[0]);
1483 area
->min_spf_interval
[0] = interval
;
1484 area
->min_spf_interval
[1] = interval
;
1489 DEFUN (no_spf_interval
,
1490 no_spf_interval_cmd
,
1493 "Minimum interval between SPF calculations\n")
1495 struct isis_area
*area
;
1499 area
->min_spf_interval
[0] = MINIMUM_SPF_INTERVAL
;
1500 area
->min_spf_interval
[1] = MINIMUM_SPF_INTERVAL
;
1505 ALIAS (no_spf_interval
,
1506 no_spf_interval_arg_cmd
,
1507 "no spf-interval <1-120>",
1509 "Minimum interval between SPF calculations\n"
1510 "Minimum interval between consecutive SPFs in seconds\n")
1512 DEFUN (spf_interval_l1
,
1513 spf_interval_l1_cmd
,
1514 "spf-interval level-1 <1-120>",
1515 "Minimum interval between SPF calculations\n"
1516 "Set interval for level 1 only\n"
1517 "Minimum interval between consecutive SPFs in seconds\n")
1519 struct isis_area
*area
;
1523 interval
= atoi (argv
[0]);
1524 area
->min_spf_interval
[0] = interval
;
1529 DEFUN (no_spf_interval_l1
,
1530 no_spf_interval_l1_cmd
,
1531 "no spf-interval level-1",
1533 "Minimum interval between SPF calculations\n"
1534 "Set interval for level 1 only\n")
1536 struct isis_area
*area
;
1540 area
->min_spf_interval
[0] = MINIMUM_SPF_INTERVAL
;
1545 ALIAS (no_spf_interval
,
1546 no_spf_interval_l1_arg_cmd
,
1547 "no spf-interval level-1 <1-120>",
1549 "Minimum interval between SPF calculations\n"
1550 "Set interval for level 1 only\n"
1551 "Minimum interval between consecutive SPFs in seconds\n")
1553 DEFUN (spf_interval_l2
,
1554 spf_interval_l2_cmd
,
1555 "spf-interval level-2 <1-120>",
1556 "Minimum interval between SPF calculations\n"
1557 "Set interval for level 2 only\n"
1558 "Minimum interval between consecutive SPFs in seconds\n")
1560 struct isis_area
*area
;
1564 interval
= atoi (argv
[0]);
1565 area
->min_spf_interval
[1] = interval
;
1570 DEFUN (no_spf_interval_l2
,
1571 no_spf_interval_l2_cmd
,
1572 "no spf-interval level-2",
1574 "Minimum interval between SPF calculations\n"
1575 "Set interval for level 2 only\n")
1577 struct isis_area
*area
;
1581 area
->min_spf_interval
[1] = MINIMUM_SPF_INTERVAL
;
1586 ALIAS (no_spf_interval
,
1587 no_spf_interval_l2_arg_cmd
,
1588 "no spf-interval level-2 <1-120>",
1590 "Minimum interval between SPF calculations\n"
1591 "Set interval for level 2 only\n"
1592 "Minimum interval between consecutive SPFs in seconds\n")
1594 #ifdef TOPOLOGY_GENERATE
1595 DEFUN (topology_generate_grid
,
1596 topology_generate_grid_cmd
,
1597 "topology generate grid <1-100> <1-100> <1-65000> [param] [param] "
1599 "Topology generation for IS-IS\n"
1600 "Topology generation\n"
1602 "X parameter of the grid\n"
1603 "Y parameter of the grid\n"
1605 "Optional param 1\n"
1606 "Optional param 2\n"
1607 "Optional param 3\n"
1610 struct isis_area
*area
;
1615 if (!spgrid_check_params (vty
, argc
, argv
))
1618 list_delete (area
->topology
);
1619 area
->topology
= list_new ();
1620 memcpy (area
->top_params
, vty
->buf
, 200);
1621 gen_spgrid_topology (vty
, area
->topology
);
1622 remove_topology_lsps (area
);
1623 generate_topology_lsps (area
);
1624 /* Regenerate L1 LSP to get two way connection to the generated
1626 lsp_regenerate_schedule (area
);
1632 DEFUN (show_isis_generated_topology
,
1633 show_isis_generated_topology_cmd
,
1634 "show isis generated-topologies",
1636 "CLNS network information\n"
1637 "Show generated topologies\n")
1639 struct isis_area
*area
;
1640 struct listnode
*node
;
1641 struct listnode
*node2
;
1644 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, node
, area
))
1646 if (!area
->topology
)
1649 vty_out (vty
, "Topology for isis area: %s%s", area
->area_tag
,
1651 vty_out (vty
, "From node To node Distance%s", VTY_NEWLINE
);
1653 for (ALL_LIST_ELEMENTS_RO (area
->topology
, node2
, arc
))
1654 vty_out (vty
, "%9ld %11ld %12ld%s", arc
->from_node
, arc
->to_node
,
1655 arc
->distance
, VTY_NEWLINE
);
1660 /* Base IS for topology generation. */
1661 DEFUN (topology_baseis
,
1662 topology_baseis_cmd
,
1663 "topology base-is WORD",
1664 "Topology generation for IS-IS\n"
1665 "A Network IS Base for this topology\n"
1666 "XXXX.XXXX.XXXX Network entity title (NET)\n")
1668 struct isis_area
*area
;
1669 u_char buff
[ISIS_SYS_ID_LEN
];
1674 if (sysid2buff (buff
, argv
[0]))
1675 sysid2buff (area
->topology_baseis
, argv
[0]);
1680 DEFUN (no_topology_baseis
,
1681 no_topology_baseis_cmd
,
1682 "no topology base-is WORD",
1684 "Topology generation for IS-IS\n"
1685 "A Network IS Base for this topology\n"
1686 "XXXX.XXXX.XXXX Network entity title (NET)\n")
1688 struct isis_area
*area
;
1693 memcpy (area
->topology_baseis
, DEFAULT_TOPOLOGY_BASEIS
, ISIS_SYS_ID_LEN
);
1697 ALIAS (no_topology_baseis
,
1698 no_topology_baseis_noid_cmd
,
1699 "no topology base-is",
1701 "Topology generation for IS-IS\n"
1702 "A Network IS Base for this topology\n")
1704 DEFUN (topology_basedynh
,
1705 topology_basedynh_cmd
,
1706 "topology base-dynh WORD",
1707 "Topology generation for IS-IS\n"
1708 "Dynamic hostname base for this topology\n"
1709 "Dynamic hostname base\n")
1711 struct isis_area
*area
;
1716 /* I hope that it's enough. */
1717 area
->topology_basedynh
= strndup (argv
[0], 16);
1720 #endif /* TOPOLOGY_GENERATE */
1722 DEFUN (lsp_lifetime
,
1724 "lsp-lifetime <380-65535>",
1725 "Maximum LSP lifetime\n"
1726 "LSP lifetime in seconds\n")
1728 struct isis_area
*area
;
1734 interval
= atoi (argv
[0]);
1736 if (interval
< ISIS_MIN_LSP_LIFETIME
)
1738 vty_out (vty
, "LSP lifetime (%us) below %us%s",
1739 interval
, ISIS_MIN_LSP_LIFETIME
, VTY_NEWLINE
);
1745 area
->max_lsp_lifetime
[0] = interval
;
1746 area
->max_lsp_lifetime
[1] = interval
;
1747 area
->lsp_refresh
[0] = interval
- 300;
1748 area
->lsp_refresh
[1] = interval
- 300;
1750 if (area
->t_lsp_refresh
[0])
1752 thread_cancel (area
->t_lsp_refresh
[0]);
1753 thread_execute (master
, lsp_refresh_l1
, area
, 0);
1756 if (area
->t_lsp_refresh
[1])
1758 thread_cancel (area
->t_lsp_refresh
[1]);
1759 thread_execute (master
, lsp_refresh_l2
, area
, 0);
1766 DEFUN (no_lsp_lifetime
,
1767 no_lsp_lifetime_cmd
,
1770 "LSP lifetime in seconds\n")
1772 struct isis_area
*area
;
1777 area
->max_lsp_lifetime
[0] = MAX_AGE
; /* 1200s */
1778 area
->max_lsp_lifetime
[1] = MAX_AGE
; /* 1200s */
1779 area
->lsp_refresh
[0] = MAX_LSP_GEN_INTERVAL
; /* 900s */
1780 area
->lsp_refresh
[1] = MAX_LSP_GEN_INTERVAL
; /* 900s */
1785 ALIAS (no_lsp_lifetime
,
1786 no_lsp_lifetime_arg_cmd
,
1787 "no lsp-lifetime <380-65535>",
1789 "Maximum LSP lifetime\n"
1790 "LSP lifetime in seconds\n")
1792 DEFUN (lsp_lifetime_l1
,
1793 lsp_lifetime_l1_cmd
,
1794 "lsp-lifetime level-1 <380-65535>",
1795 "Maximum LSP lifetime for Level 1 only\n"
1796 "LSP lifetime for Level 1 only in seconds\n")
1798 struct isis_area
*area
;
1804 interval
= atoi (argv
[0]);
1806 if (interval
< ISIS_MIN_LSP_LIFETIME
)
1808 vty_out (vty
, "Level-1 LSP lifetime (%us) below %us%s",
1809 interval
, ISIS_MIN_LSP_LIFETIME
, VTY_NEWLINE
);
1815 area
->max_lsp_lifetime
[0] = interval
;
1816 area
->lsp_refresh
[0] = interval
- 300;
1821 DEFUN (no_lsp_lifetime_l1
,
1822 no_lsp_lifetime_l1_cmd
,
1823 "no lsp-lifetime level-1",
1825 "LSP lifetime for Level 1 only in seconds\n")
1827 struct isis_area
*area
;
1832 area
->max_lsp_lifetime
[0] = MAX_AGE
; /* 1200s */
1833 area
->lsp_refresh
[0] = MAX_LSP_GEN_INTERVAL
; /* 900s */
1838 ALIAS (no_lsp_lifetime_l1
,
1839 no_lsp_lifetime_l1_arg_cmd
,
1840 "no lsp-lifetime level-1 <380-65535>",
1842 "Maximum LSP lifetime for Level 1 only\n"
1843 "LSP lifetime for Level 1 only in seconds\n")
1845 DEFUN (lsp_lifetime_l2
,
1846 lsp_lifetime_l2_cmd
,
1847 "lsp-lifetime level-2 <380-65535>",
1848 "Maximum LSP lifetime for Level 2 only\n"
1849 "LSP lifetime for Level 2 only in seconds\n")
1851 struct isis_area
*area
;
1857 interval
= atoi (argv
[0]);
1859 if (interval
< ISIS_MIN_LSP_LIFETIME
)
1861 vty_out (vty
, "Level-2 LSP lifetime (%us) below %us%s",
1862 interval
, ISIS_MIN_LSP_LIFETIME
, VTY_NEWLINE
);
1867 area
->max_lsp_lifetime
[1] = interval
;
1868 area
->lsp_refresh
[1] = interval
- 300;
1873 DEFUN (no_lsp_lifetime_l2
,
1874 no_lsp_lifetime_l2_cmd
,
1875 "no lsp-lifetime level-2",
1877 "LSP lifetime for Level 2 only in seconds\n")
1879 struct isis_area
*area
;
1884 area
->max_lsp_lifetime
[1] = MAX_AGE
; /* 1200s */
1885 area
->lsp_refresh
[1] = MAX_LSP_GEN_INTERVAL
; /* 900s */
1890 ALIAS (no_lsp_lifetime_l2
,
1891 no_lsp_lifetime_l2_arg_cmd
,
1892 "no lsp-lifetime level-2 <380-65535>",
1894 "Maximum LSP lifetime for Level 2 only\n"
1895 "LSP lifetime for Level 2 only in seconds\n")
1897 /* IS-IS configuration write function */
1899 isis_config_write (struct vty
*vty
)
1905 struct isis_area
*area
;
1906 struct listnode
*node
, *node2
;
1908 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, node
, area
))
1910 /* ISIS - Area name */
1911 vty_out (vty
, "router isis %s%s", area
->area_tag
, VTY_NEWLINE
);
1914 if (listcount (area
->area_addrs
) > 0)
1916 struct area_addr
*area_addr
;
1917 for (ALL_LIST_ELEMENTS_RO (area
->area_addrs
, node2
, area_addr
))
1919 vty_out (vty
, " net %s%s",
1920 isonet_print (area_addr
->area_addr
,
1921 area_addr
->addr_len
+ ISIS_SYS_ID_LEN
+
1926 /* ISIS - Dynamic hostname - Defaults to true so only display if
1928 if (!area
->dynhostname
)
1930 vty_out (vty
, " no hostname dynamic%s", VTY_NEWLINE
);
1933 /* ISIS - Metric-Style - when true displays wide */
1934 if (area
->newmetric
)
1936 if (!area
->oldmetric
)
1937 vty_out (vty
, " metric-style wide%s", VTY_NEWLINE
);
1939 vty_out (vty
, " metric-style transition%s", VTY_NEWLINE
);
1943 /* ISIS - Area is-type (level-1-2 is default) */
1944 if (area
->is_type
== IS_LEVEL_1
)
1946 vty_out (vty
, " is-type level-1%s", VTY_NEWLINE
);
1951 if (area
->is_type
== IS_LEVEL_2
)
1953 vty_out (vty
, " is-type level-2-only%s", VTY_NEWLINE
);
1957 /* ISIS - Lsp generation interval */
1958 if (area
->lsp_gen_interval
[0] == area
->lsp_gen_interval
[1])
1960 if (area
->lsp_gen_interval
[0] != LSP_GEN_INTERVAL_DEFAULT
)
1962 vty_out (vty
, " lsp-gen-interval %d%s",
1963 area
->lsp_gen_interval
[0], VTY_NEWLINE
);
1969 if (area
->lsp_gen_interval
[0] != LSP_GEN_INTERVAL_DEFAULT
)
1971 vty_out (vty
, " lsp-gen-interval level-1 %d%s",
1972 area
->lsp_gen_interval
[0], VTY_NEWLINE
);
1975 if (area
->lsp_gen_interval
[1] != LSP_GEN_INTERVAL_DEFAULT
)
1977 vty_out (vty
, " lsp-gen-interval level-2 %d%s",
1978 area
->lsp_gen_interval
[1], VTY_NEWLINE
);
1982 /* ISIS - LSP lifetime */
1983 if (area
->max_lsp_lifetime
[0] == area
->max_lsp_lifetime
[1])
1985 if (area
->max_lsp_lifetime
[0] != MAX_AGE
)
1987 vty_out (vty
, " lsp-lifetime %u%s", area
->max_lsp_lifetime
[0],
1994 if (area
->max_lsp_lifetime
[0] != MAX_AGE
)
1996 vty_out (vty
, " lsp-lifetime level-1 %u%s",
1997 area
->max_lsp_lifetime
[0], VTY_NEWLINE
);
2000 if (area
->max_lsp_lifetime
[1] != MAX_AGE
)
2002 vty_out (vty
, " lsp-lifetime level-2 %u%s",
2003 area
->max_lsp_lifetime
[1], VTY_NEWLINE
);
2007 /* Minimum SPF interval. */
2008 if (area
->min_spf_interval
[0] == area
->min_spf_interval
[1])
2010 if (area
->min_spf_interval
[0] != MINIMUM_SPF_INTERVAL
)
2012 vty_out (vty
, " spf-interval %d%s",
2013 area
->min_spf_interval
[0], VTY_NEWLINE
);
2019 if (area
->min_spf_interval
[0] != MINIMUM_SPF_INTERVAL
)
2021 vty_out (vty
, " spf-interval level-1 %d%s",
2022 area
->min_spf_interval
[0], VTY_NEWLINE
);
2025 if (area
->min_spf_interval
[1] != MINIMUM_SPF_INTERVAL
)
2027 vty_out (vty
, " spf-interval level-2 %d%s",
2028 area
->min_spf_interval
[1], VTY_NEWLINE
);
2032 /* Authentication passwords. */
2033 if (area
->area_passwd
.len
> 0)
2035 vty_out(vty
, " area-password %s", area
->area_passwd
.passwd
);
2036 if (CHECK_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_SEND
))
2038 vty_out(vty
, " authenticate snp ");
2039 if (CHECK_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_RECV
))
2040 vty_out(vty
, "validate");
2042 vty_out(vty
, "send-only");
2044 vty_out(vty
, "%s", VTY_NEWLINE
);
2047 if (area
->domain_passwd
.len
> 0)
2049 vty_out(vty
, " domain-password %s", area
->domain_passwd
.passwd
);
2050 if (CHECK_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_SEND
))
2052 vty_out(vty
, " authenticate snp ");
2053 if (CHECK_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_RECV
))
2054 vty_out(vty
, "validate");
2056 vty_out(vty
, "send-only");
2058 vty_out(vty
, "%s", VTY_NEWLINE
);
2062 #ifdef TOPOLOGY_GENERATE
2063 if (memcmp (area
->topology_baseis
, DEFAULT_TOPOLOGY_BASEIS
,
2066 vty_out (vty
, " topology base-is %s%s",
2067 sysid_print (area
->topology_baseis
), VTY_NEWLINE
);
2070 if (area
->topology_basedynh
)
2072 vty_out (vty
, " topology base-dynh %s%s",
2073 area
->topology_basedynh
, VTY_NEWLINE
);
2076 /* We save the whole command line here. */
2077 if (strlen(area
->top_params
))
2079 vty_out (vty
, " %s%s", area
->top_params
, VTY_NEWLINE
);
2082 #endif /* TOPOLOGY_GENERATE */
2090 static struct cmd_node isis_node
= {
2092 "%s(config-router)# ",
2099 /* Install IS-IS top node */
2100 install_node (&isis_node
, isis_config_write
);
2102 install_element (VIEW_NODE
, &show_clns_neighbors_cmd
);
2103 install_element (VIEW_NODE
, &show_isis_neighbors_cmd
);
2104 install_element (VIEW_NODE
, &show_clns_neighbors_detail_cmd
);
2105 install_element (VIEW_NODE
, &show_isis_neighbors_detail_cmd
);
2107 install_element (VIEW_NODE
, &show_hostname_cmd
);
2108 install_element (VIEW_NODE
, &show_database_cmd
);
2109 install_element (VIEW_NODE
, &show_database_detail_cmd
);
2111 install_element (ENABLE_NODE
, &show_clns_neighbors_cmd
);
2112 install_element (ENABLE_NODE
, &show_isis_neighbors_cmd
);
2113 install_element (ENABLE_NODE
, &show_clns_neighbors_detail_cmd
);
2114 install_element (ENABLE_NODE
, &show_isis_neighbors_detail_cmd
);
2116 install_element (ENABLE_NODE
, &show_hostname_cmd
);
2117 install_element (ENABLE_NODE
, &show_database_cmd
);
2118 install_element (ENABLE_NODE
, &show_database_detail_cmd
);
2119 install_element (ENABLE_NODE
, &show_debugging_cmd
);
2121 install_node (&debug_node
, config_write_debug
);
2123 install_element (ENABLE_NODE
, &debug_isis_adj_cmd
);
2124 install_element (ENABLE_NODE
, &no_debug_isis_adj_cmd
);
2125 install_element (ENABLE_NODE
, &debug_isis_csum_cmd
);
2126 install_element (ENABLE_NODE
, &no_debug_isis_csum_cmd
);
2127 install_element (ENABLE_NODE
, &debug_isis_lupd_cmd
);
2128 install_element (ENABLE_NODE
, &no_debug_isis_lupd_cmd
);
2129 install_element (ENABLE_NODE
, &debug_isis_err_cmd
);
2130 install_element (ENABLE_NODE
, &no_debug_isis_err_cmd
);
2131 install_element (ENABLE_NODE
, &debug_isis_snp_cmd
);
2132 install_element (ENABLE_NODE
, &no_debug_isis_snp_cmd
);
2133 install_element (ENABLE_NODE
, &debug_isis_upd_cmd
);
2134 install_element (ENABLE_NODE
, &no_debug_isis_upd_cmd
);
2135 install_element (ENABLE_NODE
, &debug_isis_spfevents_cmd
);
2136 install_element (ENABLE_NODE
, &no_debug_isis_spfevents_cmd
);
2137 install_element (ENABLE_NODE
, &debug_isis_spfstats_cmd
);
2138 install_element (ENABLE_NODE
, &no_debug_isis_spfstats_cmd
);
2139 install_element (ENABLE_NODE
, &debug_isis_spftrigg_cmd
);
2140 install_element (ENABLE_NODE
, &no_debug_isis_spftrigg_cmd
);
2141 install_element (ENABLE_NODE
, &debug_isis_rtevents_cmd
);
2142 install_element (ENABLE_NODE
, &no_debug_isis_rtevents_cmd
);
2143 install_element (ENABLE_NODE
, &debug_isis_events_cmd
);
2144 install_element (ENABLE_NODE
, &no_debug_isis_events_cmd
);
2146 install_element (CONFIG_NODE
, &debug_isis_adj_cmd
);
2147 install_element (CONFIG_NODE
, &no_debug_isis_adj_cmd
);
2148 install_element (CONFIG_NODE
, &debug_isis_csum_cmd
);
2149 install_element (CONFIG_NODE
, &no_debug_isis_csum_cmd
);
2150 install_element (CONFIG_NODE
, &debug_isis_lupd_cmd
);
2151 install_element (CONFIG_NODE
, &no_debug_isis_lupd_cmd
);
2152 install_element (CONFIG_NODE
, &debug_isis_err_cmd
);
2153 install_element (CONFIG_NODE
, &no_debug_isis_err_cmd
);
2154 install_element (CONFIG_NODE
, &debug_isis_snp_cmd
);
2155 install_element (CONFIG_NODE
, &no_debug_isis_snp_cmd
);
2156 install_element (CONFIG_NODE
, &debug_isis_upd_cmd
);
2157 install_element (CONFIG_NODE
, &no_debug_isis_upd_cmd
);
2158 install_element (CONFIG_NODE
, &debug_isis_spfevents_cmd
);
2159 install_element (CONFIG_NODE
, &no_debug_isis_spfevents_cmd
);
2160 install_element (CONFIG_NODE
, &debug_isis_spfstats_cmd
);
2161 install_element (CONFIG_NODE
, &no_debug_isis_spfstats_cmd
);
2162 install_element (CONFIG_NODE
, &debug_isis_spftrigg_cmd
);
2163 install_element (CONFIG_NODE
, &no_debug_isis_spftrigg_cmd
);
2164 install_element (CONFIG_NODE
, &debug_isis_rtevents_cmd
);
2165 install_element (CONFIG_NODE
, &no_debug_isis_rtevents_cmd
);
2166 install_element (CONFIG_NODE
, &debug_isis_events_cmd
);
2167 install_element (CONFIG_NODE
, &no_debug_isis_events_cmd
);
2169 install_element (CONFIG_NODE
, &router_isis_cmd
);
2170 install_element (CONFIG_NODE
, &no_router_isis_cmd
);
2172 install_default (ISIS_NODE
);
2174 install_element (ISIS_NODE
, &net_cmd
);
2175 install_element (ISIS_NODE
, &no_net_cmd
);
2177 install_element (ISIS_NODE
, &is_type_cmd
);
2178 install_element (ISIS_NODE
, &no_is_type_cmd
);
2180 install_element (ISIS_NODE
, &area_passwd_cmd
);
2181 install_element (ISIS_NODE
, &area_passwd_snpauth_cmd
);
2182 install_element (ISIS_NODE
, &no_area_passwd_cmd
);
2184 install_element (ISIS_NODE
, &domain_passwd_cmd
);
2185 install_element (ISIS_NODE
, &domain_passwd_snpauth_cmd
);
2186 install_element (ISIS_NODE
, &no_domain_passwd_cmd
);
2188 install_element (ISIS_NODE
, &lsp_gen_interval_cmd
);
2189 install_element (ISIS_NODE
, &no_lsp_gen_interval_cmd
);
2190 install_element (ISIS_NODE
, &no_lsp_gen_interval_arg_cmd
);
2191 install_element (ISIS_NODE
, &lsp_gen_interval_l1_cmd
);
2192 install_element (ISIS_NODE
, &no_lsp_gen_interval_l1_cmd
);
2193 install_element (ISIS_NODE
, &no_lsp_gen_interval_l1_arg_cmd
);
2194 install_element (ISIS_NODE
, &lsp_gen_interval_l2_cmd
);
2195 install_element (ISIS_NODE
, &no_lsp_gen_interval_l2_cmd
);
2196 install_element (ISIS_NODE
, &no_lsp_gen_interval_l2_arg_cmd
);
2198 install_element (ISIS_NODE
, &spf_interval_cmd
);
2199 install_element (ISIS_NODE
, &no_spf_interval_cmd
);
2200 install_element (ISIS_NODE
, &no_spf_interval_arg_cmd
);
2201 install_element (ISIS_NODE
, &spf_interval_l1_cmd
);
2202 install_element (ISIS_NODE
, &no_spf_interval_l1_cmd
);
2203 install_element (ISIS_NODE
, &no_spf_interval_l1_arg_cmd
);
2204 install_element (ISIS_NODE
, &spf_interval_l2_cmd
);
2205 install_element (ISIS_NODE
, &no_spf_interval_l2_cmd
);
2206 install_element (ISIS_NODE
, &no_spf_interval_l2_arg_cmd
);
2208 install_element (ISIS_NODE
, &lsp_lifetime_cmd
);
2209 install_element (ISIS_NODE
, &no_lsp_lifetime_cmd
);
2210 install_element (ISIS_NODE
, &no_lsp_lifetime_arg_cmd
);
2211 install_element (ISIS_NODE
, &lsp_lifetime_l1_cmd
);
2212 install_element (ISIS_NODE
, &no_lsp_lifetime_l1_cmd
);
2213 install_element (ISIS_NODE
, &no_lsp_lifetime_l1_arg_cmd
);
2214 install_element (ISIS_NODE
, &lsp_lifetime_l2_cmd
);
2215 install_element (ISIS_NODE
, &no_lsp_lifetime_l2_cmd
);
2216 install_element (ISIS_NODE
, &no_lsp_lifetime_l2_arg_cmd
);
2218 install_element (ISIS_NODE
, &dynamic_hostname_cmd
);
2219 install_element (ISIS_NODE
, &no_dynamic_hostname_cmd
);
2221 install_element (ISIS_NODE
, &metric_style_cmd
);
2222 install_element (ISIS_NODE
, &no_metric_style_cmd
);
2223 #ifdef TOPOLOGY_GENERATE
2224 install_element (ISIS_NODE
, &topology_generate_grid_cmd
);
2225 install_element (ISIS_NODE
, &topology_baseis_cmd
);
2226 install_element (ISIS_NODE
, &topology_basedynh_cmd
);
2227 install_element (ISIS_NODE
, &no_topology_baseis_cmd
);
2228 install_element (ISIS_NODE
, &no_topology_baseis_noid_cmd
);
2229 install_element (VIEW_NODE
, &show_isis_generated_topology_cmd
);
2230 install_element (ENABLE_NODE
, &show_isis_generated_topology_cmd
);
2231 #endif /* TOPOLOGY_GENERATE */
2234 isis_circuit_init ();
2236 isis_spf_cmds_init ();