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.
38 #include "isisd/dict.h"
39 #include "isisd/include-netbsd/iso.h"
40 #include "isisd/isis_constants.h"
41 #include "isisd/isis_common.h"
42 #include "isisd/isis_flags.h"
43 #include "isisd/isis_circuit.h"
44 #include "isisd/isis_csm.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 */
63 struct isis
*isis
= NULL
;
68 int isis_area_get(struct vty
*, const char *);
69 int isis_area_destroy(struct vty
*, const char *);
70 int area_net_title(struct vty
*, const char *);
71 int area_clear_net_title(struct vty
*, const char *);
72 int show_isis_interface_common(struct vty
*, const char *ifname
, char);
73 int show_isis_neighbor_common(struct vty
*, const char *id
, char);
74 int clear_isis_neighbor_common(struct vty
*, const char *id
);
75 int isis_config_write(struct vty
*);
80 isis_new (unsigned long process_id
)
82 isis
= XCALLOC (MTYPE_ISIS
, sizeof (struct isis
));
86 isis
->max_area_addrs
= 3;
87 isis
->process_id
= process_id
;
89 isis
->area_list
= list_new ();
90 isis
->init_circ_list
= list_new ();
91 isis
->uptime
= time (NULL
);
92 isis
->nexthops
= list_new ();
94 isis
->nexthops6
= list_new ();
95 #endif /* HAVE_IPV6 */
98 * uncomment the next line for full debugs
100 /* isis->debugs = 0xFFFF; */
104 isis_area_create (const char *area_tag
)
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
;
120 * intialize the databases
122 if (area
->is_type
& IS_LEVEL_1
)
124 area
->lspdb
[0] = lsp_db_init ();
125 area
->route_table
[0] = route_table_init ();
127 area
->route_table6
[0] = route_table_init ();
128 #endif /* HAVE_IPV6 */
130 if (area
->is_type
& IS_LEVEL_2
)
132 area
->lspdb
[1] = lsp_db_init ();
133 area
->route_table
[1] = route_table_init ();
135 area
->route_table6
[1] = route_table_init ();
136 #endif /* HAVE_IPV6 */
139 spftree_area_init (area
);
141 area
->circuit_list
= list_new ();
142 area
->area_addrs
= list_new ();
143 THREAD_TIMER_ON (master
, area
->t_tick
, lsp_tick
, area
, 1);
144 flags_initialize (&area
->flags
);
149 area
->max_lsp_lifetime
[0] = DEFAULT_LSP_LIFETIME
; /* 1200 */
150 area
->max_lsp_lifetime
[1] = DEFAULT_LSP_LIFETIME
; /* 1200 */
151 area
->lsp_refresh
[0] = DEFAULT_MAX_LSP_GEN_INTERVAL
; /* 900 */
152 area
->lsp_refresh
[1] = DEFAULT_MAX_LSP_GEN_INTERVAL
; /* 900 */
153 area
->lsp_gen_interval
[0] = DEFAULT_MIN_LSP_GEN_INTERVAL
;
154 area
->lsp_gen_interval
[1] = DEFAULT_MIN_LSP_GEN_INTERVAL
;
155 area
->min_spf_interval
[0] = MINIMUM_SPF_INTERVAL
;
156 area
->min_spf_interval
[1] = MINIMUM_SPF_INTERVAL
;
157 area
->dynhostname
= 1;
160 area
->lsp_frag_threshold
= 90;
161 area
->lsp_mtu
= DEFAULT_LSP_MTU
;
162 #ifdef TOPOLOGY_GENERATE
163 memcpy (area
->topology_baseis
, DEFAULT_TOPOLOGY_BASEIS
, ISIS_SYS_ID_LEN
);
164 #endif /* TOPOLOGY_GENERATE */
166 area
->area_tag
= strdup (area_tag
);
167 listnode_add (isis
->area_list
, area
);
174 isis_area_lookup (const char *area_tag
)
176 struct isis_area
*area
;
177 struct listnode
*node
;
179 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, node
, area
))
180 if ((area
->area_tag
== NULL
&& area_tag
== NULL
) ||
181 (area
->area_tag
&& area_tag
182 && strcmp (area
->area_tag
, area_tag
) == 0))
189 isis_area_get (struct vty
*vty
, const char *area_tag
)
191 struct isis_area
*area
;
193 area
= isis_area_lookup (area_tag
);
197 vty
->node
= ISIS_NODE
;
202 area
= isis_area_create (area_tag
);
204 if (isis
->debugs
& DEBUG_EVENTS
)
205 zlog_debug ("New IS-IS area instance %s", area
->area_tag
);
207 vty
->node
= ISIS_NODE
;
214 isis_area_destroy (struct vty
*vty
, const char *area_tag
)
216 struct isis_area
*area
;
217 struct listnode
*node
, *nnode
;
218 struct isis_circuit
*circuit
;
219 struct area_addr
*addr
;
221 area
= isis_area_lookup (area_tag
);
225 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
226 return CMD_ERR_NO_MATCH
;
229 if (area
->circuit_list
)
231 for (ALL_LIST_ELEMENTS (area
->circuit_list
, node
, nnode
, circuit
))
233 circuit
->ip_router
= 0;
235 circuit
->ipv6_router
= 0;
237 isis_csm_state_change (ISIS_DISABLE
, circuit
, area
);
239 list_delete (area
->circuit_list
);
240 area
->circuit_list
= NULL
;
243 if (area
->lspdb
[0] != NULL
)
245 lsp_db_destroy (area
->lspdb
[0]);
246 area
->lspdb
[0] = NULL
;
248 if (area
->lspdb
[1] != NULL
)
250 lsp_db_destroy (area
->lspdb
[1]);
251 area
->lspdb
[1] = NULL
;
254 spftree_area_del (area
);
256 /* invalidate and validate would delete all routes from zebra */
257 isis_route_invalidate (area
);
258 isis_route_validate (area
);
260 if (area
->route_table
[0])
262 route_table_finish (area
->route_table
[0]);
263 area
->route_table
[0] = NULL
;
265 if (area
->route_table
[1])
267 route_table_finish (area
->route_table
[1]);
268 area
->route_table
[1] = NULL
;
271 if (area
->route_table6
[0])
273 route_table_finish (area
->route_table6
[0]);
274 area
->route_table6
[0] = NULL
;
276 if (area
->route_table6
[1])
278 route_table_finish (area
->route_table6
[1]);
279 area
->route_table6
[1] = NULL
;
281 #endif /* HAVE_IPV6 */
283 for (ALL_LIST_ELEMENTS (area
->area_addrs
, node
, nnode
, addr
))
285 list_delete_node (area
->area_addrs
, node
);
286 XFREE (MTYPE_ISIS_AREA_ADDR
, addr
);
288 area
->area_addrs
= NULL
;
290 THREAD_TIMER_OFF (area
->t_tick
);
291 THREAD_TIMER_OFF (area
->t_lsp_refresh
[0]);
292 THREAD_TIMER_OFF (area
->t_lsp_refresh
[1]);
294 thread_cancel_event (master
, area
);
296 listnode_delete (isis
->area_list
, area
);
298 free (area
->area_tag
);
300 XFREE (MTYPE_ISIS_AREA
, area
);
302 if (listcount (isis
->area_list
) == 0)
304 memset (isis
->sysid
, 0, ISIS_SYS_ID_LEN
);
312 area_net_title (struct vty
*vty
, const char *net_title
)
314 struct isis_area
*area
;
315 struct area_addr
*addr
;
316 struct area_addr
*addrp
;
317 struct listnode
*node
;
324 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
325 return CMD_ERR_NO_MATCH
;
328 /* We check that we are not over the maximal number of addresses */
329 if (listcount (area
->area_addrs
) >= isis
->max_area_addrs
)
331 vty_out (vty
, "Maximum of area addresses (%d) already reached %s",
332 isis
->max_area_addrs
, VTY_NEWLINE
);
333 return CMD_ERR_NOTHING_TODO
;
336 addr
= XMALLOC (MTYPE_ISIS_AREA_ADDR
, sizeof (struct area_addr
));
337 addr
->addr_len
= dotformat2buff (buff
, net_title
);
338 memcpy (addr
->area_addr
, buff
, addr
->addr_len
);
340 zlog_debug ("added area address %s for area %s (address length %d)",
341 net_title
, area
->area_tag
, addr
->addr_len
);
342 #endif /* EXTREME_DEBUG */
343 if (addr
->addr_len
< 8 || addr
->addr_len
> 20)
345 vty_out (vty
, "area address must be at least 8..20 octets long (%d)%s",
346 addr
->addr_len
, VTY_NEWLINE
);
347 XFREE (MTYPE_ISIS_AREA_ADDR
, addr
);
348 return CMD_ERR_AMBIGUOUS
;
351 if (addr
->area_addr
[addr
->addr_len
-1] != 0)
353 vty_out (vty
, "nsel byte (last byte) in area address must be 0%s",
355 XFREE (MTYPE_ISIS_AREA_ADDR
, addr
);
356 return CMD_ERR_AMBIGUOUS
;
359 if (isis
->sysid_set
== 0)
362 * First area address - get the SystemID for this router
364 memcpy (isis
->sysid
, GETSYSID (addr
), ISIS_SYS_ID_LEN
);
366 if (isis
->debugs
& DEBUG_EVENTS
)
367 zlog_debug ("Router has SystemID %s", sysid_print (isis
->sysid
));
372 * Check that the SystemID portions match
374 if (memcmp (isis
->sysid
, GETSYSID (addr
), ISIS_SYS_ID_LEN
))
377 "System ID must not change when defining additional area"
378 " addresses%s", VTY_NEWLINE
);
379 XFREE (MTYPE_ISIS_AREA_ADDR
, addr
);
380 return CMD_ERR_AMBIGUOUS
;
383 /* now we see that we don't already have this address */
384 for (ALL_LIST_ELEMENTS_RO (area
->area_addrs
, node
, addrp
))
386 if ((addrp
->addr_len
+ ISIS_SYS_ID_LEN
+ ISIS_NSEL_LEN
) != (addr
->addr_len
))
388 if (!memcmp (addrp
->area_addr
, addr
->area_addr
, addr
->addr_len
))
390 XFREE (MTYPE_ISIS_AREA_ADDR
, addr
);
391 return CMD_SUCCESS
; /* silent fail */
397 * Forget the systemID part of the address
399 addr
->addr_len
-= (ISIS_SYS_ID_LEN
+ ISIS_NSEL_LEN
);
400 listnode_add (area
->area_addrs
, addr
);
402 /* only now we can safely generate our LSPs for this area */
403 if (listcount (area
->area_addrs
) > 0)
405 if (area
->is_type
& IS_LEVEL_1
)
406 lsp_generate (area
, IS_LEVEL_1
);
407 if (area
->is_type
& IS_LEVEL_2
)
408 lsp_generate (area
, IS_LEVEL_2
);
415 area_clear_net_title (struct vty
*vty
, const char *net_title
)
417 struct isis_area
*area
;
418 struct area_addr addr
, *addrp
= NULL
;
419 struct listnode
*node
;
425 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
426 return CMD_ERR_NO_MATCH
;
429 addr
.addr_len
= dotformat2buff (buff
, net_title
);
430 if (addr
.addr_len
< 8 || addr
.addr_len
> 20)
432 vty_out (vty
, "Unsupported area address length %d, should be 8...20 %s",
433 addr
.addr_len
, VTY_NEWLINE
);
434 return CMD_ERR_AMBIGUOUS
;
437 memcpy (addr
.area_addr
, buff
, (int) addr
.addr_len
);
439 for (ALL_LIST_ELEMENTS_RO (area
->area_addrs
, node
, addrp
))
440 if ((addrp
->addr_len
+ ISIS_SYS_ID_LEN
+ 1) == addr
.addr_len
&&
441 !memcmp (addrp
->area_addr
, addr
.area_addr
, addr
.addr_len
))
446 vty_out (vty
, "No area address %s for area %s %s", net_title
,
447 area
->area_tag
, VTY_NEWLINE
);
448 return CMD_ERR_NO_MATCH
;
451 listnode_delete (area
->area_addrs
, addrp
);
452 XFREE (MTYPE_ISIS_AREA_ADDR
, addrp
);
455 * Last area address - reset the SystemID for this router
457 if (listcount (area
->area_addrs
) == 0)
459 memset (isis
->sysid
, 0, ISIS_SYS_ID_LEN
);
461 if (isis
->debugs
& DEBUG_EVENTS
)
462 zlog_debug ("Router has no SystemID");
469 * 'show isis interface' command
473 show_isis_interface_common (struct vty
*vty
, const char *ifname
, char detail
)
475 struct listnode
*anode
, *cnode
;
476 struct isis_area
*area
;
477 struct isis_circuit
*circuit
;
481 vty_out (vty
, "IS-IS Routing Process not enabled%s", VTY_NEWLINE
);
485 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, anode
, area
))
487 vty_out (vty
, "Area %s:%s", area
->area_tag
, VTY_NEWLINE
);
489 if (detail
== ISIS_UI_LEVEL_BRIEF
)
490 vty_out (vty
, " Interface CircId State Type Level%s",
493 for (ALL_LIST_ELEMENTS_RO (area
->circuit_list
, cnode
, circuit
))
495 isis_circuit_print_vty (circuit
, vty
, detail
);
496 else if (strcmp(circuit
->interface
->name
, ifname
) == 0)
497 isis_circuit_print_vty (circuit
, vty
, detail
);
503 DEFUN (show_isis_interface
,
504 show_isis_interface_cmd
,
505 "show isis interface",
507 "ISIS network information\n"
510 return show_isis_interface_common (vty
, NULL
, ISIS_UI_LEVEL_BRIEF
);
513 DEFUN (show_isis_interface_detail
,
514 show_isis_interface_detail_cmd
,
515 "show isis interface detail",
517 "ISIS network information\n"
519 "show detailed information\n")
521 return show_isis_interface_common (vty
, NULL
, ISIS_UI_LEVEL_DETAIL
);
524 DEFUN (show_isis_interface_arg
,
525 show_isis_interface_arg_cmd
,
526 "show isis interface WORD",
528 "ISIS network information\n"
530 "ISIS interface name\n")
532 return show_isis_interface_common (vty
, argv
[0], ISIS_UI_LEVEL_DETAIL
);
536 * 'show isis neighbor' command
540 show_isis_neighbor_common (struct vty
*vty
, const char *id
, char detail
)
542 struct listnode
*anode
, *cnode
, *node
;
543 struct isis_area
*area
;
544 struct isis_circuit
*circuit
;
546 struct isis_adjacency
*adj
;
547 struct isis_dynhn
*dynhn
;
548 u_char sysid
[ISIS_SYS_ID_LEN
];
553 vty_out (vty
, "IS-IS Routing Process not enabled%s", VTY_NEWLINE
);
557 memset (sysid
, 0, ISIS_SYS_ID_LEN
);
560 if (sysid2buff (sysid
, id
) == 0)
562 dynhn
= dynhn_find_by_name (id
);
565 vty_out (vty
, "Invalid system id %s%s", id
, VTY_NEWLINE
);
568 memcpy (sysid
, dynhn
->id
, ISIS_SYS_ID_LEN
);
572 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, anode
, area
))
574 vty_out (vty
, "Area %s:%s", area
->area_tag
, VTY_NEWLINE
);
576 if (detail
== ISIS_UI_LEVEL_BRIEF
)
577 vty_out (vty
, " System Id Interface L State"
578 " Holdtime SNPA%s", VTY_NEWLINE
);
580 for (ALL_LIST_ELEMENTS_RO (area
->circuit_list
, cnode
, circuit
))
582 if (circuit
->circ_type
== CIRCUIT_T_BROADCAST
)
584 for (i
= 0; i
< 2; i
++)
586 adjdb
= circuit
->u
.bc
.adjdb
[i
];
587 if (adjdb
&& adjdb
->count
)
589 for (ALL_LIST_ELEMENTS_RO (adjdb
, node
, adj
))
590 if (!id
|| !memcmp (adj
->sysid
, sysid
,
592 isis_adj_print_vty (adj
, vty
, detail
);
596 else if (circuit
->circ_type
== CIRCUIT_T_P2P
&&
597 circuit
->u
.p2p
.neighbor
)
599 adj
= circuit
->u
.p2p
.neighbor
;
600 if (!id
|| !memcmp (adj
->sysid
, sysid
, ISIS_SYS_ID_LEN
))
601 isis_adj_print_vty (adj
, vty
, detail
);
610 * 'clear isis neighbor' command
613 clear_isis_neighbor_common (struct vty
*vty
, const char *id
)
615 struct listnode
*anode
, *cnode
, *cnextnode
, *node
, *nnode
;
616 struct isis_area
*area
;
617 struct isis_circuit
*circuit
;
619 struct isis_adjacency
*adj
;
620 struct isis_dynhn
*dynhn
;
621 u_char sysid
[ISIS_SYS_ID_LEN
];
626 vty_out (vty
, "IS-IS Routing Process not enabled%s", VTY_NEWLINE
);
630 memset (sysid
, 0, ISIS_SYS_ID_LEN
);
633 if (sysid2buff (sysid
, id
) == 0)
635 dynhn
= dynhn_find_by_name (id
);
638 vty_out (vty
, "Invalid system id %s%s", id
, VTY_NEWLINE
);
641 memcpy (sysid
, dynhn
->id
, ISIS_SYS_ID_LEN
);
645 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, anode
, area
))
647 for (ALL_LIST_ELEMENTS (area
->circuit_list
, cnode
, cnextnode
, circuit
))
649 if (circuit
->circ_type
== CIRCUIT_T_BROADCAST
)
651 for (i
= 0; i
< 2; i
++)
653 adjdb
= circuit
->u
.bc
.adjdb
[i
];
654 if (adjdb
&& adjdb
->count
)
656 for (ALL_LIST_ELEMENTS (adjdb
, node
, nnode
, adj
))
657 if (!id
|| !memcmp (adj
->sysid
, sysid
, ISIS_SYS_ID_LEN
))
658 isis_adj_state_change (adj
, ISIS_ADJ_DOWN
,
659 "clear user request");
663 else if (circuit
->circ_type
== CIRCUIT_T_P2P
&&
664 circuit
->u
.p2p
.neighbor
)
666 adj
= circuit
->u
.p2p
.neighbor
;
667 if (!id
|| !memcmp (adj
->sysid
, sysid
, ISIS_SYS_ID_LEN
))
668 isis_adj_state_change (adj
, ISIS_ADJ_DOWN
,
669 "clear user request");
677 DEFUN (show_isis_neighbor
,
678 show_isis_neighbor_cmd
,
679 "show isis neighbor",
681 "ISIS network information\n"
682 "ISIS neighbor adjacencies\n")
684 return show_isis_neighbor_common (vty
, NULL
, ISIS_UI_LEVEL_BRIEF
);
687 DEFUN (show_isis_neighbor_detail
,
688 show_isis_neighbor_detail_cmd
,
689 "show isis neighbor detail",
691 "ISIS network information\n"
692 "ISIS neighbor adjacencies\n"
693 "show detailed information\n")
695 return show_isis_neighbor_common (vty
, NULL
, ISIS_UI_LEVEL_DETAIL
);
698 DEFUN (show_isis_neighbor_arg
,
699 show_isis_neighbor_arg_cmd
,
700 "show isis neighbor WORD",
702 "ISIS network information\n"
703 "ISIS neighbor adjacencies\n"
706 return show_isis_neighbor_common (vty
, argv
[0], ISIS_UI_LEVEL_DETAIL
);
709 DEFUN (clear_isis_neighbor
,
710 clear_isis_neighbor_cmd
,
711 "clear isis neighbor",
713 "Reset ISIS network information\n"
714 "Reset ISIS neighbor adjacencies\n")
716 return clear_isis_neighbor_common (vty
, NULL
);
719 DEFUN (clear_isis_neighbor_arg
,
720 clear_isis_neighbor_arg_cmd
,
721 "clear isis neighbor WORD",
723 "ISIS network information\n"
724 "ISIS neighbor adjacencies\n"
727 return clear_isis_neighbor_common (vty
, argv
[0]);
731 * 'isis debug', 'show debugging'
734 print_debug (struct vty
*vty
, int flags
, int onoff
)
738 strcpy (onoffs
, "on");
740 strcpy (onoffs
, "off");
742 if (flags
& DEBUG_ADJ_PACKETS
)
743 vty_out (vty
, "IS-IS Adjacency related packets debugging is %s%s", onoffs
,
745 if (flags
& DEBUG_CHECKSUM_ERRORS
)
746 vty_out (vty
, "IS-IS checksum errors debugging is %s%s", onoffs
,
748 if (flags
& DEBUG_LOCAL_UPDATES
)
749 vty_out (vty
, "IS-IS local updates debugging is %s%s", onoffs
,
751 if (flags
& DEBUG_PROTOCOL_ERRORS
)
752 vty_out (vty
, "IS-IS protocol errors debugging is %s%s", onoffs
,
754 if (flags
& DEBUG_SNP_PACKETS
)
755 vty_out (vty
, "IS-IS CSNP/PSNP packets debugging is %s%s", onoffs
,
757 if (flags
& DEBUG_SPF_EVENTS
)
758 vty_out (vty
, "IS-IS SPF events debugging is %s%s", onoffs
, VTY_NEWLINE
);
759 if (flags
& DEBUG_SPF_STATS
)
760 vty_out (vty
, "IS-IS SPF Timing and Statistics Data debugging is %s%s",
761 onoffs
, VTY_NEWLINE
);
762 if (flags
& DEBUG_SPF_TRIGGERS
)
763 vty_out (vty
, "IS-IS SPF triggering events debugging is %s%s", onoffs
,
765 if (flags
& DEBUG_UPDATE_PACKETS
)
766 vty_out (vty
, "IS-IS Update related packet debugging is %s%s", onoffs
,
768 if (flags
& DEBUG_RTE_EVENTS
)
769 vty_out (vty
, "IS-IS Route related debuggin is %s%s", onoffs
,
771 if (flags
& DEBUG_EVENTS
)
772 vty_out (vty
, "IS-IS Event debugging is %s%s", onoffs
, VTY_NEWLINE
);
773 if (flags
& DEBUG_PACKET_DUMP
)
774 vty_out (vty
, "IS-IS Packet dump debugging is %s%s", onoffs
, VTY_NEWLINE
);
775 if (flags
& DEBUG_LSP_GEN
)
776 vty_out (vty
, "IS-IS LSP generation debugging is %s%s", onoffs
, VTY_NEWLINE
);
777 if (flags
& DEBUG_LSP_SCHED
)
778 vty_out (vty
, "IS-IS LSP scheduling debugging is %s%s", onoffs
, VTY_NEWLINE
);
781 DEFUN (show_debugging
,
783 "show debugging isis",
785 "State of each debugging option\n"
788 vty_out (vty
, "IS-IS:%s", VTY_NEWLINE
);
789 print_debug (vty
, isis
->debugs
, 1);
794 static struct cmd_node debug_node
= {
801 config_write_debug (struct vty
*vty
)
804 int flags
= isis
->debugs
;
806 if (flags
& DEBUG_ADJ_PACKETS
)
808 vty_out (vty
, "debug isis adj-packets%s", VTY_NEWLINE
);
811 if (flags
& DEBUG_CHECKSUM_ERRORS
)
813 vty_out (vty
, "debug isis checksum-errors%s", VTY_NEWLINE
);
816 if (flags
& DEBUG_LOCAL_UPDATES
)
818 vty_out (vty
, "debug isis local-updates%s", VTY_NEWLINE
);
821 if (flags
& DEBUG_PROTOCOL_ERRORS
)
823 vty_out (vty
, "debug isis protocol-errors%s", VTY_NEWLINE
);
826 if (flags
& DEBUG_SNP_PACKETS
)
828 vty_out (vty
, "debug isis snp-packets%s", VTY_NEWLINE
);
831 if (flags
& DEBUG_SPF_EVENTS
)
833 vty_out (vty
, "debug isis spf-events%s", VTY_NEWLINE
);
836 if (flags
& DEBUG_SPF_STATS
)
838 vty_out (vty
, "debug isis spf-statistics%s", VTY_NEWLINE
);
841 if (flags
& DEBUG_SPF_TRIGGERS
)
843 vty_out (vty
, "debug isis spf-triggers%s", VTY_NEWLINE
);
846 if (flags
& DEBUG_UPDATE_PACKETS
)
848 vty_out (vty
, "debug isis update-packets%s", VTY_NEWLINE
);
851 if (flags
& DEBUG_RTE_EVENTS
)
853 vty_out (vty
, "debug isis route-events%s", VTY_NEWLINE
);
856 if (flags
& DEBUG_EVENTS
)
858 vty_out (vty
, "debug isis events%s", VTY_NEWLINE
);
861 if (flags
& DEBUG_PACKET_DUMP
)
863 vty_out (vty
, "debug isis packet-dump%s", VTY_NEWLINE
);
866 if (flags
& DEBUG_LSP_GEN
)
868 vty_out (vty
, "debug isis lsp-gen%s", VTY_NEWLINE
);
871 if (flags
& DEBUG_LSP_SCHED
)
873 vty_out (vty
, "debug isis lsp-sched%s", VTY_NEWLINE
);
880 DEFUN (debug_isis_adj
,
882 "debug isis adj-packets",
884 "IS-IS information\n"
885 "IS-IS Adjacency related packets\n")
887 isis
->debugs
|= DEBUG_ADJ_PACKETS
;
888 print_debug (vty
, DEBUG_ADJ_PACKETS
, 1);
893 DEFUN (no_debug_isis_adj
,
894 no_debug_isis_adj_cmd
,
895 "no debug isis adj-packets",
897 "IS-IS information\n"
898 "IS-IS Adjacency related packets\n")
900 isis
->debugs
&= ~DEBUG_ADJ_PACKETS
;
901 print_debug (vty
, DEBUG_ADJ_PACKETS
, 0);
906 DEFUN (debug_isis_csum
,
908 "debug isis checksum-errors",
910 "IS-IS information\n"
911 "IS-IS LSP checksum errors\n")
913 isis
->debugs
|= DEBUG_CHECKSUM_ERRORS
;
914 print_debug (vty
, DEBUG_CHECKSUM_ERRORS
, 1);
919 DEFUN (no_debug_isis_csum
,
920 no_debug_isis_csum_cmd
,
921 "no debug isis checksum-errors",
923 "IS-IS information\n"
924 "IS-IS LSP checksum errors\n")
926 isis
->debugs
&= ~DEBUG_CHECKSUM_ERRORS
;
927 print_debug (vty
, DEBUG_CHECKSUM_ERRORS
, 0);
932 DEFUN (debug_isis_lupd
,
934 "debug isis local-updates",
936 "IS-IS information\n"
937 "IS-IS local update packets\n")
939 isis
->debugs
|= DEBUG_LOCAL_UPDATES
;
940 print_debug (vty
, DEBUG_LOCAL_UPDATES
, 1);
945 DEFUN (no_debug_isis_lupd
,
946 no_debug_isis_lupd_cmd
,
947 "no debug isis local-updates",
949 "IS-IS information\n"
950 "IS-IS local update packets\n")
952 isis
->debugs
&= ~DEBUG_LOCAL_UPDATES
;
953 print_debug (vty
, DEBUG_LOCAL_UPDATES
, 0);
958 DEFUN (debug_isis_err
,
960 "debug isis protocol-errors",
962 "IS-IS information\n"
963 "IS-IS LSP protocol errors\n")
965 isis
->debugs
|= DEBUG_PROTOCOL_ERRORS
;
966 print_debug (vty
, DEBUG_PROTOCOL_ERRORS
, 1);
971 DEFUN (no_debug_isis_err
,
972 no_debug_isis_err_cmd
,
973 "no debug isis protocol-errors",
975 "IS-IS information\n"
976 "IS-IS LSP protocol errors\n")
978 isis
->debugs
&= ~DEBUG_PROTOCOL_ERRORS
;
979 print_debug (vty
, DEBUG_PROTOCOL_ERRORS
, 0);
984 DEFUN (debug_isis_snp
,
986 "debug isis snp-packets",
988 "IS-IS information\n"
989 "IS-IS CSNP/PSNP packets\n")
991 isis
->debugs
|= DEBUG_SNP_PACKETS
;
992 print_debug (vty
, DEBUG_SNP_PACKETS
, 1);
997 DEFUN (no_debug_isis_snp
,
998 no_debug_isis_snp_cmd
,
999 "no debug isis snp-packets",
1001 "IS-IS information\n"
1002 "IS-IS CSNP/PSNP packets\n")
1004 isis
->debugs
&= ~DEBUG_SNP_PACKETS
;
1005 print_debug (vty
, DEBUG_SNP_PACKETS
, 0);
1010 DEFUN (debug_isis_upd
,
1012 "debug isis update-packets",
1014 "IS-IS information\n"
1015 "IS-IS Update related packets\n")
1017 isis
->debugs
|= DEBUG_UPDATE_PACKETS
;
1018 print_debug (vty
, DEBUG_UPDATE_PACKETS
, 1);
1023 DEFUN (no_debug_isis_upd
,
1024 no_debug_isis_upd_cmd
,
1025 "no debug isis update-packets",
1027 "IS-IS information\n"
1028 "IS-IS Update related packets\n")
1030 isis
->debugs
&= ~DEBUG_UPDATE_PACKETS
;
1031 print_debug (vty
, DEBUG_UPDATE_PACKETS
, 0);
1036 DEFUN (debug_isis_spfevents
,
1037 debug_isis_spfevents_cmd
,
1038 "debug isis spf-events",
1040 "IS-IS information\n"
1041 "IS-IS Shortest Path First Events\n")
1043 isis
->debugs
|= DEBUG_SPF_EVENTS
;
1044 print_debug (vty
, DEBUG_SPF_EVENTS
, 1);
1049 DEFUN (no_debug_isis_spfevents
,
1050 no_debug_isis_spfevents_cmd
,
1051 "no debug isis spf-events",
1053 "IS-IS information\n"
1054 "IS-IS Shortest Path First Events\n")
1056 isis
->debugs
&= ~DEBUG_SPF_EVENTS
;
1057 print_debug (vty
, DEBUG_SPF_EVENTS
, 0);
1062 DEFUN (debug_isis_spfstats
,
1063 debug_isis_spfstats_cmd
,
1064 "debug isis spf-statistics ",
1066 "IS-IS information\n"
1067 "IS-IS SPF Timing and Statistic Data\n")
1069 isis
->debugs
|= DEBUG_SPF_STATS
;
1070 print_debug (vty
, DEBUG_SPF_STATS
, 1);
1075 DEFUN (no_debug_isis_spfstats
,
1076 no_debug_isis_spfstats_cmd
,
1077 "no debug isis spf-statistics",
1079 "IS-IS information\n"
1080 "IS-IS SPF Timing and Statistic Data\n")
1082 isis
->debugs
&= ~DEBUG_SPF_STATS
;
1083 print_debug (vty
, DEBUG_SPF_STATS
, 0);
1088 DEFUN (debug_isis_spftrigg
,
1089 debug_isis_spftrigg_cmd
,
1090 "debug isis spf-triggers",
1092 "IS-IS information\n"
1093 "IS-IS SPF triggering events\n")
1095 isis
->debugs
|= DEBUG_SPF_TRIGGERS
;
1096 print_debug (vty
, DEBUG_SPF_TRIGGERS
, 1);
1101 DEFUN (no_debug_isis_spftrigg
,
1102 no_debug_isis_spftrigg_cmd
,
1103 "no debug isis spf-triggers",
1105 "IS-IS information\n"
1106 "IS-IS SPF triggering events\n")
1108 isis
->debugs
&= ~DEBUG_SPF_TRIGGERS
;
1109 print_debug (vty
, DEBUG_SPF_TRIGGERS
, 0);
1114 DEFUN (debug_isis_rtevents
,
1115 debug_isis_rtevents_cmd
,
1116 "debug isis route-events",
1118 "IS-IS information\n"
1119 "IS-IS Route related events\n")
1121 isis
->debugs
|= DEBUG_RTE_EVENTS
;
1122 print_debug (vty
, DEBUG_RTE_EVENTS
, 1);
1127 DEFUN (no_debug_isis_rtevents
,
1128 no_debug_isis_rtevents_cmd
,
1129 "no debug isis route-events",
1131 "IS-IS information\n"
1132 "IS-IS Route related events\n")
1134 isis
->debugs
&= ~DEBUG_RTE_EVENTS
;
1135 print_debug (vty
, DEBUG_RTE_EVENTS
, 0);
1140 DEFUN (debug_isis_events
,
1141 debug_isis_events_cmd
,
1142 "debug isis events",
1144 "IS-IS information\n"
1147 isis
->debugs
|= DEBUG_EVENTS
;
1148 print_debug (vty
, DEBUG_EVENTS
, 1);
1153 DEFUN (no_debug_isis_events
,
1154 no_debug_isis_events_cmd
,
1155 "no debug isis events",
1157 "IS-IS information\n"
1160 isis
->debugs
&= ~DEBUG_EVENTS
;
1161 print_debug (vty
, DEBUG_EVENTS
, 0);
1166 DEFUN (debug_isis_packet_dump
,
1167 debug_isis_packet_dump_cmd
,
1168 "debug isis packet-dump",
1170 "IS-IS information\n"
1171 "IS-IS packet dump\n")
1173 isis
->debugs
|= DEBUG_PACKET_DUMP
;
1174 print_debug (vty
, DEBUG_PACKET_DUMP
, 1);
1179 DEFUN (no_debug_isis_packet_dump
,
1180 no_debug_isis_packet_dump_cmd
,
1181 "no debug isis packet-dump",
1183 "IS-IS information\n"
1184 "IS-IS packet dump\n")
1186 isis
->debugs
&= ~DEBUG_PACKET_DUMP
;
1187 print_debug (vty
, DEBUG_PACKET_DUMP
, 0);
1192 DEFUN (debug_isis_lsp_gen
,
1193 debug_isis_lsp_gen_cmd
,
1194 "debug isis lsp-gen",
1196 "IS-IS information\n"
1197 "IS-IS generation of own LSPs\n")
1199 isis
->debugs
|= DEBUG_LSP_GEN
;
1200 print_debug (vty
, DEBUG_LSP_GEN
, 1);
1205 DEFUN (no_debug_isis_lsp_gen
,
1206 no_debug_isis_lsp_gen_cmd
,
1207 "no debug isis lsp-gen",
1209 "IS-IS information\n"
1210 "IS-IS generation of own LSPs\n")
1212 isis
->debugs
&= ~DEBUG_LSP_GEN
;
1213 print_debug (vty
, DEBUG_LSP_GEN
, 0);
1218 DEFUN (debug_isis_lsp_sched
,
1219 debug_isis_lsp_sched_cmd
,
1220 "debug isis lsp-sched",
1222 "IS-IS information\n"
1223 "IS-IS scheduling of LSP generation\n")
1225 isis
->debugs
|= DEBUG_LSP_SCHED
;
1226 print_debug (vty
, DEBUG_LSP_SCHED
, 1);
1231 DEFUN (no_debug_isis_lsp_sched
,
1232 no_debug_isis_lsp_sched_cmd
,
1233 "no debug isis lsp-gen",
1235 "IS-IS information\n"
1236 "IS-IS scheduling of LSP generation\n")
1238 isis
->debugs
&= ~DEBUG_LSP_SCHED
;
1239 print_debug (vty
, DEBUG_LSP_SCHED
, 0);
1244 DEFUN (show_hostname
,
1246 "show isis hostname",
1248 "IS-IS information\n"
1249 "IS-IS Dynamic hostname mapping\n")
1251 dynhn_print_all (vty
);
1257 vty_out_timestr(struct vty
*vty
, time_t uptime
)
1260 time_t difftime
= time (NULL
);
1262 tm
= gmtime (&difftime
);
1264 #define ONE_DAY_SECOND 60*60*24
1265 #define ONE_WEEK_SECOND 60*60*24*7
1266 if (difftime
< ONE_DAY_SECOND
)
1267 vty_out (vty
, "%02d:%02d:%02d",
1268 tm
->tm_hour
, tm
->tm_min
, tm
->tm_sec
);
1269 else if (difftime
< ONE_WEEK_SECOND
)
1270 vty_out (vty
, "%dd%02dh%02dm",
1271 tm
->tm_yday
, tm
->tm_hour
, tm
->tm_min
);
1273 vty_out (vty
, "%02dw%dd%02dh",
1275 tm
->tm_yday
- ((tm
->tm_yday
/7) * 7), tm
->tm_hour
);
1276 vty_out (vty
, " ago");
1279 DEFUN (show_isis_summary
,
1280 show_isis_summary_cmd
,
1281 "show isis summary",
1282 SHOW_STR
"IS-IS information\n" "IS-IS summary\n")
1284 struct listnode
*node
, *node2
;
1285 struct isis_area
*area
;
1286 struct isis_spftree
*spftree
;
1291 vty_out (vty
, "ISIS is not running%s", VTY_NEWLINE
);
1295 vty_out (vty
, "Process Id : %ld%s", isis
->process_id
,
1297 if (isis
->sysid_set
)
1298 vty_out (vty
, "System Id : %s%s", sysid_print (isis
->sysid
),
1301 vty_out (vty
, "Up time : ");
1302 vty_out_timestr(vty
, isis
->uptime
);
1303 vty_out (vty
, "%s", VTY_NEWLINE
);
1305 if (isis
->area_list
)
1306 vty_out (vty
, "Number of areas : %d%s", isis
->area_list
->count
,
1309 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, node
, area
))
1311 vty_out (vty
, "Area %s:%s", area
->area_tag
? area
->area_tag
: "null",
1314 if (listcount (area
->area_addrs
) > 0)
1316 struct area_addr
*area_addr
;
1317 for (ALL_LIST_ELEMENTS_RO (area
->area_addrs
, node2
, area_addr
))
1319 vty_out (vty
, " Net: %s%s",
1320 isonet_print (area_addr
->area_addr
,
1321 area_addr
->addr_len
+ ISIS_SYS_ID_LEN
+
1326 for (level
= ISIS_LEVEL1
; level
<= ISIS_LEVELS
; level
++)
1328 if ((area
->is_type
& level
) == 0)
1331 vty_out (vty
, " Level-%d:%s", level
, VTY_NEWLINE
);
1332 spftree
= area
->spftree
[level
- 1];
1333 if (spftree
->pending
)
1334 vty_out (vty
, " IPv4 SPF: (pending)%s", VTY_NEWLINE
);
1336 vty_out (vty
, " IPv4 SPF:%s", VTY_NEWLINE
);
1338 vty_out (vty
, " minimum interval : %d%s",
1339 area
->min_spf_interval
[level
- 1], VTY_NEWLINE
);
1341 vty_out (vty
, " last run elapsed : ");
1342 vty_out_timestr(vty
, spftree
->last_run_timestamp
);
1343 vty_out (vty
, "%s", VTY_NEWLINE
);
1345 vty_out (vty
, " last run duration : %u usec%s",
1346 (u_int32_t
)spftree
->last_run_duration
, VTY_NEWLINE
);
1348 vty_out (vty
, " run count : %d%s",
1349 spftree
->runcount
, VTY_NEWLINE
);
1352 spftree
= area
->spftree6
[level
- 1];
1353 if (spftree
->pending
)
1354 vty_out (vty
, " IPv6 SPF: (pending)%s", VTY_NEWLINE
);
1356 vty_out (vty
, " IPv6 SPF:%s", VTY_NEWLINE
);
1358 vty_out (vty
, " minimum interval : %d%s",
1359 area
->min_spf_interval
[level
- 1], VTY_NEWLINE
);
1361 vty_out (vty
, " last run elapsed : ");
1362 vty_out_timestr(vty
, spftree
->last_run_timestamp
);
1363 vty_out (vty
, "%s", VTY_NEWLINE
);
1365 vty_out (vty
, " last run duration : %ld msec%s",
1366 spftree
->last_run_duration
, VTY_NEWLINE
);
1368 vty_out (vty
, " run count : %d%s",
1369 spftree
->runcount
, VTY_NEWLINE
);
1373 vty_out (vty
, "%s", VTY_NEWLINE
);
1379 * This function supports following display options:
1380 * [ show isis database [detail] ]
1381 * [ show isis database <sysid> [detail] ]
1382 * [ show isis database <hostname> [detail] ]
1383 * [ show isis database <sysid>.<pseudo-id> [detail] ]
1384 * [ show isis database <hostname>.<pseudo-id> [detail] ]
1385 * [ show isis database <sysid>.<pseudo-id>-<fragment-number> [detail] ]
1386 * [ show isis database <hostname>.<pseudo-id>-<fragment-number> [detail] ]
1387 * [ show isis database detail <sysid> ]
1388 * [ show isis database detail <hostname> ]
1389 * [ show isis database detail <sysid>.<pseudo-id> ]
1390 * [ show isis database detail <hostname>.<pseudo-id> ]
1391 * [ show isis database detail <sysid>.<pseudo-id>-<fragment-number> ]
1392 * [ show isis database detail <hostname>.<pseudo-id>-<fragment-number> ]
1395 show_isis_database (struct vty
*vty
, const char *argv
, int ui_level
)
1397 struct listnode
*node
;
1398 struct isis_area
*area
;
1399 struct isis_lsp
*lsp
;
1400 struct isis_dynhn
*dynhn
;
1401 const char *pos
= argv
;
1402 u_char lspid
[ISIS_SYS_ID_LEN
+2];
1405 int level
, lsp_count
;
1407 if (isis
->area_list
->count
== 0)
1410 memset (&lspid
, 0, ISIS_SYS_ID_LEN
);
1411 memset (&sysid
, 0, 255);
1414 * extract fragment and pseudo id from the string argv
1416 * (a) <systemid/hostname>.<pseudo-id>-<framenent> or
1417 * (b) <systemid/hostname>.<pseudo-id> or
1418 * (c) <systemid/hostname> or
1419 * Where systemid is in the form:
1423 strncpy (sysid
, argv
, 254);
1424 if (argv
&& strlen (argv
) > 3)
1426 pos
= argv
+ strlen (argv
) - 3;
1427 if (strncmp (pos
, "-", 1) == 0)
1429 memcpy (number
, ++pos
, 2);
1430 lspid
[ISIS_SYS_ID_LEN
+1] = (u_char
) strtol ((char *)number
, NULL
, 16);
1432 if (strncmp (pos
, ".", 1) != 0)
1433 return CMD_ERR_AMBIGUOUS
;
1435 if (strncmp (pos
, ".", 1) == 0)
1437 memcpy (number
, ++pos
, 2);
1438 lspid
[ISIS_SYS_ID_LEN
] = (u_char
) strtol ((char *)number
, NULL
, 16);
1439 sysid
[pos
- argv
- 1] = '\0';
1443 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, node
, area
))
1445 vty_out (vty
, "Area %s:%s", area
->area_tag
? area
->area_tag
: "null",
1448 for (level
= 0; level
< ISIS_LEVELS
; level
++)
1450 if (area
->lspdb
[level
] && dict_count (area
->lspdb
[level
]) > 0)
1456 * Try to find the lsp-id if the argv string is in
1457 * the form hostname.<pseudo-id>-<fragment>
1459 if (sysid2buff (lspid
, sysid
))
1461 lsp
= lsp_search (lspid
, area
->lspdb
[level
]);
1463 else if ((dynhn
= dynhn_find_by_name (sysid
)))
1465 memcpy (lspid
, dynhn
->id
, ISIS_SYS_ID_LEN
);
1466 lsp
= lsp_search (lspid
, area
->lspdb
[level
]);
1468 else if (strncmp(unix_hostname (), sysid
, 15) == 0)
1470 memcpy (lspid
, isis
->sysid
, ISIS_SYS_ID_LEN
);
1471 lsp
= lsp_search (lspid
, area
->lspdb
[level
]);
1475 if (lsp
!= NULL
|| argv
== NULL
)
1477 vty_out (vty
, "IS-IS Level-%d link-state database:%s",
1478 level
+ 1, VTY_NEWLINE
);
1480 /* print the title in all cases */
1481 vty_out (vty
, "LSP ID PduLen "
1482 "SeqNumber Chksum Holdtime ATT/P/OL%s",
1488 if (ui_level
== ISIS_UI_LEVEL_DETAIL
)
1489 lsp_print_detail (lsp
, vty
, area
->dynhostname
);
1491 lsp_print (lsp
, vty
, area
->dynhostname
);
1493 else if (argv
== NULL
)
1495 lsp_count
= lsp_print_all (vty
, area
->lspdb
[level
],
1499 vty_out (vty
, " %u LSPs%s%s",
1500 lsp_count
, VTY_NEWLINE
, VTY_NEWLINE
);
1509 DEFUN (show_database_brief
,
1511 "show isis database",
1513 "IS-IS information\n"
1514 "IS-IS link state database\n")
1516 return show_isis_database (vty
, NULL
, ISIS_UI_LEVEL_BRIEF
);
1519 DEFUN (show_database_lsp_brief
,
1520 show_database_arg_cmd
,
1521 "show isis database WORD",
1523 "IS-IS information\n"
1524 "IS-IS link state database\n"
1527 return show_isis_database (vty
, argv
[0], ISIS_UI_LEVEL_BRIEF
);
1530 DEFUN (show_database_lsp_detail
,
1531 show_database_arg_detail_cmd
,
1532 "show isis database WORD detail",
1534 "IS-IS information\n"
1535 "IS-IS link state database\n"
1537 "Detailed information\n")
1539 return show_isis_database (vty
, argv
[0], ISIS_UI_LEVEL_DETAIL
);
1542 DEFUN (show_database_detail
,
1543 show_database_detail_cmd
,
1544 "show isis database detail",
1546 "IS-IS information\n"
1547 "IS-IS link state database\n")
1549 return show_isis_database (vty
, NULL
, ISIS_UI_LEVEL_DETAIL
);
1552 DEFUN (show_database_detail_lsp
,
1553 show_database_detail_arg_cmd
,
1554 "show isis database detail WORD",
1556 "IS-IS information\n"
1557 "IS-IS link state database\n"
1558 "Detailed information\n"
1561 return show_isis_database (vty
, argv
[0], ISIS_UI_LEVEL_DETAIL
);
1565 * 'router isis' command
1572 "ISO Routing area tag")
1574 return isis_area_get (vty
, argv
[0]);
1578 *'no router isis' command
1580 DEFUN (no_router_isis
,
1582 "no router isis WORD",
1583 "no\n" ROUTER_STR
"ISO IS-IS\n" "ISO Routing area tag")
1585 return isis_area_destroy (vty
, argv
[0]);
1594 "A Network Entity Title for this process (OSI only)\n"
1595 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
1597 return area_net_title (vty
, argv
[0]);
1607 "A Network Entity Title for this process (OSI only)\n"
1608 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
1610 return area_clear_net_title (vty
, argv
[0]);
1614 int area_set_lsp_mtu(struct vty
*vty
, struct isis_area
*area
, unsigned int lsp_mtu
)
1616 struct isis_circuit
*circuit
;
1617 struct listnode
*node
;
1619 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
, node
, circuit
))
1621 if(lsp_mtu
> isis_circuit_pdu_size(circuit
))
1623 vty_out(vty
, "ISIS area contains circuit %s, which has a maximum PDU size of %zu.%s",
1624 circuit
->interface
->name
, isis_circuit_pdu_size(circuit
),
1626 return CMD_ERR_AMBIGUOUS
;
1630 area
->lsp_mtu
= lsp_mtu
;
1631 lsp_regenerate_schedule(area
, IS_LEVEL_1_AND_2
, 1);
1636 DEFUN (area_lsp_mtu
,
1638 "lsp-mtu <128-4352>",
1639 "Configure the maximum size of generated LSPs\n"
1640 "Maximum size of generated LSPs\n")
1642 struct isis_area
*area
;
1647 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
1648 return CMD_ERR_NO_MATCH
;
1651 unsigned int lsp_mtu
;
1653 VTY_GET_INTEGER_RANGE("lsp-mtu", lsp_mtu
, argv
[0], 128, 4352);
1655 return area_set_lsp_mtu(vty
, area
, lsp_mtu
);
1658 DEFUN(no_area_lsp_mtu
,
1659 no_area_lsp_mtu_cmd
,
1662 "Configure the maximum size of generated LSPs\n")
1664 struct isis_area
*area
;
1669 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
1670 return CMD_ERR_NO_MATCH
;
1673 return area_set_lsp_mtu(vty
, area
, DEFAULT_LSP_MTU
);
1676 ALIAS(no_area_lsp_mtu
,
1677 no_area_lsp_mtu_arg_cmd
,
1678 "no lsp-mtu <128-4352>",
1680 "Configure the maximum size of generated LSPs\n"
1681 "Maximum size of generated LSPs\n");
1683 DEFUN (area_passwd_md5
,
1684 area_passwd_md5_cmd
,
1685 "area-password md5 WORD",
1686 "Configure the authentication password for an area\n"
1687 "Authentication type\n"
1690 struct isis_area
*area
;
1697 vty_out (vty
, "Can't find IS-IS instance%s", VTY_NEWLINE
);
1698 return CMD_ERR_NO_MATCH
;
1701 len
= strlen (argv
[0]);
1704 vty_out (vty
, "Too long area password (>254)%s", VTY_NEWLINE
);
1705 return CMD_ERR_AMBIGUOUS
;
1708 area
->area_passwd
.len
= (u_char
) len
;
1709 area
->area_passwd
.type
= ISIS_PASSWD_TYPE_HMAC_MD5
;
1710 strncpy ((char *)area
->area_passwd
.passwd
, argv
[0], 255);
1714 SET_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_SEND
);
1715 if (strncmp(argv
[1], "v", 1) == 0)
1716 SET_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_RECV
);
1718 UNSET_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_RECV
);
1722 UNSET_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_SEND
);
1723 UNSET_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_RECV
);
1725 lsp_regenerate_schedule (area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
1730 ALIAS (area_passwd_md5
,
1731 area_passwd_md5_snpauth_cmd
,
1732 "area-password md5 WORD authenticate snp (send-only|validate)",
1733 "Configure the authentication password for an area\n"
1734 "Authentication type\n"
1738 "Send but do not check PDUs on receiving\n"
1739 "Send and check PDUs on receiving\n");
1741 DEFUN (area_passwd_clear
,
1742 area_passwd_clear_cmd
,
1743 "area-password clear WORD",
1744 "Configure the authentication password for an area\n"
1745 "Authentication type\n"
1748 struct isis_area
*area
;
1755 vty_out (vty
, "Can't find IS-IS instance%s", VTY_NEWLINE
);
1756 return CMD_ERR_NO_MATCH
;
1759 len
= strlen (argv
[0]);
1762 vty_out (vty
, "Too long area password (>254)%s", VTY_NEWLINE
);
1763 return CMD_ERR_AMBIGUOUS
;
1766 area
->area_passwd
.len
= (u_char
) len
;
1767 area
->area_passwd
.type
= ISIS_PASSWD_TYPE_CLEARTXT
;
1768 strncpy ((char *)area
->area_passwd
.passwd
, argv
[0], 255);
1772 SET_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_SEND
);
1773 if (strncmp(argv
[1], "v", 1) == 0)
1774 SET_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_RECV
);
1776 UNSET_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_RECV
);
1780 UNSET_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_SEND
);
1781 UNSET_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_RECV
);
1783 lsp_regenerate_schedule (area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
1788 ALIAS (area_passwd_clear
,
1789 area_passwd_clear_snpauth_cmd
,
1790 "area-password clear WORD authenticate snp (send-only|validate)",
1791 "Configure the authentication password for an area\n"
1792 "Authentication type\n"
1796 "Send but do not check PDUs on receiving\n"
1797 "Send and check PDUs on receiving\n");
1799 DEFUN (no_area_passwd
,
1803 "Configure the authentication password for an area\n")
1805 struct isis_area
*area
;
1811 vty_out (vty
, "Can't find IS-IS instance%s", VTY_NEWLINE
);
1812 return CMD_ERR_NO_MATCH
;
1815 memset (&area
->area_passwd
, 0, sizeof (struct isis_passwd
));
1816 lsp_regenerate_schedule (area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
1821 DEFUN (domain_passwd_md5
,
1822 domain_passwd_md5_cmd
,
1823 "domain-password md5 WORD",
1824 "Set the authentication password for a routing domain\n"
1825 "Authentication type\n"
1826 "Routing domain password\n")
1828 struct isis_area
*area
;
1835 vty_out (vty
, "Can't find IS-IS instance%s", VTY_NEWLINE
);
1836 return CMD_ERR_NO_MATCH
;
1839 len
= strlen (argv
[0]);
1842 vty_out (vty
, "Too long area password (>254)%s", VTY_NEWLINE
);
1843 return CMD_ERR_AMBIGUOUS
;
1846 area
->domain_passwd
.len
= (u_char
) len
;
1847 area
->domain_passwd
.type
= ISIS_PASSWD_TYPE_HMAC_MD5
;
1848 strncpy ((char *)area
->domain_passwd
.passwd
, argv
[0], 255);
1852 SET_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_SEND
);
1853 if (strncmp(argv
[1], "v", 1) == 0)
1854 SET_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_RECV
);
1856 UNSET_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_RECV
);
1860 UNSET_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_SEND
);
1861 UNSET_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_RECV
);
1863 lsp_regenerate_schedule (area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
1868 ALIAS (domain_passwd_md5
,
1869 domain_passwd_md5_snpauth_cmd
,
1870 "domain-password md5 WORD authenticate snp (send-only|validate)",
1871 "Set the authentication password for a routing domain\n"
1872 "Authentication type\n"
1873 "Routing domain password\n"
1876 "Send but do not check PDUs on receiving\n"
1877 "Send and check PDUs on receiving\n");
1879 DEFUN (domain_passwd_clear
,
1880 domain_passwd_clear_cmd
,
1881 "domain-password clear WORD",
1882 "Set the authentication password for a routing domain\n"
1883 "Authentication type\n"
1884 "Routing domain password\n")
1886 struct isis_area
*area
;
1893 vty_out (vty
, "Can't find IS-IS instance%s", VTY_NEWLINE
);
1894 return CMD_ERR_NO_MATCH
;
1897 len
= strlen (argv
[0]);
1900 vty_out (vty
, "Too long area password (>254)%s", VTY_NEWLINE
);
1901 return CMD_ERR_AMBIGUOUS
;
1904 area
->domain_passwd
.len
= (u_char
) len
;
1905 area
->domain_passwd
.type
= ISIS_PASSWD_TYPE_CLEARTXT
;
1906 strncpy ((char *)area
->domain_passwd
.passwd
, argv
[0], 255);
1910 SET_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_SEND
);
1911 if (strncmp(argv
[1], "v", 1) == 0)
1912 SET_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_RECV
);
1914 UNSET_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_RECV
);
1918 UNSET_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_SEND
);
1919 UNSET_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_RECV
);
1921 lsp_regenerate_schedule (area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
1926 ALIAS (domain_passwd_clear
,
1927 domain_passwd_clear_snpauth_cmd
,
1928 "domain-password clear WORD authenticate snp (send-only|validate)",
1929 "Set the authentication password for a routing domain\n"
1930 "Authentication type\n"
1931 "Routing domain password\n"
1934 "Send but do not check PDUs on receiving\n"
1935 "Send and check PDUs on receiving\n");
1937 DEFUN (no_domain_passwd
,
1938 no_domain_passwd_cmd
,
1939 "no domain-password",
1941 "Set the authentication password for a routing domain\n")
1943 struct isis_area
*area
;
1949 vty_out (vty
, "Can't find IS-IS instance%s", VTY_NEWLINE
);
1950 return CMD_ERR_NO_MATCH
;
1953 memset (&area
->domain_passwd
, 0, sizeof (struct isis_passwd
));
1954 lsp_regenerate_schedule (area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
1961 "is-type (level-1|level-1-2|level-2-only)",
1962 "IS Level for this routing process (OSI only)\n"
1963 "Act as a station router only\n"
1964 "Act as both a station router and an area router\n"
1965 "Act as an area router only\n")
1967 struct isis_area
*area
;
1974 vty_out (vty
, "Can't find IS-IS instance%s", VTY_NEWLINE
);
1975 return CMD_ERR_NO_MATCH
;
1978 type
= string2circuit_t (argv
[0]);
1981 vty_out (vty
, "Unknown IS level %s", VTY_NEWLINE
);
1985 isis_event_system_type_change (area
, type
);
1992 "no is-type (level-1|level-1-2|level-2-only)",
1994 "IS Level for this routing process (OSI only)\n"
1995 "Act as a station router only\n"
1996 "Act as both a station router and an area router\n"
1997 "Act as an area router only\n")
1999 struct isis_area
*area
;
2006 * Put the is-type back to defaults:
2007 * - level-1-2 on first area
2008 * - level-1 for the rest
2010 if (listgetdata (listhead (isis
->area_list
)) == area
)
2011 type
= IS_LEVEL_1_AND_2
;
2015 isis_event_system_type_change (area
, type
);
2021 set_lsp_gen_interval (struct vty
*vty
, struct isis_area
*area
,
2022 uint16_t interval
, int level
)
2026 for (lvl
= IS_LEVEL_1
; lvl
<= IS_LEVEL_2
; ++lvl
)
2031 if (interval
>= area
->lsp_refresh
[lvl
-1])
2033 vty_out (vty
, "LSP gen interval %us must be less than "
2034 "the LSP refresh interval %us%s",
2035 interval
, area
->lsp_refresh
[lvl
-1], VTY_NEWLINE
);
2036 return CMD_ERR_AMBIGUOUS
;
2040 for (lvl
= IS_LEVEL_1
; lvl
<= IS_LEVEL_2
; ++lvl
)
2044 area
->lsp_gen_interval
[lvl
-1] = interval
;
2050 DEFUN (lsp_gen_interval
,
2051 lsp_gen_interval_cmd
,
2052 "lsp-gen-interval <1-120>",
2053 "Minimum interval between regenerating same LSP\n"
2054 "Minimum interval in seconds\n")
2056 struct isis_area
*area
;
2061 interval
= atoi (argv
[0]);
2062 level
= IS_LEVEL_1
| IS_LEVEL_2
;
2063 return set_lsp_gen_interval (vty
, area
, interval
, level
);
2066 DEFUN (no_lsp_gen_interval
,
2067 no_lsp_gen_interval_cmd
,
2068 "no lsp-gen-interval",
2070 "Minimum interval between regenerating same LSP\n")
2072 struct isis_area
*area
;
2077 interval
= DEFAULT_MIN_LSP_GEN_INTERVAL
;
2078 level
= IS_LEVEL_1
| IS_LEVEL_2
;
2079 return set_lsp_gen_interval (vty
, area
, interval
, level
);
2082 ALIAS (no_lsp_gen_interval
,
2083 no_lsp_gen_interval_arg_cmd
,
2084 "no lsp-gen-interval <1-120>",
2086 "Minimum interval between regenerating same LSP\n"
2087 "Minimum interval in seconds\n")
2089 DEFUN (lsp_gen_interval_l1
,
2090 lsp_gen_interval_l1_cmd
,
2091 "lsp-gen-interval level-1 <1-120>",
2092 "Minimum interval between regenerating same LSP\n"
2093 "Set interval for level 1 only\n"
2094 "Minimum interval in seconds\n")
2096 struct isis_area
*area
;
2101 interval
= atoi (argv
[0]);
2103 return set_lsp_gen_interval (vty
, area
, interval
, level
);
2106 DEFUN (no_lsp_gen_interval_l1
,
2107 no_lsp_gen_interval_l1_cmd
,
2108 "no lsp-gen-interval level-1",
2110 "Minimum interval between regenerating same LSP\n"
2111 "Set interval for level 1 only\n")
2113 struct isis_area
*area
;
2118 interval
= DEFAULT_MIN_LSP_GEN_INTERVAL
;
2120 return set_lsp_gen_interval (vty
, area
, interval
, level
);
2123 ALIAS (no_lsp_gen_interval_l1
,
2124 no_lsp_gen_interval_l1_arg_cmd
,
2125 "no lsp-gen-interval level-1 <1-120>",
2127 "Minimum interval between regenerating same LSP\n"
2128 "Set interval for level 1 only\n"
2129 "Minimum interval in seconds\n")
2131 DEFUN (lsp_gen_interval_l2
,
2132 lsp_gen_interval_l2_cmd
,
2133 "lsp-gen-interval level-2 <1-120>",
2134 "Minimum interval between regenerating same LSP\n"
2135 "Set interval for level 2 only\n"
2136 "Minimum interval in seconds\n")
2138 struct isis_area
*area
;
2143 interval
= atoi (argv
[0]);
2145 return set_lsp_gen_interval (vty
, area
, interval
, level
);
2148 DEFUN (no_lsp_gen_interval_l2
,
2149 no_lsp_gen_interval_l2_cmd
,
2150 "no lsp-gen-interval level-2",
2152 "Minimum interval between regenerating same LSP\n"
2153 "Set interval for level 2 only\n")
2155 struct isis_area
*area
;
2160 interval
= DEFAULT_MIN_LSP_GEN_INTERVAL
;
2162 return set_lsp_gen_interval (vty
, area
, interval
, level
);
2165 ALIAS (no_lsp_gen_interval_l2
,
2166 no_lsp_gen_interval_l2_arg_cmd
,
2167 "no lsp-gen-interval level-2 <1-120>",
2169 "Minimum interval between regenerating same LSP\n"
2170 "Set interval for level 2 only\n"
2171 "Minimum interval in seconds\n")
2174 validate_metric_style_narrow (struct vty
*vty
, struct isis_area
*area
)
2176 struct isis_circuit
*circuit
;
2177 struct listnode
*node
;
2180 return CMD_ERR_AMBIGUOUS
;
2184 vty_out (vty
, "ISIS area is invalid%s", VTY_NEWLINE
);
2185 return CMD_ERR_AMBIGUOUS
;
2188 for (ALL_LIST_ELEMENTS_RO (area
->circuit_list
, node
, circuit
))
2190 if ((area
->is_type
& IS_LEVEL_1
) &&
2191 (circuit
->is_type
& IS_LEVEL_1
) &&
2192 (circuit
->te_metric
[0] > MAX_NARROW_LINK_METRIC
))
2194 vty_out (vty
, "ISIS circuit %s metric is invalid%s",
2195 circuit
->interface
->name
, VTY_NEWLINE
);
2196 return CMD_ERR_AMBIGUOUS
;
2198 if ((area
->is_type
& IS_LEVEL_2
) &&
2199 (circuit
->is_type
& IS_LEVEL_2
) &&
2200 (circuit
->te_metric
[1] > MAX_NARROW_LINK_METRIC
))
2202 vty_out (vty
, "ISIS circuit %s metric is invalid%s",
2203 circuit
->interface
->name
, VTY_NEWLINE
);
2204 return CMD_ERR_AMBIGUOUS
;
2211 DEFUN (metric_style
,
2213 "metric-style (narrow|transition|wide)",
2214 "Use old-style (ISO 10589) or new-style packet formats\n"
2215 "Use old style of TLVs with narrow metric\n"
2216 "Send and accept both styles of TLVs during transition\n"
2217 "Use new style of TLVs to carry wider metric\n")
2219 struct isis_area
*area
;
2225 if (strncmp (argv
[0], "w", 1) == 0)
2227 area
->newmetric
= 1;
2228 area
->oldmetric
= 0;
2232 ret
= validate_metric_style_narrow (vty
, area
);
2233 if (ret
!= CMD_SUCCESS
)
2236 if (strncmp (argv
[0], "t", 1) == 0)
2238 area
->newmetric
= 1;
2239 area
->oldmetric
= 1;
2241 else if (strncmp (argv
[0], "n", 1) == 0)
2243 area
->newmetric
= 0;
2244 area
->oldmetric
= 1;
2251 DEFUN (no_metric_style
,
2252 no_metric_style_cmd
,
2255 "Use old-style (ISO 10589) or new-style packet formats\n")
2257 struct isis_area
*area
;
2263 ret
= validate_metric_style_narrow (vty
, area
);
2264 if (ret
!= CMD_SUCCESS
)
2267 /* Default is narrow metric. */
2268 area
->newmetric
= 0;
2269 area
->oldmetric
= 1;
2274 DEFUN (set_overload_bit
,
2275 set_overload_bit_cmd
,
2277 "Set overload bit to avoid any transit traffic\n"
2278 "Set overload bit\n")
2280 struct isis_area
*area
;
2285 area
->overload_bit
= LSPBIT_OL
;
2286 lsp_regenerate_schedule (area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
2291 DEFUN (no_set_overload_bit
,
2292 no_set_overload_bit_cmd
,
2293 "no set-overload-bit",
2294 "Reset overload bit to accept transit traffic\n"
2295 "Reset overload bit\n")
2297 struct isis_area
*area
;
2302 area
->overload_bit
= 0;
2303 lsp_regenerate_schedule (area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
2308 DEFUN (set_attached_bit
,
2309 set_attached_bit_cmd
,
2311 "Set attached bit to identify as L1/L2 router for inter-area traffic\n"
2312 "Set attached bit\n")
2314 struct isis_area
*area
;
2319 area
->attached_bit
= LSPBIT_ATT
;
2320 lsp_regenerate_schedule (area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
2325 DEFUN (no_set_attached_bit
,
2326 no_set_attached_bit_cmd
,
2327 "no set-attached-bit",
2328 "Reset attached bit\n")
2330 struct isis_area
*area
;
2335 area
->attached_bit
= 0;
2336 lsp_regenerate_schedule (area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
2341 DEFUN (dynamic_hostname
,
2342 dynamic_hostname_cmd
,
2344 "Dynamic hostname for IS-IS\n"
2345 "Dynamic hostname\n")
2347 struct isis_area
*area
;
2352 if (!area
->dynhostname
)
2354 area
->dynhostname
= 1;
2355 lsp_regenerate_schedule (area
, IS_LEVEL_1
| IS_LEVEL_2
, 0);
2361 DEFUN (no_dynamic_hostname
,
2362 no_dynamic_hostname_cmd
,
2363 "no hostname dynamic",
2365 "Dynamic hostname for IS-IS\n"
2366 "Dynamic hostname\n")
2368 struct isis_area
*area
;
2373 if (area
->dynhostname
)
2375 area
->dynhostname
= 0;
2376 lsp_regenerate_schedule (area
, IS_LEVEL_1
| IS_LEVEL_2
, 0);
2382 DEFUN (spf_interval
,
2384 "spf-interval <1-120>",
2385 "Minimum interval between SPF calculations\n"
2386 "Minimum interval between consecutive SPFs in seconds\n")
2388 struct isis_area
*area
;
2392 interval
= atoi (argv
[0]);
2393 area
->min_spf_interval
[0] = interval
;
2394 area
->min_spf_interval
[1] = interval
;
2399 DEFUN (no_spf_interval
,
2400 no_spf_interval_cmd
,
2403 "Minimum interval between SPF calculations\n")
2405 struct isis_area
*area
;
2409 area
->min_spf_interval
[0] = MINIMUM_SPF_INTERVAL
;
2410 area
->min_spf_interval
[1] = MINIMUM_SPF_INTERVAL
;
2415 ALIAS (no_spf_interval
,
2416 no_spf_interval_arg_cmd
,
2417 "no spf-interval <1-120>",
2419 "Minimum interval between SPF calculations\n"
2420 "Minimum interval between consecutive SPFs in seconds\n")
2422 DEFUN (spf_interval_l1
,
2423 spf_interval_l1_cmd
,
2424 "spf-interval level-1 <1-120>",
2425 "Minimum interval between SPF calculations\n"
2426 "Set interval for level 1 only\n"
2427 "Minimum interval between consecutive SPFs in seconds\n")
2429 struct isis_area
*area
;
2433 interval
= atoi (argv
[0]);
2434 area
->min_spf_interval
[0] = interval
;
2439 DEFUN (no_spf_interval_l1
,
2440 no_spf_interval_l1_cmd
,
2441 "no spf-interval level-1",
2443 "Minimum interval between SPF calculations\n"
2444 "Set interval for level 1 only\n")
2446 struct isis_area
*area
;
2450 area
->min_spf_interval
[0] = MINIMUM_SPF_INTERVAL
;
2455 ALIAS (no_spf_interval
,
2456 no_spf_interval_l1_arg_cmd
,
2457 "no spf-interval level-1 <1-120>",
2459 "Minimum interval between SPF calculations\n"
2460 "Set interval for level 1 only\n"
2461 "Minimum interval between consecutive SPFs in seconds\n")
2463 DEFUN (spf_interval_l2
,
2464 spf_interval_l2_cmd
,
2465 "spf-interval level-2 <1-120>",
2466 "Minimum interval between SPF calculations\n"
2467 "Set interval for level 2 only\n"
2468 "Minimum interval between consecutive SPFs in seconds\n")
2470 struct isis_area
*area
;
2474 interval
= atoi (argv
[0]);
2475 area
->min_spf_interval
[1] = interval
;
2480 DEFUN (no_spf_interval_l2
,
2481 no_spf_interval_l2_cmd
,
2482 "no spf-interval level-2",
2484 "Minimum interval between SPF calculations\n"
2485 "Set interval for level 2 only\n")
2487 struct isis_area
*area
;
2491 area
->min_spf_interval
[1] = MINIMUM_SPF_INTERVAL
;
2496 ALIAS (no_spf_interval
,
2497 no_spf_interval_l2_arg_cmd
,
2498 "no spf-interval level-2 <1-120>",
2500 "Minimum interval between SPF calculations\n"
2501 "Set interval for level 2 only\n"
2502 "Minimum interval between consecutive SPFs in seconds\n")
2505 set_lsp_max_lifetime (struct vty
*vty
, struct isis_area
*area
,
2506 uint16_t interval
, int level
)
2509 int set_refresh_interval
[ISIS_LEVELS
] = {0, 0};
2510 uint16_t refresh_interval
;
2512 refresh_interval
= interval
- 300;
2514 for (lvl
= IS_LEVEL_1
; lvl
<= IS_LEVEL_2
; lvl
++)
2518 if (refresh_interval
< area
->lsp_refresh
[lvl
-1])
2520 vty_out (vty
, "Level %d Max LSP lifetime %us must be 300s greater than "
2521 "the configured LSP refresh interval %us%s",
2522 lvl
, interval
, area
->lsp_refresh
[lvl
-1], VTY_NEWLINE
);
2523 vty_out (vty
, "Automatically reducing level %d LSP refresh interval "
2524 "to %us%s", lvl
, refresh_interval
, VTY_NEWLINE
);
2525 set_refresh_interval
[lvl
-1] = 1;
2527 if (refresh_interval
<= area
->lsp_gen_interval
[lvl
-1])
2529 vty_out (vty
, "LSP refresh interval %us must be greater than "
2530 "the configured LSP gen interval %us%s",
2531 refresh_interval
, area
->lsp_gen_interval
[lvl
-1],
2533 return CMD_ERR_AMBIGUOUS
;
2538 for (lvl
= IS_LEVEL_1
; lvl
<= IS_LEVEL_2
; lvl
++)
2542 area
->max_lsp_lifetime
[lvl
-1] = interval
;
2543 /* Automatically reducing lsp_refresh_interval to interval - 300 */
2544 if (set_refresh_interval
[lvl
-1])
2545 area
->lsp_refresh
[lvl
-1] = refresh_interval
;
2548 lsp_regenerate_schedule (area
, level
, 1);
2553 DEFUN (max_lsp_lifetime
,
2554 max_lsp_lifetime_cmd
,
2555 "max-lsp-lifetime <350-65535>",
2556 "Maximum LSP lifetime\n"
2557 "LSP lifetime in seconds\n")
2559 struct isis_area
*area
;
2564 interval
= atoi (argv
[0]);
2565 level
= IS_LEVEL_1
| IS_LEVEL_2
;
2566 return set_lsp_max_lifetime (vty
, area
, interval
, level
);
2569 DEFUN (no_max_lsp_lifetime
,
2570 no_max_lsp_lifetime_cmd
,
2571 "no max-lsp-lifetime",
2573 "LSP lifetime in seconds\n")
2575 struct isis_area
*area
;
2580 interval
= DEFAULT_LSP_LIFETIME
;
2581 level
= IS_LEVEL_1
| IS_LEVEL_2
;
2582 return set_lsp_max_lifetime (vty
, area
, interval
, level
);
2585 ALIAS (no_max_lsp_lifetime
,
2586 no_max_lsp_lifetime_arg_cmd
,
2587 "no max-lsp-lifetime <350-65535>",
2589 "Maximum LSP lifetime\n"
2590 "LSP lifetime in seconds\n")
2592 DEFUN (max_lsp_lifetime_l1
,
2593 max_lsp_lifetime_l1_cmd
,
2594 "max-lsp-lifetime level-1 <350-65535>",
2595 "Maximum LSP lifetime for Level 1 only\n"
2596 "LSP lifetime for Level 1 only in seconds\n")
2598 struct isis_area
*area
;
2603 interval
= atoi (argv
[0]);
2605 return set_lsp_max_lifetime (vty
, area
, interval
, level
);
2608 DEFUN (no_max_lsp_lifetime_l1
,
2609 no_max_lsp_lifetime_l1_cmd
,
2610 "no max-lsp-lifetime level-1",
2612 "LSP lifetime for Level 1 only in seconds\n")
2614 struct isis_area
*area
;
2619 interval
= DEFAULT_LSP_LIFETIME
;
2621 return set_lsp_max_lifetime (vty
, area
, interval
, level
);
2624 ALIAS (no_max_lsp_lifetime_l1
,
2625 no_max_lsp_lifetime_l1_arg_cmd
,
2626 "no max-lsp-lifetime level-1 <350-65535>",
2628 "Maximum LSP lifetime for Level 1 only\n"
2629 "LSP lifetime for Level 1 only in seconds\n")
2631 DEFUN (max_lsp_lifetime_l2
,
2632 max_lsp_lifetime_l2_cmd
,
2633 "max-lsp-lifetime level-2 <350-65535>",
2634 "Maximum LSP lifetime for Level 2 only\n"
2635 "LSP lifetime for Level 2 only in seconds\n")
2637 struct isis_area
*area
;
2642 interval
= atoi (argv
[0]);
2644 return set_lsp_max_lifetime (vty
, area
, interval
, level
);
2647 DEFUN (no_max_lsp_lifetime_l2
,
2648 no_max_lsp_lifetime_l2_cmd
,
2649 "no max-lsp-lifetime level-2",
2651 "LSP lifetime for Level 2 only in seconds\n")
2653 struct isis_area
*area
;
2658 interval
= DEFAULT_LSP_LIFETIME
;
2660 return set_lsp_max_lifetime (vty
, area
, interval
, level
);
2663 ALIAS (no_max_lsp_lifetime_l2
,
2664 no_max_lsp_lifetime_l2_arg_cmd
,
2665 "no max-lsp-lifetime level-2 <350-65535>",
2667 "Maximum LSP lifetime for Level 2 only\n"
2668 "LSP lifetime for Level 2 only in seconds\n")
2671 set_lsp_refresh_interval (struct vty
*vty
, struct isis_area
*area
,
2672 uint16_t interval
, int level
)
2676 for (lvl
= IS_LEVEL_1
; lvl
<= IS_LEVEL_2
; ++lvl
)
2680 if (interval
<= area
->lsp_gen_interval
[lvl
-1])
2682 vty_out (vty
, "LSP refresh interval %us must be greater than "
2683 "the configured LSP gen interval %us%s",
2684 interval
, area
->lsp_gen_interval
[lvl
-1],
2686 return CMD_ERR_AMBIGUOUS
;
2688 if (interval
> (area
->max_lsp_lifetime
[lvl
-1] - 300))
2690 vty_out (vty
, "LSP refresh interval %us must be less than "
2691 "the configured LSP lifetime %us less 300%s",
2692 interval
, area
->max_lsp_lifetime
[lvl
-1],
2694 return CMD_ERR_AMBIGUOUS
;
2698 for (lvl
= IS_LEVEL_1
; lvl
<= IS_LEVEL_2
; ++lvl
)
2702 area
->lsp_refresh
[lvl
-1] = interval
;
2704 lsp_regenerate_schedule (area
, level
, 1);
2709 DEFUN (lsp_refresh_interval
,
2710 lsp_refresh_interval_cmd
,
2711 "lsp-refresh-interval <1-65235>",
2712 "LSP refresh interval\n"
2713 "LSP refresh interval in seconds\n")
2715 struct isis_area
*area
;
2720 interval
= atoi (argv
[0]);
2721 level
= IS_LEVEL_1
| IS_LEVEL_2
;
2722 return set_lsp_refresh_interval (vty
, area
, interval
, level
);
2725 DEFUN (no_lsp_refresh_interval
,
2726 no_lsp_refresh_interval_cmd
,
2727 "no lsp-refresh-interval",
2729 "LSP refresh interval in seconds\n")
2731 struct isis_area
*area
;
2736 interval
= DEFAULT_MAX_LSP_GEN_INTERVAL
;
2737 level
= IS_LEVEL_1
| IS_LEVEL_2
;
2738 return set_lsp_refresh_interval (vty
, area
, interval
, level
);
2741 ALIAS (no_lsp_refresh_interval
,
2742 no_lsp_refresh_interval_arg_cmd
,
2743 "no lsp-refresh-interval <1-65235>",
2745 "LSP refresh interval\n"
2746 "LSP refresh interval in seconds\n")
2748 DEFUN (lsp_refresh_interval_l1
,
2749 lsp_refresh_interval_l1_cmd
,
2750 "lsp-refresh-interval level-1 <1-65235>",
2751 "LSP refresh interval for Level 1 only\n"
2752 "LSP refresh interval for Level 1 only in seconds\n")
2754 struct isis_area
*area
;
2759 interval
= atoi (argv
[0]);
2761 return set_lsp_refresh_interval (vty
, area
, interval
, level
);
2764 DEFUN (no_lsp_refresh_interval_l1
,
2765 no_lsp_refresh_interval_l1_cmd
,
2766 "no lsp-refresh-interval level-1",
2768 "LSP refresh interval for Level 1 only in seconds\n")
2770 struct isis_area
*area
;
2775 interval
= DEFAULT_MAX_LSP_GEN_INTERVAL
;
2777 return set_lsp_refresh_interval (vty
, area
, interval
, level
);
2780 ALIAS (no_lsp_refresh_interval_l1
,
2781 no_lsp_refresh_interval_l1_arg_cmd
,
2782 "no lsp-refresh-interval level-1 <1-65235>",
2784 "LSP refresh interval for Level 1 only\n"
2785 "LSP refresh interval for Level 1 only in seconds\n")
2787 DEFUN (lsp_refresh_interval_l2
,
2788 lsp_refresh_interval_l2_cmd
,
2789 "lsp-refresh-interval level-2 <1-65235>",
2790 "LSP refresh interval for Level 2 only\n"
2791 "LSP refresh interval for Level 2 only in seconds\n")
2793 struct isis_area
*area
;
2798 interval
= atoi (argv
[0]);
2800 return set_lsp_refresh_interval (vty
, area
, interval
, level
);
2803 DEFUN (no_lsp_refresh_interval_l2
,
2804 no_lsp_refresh_interval_l2_cmd
,
2805 "no lsp-refresh-interval level-2",
2807 "LSP refresh interval for Level 2 only in seconds\n")
2809 struct isis_area
*area
;
2814 interval
= DEFAULT_MAX_LSP_GEN_INTERVAL
;
2816 return set_lsp_refresh_interval (vty
, area
, interval
, level
);
2819 ALIAS (no_lsp_refresh_interval_l2
,
2820 no_lsp_refresh_interval_l2_arg_cmd
,
2821 "no lsp-refresh-interval level-2 <1-65235>",
2823 "LSP refresh interval for Level 2 only\n"
2824 "LSP refresh interval for Level 2 only in seconds\n")
2826 DEFUN (log_adj_changes
,
2827 log_adj_changes_cmd
,
2828 "log-adjacency-changes",
2829 "Log changes in adjacency state\n")
2831 struct isis_area
*area
;
2836 area
->log_adj_changes
= 1;
2841 DEFUN (no_log_adj_changes
,
2842 no_log_adj_changes_cmd
,
2843 "no log-adjacency-changes",
2844 "Stop logging changes in adjacency state\n")
2846 struct isis_area
*area
;
2851 area
->log_adj_changes
= 0;
2856 #ifdef TOPOLOGY_GENERATE
2858 DEFUN (topology_generate_grid
,
2859 topology_generate_grid_cmd
,
2860 "topology generate grid <1-100> <1-100> <1-65000> [param] [param] "
2862 "Topology generation for IS-IS\n"
2863 "Topology generation\n"
2865 "X parameter of the grid\n"
2866 "Y parameter of the grid\n"
2868 "Optional param 1\n"
2869 "Optional param 2\n"
2870 "Optional param 3\n"
2873 struct isis_area
*area
;
2878 if (!spgrid_check_params (vty
, argc
, argv
))
2881 list_delete (area
->topology
);
2882 area
->topology
= list_new ();
2883 memcpy (area
->top_params
, vty
->buf
, 200);
2884 gen_spgrid_topology (vty
, area
->topology
);
2885 remove_topology_lsps (area
);
2886 generate_topology_lsps (area
);
2887 /* Regenerate L1 LSP to get two way connection to the generated
2889 lsp_regenerate_schedule (area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
2895 DEFUN (show_isis_generated_topology
,
2896 show_isis_generated_topology_cmd
,
2897 "show isis generated-topologies",
2899 "ISIS network information\n"
2900 "Show generated topologies\n")
2902 struct isis_area
*area
;
2903 struct listnode
*node
;
2904 struct listnode
*node2
;
2907 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, node
, area
))
2909 if (!area
->topology
)
2912 vty_out (vty
, "Topology for isis area: %s%s", area
->area_tag
,
2914 vty_out (vty
, "From node To node Distance%s", VTY_NEWLINE
);
2916 for (ALL_LIST_ELEMENTS_RO (area
->topology
, node2
, arc
))
2917 vty_out (vty
, "%9ld %11ld %12ld%s", arc
->from_node
, arc
->to_node
,
2918 arc
->distance
, VTY_NEWLINE
);
2923 /* Base IS for topology generation. */
2924 DEFUN (topology_baseis
,
2925 topology_baseis_cmd
,
2926 "topology base-is WORD",
2927 "Topology generation for IS-IS\n"
2928 "A Network IS Base for this topology\n"
2929 "XXXX.XXXX.XXXX Network entity title (NET)\n")
2931 struct isis_area
*area
;
2932 u_char buff
[ISIS_SYS_ID_LEN
];
2937 if (sysid2buff (buff
, argv
[0]))
2938 sysid2buff (area
->topology_baseis
, argv
[0]);
2943 DEFUN (no_topology_baseis
,
2944 no_topology_baseis_cmd
,
2945 "no topology base-is WORD",
2947 "Topology generation for IS-IS\n"
2948 "A Network IS Base for this topology\n"
2949 "XXXX.XXXX.XXXX Network entity title (NET)\n")
2951 struct isis_area
*area
;
2956 memcpy (area
->topology_baseis
, DEFAULT_TOPOLOGY_BASEIS
, ISIS_SYS_ID_LEN
);
2960 ALIAS (no_topology_baseis
,
2961 no_topology_baseis_noid_cmd
,
2962 "no topology base-is",
2964 "Topology generation for IS-IS\n"
2965 "A Network IS Base for this topology\n")
2967 DEFUN (topology_basedynh
,
2968 topology_basedynh_cmd
,
2969 "topology base-dynh WORD",
2970 "Topology generation for IS-IS\n"
2971 "Dynamic hostname base for this topology\n"
2972 "Dynamic hostname base\n")
2974 struct isis_area
*area
;
2979 /* I hope that it's enough. */
2980 area
->topology_basedynh
= strndup (argv
[0], 16);
2984 #endif /* TOPOLOGY_GENERATE */
2986 /* IS-IS configuration write function */
2988 isis_config_write (struct vty
*vty
)
2994 struct isis_area
*area
;
2995 struct listnode
*node
, *node2
;
2997 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, node
, area
))
2999 /* ISIS - Area name */
3000 vty_out (vty
, "router isis %s%s", area
->area_tag
, VTY_NEWLINE
);
3003 if (listcount (area
->area_addrs
) > 0)
3005 struct area_addr
*area_addr
;
3006 for (ALL_LIST_ELEMENTS_RO (area
->area_addrs
, node2
, area_addr
))
3008 vty_out (vty
, " net %s%s",
3009 isonet_print (area_addr
->area_addr
,
3010 area_addr
->addr_len
+ ISIS_SYS_ID_LEN
+
3015 /* ISIS - Dynamic hostname - Defaults to true so only display if
3017 if (!area
->dynhostname
)
3019 vty_out (vty
, " no hostname dynamic%s", VTY_NEWLINE
);
3022 /* ISIS - Metric-Style - when true displays wide */
3023 if (area
->newmetric
)
3025 if (!area
->oldmetric
)
3026 vty_out (vty
, " metric-style wide%s", VTY_NEWLINE
);
3028 vty_out (vty
, " metric-style transition%s", VTY_NEWLINE
);
3033 vty_out (vty
, " metric-style narrow%s", VTY_NEWLINE
);
3036 /* ISIS - overload-bit */
3037 if (area
->overload_bit
)
3039 vty_out (vty
, " set-overload-bit%s", VTY_NEWLINE
);
3042 /* ISIS - Area is-type (level-1-2 is default) */
3043 if (area
->is_type
== IS_LEVEL_1
)
3045 vty_out (vty
, " is-type level-1%s", VTY_NEWLINE
);
3048 else if (area
->is_type
== IS_LEVEL_2
)
3050 vty_out (vty
, " is-type level-2-only%s", VTY_NEWLINE
);
3053 /* ISIS - Lsp generation interval */
3054 if (area
->lsp_gen_interval
[0] == area
->lsp_gen_interval
[1])
3056 if (area
->lsp_gen_interval
[0] != DEFAULT_MIN_LSP_GEN_INTERVAL
)
3058 vty_out (vty
, " lsp-gen-interval %d%s",
3059 area
->lsp_gen_interval
[0], VTY_NEWLINE
);
3065 if (area
->lsp_gen_interval
[0] != DEFAULT_MIN_LSP_GEN_INTERVAL
)
3067 vty_out (vty
, " lsp-gen-interval level-1 %d%s",
3068 area
->lsp_gen_interval
[0], VTY_NEWLINE
);
3071 if (area
->lsp_gen_interval
[1] != DEFAULT_MIN_LSP_GEN_INTERVAL
)
3073 vty_out (vty
, " lsp-gen-interval level-2 %d%s",
3074 area
->lsp_gen_interval
[1], VTY_NEWLINE
);
3078 /* ISIS - LSP lifetime */
3079 if (area
->max_lsp_lifetime
[0] == area
->max_lsp_lifetime
[1])
3081 if (area
->max_lsp_lifetime
[0] != DEFAULT_LSP_LIFETIME
)
3083 vty_out (vty
, " max-lsp-lifetime %u%s", area
->max_lsp_lifetime
[0],
3090 if (area
->max_lsp_lifetime
[0] != DEFAULT_LSP_LIFETIME
)
3092 vty_out (vty
, " max-lsp-lifetime level-1 %u%s",
3093 area
->max_lsp_lifetime
[0], VTY_NEWLINE
);
3096 if (area
->max_lsp_lifetime
[1] != DEFAULT_LSP_LIFETIME
)
3098 vty_out (vty
, " max-lsp-lifetime level-2 %u%s",
3099 area
->max_lsp_lifetime
[1], VTY_NEWLINE
);
3103 /* ISIS - LSP refresh interval */
3104 if (area
->lsp_refresh
[0] == area
->lsp_refresh
[1])
3106 if (area
->lsp_refresh
[0] != DEFAULT_MAX_LSP_GEN_INTERVAL
)
3108 vty_out (vty
, " lsp-refresh-interval %u%s", area
->lsp_refresh
[0],
3115 if (area
->lsp_refresh
[0] != DEFAULT_MAX_LSP_GEN_INTERVAL
)
3117 vty_out (vty
, " lsp-refresh-interval level-1 %u%s",
3118 area
->lsp_refresh
[0], VTY_NEWLINE
);
3121 if (area
->lsp_refresh
[1] != DEFAULT_MAX_LSP_GEN_INTERVAL
)
3123 vty_out (vty
, " lsp-refresh-interval level-2 %u%s",
3124 area
->lsp_refresh
[1], VTY_NEWLINE
);
3128 if (area
->lsp_mtu
!= DEFAULT_LSP_MTU
)
3130 vty_out(vty
, " lsp-mtu %u%s", area
->lsp_mtu
, VTY_NEWLINE
);
3134 /* Minimum SPF interval. */
3135 if (area
->min_spf_interval
[0] == area
->min_spf_interval
[1])
3137 if (area
->min_spf_interval
[0] != MINIMUM_SPF_INTERVAL
)
3139 vty_out (vty
, " spf-interval %d%s",
3140 area
->min_spf_interval
[0], VTY_NEWLINE
);
3146 if (area
->min_spf_interval
[0] != MINIMUM_SPF_INTERVAL
)
3148 vty_out (vty
, " spf-interval level-1 %d%s",
3149 area
->min_spf_interval
[0], VTY_NEWLINE
);
3152 if (area
->min_spf_interval
[1] != MINIMUM_SPF_INTERVAL
)
3154 vty_out (vty
, " spf-interval level-2 %d%s",
3155 area
->min_spf_interval
[1], VTY_NEWLINE
);
3159 /* Authentication passwords. */
3160 if (area
->area_passwd
.type
== ISIS_PASSWD_TYPE_HMAC_MD5
)
3162 vty_out(vty
, " area-password md5 %s", area
->area_passwd
.passwd
);
3163 if (CHECK_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_SEND
))
3165 vty_out(vty
, " authenticate snp ");
3166 if (CHECK_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_RECV
))
3167 vty_out(vty
, "validate");
3169 vty_out(vty
, "send-only");
3171 vty_out(vty
, "%s", VTY_NEWLINE
);
3174 else if (area
->area_passwd
.type
== ISIS_PASSWD_TYPE_CLEARTXT
)
3176 vty_out(vty
, " area-password clear %s", area
->area_passwd
.passwd
);
3177 if (CHECK_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_SEND
))
3179 vty_out(vty
, " authenticate snp ");
3180 if (CHECK_FLAG(area
->area_passwd
.snp_auth
, SNP_AUTH_RECV
))
3181 vty_out(vty
, "validate");
3183 vty_out(vty
, "send-only");
3185 vty_out(vty
, "%s", VTY_NEWLINE
);
3188 if (area
->domain_passwd
.type
== ISIS_PASSWD_TYPE_HMAC_MD5
)
3190 vty_out(vty
, " domain-password md5 %s",
3191 area
->domain_passwd
.passwd
);
3192 if (CHECK_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_SEND
))
3194 vty_out(vty
, " authenticate snp ");
3195 if (CHECK_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_RECV
))
3196 vty_out(vty
, "validate");
3198 vty_out(vty
, "send-only");
3200 vty_out(vty
, "%s", VTY_NEWLINE
);
3203 else if (area
->domain_passwd
.type
== ISIS_PASSWD_TYPE_CLEARTXT
)
3205 vty_out(vty
, " domain-password clear %s",
3206 area
->domain_passwd
.passwd
);
3207 if (CHECK_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_SEND
))
3209 vty_out(vty
, " authenticate snp ");
3210 if (CHECK_FLAG(area
->domain_passwd
.snp_auth
, SNP_AUTH_RECV
))
3211 vty_out(vty
, "validate");
3213 vty_out(vty
, "send-only");
3215 vty_out(vty
, "%s", VTY_NEWLINE
);
3219 if (area
->log_adj_changes
)
3221 vty_out (vty
, " log-adjacency-changes%s", VTY_NEWLINE
);
3225 #ifdef TOPOLOGY_GENERATE
3226 if (memcmp (area
->topology_baseis
, DEFAULT_TOPOLOGY_BASEIS
,
3229 vty_out (vty
, " topology base-is %s%s",
3230 sysid_print ((u_char
*)area
->topology_baseis
), VTY_NEWLINE
);
3233 if (area
->topology_basedynh
)
3235 vty_out (vty
, " topology base-dynh %s%s",
3236 area
->topology_basedynh
, VTY_NEWLINE
);
3239 /* We save the whole command line here. */
3240 if (strlen(area
->top_params
))
3242 vty_out (vty
, " %s%s", area
->top_params
, VTY_NEWLINE
);
3245 #endif /* TOPOLOGY_GENERATE */
3253 struct cmd_node isis_node
= {
3255 "%s(config-router)# ",
3262 /* Install IS-IS top node */
3263 install_node (&isis_node
, isis_config_write
);
3265 install_element (VIEW_NODE
, &show_isis_summary_cmd
);
3267 install_element (VIEW_NODE
, &show_isis_interface_cmd
);
3268 install_element (VIEW_NODE
, &show_isis_interface_detail_cmd
);
3269 install_element (VIEW_NODE
, &show_isis_interface_arg_cmd
);
3271 install_element (VIEW_NODE
, &show_isis_neighbor_cmd
);
3272 install_element (VIEW_NODE
, &show_isis_neighbor_detail_cmd
);
3273 install_element (VIEW_NODE
, &show_isis_neighbor_arg_cmd
);
3274 install_element (VIEW_NODE
, &clear_isis_neighbor_cmd
);
3275 install_element (VIEW_NODE
, &clear_isis_neighbor_arg_cmd
);
3277 install_element (VIEW_NODE
, &show_hostname_cmd
);
3278 install_element (VIEW_NODE
, &show_database_cmd
);
3279 install_element (VIEW_NODE
, &show_database_arg_cmd
);
3280 install_element (VIEW_NODE
, &show_database_arg_detail_cmd
);
3281 install_element (VIEW_NODE
, &show_database_detail_cmd
);
3282 install_element (VIEW_NODE
, &show_database_detail_arg_cmd
);
3284 install_element (ENABLE_NODE
, &show_isis_summary_cmd
);
3286 install_element (ENABLE_NODE
, &show_isis_interface_cmd
);
3287 install_element (ENABLE_NODE
, &show_isis_interface_detail_cmd
);
3288 install_element (ENABLE_NODE
, &show_isis_interface_arg_cmd
);
3290 install_element (ENABLE_NODE
, &show_isis_neighbor_cmd
);
3291 install_element (ENABLE_NODE
, &show_isis_neighbor_detail_cmd
);
3292 install_element (ENABLE_NODE
, &show_isis_neighbor_arg_cmd
);
3293 install_element (ENABLE_NODE
, &clear_isis_neighbor_cmd
);
3294 install_element (ENABLE_NODE
, &clear_isis_neighbor_arg_cmd
);
3296 install_element (ENABLE_NODE
, &show_hostname_cmd
);
3297 install_element (ENABLE_NODE
, &show_database_cmd
);
3298 install_element (ENABLE_NODE
, &show_database_arg_cmd
);
3299 install_element (ENABLE_NODE
, &show_database_arg_detail_cmd
);
3300 install_element (ENABLE_NODE
, &show_database_detail_cmd
);
3301 install_element (ENABLE_NODE
, &show_database_detail_arg_cmd
);
3302 install_element (ENABLE_NODE
, &show_debugging_cmd
);
3304 install_node (&debug_node
, config_write_debug
);
3306 install_element (ENABLE_NODE
, &debug_isis_adj_cmd
);
3307 install_element (ENABLE_NODE
, &no_debug_isis_adj_cmd
);
3308 install_element (ENABLE_NODE
, &debug_isis_csum_cmd
);
3309 install_element (ENABLE_NODE
, &no_debug_isis_csum_cmd
);
3310 install_element (ENABLE_NODE
, &debug_isis_lupd_cmd
);
3311 install_element (ENABLE_NODE
, &no_debug_isis_lupd_cmd
);
3312 install_element (ENABLE_NODE
, &debug_isis_err_cmd
);
3313 install_element (ENABLE_NODE
, &no_debug_isis_err_cmd
);
3314 install_element (ENABLE_NODE
, &debug_isis_snp_cmd
);
3315 install_element (ENABLE_NODE
, &no_debug_isis_snp_cmd
);
3316 install_element (ENABLE_NODE
, &debug_isis_upd_cmd
);
3317 install_element (ENABLE_NODE
, &no_debug_isis_upd_cmd
);
3318 install_element (ENABLE_NODE
, &debug_isis_spfevents_cmd
);
3319 install_element (ENABLE_NODE
, &no_debug_isis_spfevents_cmd
);
3320 install_element (ENABLE_NODE
, &debug_isis_spfstats_cmd
);
3321 install_element (ENABLE_NODE
, &no_debug_isis_spfstats_cmd
);
3322 install_element (ENABLE_NODE
, &debug_isis_spftrigg_cmd
);
3323 install_element (ENABLE_NODE
, &no_debug_isis_spftrigg_cmd
);
3324 install_element (ENABLE_NODE
, &debug_isis_rtevents_cmd
);
3325 install_element (ENABLE_NODE
, &no_debug_isis_rtevents_cmd
);
3326 install_element (ENABLE_NODE
, &debug_isis_events_cmd
);
3327 install_element (ENABLE_NODE
, &no_debug_isis_events_cmd
);
3328 install_element (ENABLE_NODE
, &debug_isis_packet_dump_cmd
);
3329 install_element (ENABLE_NODE
, &no_debug_isis_packet_dump_cmd
);
3330 install_element (ENABLE_NODE
, &debug_isis_lsp_gen_cmd
);
3331 install_element (ENABLE_NODE
, &no_debug_isis_lsp_gen_cmd
);
3332 install_element (ENABLE_NODE
, &debug_isis_lsp_sched_cmd
);
3333 install_element (ENABLE_NODE
, &no_debug_isis_lsp_sched_cmd
);
3335 install_element (CONFIG_NODE
, &debug_isis_adj_cmd
);
3336 install_element (CONFIG_NODE
, &no_debug_isis_adj_cmd
);
3337 install_element (CONFIG_NODE
, &debug_isis_csum_cmd
);
3338 install_element (CONFIG_NODE
, &no_debug_isis_csum_cmd
);
3339 install_element (CONFIG_NODE
, &debug_isis_lupd_cmd
);
3340 install_element (CONFIG_NODE
, &no_debug_isis_lupd_cmd
);
3341 install_element (CONFIG_NODE
, &debug_isis_err_cmd
);
3342 install_element (CONFIG_NODE
, &no_debug_isis_err_cmd
);
3343 install_element (CONFIG_NODE
, &debug_isis_snp_cmd
);
3344 install_element (CONFIG_NODE
, &no_debug_isis_snp_cmd
);
3345 install_element (CONFIG_NODE
, &debug_isis_upd_cmd
);
3346 install_element (CONFIG_NODE
, &no_debug_isis_upd_cmd
);
3347 install_element (CONFIG_NODE
, &debug_isis_spfevents_cmd
);
3348 install_element (CONFIG_NODE
, &no_debug_isis_spfevents_cmd
);
3349 install_element (CONFIG_NODE
, &debug_isis_spfstats_cmd
);
3350 install_element (CONFIG_NODE
, &no_debug_isis_spfstats_cmd
);
3351 install_element (CONFIG_NODE
, &debug_isis_spftrigg_cmd
);
3352 install_element (CONFIG_NODE
, &no_debug_isis_spftrigg_cmd
);
3353 install_element (CONFIG_NODE
, &debug_isis_rtevents_cmd
);
3354 install_element (CONFIG_NODE
, &no_debug_isis_rtevents_cmd
);
3355 install_element (CONFIG_NODE
, &debug_isis_events_cmd
);
3356 install_element (CONFIG_NODE
, &no_debug_isis_events_cmd
);
3357 install_element (CONFIG_NODE
, &debug_isis_packet_dump_cmd
);
3358 install_element (CONFIG_NODE
, &no_debug_isis_packet_dump_cmd
);
3359 install_element (CONFIG_NODE
, &debug_isis_lsp_gen_cmd
);
3360 install_element (CONFIG_NODE
, &no_debug_isis_lsp_gen_cmd
);
3361 install_element (CONFIG_NODE
, &debug_isis_lsp_sched_cmd
);
3362 install_element (CONFIG_NODE
, &no_debug_isis_lsp_sched_cmd
);
3364 install_element (CONFIG_NODE
, &router_isis_cmd
);
3365 install_element (CONFIG_NODE
, &no_router_isis_cmd
);
3367 install_default (ISIS_NODE
);
3369 install_element (ISIS_NODE
, &net_cmd
);
3370 install_element (ISIS_NODE
, &no_net_cmd
);
3372 install_element (ISIS_NODE
, &is_type_cmd
);
3373 install_element (ISIS_NODE
, &no_is_type_cmd
);
3375 install_element (ISIS_NODE
, &area_lsp_mtu_cmd
);
3376 install_element (ISIS_NODE
, &no_area_lsp_mtu_cmd
);
3377 install_element (ISIS_NODE
, &no_area_lsp_mtu_arg_cmd
);
3379 install_element (ISIS_NODE
, &area_passwd_md5_cmd
);
3380 install_element (ISIS_NODE
, &area_passwd_md5_snpauth_cmd
);
3381 install_element (ISIS_NODE
, &area_passwd_clear_cmd
);
3382 install_element (ISIS_NODE
, &area_passwd_clear_snpauth_cmd
);
3383 install_element (ISIS_NODE
, &no_area_passwd_cmd
);
3385 install_element (ISIS_NODE
, &domain_passwd_md5_cmd
);
3386 install_element (ISIS_NODE
, &domain_passwd_md5_snpauth_cmd
);
3387 install_element (ISIS_NODE
, &domain_passwd_clear_cmd
);
3388 install_element (ISIS_NODE
, &domain_passwd_clear_snpauth_cmd
);
3389 install_element (ISIS_NODE
, &no_domain_passwd_cmd
);
3391 install_element (ISIS_NODE
, &lsp_gen_interval_cmd
);
3392 install_element (ISIS_NODE
, &no_lsp_gen_interval_cmd
);
3393 install_element (ISIS_NODE
, &no_lsp_gen_interval_arg_cmd
);
3394 install_element (ISIS_NODE
, &lsp_gen_interval_l1_cmd
);
3395 install_element (ISIS_NODE
, &no_lsp_gen_interval_l1_cmd
);
3396 install_element (ISIS_NODE
, &no_lsp_gen_interval_l1_arg_cmd
);
3397 install_element (ISIS_NODE
, &lsp_gen_interval_l2_cmd
);
3398 install_element (ISIS_NODE
, &no_lsp_gen_interval_l2_cmd
);
3399 install_element (ISIS_NODE
, &no_lsp_gen_interval_l2_arg_cmd
);
3401 install_element (ISIS_NODE
, &spf_interval_cmd
);
3402 install_element (ISIS_NODE
, &no_spf_interval_cmd
);
3403 install_element (ISIS_NODE
, &no_spf_interval_arg_cmd
);
3404 install_element (ISIS_NODE
, &spf_interval_l1_cmd
);
3405 install_element (ISIS_NODE
, &no_spf_interval_l1_cmd
);
3406 install_element (ISIS_NODE
, &no_spf_interval_l1_arg_cmd
);
3407 install_element (ISIS_NODE
, &spf_interval_l2_cmd
);
3408 install_element (ISIS_NODE
, &no_spf_interval_l2_cmd
);
3409 install_element (ISIS_NODE
, &no_spf_interval_l2_arg_cmd
);
3411 install_element (ISIS_NODE
, &max_lsp_lifetime_cmd
);
3412 install_element (ISIS_NODE
, &no_max_lsp_lifetime_cmd
);
3413 install_element (ISIS_NODE
, &no_max_lsp_lifetime_arg_cmd
);
3414 install_element (ISIS_NODE
, &max_lsp_lifetime_l1_cmd
);
3415 install_element (ISIS_NODE
, &no_max_lsp_lifetime_l1_cmd
);
3416 install_element (ISIS_NODE
, &no_max_lsp_lifetime_l1_arg_cmd
);
3417 install_element (ISIS_NODE
, &max_lsp_lifetime_l2_cmd
);
3418 install_element (ISIS_NODE
, &no_max_lsp_lifetime_l2_cmd
);
3419 install_element (ISIS_NODE
, &no_max_lsp_lifetime_l2_arg_cmd
);
3421 install_element (ISIS_NODE
, &lsp_refresh_interval_cmd
);
3422 install_element (ISIS_NODE
, &no_lsp_refresh_interval_cmd
);
3423 install_element (ISIS_NODE
, &no_lsp_refresh_interval_arg_cmd
);
3424 install_element (ISIS_NODE
, &lsp_refresh_interval_l1_cmd
);
3425 install_element (ISIS_NODE
, &no_lsp_refresh_interval_l1_cmd
);
3426 install_element (ISIS_NODE
, &no_lsp_refresh_interval_l1_arg_cmd
);
3427 install_element (ISIS_NODE
, &lsp_refresh_interval_l2_cmd
);
3428 install_element (ISIS_NODE
, &no_lsp_refresh_interval_l2_cmd
);
3429 install_element (ISIS_NODE
, &no_lsp_refresh_interval_l2_arg_cmd
);
3431 install_element (ISIS_NODE
, &set_overload_bit_cmd
);
3432 install_element (ISIS_NODE
, &no_set_overload_bit_cmd
);
3434 install_element (ISIS_NODE
, &set_attached_bit_cmd
);
3435 install_element (ISIS_NODE
, &no_set_attached_bit_cmd
);
3437 install_element (ISIS_NODE
, &dynamic_hostname_cmd
);
3438 install_element (ISIS_NODE
, &no_dynamic_hostname_cmd
);
3440 install_element (ISIS_NODE
, &metric_style_cmd
);
3441 install_element (ISIS_NODE
, &no_metric_style_cmd
);
3443 install_element (ISIS_NODE
, &log_adj_changes_cmd
);
3444 install_element (ISIS_NODE
, &no_log_adj_changes_cmd
);
3446 #ifdef TOPOLOGY_GENERATE
3447 install_element (ISIS_NODE
, &topology_generate_grid_cmd
);
3448 install_element (ISIS_NODE
, &topology_baseis_cmd
);
3449 install_element (ISIS_NODE
, &topology_basedynh_cmd
);
3450 install_element (ISIS_NODE
, &no_topology_baseis_cmd
);
3451 install_element (ISIS_NODE
, &no_topology_baseis_noid_cmd
);
3452 install_element (VIEW_NODE
, &show_isis_generated_topology_cmd
);
3453 install_element (ENABLE_NODE
, &show_isis_generated_topology_cmd
);
3454 #endif /* TOPOLOGY_GENERATE */