blob: 1f0167bb0171189c3975efd229ec7a85c8f404ba [file] [log] [blame]
jardineb5d44e2003-12-23 08:09:43 +00001/*
2 * IS-IS Rout(e)ing protocol - isisd.c
3 *
4 * Copyright (C) 2001,2002 Sampo Saaristo
5 * Tampere University of Technology
6 * Institute of Communications Engineering
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public Licenseas published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
17
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 */
22
jardineb5d44e2003-12-23 08:09:43 +000023#include <zebra.h>
jardineb5d44e2003-12-23 08:09:43 +000024
25#include "thread.h"
26#include "vty.h"
27#include "command.h"
28#include "log.h"
29#include "memory.h"
30#include "linklist.h"
31#include "if.h"
32#include "hash.h"
33#include "stream.h"
34#include "prefix.h"
35#include "table.h"
36
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
56#ifdef TOPOLOGY_GENERATE
57#include "spgrid.h"
hassof390d2c2004-09-10 20:48:21 +000058u_char DEFAULT_TOPOLOGY_BASEIS[6] = { 0xFE, 0xED, 0xFE, 0xED, 0x00, 0x00 };
jardineb5d44e2003-12-23 08:09:43 +000059#endif /* TOPOLOGY_GENERATE */
60
jardineb5d44e2003-12-23 08:09:43 +000061struct isis *isis = NULL;
hasso73d1aea2004-09-24 10:45:28 +000062extern struct thread_master *master;
jardineb5d44e2003-12-23 08:09:43 +000063
jardineb5d44e2003-12-23 08:09:43 +000064void
65isis_new (unsigned long process_id)
66{
hassoaac372f2005-09-01 17:52:33 +000067 isis = XCALLOC (MTYPE_ISIS, sizeof (struct isis));
jardineb5d44e2003-12-23 08:09:43 +000068 /*
69 * Default values
70 */
71 isis->max_area_addrs = 3;
72
73 isis->process_id = process_id;
74 isis->area_list = list_new ();
75 isis->init_circ_list = list_new ();
76 isis->uptime = time (NULL);
77 isis->nexthops = list_new ();
78#ifdef HAVE_IPV6
79 isis->nexthops6 = list_new ();
80#endif /* HAVE_IPV6 */
81 /*
82 * uncomment the next line for full debugs
83 */
hassof390d2c2004-09-10 20:48:21 +000084 /* isis->debugs = 0xFFFF; */
jardineb5d44e2003-12-23 08:09:43 +000085}
86
87struct isis_area *
88isis_area_create ()
89{
jardineb5d44e2003-12-23 08:09:43 +000090 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +000091
hassoaac372f2005-09-01 17:52:33 +000092 area = XCALLOC (MTYPE_ISIS_AREA, sizeof (struct isis_area));
jardineb5d44e2003-12-23 08:09:43 +000093
94 /*
95 * The first instance is level-1-2 rest are level-1, unless otherwise
96 * configured
97 */
98 if (listcount (isis->area_list) > 0)
99 area->is_type = IS_LEVEL_1;
100 else
101 area->is_type = IS_LEVEL_1_AND_2;
102 /*
103 * intialize the databases
104 */
105 area->lspdb[0] = lsp_db_init ();
106 area->lspdb[1] = lsp_db_init ();
hassof390d2c2004-09-10 20:48:21 +0000107
jardineb5d44e2003-12-23 08:09:43 +0000108 spftree_area_init (area);
109 area->route_table = route_table_init ();
110#ifdef HAVE_IPV6
111 area->route_table6 = route_table_init ();
112#endif /* HAVE_IPV6 */
113 area->circuit_list = list_new ();
114 area->area_addrs = list_new ();
hassof390d2c2004-09-10 20:48:21 +0000115 THREAD_TIMER_ON (master, area->t_tick, lsp_tick, area, 1);
jardineb5d44e2003-12-23 08:09:43 +0000116 area->flags.maxindex = -1;
117 /*
118 * Default values
119 */
hassof390d2c2004-09-10 20:48:21 +0000120 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200 */
121 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200 */
jardineb5d44e2003-12-23 08:09:43 +0000122 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
123 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
hassof390d2c2004-09-10 20:48:21 +0000124 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900 */
125 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900 */
jardineb5d44e2003-12-23 08:09:43 +0000126 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
127 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
128 area->dynhostname = 1;
129 area->lsp_frag_threshold = 90;
130#ifdef TOPOLOGY_GENERATE
131 memcpy (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS, ISIS_SYS_ID_LEN);
132#endif /* TOPOLOGY_GENERATE */
133
134 /* FIXME: Think of a better way... */
135 area->min_bcast_mtu = 1497;
136
137 return area;
138}
139
140struct isis_area *
hassof90a5f62004-10-11 13:11:56 +0000141isis_area_lookup (const char *area_tag)
jardineb5d44e2003-12-23 08:09:43 +0000142{
143 struct isis_area *area;
paul1eb8ef22005-04-07 07:30:20 +0000144 struct listnode *node, *nnode;
hassof390d2c2004-09-10 20:48:21 +0000145
paul1eb8ef22005-04-07 07:30:20 +0000146 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
jardineb5d44e2003-12-23 08:09:43 +0000147 if ((area->area_tag == NULL && area_tag == NULL) ||
hassof390d2c2004-09-10 20:48:21 +0000148 (area->area_tag && area_tag
149 && strcmp (area->area_tag, area_tag) == 0))
150 return area;
151
jardineb5d44e2003-12-23 08:09:43 +0000152 return NULL;
153}
154
hassof390d2c2004-09-10 20:48:21 +0000155int
hassof90a5f62004-10-11 13:11:56 +0000156isis_area_get (struct vty *vty, const char *area_tag)
jardineb5d44e2003-12-23 08:09:43 +0000157{
jardineb5d44e2003-12-23 08:09:43 +0000158 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000159
jardineb5d44e2003-12-23 08:09:43 +0000160 area = isis_area_lookup (area_tag);
hassof390d2c2004-09-10 20:48:21 +0000161
162 if (area)
163 {
164 vty->node = ISIS_NODE;
165 vty->index = area;
166 return CMD_SUCCESS;
167 }
168
jardineb5d44e2003-12-23 08:09:43 +0000169 area = isis_area_create ();
170 area->area_tag = strdup (area_tag);
171 listnode_add (isis->area_list, area);
hassof390d2c2004-09-10 20:48:21 +0000172
hassoc89c05d2005-09-04 21:36:36 +0000173 if (isis->debugs & DEBUG_EVENTS)
174 zlog_debug ("New IS-IS area instance %s", area->area_tag);
jardineb5d44e2003-12-23 08:09:43 +0000175
176 vty->node = ISIS_NODE;
177 vty->index = area;
hassof390d2c2004-09-10 20:48:21 +0000178
jardineb5d44e2003-12-23 08:09:43 +0000179 return CMD_SUCCESS;
180}
181
182int
hassof90a5f62004-10-11 13:11:56 +0000183isis_area_destroy (struct vty *vty, const char *area_tag)
jardineb5d44e2003-12-23 08:09:43 +0000184{
jardineb5d44e2003-12-23 08:09:43 +0000185 struct isis_area *area;
paul1eb8ef22005-04-07 07:30:20 +0000186 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000187 struct isis_circuit *circuit;
188
189 area = isis_area_lookup (area_tag);
jardineb5d44e2003-12-23 08:09:43 +0000190
hassof390d2c2004-09-10 20:48:21 +0000191 if (area == NULL)
192 {
193 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
194 return CMD_WARNING;
jardineb5d44e2003-12-23 08:09:43 +0000195 }
hassof390d2c2004-09-10 20:48:21 +0000196
197 if (area->circuit_list)
198 {
paul1eb8ef22005-04-07 07:30:20 +0000199 for (ALL_LIST_ELEMENTS (area->circuit_list, node, nnode, circuit))
200 isis_circuit_del (circuit);
201
hassof390d2c2004-09-10 20:48:21 +0000202 list_delete (area->circuit_list);
203 }
jardineb5d44e2003-12-23 08:09:43 +0000204 listnode_delete (isis->area_list, area);
hassof390d2c2004-09-10 20:48:21 +0000205 THREAD_TIMER_OFF (area->t_tick);
jardineb5d44e2003-12-23 08:09:43 +0000206 if (area->t_remove_aged)
207 thread_cancel (area->t_remove_aged);
hassof390d2c2004-09-10 20:48:21 +0000208 THREAD_TIMER_OFF (area->t_lsp_refresh[0]);
209 THREAD_TIMER_OFF (area->t_lsp_refresh[1]);
jardineb5d44e2003-12-23 08:09:43 +0000210
211 XFREE (MTYPE_ISIS_AREA, area);
hassof390d2c2004-09-10 20:48:21 +0000212
jardineb5d44e2003-12-23 08:09:43 +0000213 return CMD_SUCCESS;
214}
215
hassof390d2c2004-09-10 20:48:21 +0000216int
hassof7c43dc2004-09-26 16:24:14 +0000217area_net_title (struct vty *vty, u_char *net_title)
jardineb5d44e2003-12-23 08:09:43 +0000218{
jardineb5d44e2003-12-23 08:09:43 +0000219 struct isis_area *area;
220 struct area_addr *addr;
221 struct area_addr *addrp;
paul1eb8ef22005-04-07 07:30:20 +0000222 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000223
224 u_char buff[255];
225 area = vty->index;
226
hassof390d2c2004-09-10 20:48:21 +0000227 if (!area)
228 {
229 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
230 return CMD_WARNING;
231 }
jardineb5d44e2003-12-23 08:09:43 +0000232
233 /* We check that we are not over the maximal number of addresses */
hassof390d2c2004-09-10 20:48:21 +0000234 if (listcount (area->area_addrs) >= isis->max_area_addrs)
235 {
236 vty_out (vty, "Maximum of area addresses (%d) already reached %s",
237 isis->max_area_addrs, VTY_NEWLINE);
238 return CMD_WARNING;
239 }
jardineb5d44e2003-12-23 08:09:43 +0000240
241 addr = XMALLOC (MTYPE_ISIS_AREA_ADDR, sizeof (struct area_addr));
242 addr->addr_len = dotformat2buff (buff, net_title);
243 memcpy (addr->area_addr, buff, addr->addr_len);
244#ifdef EXTREME_DEBUG
hasso529d65b2004-12-24 00:14:50 +0000245 zlog_debug ("added area address %s for area %s (address length %d)",
jardineb5d44e2003-12-23 08:09:43 +0000246 net_title, area->area_tag, addr->addr_len);
247#endif /* EXTREME_DEBUG */
hassof390d2c2004-09-10 20:48:21 +0000248 if (addr->addr_len < 8 || addr->addr_len > 20)
249 {
250 zlog_warn ("area address must be at least 8..20 octets long (%d)",
251 addr->addr_len);
jardineb5d44e2003-12-23 08:09:43 +0000252 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
253 return CMD_WARNING;
254 }
255
hassof390d2c2004-09-10 20:48:21 +0000256 if (isis->sysid_set == 0)
257 {
258 /*
259 * First area address - get the SystemID for this router
260 */
261 memcpy (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN), ISIS_SYS_ID_LEN);
262 isis->sysid_set = 1;
hassoc89c05d2005-09-04 21:36:36 +0000263 if (isis->debugs & DEBUG_EVENTS)
264 zlog_debug ("Router has SystemID %s", sysid_print (isis->sysid));
jardineb5d44e2003-12-23 08:09:43 +0000265 }
hassof390d2c2004-09-10 20:48:21 +0000266 else
267 {
268 /*
269 * Check that the SystemID portions match
270 */
271 if (memcmp (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN),
272 ISIS_SYS_ID_LEN))
273 {
274 vty_out (vty,
275 "System ID must not change when defining additional area"
276 " addresses%s", VTY_NEWLINE);
277 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
278 return CMD_WARNING;
279 }
jardineb5d44e2003-12-23 08:09:43 +0000280
hassof390d2c2004-09-10 20:48:21 +0000281 /* now we see that we don't already have this address */
paul1eb8ef22005-04-07 07:30:20 +0000282 for (ALL_LIST_ELEMENTS (area->area_addrs, node, nnode, addrp))
hassof390d2c2004-09-10 20:48:21 +0000283 {
284 if ((addrp->addr_len + ISIS_SYS_ID_LEN + 1) == (addr->addr_len))
285 {
286 if (!memcmp (addrp->area_addr, addr->area_addr, addr->addr_len))
287 {
288 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
289 return CMD_SUCCESS; /* silent fail */
290 }
291 }
292 }
293
294 }
jardineb5d44e2003-12-23 08:09:43 +0000295 /*
296 * Forget the systemID part of the address
297 */
298 addr->addr_len -= (ISIS_SYS_ID_LEN + 1);
299 listnode_add (area->area_addrs, addr);
300
301 /* only now we can safely generate our LSPs for this area */
hassof390d2c2004-09-10 20:48:21 +0000302 if (listcount (area->area_addrs) > 0)
303 {
304 lsp_l1_generate (area);
305 lsp_l2_generate (area);
306 }
jardineb5d44e2003-12-23 08:09:43 +0000307
308 return CMD_SUCCESS;
309}
310
311int
hassof7c43dc2004-09-26 16:24:14 +0000312area_clear_net_title (struct vty *vty, u_char *net_title)
jardineb5d44e2003-12-23 08:09:43 +0000313{
314 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000315 struct area_addr addr, *addrp = NULL;
paul1eb8ef22005-04-07 07:30:20 +0000316 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000317 u_char buff[255];
318
319 area = vty->index;
hassof390d2c2004-09-10 20:48:21 +0000320 if (!area)
321 {
322 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
323 return CMD_WARNING;
324 }
325
jardineb5d44e2003-12-23 08:09:43 +0000326 addr.addr_len = dotformat2buff (buff, net_title);
hassof390d2c2004-09-10 20:48:21 +0000327 if (addr.addr_len < 8 || addr.addr_len > 20)
328 {
329 vty_out (vty, "Unsupported area address length %d, should be 8...20 %s",
330 addr.addr_len, VTY_NEWLINE);
331 return CMD_WARNING;
332 }
333
334 memcpy (addr.area_addr, buff, (int) addr.addr_len);
335
paul1eb8ef22005-04-07 07:30:20 +0000336 for (ALL_LIST_ELEMENTS (area->area_addrs, node, nnode, addrp))
jardineb5d44e2003-12-23 08:09:43 +0000337 if (addrp->addr_len == addr.addr_len &&
338 !memcmp (addrp->area_addr, addr.area_addr, addr.addr_len))
hassof390d2c2004-09-10 20:48:21 +0000339 break;
340
341 if (!addrp)
342 {
343 vty_out (vty, "No area address %s for area %s %s", net_title,
344 area->area_tag, VTY_NEWLINE);
345 return CMD_WARNING;
346 }
347
jardineb5d44e2003-12-23 08:09:43 +0000348 listnode_delete (area->area_addrs, addrp);
hassof390d2c2004-09-10 20:48:21 +0000349
jardineb5d44e2003-12-23 08:09:43 +0000350 return CMD_SUCCESS;
351}
352
jardineb5d44e2003-12-23 08:09:43 +0000353/*
354 * 'show clns neighbors' command
355 */
356
357int
hassof390d2c2004-09-10 20:48:21 +0000358show_clns_neigh (struct vty *vty, char detail)
jardineb5d44e2003-12-23 08:09:43 +0000359{
paul1eb8ef22005-04-07 07:30:20 +0000360 struct listnode *anode, *annode, *cnode, *cnnode;
jardineb5d44e2003-12-23 08:09:43 +0000361 struct isis_area *area;
362 struct isis_circuit *circuit;
363 struct list *db;
364 int i;
365
hassof390d2c2004-09-10 20:48:21 +0000366 if (!isis)
367 {
368 vty_out (vty, "IS-IS Routing Process not enabled%s", VTY_NEWLINE);
369 return CMD_SUCCESS;
370 }
jardineb5d44e2003-12-23 08:09:43 +0000371
paul1eb8ef22005-04-07 07:30:20 +0000372 for (ALL_LIST_ELEMENTS (isis->area_list, anode, annode, area))
hassof390d2c2004-09-10 20:48:21 +0000373 {
hassof390d2c2004-09-10 20:48:21 +0000374 vty_out (vty, "Area %s:%s", area->area_tag, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000375
hassof390d2c2004-09-10 20:48:21 +0000376 if (detail == ISIS_UI_LEVEL_BRIEF)
377 vty_out (vty, " System Id Interface L State "
378 "Holdtime SNPA%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000379
paul1eb8ef22005-04-07 07:30:20 +0000380 for (ALL_LIST_ELEMENTS (area->circuit_list, cnode, cnnode, circuit))
hassof390d2c2004-09-10 20:48:21 +0000381 {
hassof390d2c2004-09-10 20:48:21 +0000382 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
383 {
384 for (i = 0; i < 2; i++)
385 {
386 db = circuit->u.bc.adjdb[i];
387 if (db && db->count)
388 {
389 if (detail == ISIS_UI_LEVEL_BRIEF)
390 isis_adjdb_iterate (db,
391 (void (*)
392 (struct isis_adjacency *,
393 void *)) isis_adj_print_vty,
394 vty);
395 if (detail == ISIS_UI_LEVEL_DETAIL)
396 isis_adjdb_iterate (db,
397 (void (*)
398 (struct isis_adjacency *,
399 void *))
400 isis_adj_print_vty_detail, vty);
401 if (detail == ISIS_UI_LEVEL_EXTENSIVE)
402 isis_adjdb_iterate (db,
403 (void (*)
404 (struct isis_adjacency *,
405 void *))
406 isis_adj_print_vty_extensive,
407 vty);
408 }
409 }
410 }
411 else if (circuit->circ_type == CIRCUIT_T_P2P &&
412 circuit->u.p2p.neighbor)
413 {
414 if (detail == ISIS_UI_LEVEL_BRIEF)
415 isis_adj_p2p_print_vty (circuit->u.p2p.neighbor, vty);
416 if (detail == ISIS_UI_LEVEL_DETAIL)
417 isis_adj_p2p_print_vty_detail (circuit->u.p2p.neighbor, vty);
418 if (detail == ISIS_UI_LEVEL_EXTENSIVE)
419 isis_adj_p2p_print_vty_extensive (circuit->u.p2p.neighbor,
420 vty);
421 }
422 }
jardineb5d44e2003-12-23 08:09:43 +0000423 }
hassof390d2c2004-09-10 20:48:21 +0000424
jardineb5d44e2003-12-23 08:09:43 +0000425 return CMD_SUCCESS;
426}
427
428DEFUN (show_clns_neighbors,
429 show_clns_neighbors_cmd,
430 "show clns neighbors",
431 SHOW_STR
432 "clns network information\n"
433 "CLNS neighbor adjacencies\n")
434{
hassof390d2c2004-09-10 20:48:21 +0000435 return show_clns_neigh (vty, ISIS_UI_LEVEL_BRIEF);
jardineb5d44e2003-12-23 08:09:43 +0000436}
437
438ALIAS (show_clns_neighbors,
439 show_isis_neighbors_cmd,
440 "show isis neighbors",
441 SHOW_STR
442 "IS-IS network information\n"
443 "IS-IS neighbor adjacencies\n")
444
445DEFUN (show_clns_neighbors_detail,
446 show_clns_neighbors_detail_cmd,
447 "show clns neighbors detail",
448 SHOW_STR
449 "clns network information\n"
450 "CLNS neighbor adjacencies\n"
451 "show detailed information\n")
452{
hassof390d2c2004-09-10 20:48:21 +0000453 return show_clns_neigh (vty, ISIS_UI_LEVEL_DETAIL);
jardineb5d44e2003-12-23 08:09:43 +0000454}
455
456ALIAS (show_clns_neighbors_detail,
457 show_isis_neighbors_detail_cmd,
458 "show isis neighbors detail",
459 SHOW_STR
460 "IS-IS network information\n"
461 "IS-IS neighbor adjacencies\n"
462 "show detailed information\n")
jardineb5d44e2003-12-23 08:09:43 +0000463/*
464 * 'isis debug', 'show debugging'
465 */
jardineb5d44e2003-12-23 08:09:43 +0000466void
467print_debug (struct vty *vty, int flags, int onoff)
468{
469 char onoffs[4];
470 if (onoff)
hassof390d2c2004-09-10 20:48:21 +0000471 strcpy (onoffs, "on");
jardineb5d44e2003-12-23 08:09:43 +0000472 else
hassof390d2c2004-09-10 20:48:21 +0000473 strcpy (onoffs, "off");
jardineb5d44e2003-12-23 08:09:43 +0000474
475 if (flags & DEBUG_ADJ_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000476 vty_out (vty, "IS-IS Adjacency related packets debugging is %s%s", onoffs,
477 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000478 if (flags & DEBUG_CHECKSUM_ERRORS)
hassof390d2c2004-09-10 20:48:21 +0000479 vty_out (vty, "IS-IS checksum errors debugging is %s%s", onoffs,
480 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000481 if (flags & DEBUG_LOCAL_UPDATES)
hassof390d2c2004-09-10 20:48:21 +0000482 vty_out (vty, "IS-IS local updates debugging is %s%s", onoffs,
483 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000484 if (flags & DEBUG_PROTOCOL_ERRORS)
hassof390d2c2004-09-10 20:48:21 +0000485 vty_out (vty, "IS-IS protocol errors debugging is %s%s", onoffs,
486 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000487 if (flags & DEBUG_SNP_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000488 vty_out (vty, "IS-IS CSNP/PSNP packets debugging is %s%s", onoffs,
489 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000490 if (flags & DEBUG_SPF_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000491 vty_out (vty, "IS-IS SPF events debugging is %s%s", onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000492 if (flags & DEBUG_SPF_STATS)
hassof390d2c2004-09-10 20:48:21 +0000493 vty_out (vty, "IS-IS SPF Timing and Statistics Data debugging is %s%s",
494 onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000495 if (flags & DEBUG_SPF_TRIGGERS)
hassof390d2c2004-09-10 20:48:21 +0000496 vty_out (vty, "IS-IS SPF triggering events debugging is %s%s", onoffs,
497 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000498 if (flags & DEBUG_UPDATE_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000499 vty_out (vty, "IS-IS Update related packet debugging is %s%s", onoffs,
500 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000501 if (flags & DEBUG_RTE_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000502 vty_out (vty, "IS-IS Route related debuggin is %s%s", onoffs,
503 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000504 if (flags & DEBUG_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000505 vty_out (vty, "IS-IS Event debugging is %s%s", onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000506
507}
508
509DEFUN (show_debugging,
510 show_debugging_cmd,
511 "show debugging",
512 SHOW_STR
513 "State of each debugging option\n")
514{
hassof390d2c2004-09-10 20:48:21 +0000515 vty_out (vty, "IS-IS:%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000516 print_debug (vty, isis->debugs, 1);
517 return CMD_SUCCESS;
518}
519
jardin9e867fe2003-12-23 08:56:18 +0000520/* Debug node. */
hassof390d2c2004-09-10 20:48:21 +0000521static struct cmd_node debug_node = {
jardin9e867fe2003-12-23 08:56:18 +0000522 DEBUG_NODE,
hassof390d2c2004-09-10 20:48:21 +0000523 "",
524 1
jardin9e867fe2003-12-23 08:56:18 +0000525};
526
527static int
528config_write_debug (struct vty *vty)
529{
530 int write = 0;
531 int flags = isis->debugs;
532
hassof390d2c2004-09-10 20:48:21 +0000533 if (flags & DEBUG_ADJ_PACKETS)
534 {
535 vty_out (vty, "debug isis adj-packets%s", VTY_NEWLINE);
536 write++;
537 }
538 if (flags & DEBUG_CHECKSUM_ERRORS)
539 {
540 vty_out (vty, "debug isis checksum-errors%s", VTY_NEWLINE);
541 write++;
542 }
543 if (flags & DEBUG_LOCAL_UPDATES)
544 {
545 vty_out (vty, "debug isis local-updates%s", VTY_NEWLINE);
546 write++;
547 }
548 if (flags & DEBUG_PROTOCOL_ERRORS)
549 {
550 vty_out (vty, "debug isis protocol-errors%s", VTY_NEWLINE);
551 write++;
552 }
553 if (flags & DEBUG_SNP_PACKETS)
554 {
555 vty_out (vty, "debug isis snp-packets%s", VTY_NEWLINE);
556 write++;
557 }
558 if (flags & DEBUG_SPF_EVENTS)
559 {
560 vty_out (vty, "debug isis spf-events%s", VTY_NEWLINE);
561 write++;
562 }
563 if (flags & DEBUG_SPF_STATS)
564 {
565 vty_out (vty, "debug isis spf-statistics%s", VTY_NEWLINE);
566 write++;
567 }
568 if (flags & DEBUG_SPF_TRIGGERS)
569 {
570 vty_out (vty, "debug isis spf-triggers%s", VTY_NEWLINE);
571 write++;
572 }
573 if (flags & DEBUG_UPDATE_PACKETS)
574 {
575 vty_out (vty, "debug isis update-packets%s", VTY_NEWLINE);
576 write++;
577 }
578 if (flags & DEBUG_RTE_EVENTS)
579 {
580 vty_out (vty, "debug isis route-events%s", VTY_NEWLINE);
581 write++;
582 }
583 if (flags & DEBUG_EVENTS)
584 {
585 vty_out (vty, "debug isis events%s", VTY_NEWLINE);
586 write++;
587 }
jardin9e867fe2003-12-23 08:56:18 +0000588
589 return write;
590}
591
jardineb5d44e2003-12-23 08:09:43 +0000592DEFUN (debug_isis_adj,
593 debug_isis_adj_cmd,
594 "debug isis adj-packets",
595 DEBUG_STR
596 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000597 "IS-IS Adjacency related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000598{
599 isis->debugs |= DEBUG_ADJ_PACKETS;
hassof390d2c2004-09-10 20:48:21 +0000600 print_debug (vty, DEBUG_ADJ_PACKETS, 1);
jardineb5d44e2003-12-23 08:09:43 +0000601
602 return CMD_SUCCESS;
603}
604
605DEFUN (no_debug_isis_adj,
606 no_debug_isis_adj_cmd,
607 "no debug isis adj-packets",
608 UNDEBUG_STR
609 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000610 "IS-IS Adjacency related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000611{
jardineb5d44e2003-12-23 08:09:43 +0000612 isis->debugs &= ~DEBUG_ADJ_PACKETS;
613 print_debug (vty, DEBUG_ADJ_PACKETS, 0);
614
615 return CMD_SUCCESS;
616}
617
jardineb5d44e2003-12-23 08:09:43 +0000618DEFUN (debug_isis_csum,
619 debug_isis_csum_cmd,
620 "debug isis checksum-errors",
621 DEBUG_STR
622 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000623 "IS-IS LSP checksum errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000624{
625 isis->debugs |= DEBUG_CHECKSUM_ERRORS;
626 print_debug (vty, DEBUG_CHECKSUM_ERRORS, 1);
627
628 return CMD_SUCCESS;
629}
630
631DEFUN (no_debug_isis_csum,
632 no_debug_isis_csum_cmd,
633 "no debug isis checksum-errors",
634 UNDEBUG_STR
635 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000636 "IS-IS LSP checksum errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000637{
638 isis->debugs &= ~DEBUG_CHECKSUM_ERRORS;
639 print_debug (vty, DEBUG_CHECKSUM_ERRORS, 0);
hassof390d2c2004-09-10 20:48:21 +0000640
jardineb5d44e2003-12-23 08:09:43 +0000641 return CMD_SUCCESS;
642}
643
644DEFUN (debug_isis_lupd,
645 debug_isis_lupd_cmd,
646 "debug isis local-updates",
647 DEBUG_STR
648 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000649 "IS-IS local update packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000650{
651 isis->debugs |= DEBUG_LOCAL_UPDATES;
652 print_debug (vty, DEBUG_LOCAL_UPDATES, 1);
653
654 return CMD_SUCCESS;
655}
656
657DEFUN (no_debug_isis_lupd,
658 no_debug_isis_lupd_cmd,
659 "no debug isis local-updates",
660 UNDEBUG_STR
661 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000662 "IS-IS local update packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000663{
664 isis->debugs &= ~DEBUG_LOCAL_UPDATES;
hassof390d2c2004-09-10 20:48:21 +0000665 print_debug (vty, DEBUG_LOCAL_UPDATES, 0);
666
jardineb5d44e2003-12-23 08:09:43 +0000667 return CMD_SUCCESS;
668}
669
670DEFUN (debug_isis_err,
671 debug_isis_err_cmd,
hassof390d2c2004-09-10 20:48:21 +0000672 "debug isis protocol-errors",
jardineb5d44e2003-12-23 08:09:43 +0000673 DEBUG_STR
674 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000675 "IS-IS LSP protocol errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000676{
677 isis->debugs |= DEBUG_PROTOCOL_ERRORS;
678 print_debug (vty, DEBUG_PROTOCOL_ERRORS, 1);
679
680 return CMD_SUCCESS;
681}
682
683DEFUN (no_debug_isis_err,
684 no_debug_isis_err_cmd,
685 "no debug isis protocol-errors",
686 UNDEBUG_STR
687 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000688 "IS-IS LSP protocol errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000689{
690 isis->debugs &= ~DEBUG_PROTOCOL_ERRORS;
691 print_debug (vty, DEBUG_PROTOCOL_ERRORS, 0);
hassof390d2c2004-09-10 20:48:21 +0000692
jardineb5d44e2003-12-23 08:09:43 +0000693 return CMD_SUCCESS;
694}
695
696DEFUN (debug_isis_snp,
697 debug_isis_snp_cmd,
698 "debug isis snp-packets",
699 DEBUG_STR
700 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000701 "IS-IS CSNP/PSNP packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000702{
703 isis->debugs |= DEBUG_SNP_PACKETS;
704 print_debug (vty, DEBUG_SNP_PACKETS, 1);
705
706 return CMD_SUCCESS;
707}
708
709DEFUN (no_debug_isis_snp,
710 no_debug_isis_snp_cmd,
711 "no debug isis snp-packets",
712 UNDEBUG_STR
713 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000714 "IS-IS CSNP/PSNP packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000715{
hassof390d2c2004-09-10 20:48:21 +0000716 isis->debugs &= ~DEBUG_SNP_PACKETS;
jardineb5d44e2003-12-23 08:09:43 +0000717 print_debug (vty, DEBUG_SNP_PACKETS, 0);
hassof390d2c2004-09-10 20:48:21 +0000718
jardineb5d44e2003-12-23 08:09:43 +0000719 return CMD_SUCCESS;
720}
721
jardineb5d44e2003-12-23 08:09:43 +0000722DEFUN (debug_isis_upd,
723 debug_isis_upd_cmd,
724 "debug isis update-packets",
725 DEBUG_STR
726 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000727 "IS-IS Update related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000728{
729 isis->debugs |= DEBUG_UPDATE_PACKETS;
730 print_debug (vty, DEBUG_UPDATE_PACKETS, 1);
731
732 return CMD_SUCCESS;
733}
734
735DEFUN (no_debug_isis_upd,
736 no_debug_isis_upd_cmd,
737 "no debug isis update-packets",
738 UNDEBUG_STR
739 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000740 "IS-IS Update related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000741{
742 isis->debugs &= ~DEBUG_UPDATE_PACKETS;
743 print_debug (vty, DEBUG_UPDATE_PACKETS, 0);
hassof390d2c2004-09-10 20:48:21 +0000744
jardineb5d44e2003-12-23 08:09:43 +0000745 return CMD_SUCCESS;
746}
747
jardineb5d44e2003-12-23 08:09:43 +0000748DEFUN (debug_isis_spfevents,
749 debug_isis_spfevents_cmd,
750 "debug isis spf-events",
751 DEBUG_STR
752 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000753 "IS-IS Shortest Path First Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000754{
755 isis->debugs |= DEBUG_SPF_EVENTS;
hassof390d2c2004-09-10 20:48:21 +0000756 print_debug (vty, DEBUG_SPF_EVENTS, 1);
jardineb5d44e2003-12-23 08:09:43 +0000757
758 return CMD_SUCCESS;
759}
760
761DEFUN (no_debug_isis_spfevents,
762 no_debug_isis_spfevents_cmd,
763 "no debug isis spf-events",
764 UNDEBUG_STR
765 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000766 "IS-IS Shortest Path First Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000767{
768 isis->debugs &= ~DEBUG_SPF_EVENTS;
hassof390d2c2004-09-10 20:48:21 +0000769 print_debug (vty, DEBUG_SPF_EVENTS, 0);
770
jardineb5d44e2003-12-23 08:09:43 +0000771 return CMD_SUCCESS;
772}
773
774
775DEFUN (debug_isis_spfstats,
776 debug_isis_spfstats_cmd,
777 "debug isis spf-statistics ",
778 DEBUG_STR
779 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000780 "IS-IS SPF Timing and Statistic Data\n")
jardineb5d44e2003-12-23 08:09:43 +0000781{
782 isis->debugs |= DEBUG_SPF_STATS;
783 print_debug (vty, DEBUG_SPF_STATS, 1);
784
785 return CMD_SUCCESS;
786}
787
788DEFUN (no_debug_isis_spfstats,
789 no_debug_isis_spfstats_cmd,
790 "no debug isis spf-statistics",
791 UNDEBUG_STR
792 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000793 "IS-IS SPF Timing and Statistic Data\n")
jardineb5d44e2003-12-23 08:09:43 +0000794{
795 isis->debugs &= ~DEBUG_SPF_STATS;
796 print_debug (vty, DEBUG_SPF_STATS, 0);
hassof390d2c2004-09-10 20:48:21 +0000797
jardineb5d44e2003-12-23 08:09:43 +0000798 return CMD_SUCCESS;
799}
800
801DEFUN (debug_isis_spftrigg,
802 debug_isis_spftrigg_cmd,
803 "debug isis spf-triggers",
804 DEBUG_STR
805 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000806 "IS-IS SPF triggering events\n")
jardineb5d44e2003-12-23 08:09:43 +0000807{
808 isis->debugs |= DEBUG_SPF_TRIGGERS;
809 print_debug (vty, DEBUG_SPF_TRIGGERS, 1);
810
811 return CMD_SUCCESS;
812}
813
814DEFUN (no_debug_isis_spftrigg,
815 no_debug_isis_spftrigg_cmd,
816 "no debug isis spf-triggers",
817 UNDEBUG_STR
818 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000819 "IS-IS SPF triggering events\n")
jardineb5d44e2003-12-23 08:09:43 +0000820{
821 isis->debugs &= ~DEBUG_SPF_TRIGGERS;
822 print_debug (vty, DEBUG_SPF_TRIGGERS, 0);
hassof390d2c2004-09-10 20:48:21 +0000823
jardineb5d44e2003-12-23 08:09:43 +0000824 return CMD_SUCCESS;
825}
826
827DEFUN (debug_isis_rtevents,
828 debug_isis_rtevents_cmd,
829 "debug isis route-events",
830 DEBUG_STR
831 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000832 "IS-IS Route related events\n")
jardineb5d44e2003-12-23 08:09:43 +0000833{
834 isis->debugs |= DEBUG_RTE_EVENTS;
835 print_debug (vty, DEBUG_RTE_EVENTS, 1);
836
837 return CMD_SUCCESS;
838}
839
840DEFUN (no_debug_isis_rtevents,
841 no_debug_isis_rtevents_cmd,
842 "no debug isis route-events",
843 UNDEBUG_STR
844 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000845 "IS-IS Route related events\n")
jardineb5d44e2003-12-23 08:09:43 +0000846{
847 isis->debugs &= ~DEBUG_RTE_EVENTS;
848 print_debug (vty, DEBUG_RTE_EVENTS, 0);
hassof390d2c2004-09-10 20:48:21 +0000849
jardineb5d44e2003-12-23 08:09:43 +0000850 return CMD_SUCCESS;
851}
852
853DEFUN (debug_isis_events,
854 debug_isis_events_cmd,
855 "debug isis events",
856 DEBUG_STR
857 "IS-IS information\n"
hassof1082d12005-09-19 04:23:34 +0000858 "IS-IS Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000859{
860 isis->debugs |= DEBUG_EVENTS;
861 print_debug (vty, DEBUG_EVENTS, 1);
862
863 return CMD_SUCCESS;
864}
865
866DEFUN (no_debug_isis_events,
867 no_debug_isis_events_cmd,
868 "no debug isis events",
869 UNDEBUG_STR
870 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000871 "IS-IS Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000872{
873 isis->debugs &= ~DEBUG_EVENTS;
874 print_debug (vty, DEBUG_EVENTS, 0);
hassof390d2c2004-09-10 20:48:21 +0000875
jardineb5d44e2003-12-23 08:09:43 +0000876 return CMD_SUCCESS;
877}
878
jardineb5d44e2003-12-23 08:09:43 +0000879DEFUN (show_hostname,
880 show_hostname_cmd,
881 "show isis hostname",
882 SHOW_STR
883 "IS-IS information\n"
884 "IS-IS Dynamic hostname mapping\n")
885{
886 dynhn_print_all (vty);
hassof390d2c2004-09-10 20:48:21 +0000887
jardineb5d44e2003-12-23 08:09:43 +0000888 return CMD_SUCCESS;
889}
890
jardineb5d44e2003-12-23 08:09:43 +0000891DEFUN (show_database,
892 show_database_cmd,
893 "show isis database",
hassof390d2c2004-09-10 20:48:21 +0000894 SHOW_STR "IS-IS information\n" "IS-IS link state database\n")
jardineb5d44e2003-12-23 08:09:43 +0000895{
paul1eb8ef22005-04-07 07:30:20 +0000896 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000897 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000898 int level, lsp_count;
jardineb5d44e2003-12-23 08:09:43 +0000899
900 if (isis->area_list->count == 0)
901 return CMD_SUCCESS;
jardineb5d44e2003-12-23 08:09:43 +0000902
paul1eb8ef22005-04-07 07:30:20 +0000903 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
hassof390d2c2004-09-10 20:48:21 +0000904 {
hassof390d2c2004-09-10 20:48:21 +0000905 vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null",
906 VTY_NEWLINE);
907 for (level = 0; level < ISIS_LEVELS; level++)
908 {
909 if (area->lspdb[level] && dict_count (area->lspdb[level]) > 0)
910 {
911 vty_out (vty, "IS-IS Level-%d link-state database:%s",
912 level + 1, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000913
hassof390d2c2004-09-10 20:48:21 +0000914 lsp_count = lsp_print_all (vty, area->lspdb[level],
915 ISIS_UI_LEVEL_BRIEF,
916 area->dynhostname);
917
918 vty_out (vty, "%s %u LSPs%s%s",
919 VTY_NEWLINE, lsp_count, VTY_NEWLINE, VTY_NEWLINE);
920 }
921 }
jardineb5d44e2003-12-23 08:09:43 +0000922 }
jardineb5d44e2003-12-23 08:09:43 +0000923
924 return CMD_SUCCESS;
925}
926
jardineb5d44e2003-12-23 08:09:43 +0000927DEFUN (show_database_detail,
928 show_database_detail_cmd,
929 "show isis database detail",
930 SHOW_STR
931 "IS-IS information\n"
932 "IS-IS link state database\n")
933{
paul1eb8ef22005-04-07 07:30:20 +0000934 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000935 struct isis_area *area;
936 int level, lsp_count;
937
938 if (isis->area_list->count == 0)
939 return CMD_SUCCESS;
940
paul1eb8ef22005-04-07 07:30:20 +0000941 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
hassof390d2c2004-09-10 20:48:21 +0000942 {
hassof390d2c2004-09-10 20:48:21 +0000943 vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null",
944 VTY_NEWLINE);
945 for (level = 0; level < ISIS_LEVELS; level++)
946 {
947 if (area->lspdb[level] && dict_count (area->lspdb[level]) > 0)
948 {
949 vty_out (vty, "IS-IS Level-%d Link State Database:%s",
950 level + 1, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000951
hassof390d2c2004-09-10 20:48:21 +0000952 lsp_count = lsp_print_all (vty, area->lspdb[level],
953 ISIS_UI_LEVEL_DETAIL,
954 area->dynhostname);
jardineb5d44e2003-12-23 08:09:43 +0000955
hassof390d2c2004-09-10 20:48:21 +0000956 vty_out (vty, "%s %u LSPs%s%s",
957 VTY_NEWLINE, lsp_count, VTY_NEWLINE, VTY_NEWLINE);
958 }
959 }
jardineb5d44e2003-12-23 08:09:43 +0000960 }
jardineb5d44e2003-12-23 08:09:43 +0000961
962 return CMD_SUCCESS;
963}
964
965/*
966 * 'router isis' command
967 */
968DEFUN (router_isis,
969 router_isis_cmd,
970 "router isis WORD",
hassof390d2c2004-09-10 20:48:21 +0000971 ROUTER_STR
jardineb5d44e2003-12-23 08:09:43 +0000972 "ISO IS-IS\n"
973 "ISO Routing area tag")
974{
jardineb5d44e2003-12-23 08:09:43 +0000975 return isis_area_get (vty, argv[0]);
jardineb5d44e2003-12-23 08:09:43 +0000976}
977
978/*
979 *'no router isis' command
980 */
981DEFUN (no_router_isis,
982 no_router_isis_cmd,
983 "no router isis WORD",
hassof390d2c2004-09-10 20:48:21 +0000984 "no\n" ROUTER_STR "ISO IS-IS\n" "ISO Routing area tag")
jardineb5d44e2003-12-23 08:09:43 +0000985{
986 return isis_area_destroy (vty, argv[0]);
987}
988
989/*
990 * 'net' command
991 */
992DEFUN (net,
993 net_cmd,
994 "net WORD",
995 "A Network Entity Title for this process (OSI only)\n"
hassof390d2c2004-09-10 20:48:21 +0000996 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +0000997{
hassof7c43dc2004-09-26 16:24:14 +0000998 return area_net_title (vty, (u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +0000999}
1000
jardineb5d44e2003-12-23 08:09:43 +00001001/*
1002 * 'no net' command
1003 */
1004DEFUN (no_net,
1005 no_net_cmd,
1006 "no net WORD",
1007 NO_STR
1008 "A Network Entity Title for this process (OSI only)\n"
hassof390d2c2004-09-10 20:48:21 +00001009 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001010{
hassof7c43dc2004-09-26 16:24:14 +00001011 return area_clear_net_title (vty, (u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +00001012}
1013
1014DEFUN (area_passwd,
1015 area_passwd_cmd,
1016 "area-password WORD",
1017 "Configure the authentication password for an area\n"
hassof390d2c2004-09-10 20:48:21 +00001018 "Area password\n")
jardineb5d44e2003-12-23 08:09:43 +00001019{
1020 struct isis_area *area;
1021 int len;
1022
1023 area = vty->index;
1024
hassof390d2c2004-09-10 20:48:21 +00001025 if (!area)
1026 {
1027 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1028 return CMD_WARNING;
1029 }
1030
jardineb5d44e2003-12-23 08:09:43 +00001031 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001032 if (len > 254)
1033 {
1034 vty_out (vty, "Too long area password (>254)%s", VTY_NEWLINE);
1035 return CMD_WARNING;
1036 }
1037 area->area_passwd.len = (u_char) len;
jardineb5d44e2003-12-23 08:09:43 +00001038 area->area_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001039 strncpy ((char *)area->area_passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001040
hasso1cbc5622005-01-01 10:29:51 +00001041 if (argc > 1)
1042 {
1043 SET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND);
1044 if (strncmp(argv[1], "v", 1) == 0)
1045 SET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1046 else
1047 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1048 }
1049 else
1050 {
1051 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND);
1052 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1053 }
1054
jardineb5d44e2003-12-23 08:09:43 +00001055 return CMD_SUCCESS;
1056}
1057
hasso1cbc5622005-01-01 10:29:51 +00001058ALIAS (area_passwd,
1059 area_passwd_snpauth_cmd,
1060 "area-password WORD authenticate snp (send-only|validate)",
1061 "Configure the authentication password for an area\n"
1062 "Area password\n"
1063 "Authentication\n"
1064 "SNP PDUs\n"
1065 "Send but do not check PDUs on receiving\n"
1066 "Send and check PDUs on receiving\n");
1067
jardineb5d44e2003-12-23 08:09:43 +00001068DEFUN (no_area_passwd,
1069 no_area_passwd_cmd,
1070 "no area-password",
1071 NO_STR
1072 "Configure the authentication password for an area\n")
1073{
1074 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001075
jardineb5d44e2003-12-23 08:09:43 +00001076 area = vty->index;
1077
hassof390d2c2004-09-10 20:48:21 +00001078 if (!area)
1079 {
1080 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1081 return CMD_WARNING;
1082 }
1083
jardineb5d44e2003-12-23 08:09:43 +00001084 memset (&area->area_passwd, 0, sizeof (struct isis_passwd));
1085
1086 return CMD_SUCCESS;
1087}
1088
jardineb5d44e2003-12-23 08:09:43 +00001089DEFUN (domain_passwd,
1090 domain_passwd_cmd,
1091 "domain-password WORD",
1092 "Set the authentication password for a routing domain\n"
hassof390d2c2004-09-10 20:48:21 +00001093 "Routing domain password\n")
jardineb5d44e2003-12-23 08:09:43 +00001094{
1095 struct isis_area *area;
1096 int len;
1097
1098 area = vty->index;
1099
hassof390d2c2004-09-10 20:48:21 +00001100 if (!area)
1101 {
1102 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1103 return CMD_WARNING;
1104 }
1105
jardineb5d44e2003-12-23 08:09:43 +00001106 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001107 if (len > 254)
1108 {
1109 vty_out (vty, "Too long area password (>254)%s", VTY_NEWLINE);
1110 return CMD_WARNING;
1111 }
1112 area->domain_passwd.len = (u_char) len;
jardineb5d44e2003-12-23 08:09:43 +00001113 area->domain_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001114 strncpy ((char *)area->domain_passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001115
hasso1cbc5622005-01-01 10:29:51 +00001116 if (argc > 1)
1117 {
1118 SET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND);
1119 if (strncmp(argv[1], "v", 1) == 0)
1120 SET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1121 else
1122 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1123 }
1124 else
1125 {
1126 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND);
1127 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1128 }
1129
jardineb5d44e2003-12-23 08:09:43 +00001130 return CMD_SUCCESS;
1131}
1132
hasso1cbc5622005-01-01 10:29:51 +00001133ALIAS (domain_passwd,
1134 domain_passwd_snpauth_cmd,
1135 "domain-password WORD authenticate snp (send-only|validate)",
1136 "Set the authentication password for a routing domain\n"
1137 "Routing domain password\n"
1138 "Authentication\n"
1139 "SNP PDUs\n"
1140 "Send but do not check PDUs on receiving\n"
1141 "Send and check PDUs on receiving\n");
1142
jardineb5d44e2003-12-23 08:09:43 +00001143DEFUN (no_domain_passwd,
1144 no_domain_passwd_cmd,
1145 "no domain-password WORD",
1146 NO_STR
1147 "Set the authentication password for a routing domain\n")
1148{
1149 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001150
jardineb5d44e2003-12-23 08:09:43 +00001151 area = vty->index;
1152
hassof390d2c2004-09-10 20:48:21 +00001153 if (!area)
1154 {
1155 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1156 return CMD_WARNING;
1157 }
1158
jardineb5d44e2003-12-23 08:09:43 +00001159 memset (&area->domain_passwd, 0, sizeof (struct isis_passwd));
hassof390d2c2004-09-10 20:48:21 +00001160
jardineb5d44e2003-12-23 08:09:43 +00001161 return CMD_SUCCESS;
1162}
1163
1164DEFUN (is_type,
1165 is_type_cmd,
1166 "is-type (level-1|level-1-2|level-2-only)",
1167 "IS Level for this routing process (OSI only)\n"
1168 "Act as a station router only\n"
1169 "Act as both a station router and an area router\n"
1170 "Act as an area router only\n")
1171{
1172 struct isis_area *area;
1173 int type;
1174
1175 area = vty->index;
1176
hassof390d2c2004-09-10 20:48:21 +00001177 if (!area)
1178 {
1179 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1180 return CMD_WARNING;
1181 }
jardineb5d44e2003-12-23 08:09:43 +00001182
hassof7c43dc2004-09-26 16:24:14 +00001183 type = string2circuit_t ((u_char *)argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001184 if (!type)
1185 {
1186 vty_out (vty, "Unknown IS level %s", VTY_NEWLINE);
1187 return CMD_SUCCESS;
1188 }
jardineb5d44e2003-12-23 08:09:43 +00001189
1190 isis_event_system_type_change (area, type);
hassof390d2c2004-09-10 20:48:21 +00001191
jardineb5d44e2003-12-23 08:09:43 +00001192 return CMD_SUCCESS;
1193}
1194
1195DEFUN (no_is_type,
1196 no_is_type_cmd,
1197 "no is-type (level-1|level-1-2|level-2-only)",
1198 NO_STR
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")
1203{
jardineb5d44e2003-12-23 08:09:43 +00001204 struct isis_area *area;
1205 int type;
1206
1207 area = vty->index;
1208 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001209
jardineb5d44e2003-12-23 08:09:43 +00001210 /*
1211 * Put the is-type back to default. Which is level-1-2 on first
1212 * circuit for the area level-1 for the rest
1213 */
paul1eb8ef22005-04-07 07:30:20 +00001214 if (listgetdata (listhead (isis->area_list)) == area)
jardineb5d44e2003-12-23 08:09:43 +00001215 type = IS_LEVEL_1_AND_2;
1216 else
1217 type = IS_LEVEL_1;
1218
1219 isis_event_system_type_change (area, type);
1220
1221 return CMD_SUCCESS;
1222}
1223
1224DEFUN (lsp_gen_interval,
1225 lsp_gen_interval_cmd,
1226 "lsp-gen-interval <1-120>",
1227 "Minimum interval between regenerating same LSP\n"
1228 "Minimum interval in seconds\n")
1229{
1230 struct isis_area *area;
1231 uint16_t interval;
1232
1233 area = vty->index;
1234 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001235
jardineb5d44e2003-12-23 08:09:43 +00001236 interval = atoi (argv[0]);
1237 area->lsp_gen_interval[0] = interval;
1238 area->lsp_gen_interval[1] = interval;
1239
1240 return CMD_SUCCESS;
1241}
1242
1243DEFUN (no_lsp_gen_interval,
1244 no_lsp_gen_interval_cmd,
1245 "no lsp-gen-interval",
1246 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001247 "Minimum interval between regenerating same LSP\n")
jardineb5d44e2003-12-23 08:09:43 +00001248{
1249 struct isis_area *area;
1250
1251 area = vty->index;
1252 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001253
jardineb5d44e2003-12-23 08:09:43 +00001254 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
1255 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
1256
1257 return CMD_SUCCESS;
1258}
1259
1260ALIAS (no_lsp_gen_interval,
1261 no_lsp_gen_interval_arg_cmd,
1262 "no lsp-gen-interval <1-120>",
1263 NO_STR
1264 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001265 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001266
1267DEFUN (lsp_gen_interval_l1,
1268 lsp_gen_interval_l1_cmd,
1269 "lsp-gen-interval level-1 <1-120>",
1270 "Minimum interval between regenerating same LSP\n"
1271 "Set interval for level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001272 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001273{
1274 struct isis_area *area;
1275 uint16_t interval;
1276
1277 area = vty->index;
1278 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001279
jardineb5d44e2003-12-23 08:09:43 +00001280 interval = atoi (argv[0]);
1281 area->lsp_gen_interval[0] = interval;
1282
1283 return CMD_SUCCESS;
1284}
1285
1286DEFUN (no_lsp_gen_interval_l1,
1287 no_lsp_gen_interval_l1_cmd,
1288 "no lsp-gen-interval level-1",
1289 NO_STR
1290 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001291 "Set interval for level 1 only\n")
jardineb5d44e2003-12-23 08:09:43 +00001292{
1293 struct isis_area *area;
1294
1295 area = vty->index;
1296 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001297
jardineb5d44e2003-12-23 08:09:43 +00001298 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
1299
1300 return CMD_SUCCESS;
1301}
1302
1303ALIAS (no_lsp_gen_interval_l1,
1304 no_lsp_gen_interval_l1_arg_cmd,
1305 "no lsp-gen-interval level-1 <1-120>",
1306 NO_STR
1307 "Minimum interval between regenerating same LSP\n"
1308 "Set interval for level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001309 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001310
1311DEFUN (lsp_gen_interval_l2,
1312 lsp_gen_interval_l2_cmd,
1313 "lsp-gen-interval level-2 <1-120>",
1314 "Minimum interval between regenerating same LSP\n"
1315 "Set interval for level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001316 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001317{
1318 struct isis_area *area;
1319 int interval;
1320
1321 area = vty->index;
1322 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001323
jardineb5d44e2003-12-23 08:09:43 +00001324 interval = atoi (argv[0]);
1325 area->lsp_gen_interval[1] = interval;
1326
1327 return CMD_SUCCESS;
1328}
1329
1330DEFUN (no_lsp_gen_interval_l2,
1331 no_lsp_gen_interval_l2_cmd,
1332 "no lsp-gen-interval level-2",
1333 NO_STR
1334 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001335 "Set interval for level 2 only\n")
jardineb5d44e2003-12-23 08:09:43 +00001336{
1337 struct isis_area *area;
1338 int interval;
1339
1340 area = vty->index;
1341 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001342
jardineb5d44e2003-12-23 08:09:43 +00001343 interval = atoi (argv[0]);
1344 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
1345
1346 return CMD_SUCCESS;
1347}
1348
1349ALIAS (no_lsp_gen_interval_l2,
1350 no_lsp_gen_interval_l2_arg_cmd,
1351 "no lsp-gen-interval level-2 <1-120>",
1352 NO_STR
1353 "Minimum interval between regenerating same LSP\n"
1354 "Set interval for level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001355 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001356
1357DEFUN (metric_style,
1358 metric_style_cmd,
1359 "metric-style (narrow|wide)",
1360 "Use old-style (ISO 10589) or new-style packet formats\n"
1361 "Use old style of TLVs with narrow metric\n"
1362 "Use new style of TLVs to carry wider metric\n")
1363{
1364 struct isis_area *area;
1365
1366 area = vty->index;
1367 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001368 if (!strcmp (argv[0], "wide"))
jardineb5d44e2003-12-23 08:09:43 +00001369 area->newmetric = 1;
1370 else
1371 area->newmetric = 0;
1372
1373 return CMD_SUCCESS;
1374}
1375
1376DEFUN (no_metric_style,
1377 no_metric_style_cmd,
1378 "no metric-style (narrow|wide)",
1379 NO_STR
1380 "Use old-style (ISO 10589) or new-style packet formats\n"
1381 "Use old style of TLVs with narrow metric\n"
1382 "Use new style of TLVs to carry wider metric\n")
1383{
1384 struct isis_area *area;
1385
1386 area = vty->index;
1387 assert (area);
1388
hassof390d2c2004-09-10 20:48:21 +00001389 if (!strcmp (argv[0], "wide"))
jardineb5d44e2003-12-23 08:09:43 +00001390 area->newmetric = 0;
1391 else
1392 area->newmetric = 1;
1393
1394 return CMD_SUCCESS;
1395}
1396
1397DEFUN (dynamic_hostname,
1398 dynamic_hostname_cmd,
1399 "hostname dynamic",
1400 "Dynamic hostname for IS-IS\n"
hassof390d2c2004-09-10 20:48:21 +00001401 "Dynamic hostname\n")
jardineb5d44e2003-12-23 08:09:43 +00001402{
1403 struct isis_area *area;
1404
1405 area = vty->index;
1406 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001407
jardineb5d44e2003-12-23 08:09:43 +00001408 area->dynhostname = 1;
hassof390d2c2004-09-10 20:48:21 +00001409
jardineb5d44e2003-12-23 08:09:43 +00001410 return CMD_SUCCESS;
1411}
1412
1413DEFUN (no_dynamic_hostname,
1414 no_dynamic_hostname_cmd,
1415 "no hostname dynamic",
1416 NO_STR
1417 "Dynamic hostname for IS-IS\n"
hassof390d2c2004-09-10 20:48:21 +00001418 "Dynamic hostname\n")
jardineb5d44e2003-12-23 08:09:43 +00001419{
1420 struct isis_area *area;
1421
1422 area = vty->index;
1423 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001424
jardineb5d44e2003-12-23 08:09:43 +00001425 area->dynhostname = 0;
hassof390d2c2004-09-10 20:48:21 +00001426
jardineb5d44e2003-12-23 08:09:43 +00001427 return CMD_SUCCESS;
1428}
1429
1430DEFUN (spf_interval,
1431 spf_interval_cmd,
1432 "spf-interval <1-120>",
hasso2097cd82003-12-23 11:51:08 +00001433 "Minimum interval between SPF calculations\n"
jardineb5d44e2003-12-23 08:09:43 +00001434 "Minimum interval between consecutive SPFs in seconds\n")
1435{
1436 struct isis_area *area;
1437 u_int16_t interval;
hassof390d2c2004-09-10 20:48:21 +00001438
jardineb5d44e2003-12-23 08:09:43 +00001439 area = vty->index;
1440 interval = atoi (argv[0]);
1441 area->min_spf_interval[0] = interval;
1442 area->min_spf_interval[1] = interval;
hassof390d2c2004-09-10 20:48:21 +00001443
jardineb5d44e2003-12-23 08:09:43 +00001444 return CMD_SUCCESS;
1445}
1446
1447DEFUN (no_spf_interval,
1448 no_spf_interval_cmd,
1449 "no spf-interval",
1450 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001451 "Minimum interval between SPF calculations\n")
jardineb5d44e2003-12-23 08:09:43 +00001452{
1453 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001454
jardineb5d44e2003-12-23 08:09:43 +00001455 area = vty->index;
1456
1457 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
1458 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001459
jardineb5d44e2003-12-23 08:09:43 +00001460 return CMD_SUCCESS;
1461}
1462
1463ALIAS (no_spf_interval,
1464 no_spf_interval_arg_cmd,
1465 "no spf-interval <1-120>",
1466 NO_STR
1467 "Minimum interval between SPF calculations\n"
hassof390d2c2004-09-10 20:48:21 +00001468 "Minimum interval between consecutive SPFs in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001469
1470DEFUN (spf_interval_l1,
1471 spf_interval_l1_cmd,
1472 "spf-interval level-1 <1-120>",
1473 "Minimum interval between SPF calculations\n"
1474 "Set interval for level 1 only\n"
1475 "Minimum interval between consecutive SPFs in seconds\n")
1476{
1477 struct isis_area *area;
1478 u_int16_t interval;
hassof390d2c2004-09-10 20:48:21 +00001479
jardineb5d44e2003-12-23 08:09:43 +00001480 area = vty->index;
1481 interval = atoi (argv[0]);
1482 area->min_spf_interval[0] = interval;
hassof390d2c2004-09-10 20:48:21 +00001483
jardineb5d44e2003-12-23 08:09:43 +00001484 return CMD_SUCCESS;
1485}
1486
1487DEFUN (no_spf_interval_l1,
1488 no_spf_interval_l1_cmd,
1489 "no spf-interval level-1",
1490 NO_STR
1491 "Minimum interval between SPF calculations\n"
1492 "Set interval for level 1 only\n")
1493{
1494 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001495
jardineb5d44e2003-12-23 08:09:43 +00001496 area = vty->index;
1497
1498 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001499
jardineb5d44e2003-12-23 08:09:43 +00001500 return CMD_SUCCESS;
1501}
1502
1503ALIAS (no_spf_interval,
1504 no_spf_interval_l1_arg_cmd,
1505 "no spf-interval level-1 <1-120>",
1506 NO_STR
1507 "Minimum interval between SPF calculations\n"
1508 "Set interval for level 1 only\n"
1509 "Minimum interval between consecutive SPFs in seconds\n")
1510
1511DEFUN (spf_interval_l2,
1512 spf_interval_l2_cmd,
1513 "spf-interval level-2 <1-120>",
1514 "Minimum interval between SPF calculations\n"
1515 "Set interval for level 2 only\n"
1516 "Minimum interval between consecutive SPFs in seconds\n")
1517{
1518 struct isis_area *area;
1519 u_int16_t interval;
hassof390d2c2004-09-10 20:48:21 +00001520
jardineb5d44e2003-12-23 08:09:43 +00001521 area = vty->index;
1522 interval = atoi (argv[0]);
1523 area->min_spf_interval[1] = interval;
hassof390d2c2004-09-10 20:48:21 +00001524
jardineb5d44e2003-12-23 08:09:43 +00001525 return CMD_SUCCESS;
1526}
1527
1528DEFUN (no_spf_interval_l2,
1529 no_spf_interval_l2_cmd,
1530 "no spf-interval level-2",
1531 NO_STR
1532 "Minimum interval between SPF calculations\n"
1533 "Set interval for level 2 only\n")
1534{
1535 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001536
jardineb5d44e2003-12-23 08:09:43 +00001537 area = vty->index;
1538
1539 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001540
jardineb5d44e2003-12-23 08:09:43 +00001541 return CMD_SUCCESS;
1542}
1543
1544ALIAS (no_spf_interval,
1545 no_spf_interval_l2_arg_cmd,
1546 "no spf-interval level-2 <1-120>",
1547 NO_STR
1548 "Minimum interval between SPF calculations\n"
1549 "Set interval for level 2 only\n"
1550 "Minimum interval between consecutive SPFs in seconds\n")
1551
jardineb5d44e2003-12-23 08:09:43 +00001552#ifdef TOPOLOGY_GENERATE
1553DEFUN (topology_generate_grid,
1554 topology_generate_grid_cmd,
1555 "topology generate grid <1-100> <1-100> <1-65000> [param] [param] "
1556 "[param]",
hassof1082d12005-09-19 04:23:34 +00001557 "Topology generation for IS-IS\n"
1558 "Topology generation\n"
1559 "Grid topology\n"
jardineb5d44e2003-12-23 08:09:43 +00001560 "X parameter of the grid\n"
1561 "Y parameter of the grid\n"
1562 "Random seed\n"
1563 "Optional param 1\n"
1564 "Optional param 2\n"
1565 "Optional param 3\n"
1566 "Topology\n")
1567{
1568 struct isis_area *area;
1569
1570 area = vty->index;
1571 assert (area);
1572
hassof390d2c2004-09-10 20:48:21 +00001573 if (!spgrid_check_params (vty, argc, argv))
1574 {
1575 if (area->topology)
1576 list_delete (area->topology);
1577 area->topology = list_new ();
1578 memcpy (area->top_params, vty->buf, 200);
1579 gen_spgrid_topology (vty, area->topology);
1580 remove_topology_lsps (area);
1581 generate_topology_lsps (area);
hassof1082d12005-09-19 04:23:34 +00001582 /* Regenerate L1 LSP to get two way connection to the generated
1583 * topology. */
1584 lsp_regenerate_schedule (area);
hassof390d2c2004-09-10 20:48:21 +00001585 }
jardineb5d44e2003-12-23 08:09:43 +00001586
1587 return CMD_SUCCESS;
1588}
1589
hassof695b012005-04-02 19:03:39 +00001590DEFUN (show_isis_generated_topology,
1591 show_isis_generated_topology_cmd,
hassof1082d12005-09-19 04:23:34 +00001592 "show isis generated-topologies",
jardineb5d44e2003-12-23 08:09:43 +00001593 SHOW_STR
hassof1082d12005-09-19 04:23:34 +00001594 "CLNS network information\n"
1595 "Show generated topologies\n")
jardineb5d44e2003-12-23 08:09:43 +00001596{
1597 struct isis_area *area;
paul92c9f222005-05-25 12:21:13 +00001598 struct listnode *node;
jardineb5d44e2003-12-23 08:09:43 +00001599 struct listnode *node2;
1600 struct arc *arc;
hassof1082d12005-09-19 04:23:34 +00001601
paul92c9f222005-05-25 12:21:13 +00001602 for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
hassof1082d12005-09-19 04:23:34 +00001603 {
1604 if (!area->topology)
1605 continue;
1606
1607 vty_out (vty, "Topology for isis area: %s%s", area->area_tag,
1608 VTY_NEWLINE);
1609 vty_out (vty, "From node To node Distance%s", VTY_NEWLINE);
1610
1611 for (ALL_LIST_ELEMENTS_RO (area->topology, node2, arc))
1612 vty_out (vty, "%9ld %11ld %12ld%s", arc->from_node, arc->to_node,
1613 arc->distance, VTY_NEWLINE);
1614 }
jardineb5d44e2003-12-23 08:09:43 +00001615 return CMD_SUCCESS;
1616}
1617
hassof1082d12005-09-19 04:23:34 +00001618/* Base IS for topology generation. */
hassof390d2c2004-09-10 20:48:21 +00001619DEFUN (topology_baseis,
jardineb5d44e2003-12-23 08:09:43 +00001620 topology_baseis_cmd,
1621 "topology base-is WORD",
hassof1082d12005-09-19 04:23:34 +00001622 "Topology generation for IS-IS\n"
1623 "A Network IS Base for this topology\n"
1624 "XXXX.XXXX.XXXX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001625{
1626 struct isis_area *area;
1627 u_char buff[ISIS_SYS_ID_LEN];
1628
1629 area = vty->index;
1630 assert (area);
1631
hassof390d2c2004-09-10 20:48:21 +00001632 if (sysid2buff (buff, argv[0]))
hassof1082d12005-09-19 04:23:34 +00001633 sysid2buff (area->topology_baseis, argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001634
jardineb5d44e2003-12-23 08:09:43 +00001635 return CMD_SUCCESS;
1636}
1637
jardineb5d44e2003-12-23 08:09:43 +00001638DEFUN (no_topology_baseis,
1639 no_topology_baseis_cmd,
1640 "no topology base-is WORD",
1641 NO_STR
hassof1082d12005-09-19 04:23:34 +00001642 "Topology generation for IS-IS\n"
1643 "A Network IS Base for this topology\n"
1644 "XXXX.XXXX.XXXX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001645{
1646 struct isis_area *area;
1647
1648 area = vty->index;
1649 assert (area);
1650
hassof390d2c2004-09-10 20:48:21 +00001651 memcpy (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS, ISIS_SYS_ID_LEN);
jardineb5d44e2003-12-23 08:09:43 +00001652 return CMD_SUCCESS;
1653}
1654
hassof1082d12005-09-19 04:23:34 +00001655ALIAS (no_topology_baseis,
1656 no_topology_baseis_noid_cmd,
1657 "no topology base-is",
1658 NO_STR
1659 "Topology generation for IS-IS\n"
1660 "A Network IS Base for this topology\n")
1661
1662DEFUN (topology_basedynh,
1663 topology_basedynh_cmd,
1664 "topology base-dynh WORD",
1665 "Topology generation for IS-IS\n"
1666 "Dynamic hostname base for this topology\n"
1667 "Dynamic hostname base\n")
1668{
1669 struct isis_area *area;
1670
1671 area = vty->index;
1672 assert (area);
1673
1674 /* I hope that it's enough. */
1675 area->topology_basedynh = strndup (argv[0], 16);
1676 return CMD_SUCCESS;
1677}
jardineb5d44e2003-12-23 08:09:43 +00001678#endif /* TOPOLOGY_GENERATE */
1679
1680DEFUN (lsp_lifetime,
1681 lsp_lifetime_cmd,
1682 "lsp-lifetime <380-65535>",
1683 "Maximum LSP lifetime\n"
hassof390d2c2004-09-10 20:48:21 +00001684 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001685{
1686 struct isis_area *area;
1687 uint16_t interval;
1688
1689 area = vty->index;
1690 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001691
jardineb5d44e2003-12-23 08:09:43 +00001692 interval = atoi (argv[0]);
1693
hassof390d2c2004-09-10 20:48:21 +00001694 if (interval < ISIS_MIN_LSP_LIFETIME)
1695 {
1696 vty_out (vty, "LSP lifetime (%us) below %us%s",
1697 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001698
hassof390d2c2004-09-10 20:48:21 +00001699 return CMD_WARNING;
1700 }
jardineb5d44e2003-12-23 08:09:43 +00001701
1702
1703 area->max_lsp_lifetime[0] = interval;
1704 area->max_lsp_lifetime[1] = interval;
hassof390d2c2004-09-10 20:48:21 +00001705 area->lsp_refresh[0] = interval - 300;
1706 area->lsp_refresh[1] = interval - 300;
jardineb5d44e2003-12-23 08:09:43 +00001707
hassof390d2c2004-09-10 20:48:21 +00001708 if (area->t_lsp_refresh[0])
1709 {
1710 thread_cancel (area->t_lsp_refresh[0]);
1711 thread_execute (master, lsp_refresh_l1, area, 0);
1712 }
jardineb5d44e2003-12-23 08:09:43 +00001713
hassof390d2c2004-09-10 20:48:21 +00001714 if (area->t_lsp_refresh[1])
1715 {
1716 thread_cancel (area->t_lsp_refresh[1]);
1717 thread_execute (master, lsp_refresh_l2, area, 0);
1718 }
jardineb5d44e2003-12-23 08:09:43 +00001719
1720
1721 return CMD_SUCCESS;
1722}
1723
1724DEFUN (no_lsp_lifetime,
1725 no_lsp_lifetime_cmd,
1726 "no lsp-lifetime",
1727 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001728 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001729{
1730 struct isis_area *area;
1731
1732 area = vty->index;
1733 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001734
1735 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200s */
1736 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200s */
1737 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900s */
1738 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001739
1740 return CMD_SUCCESS;
1741}
1742
1743ALIAS (no_lsp_lifetime,
1744 no_lsp_lifetime_arg_cmd,
1745 "no lsp-lifetime <380-65535>",
1746 NO_STR
1747 "Maximum LSP lifetime\n"
hassof390d2c2004-09-10 20:48:21 +00001748 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001749
1750DEFUN (lsp_lifetime_l1,
1751 lsp_lifetime_l1_cmd,
1752 "lsp-lifetime level-1 <380-65535>",
1753 "Maximum LSP lifetime for Level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001754 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001755{
1756 struct isis_area *area;
1757 uint16_t interval;
1758
1759 area = vty->index;
1760 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001761
jardineb5d44e2003-12-23 08:09:43 +00001762 interval = atoi (argv[0]);
1763
hassof390d2c2004-09-10 20:48:21 +00001764 if (interval < ISIS_MIN_LSP_LIFETIME)
1765 {
1766 vty_out (vty, "Level-1 LSP lifetime (%us) below %us%s",
1767 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001768
hassof390d2c2004-09-10 20:48:21 +00001769 return CMD_WARNING;
1770 }
jardineb5d44e2003-12-23 08:09:43 +00001771
1772
1773 area->max_lsp_lifetime[0] = interval;
hassof390d2c2004-09-10 20:48:21 +00001774 area->lsp_refresh[0] = interval - 300;
jardineb5d44e2003-12-23 08:09:43 +00001775
1776 return CMD_SUCCESS;
1777}
1778
1779DEFUN (no_lsp_lifetime_l1,
1780 no_lsp_lifetime_l1_cmd,
1781 "no lsp-lifetime level-1",
1782 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001783 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001784{
1785 struct isis_area *area;
1786
1787 area = vty->index;
1788 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001789
1790 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200s */
1791 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001792
1793 return CMD_SUCCESS;
1794}
1795
1796ALIAS (no_lsp_lifetime_l1,
1797 no_lsp_lifetime_l1_arg_cmd,
1798 "no lsp-lifetime level-1 <380-65535>",
1799 NO_STR
1800 "Maximum LSP lifetime for Level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001801 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001802
1803DEFUN (lsp_lifetime_l2,
1804 lsp_lifetime_l2_cmd,
1805 "lsp-lifetime level-2 <380-65535>",
1806 "Maximum LSP lifetime for Level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001807 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001808{
1809 struct isis_area *area;
1810 uint16_t interval;
1811
1812 area = vty->index;
1813 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001814
jardineb5d44e2003-12-23 08:09:43 +00001815 interval = atoi (argv[0]);
1816
hassof390d2c2004-09-10 20:48:21 +00001817 if (interval < ISIS_MIN_LSP_LIFETIME)
1818 {
1819 vty_out (vty, "Level-2 LSP lifetime (%us) below %us%s",
1820 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001821
hassof390d2c2004-09-10 20:48:21 +00001822 return CMD_WARNING;
1823 }
jardineb5d44e2003-12-23 08:09:43 +00001824
1825 area->max_lsp_lifetime[1] = interval;
1826 area->lsp_refresh[1] = interval - 300;
1827
1828 return CMD_SUCCESS;
1829}
1830
1831DEFUN (no_lsp_lifetime_l2,
1832 no_lsp_lifetime_l2_cmd,
1833 "no lsp-lifetime level-2",
1834 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001835 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001836{
1837 struct isis_area *area;
1838
1839 area = vty->index;
1840 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001841
1842 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200s */
1843 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001844
1845 return CMD_SUCCESS;
1846}
1847
1848ALIAS (no_lsp_lifetime_l2,
1849 no_lsp_lifetime_l2_arg_cmd,
1850 "no lsp-lifetime level-2 <380-65535>",
1851 NO_STR
1852 "Maximum LSP lifetime for Level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001853 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001854
1855/* IS-IS configuration write function */
1856int
1857isis_config_write (struct vty *vty)
1858{
1859 int write = 0;
jardineb5d44e2003-12-23 08:09:43 +00001860
hassof390d2c2004-09-10 20:48:21 +00001861 if (isis != NULL)
1862 {
1863 struct isis_area *area;
paul1eb8ef22005-04-07 07:30:20 +00001864 struct listnode *node, *nnode;
1865 struct listnode *node2, *nnode2;
jardineb5d44e2003-12-23 08:09:43 +00001866
paul1eb8ef22005-04-07 07:30:20 +00001867 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
hassof390d2c2004-09-10 20:48:21 +00001868 {
1869 /* ISIS - Area name */
1870 vty_out (vty, "router isis %s%s", area->area_tag, VTY_NEWLINE);
1871 write++;
1872 /* ISIS - Net */
1873 if (listcount (area->area_addrs) > 0)
1874 {
1875 struct area_addr *area_addr;
paul1eb8ef22005-04-07 07:30:20 +00001876 for (ALL_LIST_ELEMENTS (area->area_addrs, node2, nnode2, area_addr))
hassof390d2c2004-09-10 20:48:21 +00001877 {
1878 vty_out (vty, " net %s%s",
1879 isonet_print (area_addr->area_addr,
1880 area_addr->addr_len + ISIS_SYS_ID_LEN +
1881 1), VTY_NEWLINE);
1882 write++;
1883 }
1884 }
1885 /* ISIS - Dynamic hostname - Defaults to true so only display if false */
1886 if (!area->dynhostname)
1887 {
1888 vty_out (vty, " no hostname dynamic%s", VTY_NEWLINE);
1889 write++;
1890 }
1891 /* ISIS - Metric-Style - when true displays wide */
1892 if (area->newmetric)
1893 {
1894 vty_out (vty, " metric-style wide%s", VTY_NEWLINE);
1895 write++;
1896 }
1897 /* ISIS - Area is-type (level-1-2 is default) */
1898 if (area->is_type == IS_LEVEL_1)
1899 {
1900 vty_out (vty, " is-type level-1%s", VTY_NEWLINE);
1901 write++;
1902 }
1903 else
1904 {
1905 if (area->is_type == IS_LEVEL_2)
1906 {
1907 vty_out (vty, " is-type level-2-only%s", VTY_NEWLINE);
1908 write++;
1909 }
1910 }
1911 /* ISIS - Lsp generation interval */
1912 if (area->lsp_gen_interval[0] == area->lsp_gen_interval[1])
1913 {
1914 if (area->lsp_gen_interval[0] != LSP_GEN_INTERVAL_DEFAULT)
1915 {
1916 vty_out (vty, " lsp-gen-interval %d%s",
1917 area->lsp_gen_interval[0], VTY_NEWLINE);
1918 write++;
1919 }
1920 }
1921 else
1922 {
1923 if (area->lsp_gen_interval[0] != LSP_GEN_INTERVAL_DEFAULT)
1924 {
1925 vty_out (vty, " lsp-gen-interval level-1 %d%s",
1926 area->lsp_gen_interval[0], VTY_NEWLINE);
1927 write++;
1928 }
1929 if (area->lsp_gen_interval[1] != LSP_GEN_INTERVAL_DEFAULT)
1930 {
1931 vty_out (vty, " lsp-gen-interval level-2 %d%s",
1932 area->lsp_gen_interval[1], VTY_NEWLINE);
1933 write++;
1934 }
1935 }
1936 /* ISIS - LSP lifetime */
1937 if (area->max_lsp_lifetime[0] == area->max_lsp_lifetime[1])
1938 {
1939 if (area->max_lsp_lifetime[0] != MAX_AGE)
1940 {
1941 vty_out (vty, " lsp-lifetime %u%s", area->max_lsp_lifetime[0],
1942 VTY_NEWLINE);
1943 write++;
1944 }
1945 }
1946 else
1947 {
1948 if (area->max_lsp_lifetime[0] != MAX_AGE)
1949 {
1950 vty_out (vty, " lsp-lifetime level-1 %u%s",
1951 area->max_lsp_lifetime[0], VTY_NEWLINE);
1952 write++;
1953 }
1954 if (area->max_lsp_lifetime[1] != MAX_AGE)
1955 {
1956 vty_out (vty, " lsp-lifetime level-2 %u%s",
1957 area->max_lsp_lifetime[1], VTY_NEWLINE);
1958 write++;
1959 }
1960 }
hasso53c997c2004-09-15 16:21:59 +00001961 /* Authentication passwords. */
1962 if (area->area_passwd.len > 0)
1963 {
hasso1cbc5622005-01-01 10:29:51 +00001964 vty_out(vty, " area-password %s", area->area_passwd.passwd);
1965 if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND))
1966 {
1967 vty_out(vty, " authenticate snp ");
1968 if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV))
1969 vty_out(vty, "validate");
1970 else
1971 vty_out(vty, "send-only");
1972 }
1973 vty_out(vty, "%s", VTY_NEWLINE);
hasso53c997c2004-09-15 16:21:59 +00001974 write++;
1975 }
1976 if (area->domain_passwd.len > 0)
1977 {
hasso1cbc5622005-01-01 10:29:51 +00001978 vty_out(vty, " domain-password %s", area->domain_passwd.passwd);
1979 if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND))
1980 {
1981 vty_out(vty, " authenticate snp ");
1982 if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV))
1983 vty_out(vty, "validate");
1984 else
1985 vty_out(vty, "send-only");
1986 }
1987 vty_out(vty, "%s", VTY_NEWLINE);
hasso53c997c2004-09-15 16:21:59 +00001988 write++;
1989 }
hassof1082d12005-09-19 04:23:34 +00001990
hassof390d2c2004-09-10 20:48:21 +00001991#ifdef TOPOLOGY_GENERATE
hassof1082d12005-09-19 04:23:34 +00001992 if (memcmp (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS,
1993 ISIS_SYS_ID_LEN))
1994 {
1995 vty_out (vty, " topology base-is %s%s",
1996 sysid_print (area->topology_baseis), VTY_NEWLINE);
1997 write++;
1998 }
1999 if (area->topology_basedynh)
2000 {
2001 vty_out (vty, " topology base-dynh %s%s",
2002 area->topology_basedynh, VTY_NEWLINE);
2003 write++;
2004 }
2005 /* We save the whole command line here. */
2006 if (strlen(area->top_params))
hassof390d2c2004-09-10 20:48:21 +00002007 {
2008 vty_out (vty, " %s%s", area->top_params, VTY_NEWLINE);
2009 write++;
2010 }
hassof390d2c2004-09-10 20:48:21 +00002011#endif /* TOPOLOGY_GENERATE */
hassof1082d12005-09-19 04:23:34 +00002012
hassof390d2c2004-09-10 20:48:21 +00002013 }
jardineb5d44e2003-12-23 08:09:43 +00002014 }
hassof390d2c2004-09-10 20:48:21 +00002015
jardineb5d44e2003-12-23 08:09:43 +00002016 return write;
2017}
2018
hassof390d2c2004-09-10 20:48:21 +00002019struct cmd_node isis_node = {
jardineb5d44e2003-12-23 08:09:43 +00002020 ISIS_NODE,
hasso2097cd82003-12-23 11:51:08 +00002021 "%s(config-router)# ",
jardineb5d44e2003-12-23 08:09:43 +00002022 1
2023};
2024
hassof390d2c2004-09-10 20:48:21 +00002025void
jardineb5d44e2003-12-23 08:09:43 +00002026isis_init ()
2027{
jardineb5d44e2003-12-23 08:09:43 +00002028 /* Install IS-IS top node */
2029 install_node (&isis_node, isis_config_write);
hassof390d2c2004-09-10 20:48:21 +00002030
jardineb5d44e2003-12-23 08:09:43 +00002031 install_element (VIEW_NODE, &show_clns_neighbors_cmd);
2032 install_element (VIEW_NODE, &show_isis_neighbors_cmd);
2033 install_element (VIEW_NODE, &show_clns_neighbors_detail_cmd);
2034 install_element (VIEW_NODE, &show_isis_neighbors_detail_cmd);
2035
2036 install_element (VIEW_NODE, &show_hostname_cmd);
2037 install_element (VIEW_NODE, &show_database_cmd);
2038 install_element (VIEW_NODE, &show_database_detail_cmd);
2039
2040 install_element (ENABLE_NODE, &show_clns_neighbors_cmd);
2041 install_element (ENABLE_NODE, &show_isis_neighbors_cmd);
2042 install_element (ENABLE_NODE, &show_clns_neighbors_detail_cmd);
2043 install_element (ENABLE_NODE, &show_isis_neighbors_detail_cmd);
2044
2045 install_element (ENABLE_NODE, &show_hostname_cmd);
2046 install_element (ENABLE_NODE, &show_database_cmd);
2047 install_element (ENABLE_NODE, &show_database_detail_cmd);
2048 install_element (ENABLE_NODE, &show_debugging_cmd);
2049
hassof390d2c2004-09-10 20:48:21 +00002050 install_node (&debug_node, config_write_debug);
jardin9e867fe2003-12-23 08:56:18 +00002051
jardineb5d44e2003-12-23 08:09:43 +00002052 install_element (ENABLE_NODE, &debug_isis_adj_cmd);
2053 install_element (ENABLE_NODE, &no_debug_isis_adj_cmd);
2054 install_element (ENABLE_NODE, &debug_isis_csum_cmd);
2055 install_element (ENABLE_NODE, &no_debug_isis_csum_cmd);
2056 install_element (ENABLE_NODE, &debug_isis_lupd_cmd);
2057 install_element (ENABLE_NODE, &no_debug_isis_lupd_cmd);
2058 install_element (ENABLE_NODE, &debug_isis_err_cmd);
2059 install_element (ENABLE_NODE, &no_debug_isis_err_cmd);
2060 install_element (ENABLE_NODE, &debug_isis_snp_cmd);
2061 install_element (ENABLE_NODE, &no_debug_isis_snp_cmd);
2062 install_element (ENABLE_NODE, &debug_isis_upd_cmd);
2063 install_element (ENABLE_NODE, &no_debug_isis_upd_cmd);
2064 install_element (ENABLE_NODE, &debug_isis_spfevents_cmd);
2065 install_element (ENABLE_NODE, &no_debug_isis_spfevents_cmd);
2066 install_element (ENABLE_NODE, &debug_isis_spfstats_cmd);
2067 install_element (ENABLE_NODE, &no_debug_isis_spfstats_cmd);
2068 install_element (ENABLE_NODE, &debug_isis_spftrigg_cmd);
2069 install_element (ENABLE_NODE, &no_debug_isis_spftrigg_cmd);
2070 install_element (ENABLE_NODE, &debug_isis_rtevents_cmd);
2071 install_element (ENABLE_NODE, &no_debug_isis_rtevents_cmd);
2072 install_element (ENABLE_NODE, &debug_isis_events_cmd);
2073 install_element (ENABLE_NODE, &no_debug_isis_events_cmd);
2074
jardin9e867fe2003-12-23 08:56:18 +00002075 install_element (CONFIG_NODE, &debug_isis_adj_cmd);
2076 install_element (CONFIG_NODE, &no_debug_isis_adj_cmd);
2077 install_element (CONFIG_NODE, &debug_isis_csum_cmd);
2078 install_element (CONFIG_NODE, &no_debug_isis_csum_cmd);
2079 install_element (CONFIG_NODE, &debug_isis_lupd_cmd);
2080 install_element (CONFIG_NODE, &no_debug_isis_lupd_cmd);
2081 install_element (CONFIG_NODE, &debug_isis_err_cmd);
2082 install_element (CONFIG_NODE, &no_debug_isis_err_cmd);
2083 install_element (CONFIG_NODE, &debug_isis_snp_cmd);
2084 install_element (CONFIG_NODE, &no_debug_isis_snp_cmd);
2085 install_element (CONFIG_NODE, &debug_isis_upd_cmd);
2086 install_element (CONFIG_NODE, &no_debug_isis_upd_cmd);
2087 install_element (CONFIG_NODE, &debug_isis_spfevents_cmd);
2088 install_element (CONFIG_NODE, &no_debug_isis_spfevents_cmd);
2089 install_element (CONFIG_NODE, &debug_isis_spfstats_cmd);
2090 install_element (CONFIG_NODE, &no_debug_isis_spfstats_cmd);
2091 install_element (CONFIG_NODE, &debug_isis_spftrigg_cmd);
2092 install_element (CONFIG_NODE, &no_debug_isis_spftrigg_cmd);
2093 install_element (CONFIG_NODE, &debug_isis_rtevents_cmd);
2094 install_element (CONFIG_NODE, &no_debug_isis_rtevents_cmd);
2095 install_element (CONFIG_NODE, &debug_isis_events_cmd);
2096 install_element (CONFIG_NODE, &no_debug_isis_events_cmd);
2097
jardineb5d44e2003-12-23 08:09:43 +00002098 install_element (CONFIG_NODE, &router_isis_cmd);
2099 install_element (CONFIG_NODE, &no_router_isis_cmd);
2100
2101 install_default (ISIS_NODE);
2102
2103 install_element (ISIS_NODE, &net_cmd);
2104 install_element (ISIS_NODE, &no_net_cmd);
2105
2106 install_element (ISIS_NODE, &is_type_cmd);
2107 install_element (ISIS_NODE, &no_is_type_cmd);
2108
2109 install_element (ISIS_NODE, &area_passwd_cmd);
hasso1cbc5622005-01-01 10:29:51 +00002110 install_element (ISIS_NODE, &area_passwd_snpauth_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002111 install_element (ISIS_NODE, &no_area_passwd_cmd);
2112
2113 install_element (ISIS_NODE, &domain_passwd_cmd);
hasso1cbc5622005-01-01 10:29:51 +00002114 install_element (ISIS_NODE, &domain_passwd_snpauth_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002115 install_element (ISIS_NODE, &no_domain_passwd_cmd);
2116
2117 install_element (ISIS_NODE, &lsp_gen_interval_cmd);
2118 install_element (ISIS_NODE, &no_lsp_gen_interval_cmd);
2119 install_element (ISIS_NODE, &no_lsp_gen_interval_arg_cmd);
2120 install_element (ISIS_NODE, &lsp_gen_interval_l1_cmd);
2121 install_element (ISIS_NODE, &no_lsp_gen_interval_l1_cmd);
2122 install_element (ISIS_NODE, &no_lsp_gen_interval_l1_arg_cmd);
2123 install_element (ISIS_NODE, &lsp_gen_interval_l2_cmd);
2124 install_element (ISIS_NODE, &no_lsp_gen_interval_l2_cmd);
2125 install_element (ISIS_NODE, &no_lsp_gen_interval_l2_arg_cmd);
2126
2127 install_element (ISIS_NODE, &spf_interval_cmd);
2128 install_element (ISIS_NODE, &no_spf_interval_cmd);
2129 install_element (ISIS_NODE, &no_spf_interval_arg_cmd);
2130 install_element (ISIS_NODE, &spf_interval_l1_cmd);
2131 install_element (ISIS_NODE, &no_spf_interval_l1_cmd);
2132 install_element (ISIS_NODE, &no_spf_interval_l1_arg_cmd);
2133 install_element (ISIS_NODE, &spf_interval_l2_cmd);
2134 install_element (ISIS_NODE, &no_spf_interval_l2_cmd);
2135 install_element (ISIS_NODE, &no_spf_interval_l2_arg_cmd);
hassof390d2c2004-09-10 20:48:21 +00002136
jardineb5d44e2003-12-23 08:09:43 +00002137 install_element (ISIS_NODE, &lsp_lifetime_cmd);
2138 install_element (ISIS_NODE, &no_lsp_lifetime_cmd);
2139 install_element (ISIS_NODE, &no_lsp_lifetime_arg_cmd);
2140 install_element (ISIS_NODE, &lsp_lifetime_l1_cmd);
2141 install_element (ISIS_NODE, &no_lsp_lifetime_l1_cmd);
2142 install_element (ISIS_NODE, &no_lsp_lifetime_l1_arg_cmd);
2143 install_element (ISIS_NODE, &lsp_lifetime_l2_cmd);
2144 install_element (ISIS_NODE, &no_lsp_lifetime_l2_cmd);
2145 install_element (ISIS_NODE, &no_lsp_lifetime_l2_arg_cmd);
2146
2147 install_element (ISIS_NODE, &dynamic_hostname_cmd);
2148 install_element (ISIS_NODE, &no_dynamic_hostname_cmd);
2149
2150 install_element (ISIS_NODE, &metric_style_cmd);
2151 install_element (ISIS_NODE, &no_metric_style_cmd);
2152#ifdef TOPOLOGY_GENERATE
2153 install_element (ISIS_NODE, &topology_generate_grid_cmd);
2154 install_element (ISIS_NODE, &topology_baseis_cmd);
hassof1082d12005-09-19 04:23:34 +00002155 install_element (ISIS_NODE, &topology_basedynh_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002156 install_element (ISIS_NODE, &no_topology_baseis_cmd);
hassof1082d12005-09-19 04:23:34 +00002157 install_element (ISIS_NODE, &no_topology_baseis_noid_cmd);
hassof695b012005-04-02 19:03:39 +00002158 install_element (VIEW_NODE, &show_isis_generated_topology_cmd);
2159 install_element (ENABLE_NODE, &show_isis_generated_topology_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002160#endif /* TOPOLOGY_GENERATE */
2161
hassof390d2c2004-09-10 20:48:21 +00002162 isis_new (0);
jardineb5d44e2003-12-23 08:09:43 +00002163 isis_circuit_init ();
2164 isis_zebra_init ();
2165 isis_spf_cmds_init ();
2166}