blob: e6679cf3599e4f11413752f806b57ebbde4a4abb [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
23#include <string.h>
24#include <zebra.h>
jardineb5d44e2003-12-23 08:09:43 +000025
26#include "thread.h"
27#include "vty.h"
28#include "command.h"
29#include "log.h"
30#include "memory.h"
31#include "linklist.h"
32#include "if.h"
33#include "hash.h"
34#include "stream.h"
35#include "prefix.h"
36#include "table.h"
37
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_circuit.h"
43#include "isisd/isis_flags.h"
44#include "isisd/isisd.h"
45#include "isisd/isis_dynhn.h"
46#include "isisd/isis_adjacency.h"
47#include "isisd/isis_pdu.h"
48#include "isisd/isis_misc.h"
49#include "isisd/isis_constants.h"
50#include "isisd/isis_tlv.h"
51#include "isisd/isis_lsp.h"
52#include "isisd/isis_spf.h"
53#include "isisd/isis_route.h"
54#include "isisd/isis_zebra.h"
55#include "isisd/isis_events.h"
56
57#ifdef TOPOLOGY_GENERATE
58#include "spgrid.h"
hassof390d2c2004-09-10 20:48:21 +000059u_char DEFAULT_TOPOLOGY_BASEIS[6] = { 0xFE, 0xED, 0xFE, 0xED, 0x00, 0x00 };
jardineb5d44e2003-12-23 08:09:43 +000060#endif /* TOPOLOGY_GENERATE */
61
jardineb5d44e2003-12-23 08:09:43 +000062struct isis *isis = NULL;
hasso73d1aea2004-09-24 10:45:28 +000063extern struct thread_master *master;
jardineb5d44e2003-12-23 08:09:43 +000064
jardineb5d44e2003-12-23 08:09:43 +000065void
66isis_new (unsigned long process_id)
67{
hassoaac372f2005-09-01 17:52:33 +000068 isis = XCALLOC (MTYPE_ISIS, sizeof (struct isis));
jardineb5d44e2003-12-23 08:09:43 +000069 /*
70 * Default values
71 */
72 isis->max_area_addrs = 3;
73
74 isis->process_id = process_id;
75 isis->area_list = list_new ();
76 isis->init_circ_list = list_new ();
77 isis->uptime = time (NULL);
78 isis->nexthops = list_new ();
79#ifdef HAVE_IPV6
80 isis->nexthops6 = list_new ();
81#endif /* HAVE_IPV6 */
82 /*
83 * uncomment the next line for full debugs
84 */
hassof390d2c2004-09-10 20:48:21 +000085 /* isis->debugs = 0xFFFF; */
jardineb5d44e2003-12-23 08:09:43 +000086}
87
88struct isis_area *
89isis_area_create ()
90{
jardineb5d44e2003-12-23 08:09:43 +000091 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +000092
hassoaac372f2005-09-01 17:52:33 +000093 area = XCALLOC (MTYPE_ISIS_AREA, sizeof (struct isis_area));
jardineb5d44e2003-12-23 08:09:43 +000094
95 /*
96 * The first instance is level-1-2 rest are level-1, unless otherwise
97 * configured
98 */
99 if (listcount (isis->area_list) > 0)
100 area->is_type = IS_LEVEL_1;
101 else
102 area->is_type = IS_LEVEL_1_AND_2;
103 /*
104 * intialize the databases
105 */
106 area->lspdb[0] = lsp_db_init ();
107 area->lspdb[1] = lsp_db_init ();
hassof390d2c2004-09-10 20:48:21 +0000108
jardineb5d44e2003-12-23 08:09:43 +0000109 spftree_area_init (area);
110 area->route_table = route_table_init ();
111#ifdef HAVE_IPV6
112 area->route_table6 = route_table_init ();
113#endif /* HAVE_IPV6 */
114 area->circuit_list = list_new ();
115 area->area_addrs = list_new ();
hassof390d2c2004-09-10 20:48:21 +0000116 THREAD_TIMER_ON (master, area->t_tick, lsp_tick, area, 1);
jardineb5d44e2003-12-23 08:09:43 +0000117 area->flags.maxindex = -1;
118 /*
119 * Default values
120 */
hassof390d2c2004-09-10 20:48:21 +0000121 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200 */
122 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200 */
jardineb5d44e2003-12-23 08:09:43 +0000123 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
124 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
hassof390d2c2004-09-10 20:48:21 +0000125 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900 */
126 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900 */
jardineb5d44e2003-12-23 08:09:43 +0000127 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
128 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
129 area->dynhostname = 1;
130 area->lsp_frag_threshold = 90;
131#ifdef TOPOLOGY_GENERATE
132 memcpy (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS, ISIS_SYS_ID_LEN);
133#endif /* TOPOLOGY_GENERATE */
134
135 /* FIXME: Think of a better way... */
136 area->min_bcast_mtu = 1497;
137
138 return area;
139}
140
141struct isis_area *
hassof90a5f62004-10-11 13:11:56 +0000142isis_area_lookup (const char *area_tag)
jardineb5d44e2003-12-23 08:09:43 +0000143{
144 struct isis_area *area;
paul1eb8ef22005-04-07 07:30:20 +0000145 struct listnode *node, *nnode;
hassof390d2c2004-09-10 20:48:21 +0000146
paul1eb8ef22005-04-07 07:30:20 +0000147 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
jardineb5d44e2003-12-23 08:09:43 +0000148 if ((area->area_tag == NULL && area_tag == NULL) ||
hassof390d2c2004-09-10 20:48:21 +0000149 (area->area_tag && area_tag
150 && strcmp (area->area_tag, area_tag) == 0))
151 return area;
152
jardineb5d44e2003-12-23 08:09:43 +0000153 return NULL;
154}
155
hassof390d2c2004-09-10 20:48:21 +0000156int
hassof90a5f62004-10-11 13:11:56 +0000157isis_area_get (struct vty *vty, const char *area_tag)
jardineb5d44e2003-12-23 08:09:43 +0000158{
jardineb5d44e2003-12-23 08:09:43 +0000159 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000160
jardineb5d44e2003-12-23 08:09:43 +0000161 area = isis_area_lookup (area_tag);
hassof390d2c2004-09-10 20:48:21 +0000162
163 if (area)
164 {
165 vty->node = ISIS_NODE;
166 vty->index = area;
167 return CMD_SUCCESS;
168 }
169
jardineb5d44e2003-12-23 08:09:43 +0000170 area = isis_area_create ();
171 area->area_tag = strdup (area_tag);
172 listnode_add (isis->area_list, area);
hassof390d2c2004-09-10 20:48:21 +0000173
hasso529d65b2004-12-24 00:14:50 +0000174 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;
hasso529d65b2004-12-24 00:14:50 +0000263 zlog_debug ("Router has SystemID %s", sysid_print (isis->sysid));
jardineb5d44e2003-12-23 08:09:43 +0000264 }
hassof390d2c2004-09-10 20:48:21 +0000265 else
266 {
267 /*
268 * Check that the SystemID portions match
269 */
270 if (memcmp (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN),
271 ISIS_SYS_ID_LEN))
272 {
273 vty_out (vty,
274 "System ID must not change when defining additional area"
275 " addresses%s", VTY_NEWLINE);
276 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
277 return CMD_WARNING;
278 }
jardineb5d44e2003-12-23 08:09:43 +0000279
hassof390d2c2004-09-10 20:48:21 +0000280 /* now we see that we don't already have this address */
paul1eb8ef22005-04-07 07:30:20 +0000281 for (ALL_LIST_ELEMENTS (area->area_addrs, node, nnode, addrp))
hassof390d2c2004-09-10 20:48:21 +0000282 {
283 if ((addrp->addr_len + ISIS_SYS_ID_LEN + 1) == (addr->addr_len))
284 {
285 if (!memcmp (addrp->area_addr, addr->area_addr, addr->addr_len))
286 {
287 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
288 return CMD_SUCCESS; /* silent fail */
289 }
290 }
291 }
292
293 }
jardineb5d44e2003-12-23 08:09:43 +0000294 /*
295 * Forget the systemID part of the address
296 */
297 addr->addr_len -= (ISIS_SYS_ID_LEN + 1);
298 listnode_add (area->area_addrs, addr);
299
300 /* only now we can safely generate our LSPs for this area */
hassof390d2c2004-09-10 20:48:21 +0000301 if (listcount (area->area_addrs) > 0)
302 {
303 lsp_l1_generate (area);
304 lsp_l2_generate (area);
305 }
jardineb5d44e2003-12-23 08:09:43 +0000306
307 return CMD_SUCCESS;
308}
309
310int
hassof7c43dc2004-09-26 16:24:14 +0000311area_clear_net_title (struct vty *vty, u_char *net_title)
jardineb5d44e2003-12-23 08:09:43 +0000312{
313 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000314 struct area_addr addr, *addrp = NULL;
paul1eb8ef22005-04-07 07:30:20 +0000315 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000316 u_char buff[255];
317
318 area = vty->index;
hassof390d2c2004-09-10 20:48:21 +0000319 if (!area)
320 {
321 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
322 return CMD_WARNING;
323 }
324
jardineb5d44e2003-12-23 08:09:43 +0000325 addr.addr_len = dotformat2buff (buff, net_title);
hassof390d2c2004-09-10 20:48:21 +0000326 if (addr.addr_len < 8 || addr.addr_len > 20)
327 {
328 vty_out (vty, "Unsupported area address length %d, should be 8...20 %s",
329 addr.addr_len, VTY_NEWLINE);
330 return CMD_WARNING;
331 }
332
333 memcpy (addr.area_addr, buff, (int) addr.addr_len);
334
paul1eb8ef22005-04-07 07:30:20 +0000335 for (ALL_LIST_ELEMENTS (area->area_addrs, node, nnode, addrp))
jardineb5d44e2003-12-23 08:09:43 +0000336 if (addrp->addr_len == addr.addr_len &&
337 !memcmp (addrp->area_addr, addr.area_addr, addr.addr_len))
hassof390d2c2004-09-10 20:48:21 +0000338 break;
339
340 if (!addrp)
341 {
342 vty_out (vty, "No area address %s for area %s %s", net_title,
343 area->area_tag, VTY_NEWLINE);
344 return CMD_WARNING;
345 }
346
jardineb5d44e2003-12-23 08:09:43 +0000347 listnode_delete (area->area_addrs, addrp);
hassof390d2c2004-09-10 20:48:21 +0000348
jardineb5d44e2003-12-23 08:09:43 +0000349 return CMD_SUCCESS;
350}
351
jardineb5d44e2003-12-23 08:09:43 +0000352/*
353 * 'show clns neighbors' command
354 */
355
356int
hassof390d2c2004-09-10 20:48:21 +0000357show_clns_neigh (struct vty *vty, char detail)
jardineb5d44e2003-12-23 08:09:43 +0000358{
paul1eb8ef22005-04-07 07:30:20 +0000359 struct listnode *anode, *annode, *cnode, *cnnode;
jardineb5d44e2003-12-23 08:09:43 +0000360 struct isis_area *area;
361 struct isis_circuit *circuit;
362 struct list *db;
363 int i;
364
hassof390d2c2004-09-10 20:48:21 +0000365 if (!isis)
366 {
367 vty_out (vty, "IS-IS Routing Process not enabled%s", VTY_NEWLINE);
368 return CMD_SUCCESS;
369 }
jardineb5d44e2003-12-23 08:09:43 +0000370
paul1eb8ef22005-04-07 07:30:20 +0000371 for (ALL_LIST_ELEMENTS (isis->area_list, anode, annode, area))
hassof390d2c2004-09-10 20:48:21 +0000372 {
hassof390d2c2004-09-10 20:48:21 +0000373 vty_out (vty, "Area %s:%s", area->area_tag, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000374
hassof390d2c2004-09-10 20:48:21 +0000375 if (detail == ISIS_UI_LEVEL_BRIEF)
376 vty_out (vty, " System Id Interface L State "
377 "Holdtime SNPA%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000378
paul1eb8ef22005-04-07 07:30:20 +0000379 for (ALL_LIST_ELEMENTS (area->circuit_list, cnode, cnnode, circuit))
hassof390d2c2004-09-10 20:48:21 +0000380 {
hassof390d2c2004-09-10 20:48:21 +0000381 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
382 {
383 for (i = 0; i < 2; i++)
384 {
385 db = circuit->u.bc.adjdb[i];
386 if (db && db->count)
387 {
388 if (detail == ISIS_UI_LEVEL_BRIEF)
389 isis_adjdb_iterate (db,
390 (void (*)
391 (struct isis_adjacency *,
392 void *)) isis_adj_print_vty,
393 vty);
394 if (detail == ISIS_UI_LEVEL_DETAIL)
395 isis_adjdb_iterate (db,
396 (void (*)
397 (struct isis_adjacency *,
398 void *))
399 isis_adj_print_vty_detail, vty);
400 if (detail == ISIS_UI_LEVEL_EXTENSIVE)
401 isis_adjdb_iterate (db,
402 (void (*)
403 (struct isis_adjacency *,
404 void *))
405 isis_adj_print_vty_extensive,
406 vty);
407 }
408 }
409 }
410 else if (circuit->circ_type == CIRCUIT_T_P2P &&
411 circuit->u.p2p.neighbor)
412 {
413 if (detail == ISIS_UI_LEVEL_BRIEF)
414 isis_adj_p2p_print_vty (circuit->u.p2p.neighbor, vty);
415 if (detail == ISIS_UI_LEVEL_DETAIL)
416 isis_adj_p2p_print_vty_detail (circuit->u.p2p.neighbor, vty);
417 if (detail == ISIS_UI_LEVEL_EXTENSIVE)
418 isis_adj_p2p_print_vty_extensive (circuit->u.p2p.neighbor,
419 vty);
420 }
421 }
jardineb5d44e2003-12-23 08:09:43 +0000422 }
hassof390d2c2004-09-10 20:48:21 +0000423
jardineb5d44e2003-12-23 08:09:43 +0000424 return CMD_SUCCESS;
425}
426
427DEFUN (show_clns_neighbors,
428 show_clns_neighbors_cmd,
429 "show clns neighbors",
430 SHOW_STR
431 "clns network information\n"
432 "CLNS neighbor adjacencies\n")
433{
hassof390d2c2004-09-10 20:48:21 +0000434 return show_clns_neigh (vty, ISIS_UI_LEVEL_BRIEF);
jardineb5d44e2003-12-23 08:09:43 +0000435}
436
437ALIAS (show_clns_neighbors,
438 show_isis_neighbors_cmd,
439 "show isis neighbors",
440 SHOW_STR
441 "IS-IS network information\n"
442 "IS-IS neighbor adjacencies\n")
443
444DEFUN (show_clns_neighbors_detail,
445 show_clns_neighbors_detail_cmd,
446 "show clns neighbors detail",
447 SHOW_STR
448 "clns network information\n"
449 "CLNS neighbor adjacencies\n"
450 "show detailed information\n")
451{
hassof390d2c2004-09-10 20:48:21 +0000452 return show_clns_neigh (vty, ISIS_UI_LEVEL_DETAIL);
jardineb5d44e2003-12-23 08:09:43 +0000453}
454
455ALIAS (show_clns_neighbors_detail,
456 show_isis_neighbors_detail_cmd,
457 "show isis neighbors detail",
458 SHOW_STR
459 "IS-IS network information\n"
460 "IS-IS neighbor adjacencies\n"
461 "show detailed information\n")
jardineb5d44e2003-12-23 08:09:43 +0000462/*
463 * 'isis debug', 'show debugging'
464 */
jardineb5d44e2003-12-23 08:09:43 +0000465void
466print_debug (struct vty *vty, int flags, int onoff)
467{
468 char onoffs[4];
469 if (onoff)
hassof390d2c2004-09-10 20:48:21 +0000470 strcpy (onoffs, "on");
jardineb5d44e2003-12-23 08:09:43 +0000471 else
hassof390d2c2004-09-10 20:48:21 +0000472 strcpy (onoffs, "off");
jardineb5d44e2003-12-23 08:09:43 +0000473
474 if (flags & DEBUG_ADJ_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000475 vty_out (vty, "IS-IS Adjacency related packets debugging is %s%s", onoffs,
476 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000477 if (flags & DEBUG_CHECKSUM_ERRORS)
hassof390d2c2004-09-10 20:48:21 +0000478 vty_out (vty, "IS-IS checksum errors debugging is %s%s", onoffs,
479 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000480 if (flags & DEBUG_LOCAL_UPDATES)
hassof390d2c2004-09-10 20:48:21 +0000481 vty_out (vty, "IS-IS local updates debugging is %s%s", onoffs,
482 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000483 if (flags & DEBUG_PROTOCOL_ERRORS)
hassof390d2c2004-09-10 20:48:21 +0000484 vty_out (vty, "IS-IS protocol errors debugging is %s%s", onoffs,
485 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000486 if (flags & DEBUG_SNP_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000487 vty_out (vty, "IS-IS CSNP/PSNP packets debugging is %s%s", onoffs,
488 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000489 if (flags & DEBUG_SPF_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000490 vty_out (vty, "IS-IS SPF events debugging is %s%s", onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000491 if (flags & DEBUG_SPF_STATS)
hassof390d2c2004-09-10 20:48:21 +0000492 vty_out (vty, "IS-IS SPF Timing and Statistics Data debugging is %s%s",
493 onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000494 if (flags & DEBUG_SPF_TRIGGERS)
hassof390d2c2004-09-10 20:48:21 +0000495 vty_out (vty, "IS-IS SPF triggering events debugging is %s%s", onoffs,
496 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000497 if (flags & DEBUG_UPDATE_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000498 vty_out (vty, "IS-IS Update related packet debugging is %s%s", onoffs,
499 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000500 if (flags & DEBUG_RTE_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000501 vty_out (vty, "IS-IS Route related debuggin is %s%s", onoffs,
502 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000503 if (flags & DEBUG_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000504 vty_out (vty, "IS-IS Event debugging is %s%s", onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000505
506}
507
508DEFUN (show_debugging,
509 show_debugging_cmd,
510 "show debugging",
511 SHOW_STR
512 "State of each debugging option\n")
513{
hassof390d2c2004-09-10 20:48:21 +0000514 vty_out (vty, "IS-IS:%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000515 print_debug (vty, isis->debugs, 1);
516 return CMD_SUCCESS;
517}
518
jardin9e867fe2003-12-23 08:56:18 +0000519/* Debug node. */
hassof390d2c2004-09-10 20:48:21 +0000520static struct cmd_node debug_node = {
jardin9e867fe2003-12-23 08:56:18 +0000521 DEBUG_NODE,
hassof390d2c2004-09-10 20:48:21 +0000522 "",
523 1
jardin9e867fe2003-12-23 08:56:18 +0000524};
525
526static int
527config_write_debug (struct vty *vty)
528{
529 int write = 0;
530 int flags = isis->debugs;
531
hassof390d2c2004-09-10 20:48:21 +0000532 if (flags & DEBUG_ADJ_PACKETS)
533 {
534 vty_out (vty, "debug isis adj-packets%s", VTY_NEWLINE);
535 write++;
536 }
537 if (flags & DEBUG_CHECKSUM_ERRORS)
538 {
539 vty_out (vty, "debug isis checksum-errors%s", VTY_NEWLINE);
540 write++;
541 }
542 if (flags & DEBUG_LOCAL_UPDATES)
543 {
544 vty_out (vty, "debug isis local-updates%s", VTY_NEWLINE);
545 write++;
546 }
547 if (flags & DEBUG_PROTOCOL_ERRORS)
548 {
549 vty_out (vty, "debug isis protocol-errors%s", VTY_NEWLINE);
550 write++;
551 }
552 if (flags & DEBUG_SNP_PACKETS)
553 {
554 vty_out (vty, "debug isis snp-packets%s", VTY_NEWLINE);
555 write++;
556 }
557 if (flags & DEBUG_SPF_EVENTS)
558 {
559 vty_out (vty, "debug isis spf-events%s", VTY_NEWLINE);
560 write++;
561 }
562 if (flags & DEBUG_SPF_STATS)
563 {
564 vty_out (vty, "debug isis spf-statistics%s", VTY_NEWLINE);
565 write++;
566 }
567 if (flags & DEBUG_SPF_TRIGGERS)
568 {
569 vty_out (vty, "debug isis spf-triggers%s", VTY_NEWLINE);
570 write++;
571 }
572 if (flags & DEBUG_UPDATE_PACKETS)
573 {
574 vty_out (vty, "debug isis update-packets%s", VTY_NEWLINE);
575 write++;
576 }
577 if (flags & DEBUG_RTE_EVENTS)
578 {
579 vty_out (vty, "debug isis route-events%s", VTY_NEWLINE);
580 write++;
581 }
582 if (flags & DEBUG_EVENTS)
583 {
584 vty_out (vty, "debug isis events%s", VTY_NEWLINE);
585 write++;
586 }
jardin9e867fe2003-12-23 08:56:18 +0000587
588 return write;
589}
590
jardineb5d44e2003-12-23 08:09:43 +0000591DEFUN (debug_isis_adj,
592 debug_isis_adj_cmd,
593 "debug isis adj-packets",
594 DEBUG_STR
595 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000596 "IS-IS Adjacency related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000597{
598 isis->debugs |= DEBUG_ADJ_PACKETS;
hassof390d2c2004-09-10 20:48:21 +0000599 print_debug (vty, DEBUG_ADJ_PACKETS, 1);
jardineb5d44e2003-12-23 08:09:43 +0000600
601 return CMD_SUCCESS;
602}
603
604DEFUN (no_debug_isis_adj,
605 no_debug_isis_adj_cmd,
606 "no debug isis adj-packets",
607 UNDEBUG_STR
608 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000609 "IS-IS Adjacency related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000610{
jardineb5d44e2003-12-23 08:09:43 +0000611 isis->debugs &= ~DEBUG_ADJ_PACKETS;
612 print_debug (vty, DEBUG_ADJ_PACKETS, 0);
613
614 return CMD_SUCCESS;
615}
616
jardineb5d44e2003-12-23 08:09:43 +0000617DEFUN (debug_isis_csum,
618 debug_isis_csum_cmd,
619 "debug isis checksum-errors",
620 DEBUG_STR
621 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000622 "IS-IS LSP checksum errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000623{
624 isis->debugs |= DEBUG_CHECKSUM_ERRORS;
625 print_debug (vty, DEBUG_CHECKSUM_ERRORS, 1);
626
627 return CMD_SUCCESS;
628}
629
630DEFUN (no_debug_isis_csum,
631 no_debug_isis_csum_cmd,
632 "no debug isis checksum-errors",
633 UNDEBUG_STR
634 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000635 "IS-IS LSP checksum errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000636{
637 isis->debugs &= ~DEBUG_CHECKSUM_ERRORS;
638 print_debug (vty, DEBUG_CHECKSUM_ERRORS, 0);
hassof390d2c2004-09-10 20:48:21 +0000639
jardineb5d44e2003-12-23 08:09:43 +0000640 return CMD_SUCCESS;
641}
642
643DEFUN (debug_isis_lupd,
644 debug_isis_lupd_cmd,
645 "debug isis local-updates",
646 DEBUG_STR
647 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000648 "IS-IS local update packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000649{
650 isis->debugs |= DEBUG_LOCAL_UPDATES;
651 print_debug (vty, DEBUG_LOCAL_UPDATES, 1);
652
653 return CMD_SUCCESS;
654}
655
656DEFUN (no_debug_isis_lupd,
657 no_debug_isis_lupd_cmd,
658 "no debug isis local-updates",
659 UNDEBUG_STR
660 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000661 "IS-IS local update packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000662{
663 isis->debugs &= ~DEBUG_LOCAL_UPDATES;
hassof390d2c2004-09-10 20:48:21 +0000664 print_debug (vty, DEBUG_LOCAL_UPDATES, 0);
665
jardineb5d44e2003-12-23 08:09:43 +0000666 return CMD_SUCCESS;
667}
668
669DEFUN (debug_isis_err,
670 debug_isis_err_cmd,
hassof390d2c2004-09-10 20:48:21 +0000671 "debug isis protocol-errors",
jardineb5d44e2003-12-23 08:09:43 +0000672 DEBUG_STR
673 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000674 "IS-IS LSP protocol errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000675{
676 isis->debugs |= DEBUG_PROTOCOL_ERRORS;
677 print_debug (vty, DEBUG_PROTOCOL_ERRORS, 1);
678
679 return CMD_SUCCESS;
680}
681
682DEFUN (no_debug_isis_err,
683 no_debug_isis_err_cmd,
684 "no debug isis protocol-errors",
685 UNDEBUG_STR
686 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000687 "IS-IS LSP protocol errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000688{
689 isis->debugs &= ~DEBUG_PROTOCOL_ERRORS;
690 print_debug (vty, DEBUG_PROTOCOL_ERRORS, 0);
hassof390d2c2004-09-10 20:48:21 +0000691
jardineb5d44e2003-12-23 08:09:43 +0000692 return CMD_SUCCESS;
693}
694
695DEFUN (debug_isis_snp,
696 debug_isis_snp_cmd,
697 "debug isis snp-packets",
698 DEBUG_STR
699 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000700 "IS-IS CSNP/PSNP packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000701{
702 isis->debugs |= DEBUG_SNP_PACKETS;
703 print_debug (vty, DEBUG_SNP_PACKETS, 1);
704
705 return CMD_SUCCESS;
706}
707
708DEFUN (no_debug_isis_snp,
709 no_debug_isis_snp_cmd,
710 "no debug isis snp-packets",
711 UNDEBUG_STR
712 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000713 "IS-IS CSNP/PSNP packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000714{
hassof390d2c2004-09-10 20:48:21 +0000715 isis->debugs &= ~DEBUG_SNP_PACKETS;
jardineb5d44e2003-12-23 08:09:43 +0000716 print_debug (vty, DEBUG_SNP_PACKETS, 0);
hassof390d2c2004-09-10 20:48:21 +0000717
jardineb5d44e2003-12-23 08:09:43 +0000718 return CMD_SUCCESS;
719}
720
jardineb5d44e2003-12-23 08:09:43 +0000721DEFUN (debug_isis_upd,
722 debug_isis_upd_cmd,
723 "debug isis update-packets",
724 DEBUG_STR
725 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000726 "IS-IS Update related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000727{
728 isis->debugs |= DEBUG_UPDATE_PACKETS;
729 print_debug (vty, DEBUG_UPDATE_PACKETS, 1);
730
731 return CMD_SUCCESS;
732}
733
734DEFUN (no_debug_isis_upd,
735 no_debug_isis_upd_cmd,
736 "no debug isis update-packets",
737 UNDEBUG_STR
738 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000739 "IS-IS Update related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000740{
741 isis->debugs &= ~DEBUG_UPDATE_PACKETS;
742 print_debug (vty, DEBUG_UPDATE_PACKETS, 0);
hassof390d2c2004-09-10 20:48:21 +0000743
jardineb5d44e2003-12-23 08:09:43 +0000744 return CMD_SUCCESS;
745}
746
jardineb5d44e2003-12-23 08:09:43 +0000747DEFUN (debug_isis_spfevents,
748 debug_isis_spfevents_cmd,
749 "debug isis spf-events",
750 DEBUG_STR
751 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000752 "IS-IS Shortest Path First Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000753{
754 isis->debugs |= DEBUG_SPF_EVENTS;
hassof390d2c2004-09-10 20:48:21 +0000755 print_debug (vty, DEBUG_SPF_EVENTS, 1);
jardineb5d44e2003-12-23 08:09:43 +0000756
757 return CMD_SUCCESS;
758}
759
760DEFUN (no_debug_isis_spfevents,
761 no_debug_isis_spfevents_cmd,
762 "no debug isis spf-events",
763 UNDEBUG_STR
764 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000765 "IS-IS Shortest Path First Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000766{
767 isis->debugs &= ~DEBUG_SPF_EVENTS;
hassof390d2c2004-09-10 20:48:21 +0000768 print_debug (vty, DEBUG_SPF_EVENTS, 0);
769
jardineb5d44e2003-12-23 08:09:43 +0000770 return CMD_SUCCESS;
771}
772
773
774DEFUN (debug_isis_spfstats,
775 debug_isis_spfstats_cmd,
776 "debug isis spf-statistics ",
777 DEBUG_STR
778 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000779 "IS-IS SPF Timing and Statistic Data\n")
jardineb5d44e2003-12-23 08:09:43 +0000780{
781 isis->debugs |= DEBUG_SPF_STATS;
782 print_debug (vty, DEBUG_SPF_STATS, 1);
783
784 return CMD_SUCCESS;
785}
786
787DEFUN (no_debug_isis_spfstats,
788 no_debug_isis_spfstats_cmd,
789 "no debug isis spf-statistics",
790 UNDEBUG_STR
791 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000792 "IS-IS SPF Timing and Statistic Data\n")
jardineb5d44e2003-12-23 08:09:43 +0000793{
794 isis->debugs &= ~DEBUG_SPF_STATS;
795 print_debug (vty, DEBUG_SPF_STATS, 0);
hassof390d2c2004-09-10 20:48:21 +0000796
jardineb5d44e2003-12-23 08:09:43 +0000797 return CMD_SUCCESS;
798}
799
800DEFUN (debug_isis_spftrigg,
801 debug_isis_spftrigg_cmd,
802 "debug isis spf-triggers",
803 DEBUG_STR
804 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000805 "IS-IS SPF triggering events\n")
jardineb5d44e2003-12-23 08:09:43 +0000806{
807 isis->debugs |= DEBUG_SPF_TRIGGERS;
808 print_debug (vty, DEBUG_SPF_TRIGGERS, 1);
809
810 return CMD_SUCCESS;
811}
812
813DEFUN (no_debug_isis_spftrigg,
814 no_debug_isis_spftrigg_cmd,
815 "no debug isis spf-triggers",
816 UNDEBUG_STR
817 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000818 "IS-IS SPF triggering events\n")
jardineb5d44e2003-12-23 08:09:43 +0000819{
820 isis->debugs &= ~DEBUG_SPF_TRIGGERS;
821 print_debug (vty, DEBUG_SPF_TRIGGERS, 0);
hassof390d2c2004-09-10 20:48:21 +0000822
jardineb5d44e2003-12-23 08:09:43 +0000823 return CMD_SUCCESS;
824}
825
826DEFUN (debug_isis_rtevents,
827 debug_isis_rtevents_cmd,
828 "debug isis route-events",
829 DEBUG_STR
830 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000831 "IS-IS Route related events\n")
jardineb5d44e2003-12-23 08:09:43 +0000832{
833 isis->debugs |= DEBUG_RTE_EVENTS;
834 print_debug (vty, DEBUG_RTE_EVENTS, 1);
835
836 return CMD_SUCCESS;
837}
838
839DEFUN (no_debug_isis_rtevents,
840 no_debug_isis_rtevents_cmd,
841 "no debug isis route-events",
842 UNDEBUG_STR
843 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000844 "IS-IS Route related events\n")
jardineb5d44e2003-12-23 08:09:43 +0000845{
846 isis->debugs &= ~DEBUG_RTE_EVENTS;
847 print_debug (vty, DEBUG_RTE_EVENTS, 0);
hassof390d2c2004-09-10 20:48:21 +0000848
jardineb5d44e2003-12-23 08:09:43 +0000849 return CMD_SUCCESS;
850}
851
852DEFUN (debug_isis_events,
853 debug_isis_events_cmd,
854 "debug isis events",
855 DEBUG_STR
856 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000857 "IS-IS Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000858{
859 isis->debugs |= DEBUG_EVENTS;
860 print_debug (vty, DEBUG_EVENTS, 1);
861
862 return CMD_SUCCESS;
863}
864
865DEFUN (no_debug_isis_events,
866 no_debug_isis_events_cmd,
867 "no debug isis events",
868 UNDEBUG_STR
869 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000870 "IS-IS Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000871{
872 isis->debugs &= ~DEBUG_EVENTS;
873 print_debug (vty, DEBUG_EVENTS, 0);
hassof390d2c2004-09-10 20:48:21 +0000874
jardineb5d44e2003-12-23 08:09:43 +0000875 return CMD_SUCCESS;
876}
877
jardineb5d44e2003-12-23 08:09:43 +0000878DEFUN (show_hostname,
879 show_hostname_cmd,
880 "show isis hostname",
881 SHOW_STR
882 "IS-IS information\n"
883 "IS-IS Dynamic hostname mapping\n")
884{
885 dynhn_print_all (vty);
hassof390d2c2004-09-10 20:48:21 +0000886
jardineb5d44e2003-12-23 08:09:43 +0000887 return CMD_SUCCESS;
888}
889
jardineb5d44e2003-12-23 08:09:43 +0000890DEFUN (show_database,
891 show_database_cmd,
892 "show isis database",
hassof390d2c2004-09-10 20:48:21 +0000893 SHOW_STR "IS-IS information\n" "IS-IS link state database\n")
jardineb5d44e2003-12-23 08:09:43 +0000894{
paul1eb8ef22005-04-07 07:30:20 +0000895 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000896 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000897 int level, lsp_count;
jardineb5d44e2003-12-23 08:09:43 +0000898
899 if (isis->area_list->count == 0)
900 return CMD_SUCCESS;
jardineb5d44e2003-12-23 08:09:43 +0000901
paul1eb8ef22005-04-07 07:30:20 +0000902 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
hassof390d2c2004-09-10 20:48:21 +0000903 {
hassof390d2c2004-09-10 20:48:21 +0000904 vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null",
905 VTY_NEWLINE);
906 for (level = 0; level < ISIS_LEVELS; level++)
907 {
908 if (area->lspdb[level] && dict_count (area->lspdb[level]) > 0)
909 {
910 vty_out (vty, "IS-IS Level-%d link-state database:%s",
911 level + 1, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000912
hassof390d2c2004-09-10 20:48:21 +0000913 lsp_count = lsp_print_all (vty, area->lspdb[level],
914 ISIS_UI_LEVEL_BRIEF,
915 area->dynhostname);
916
917 vty_out (vty, "%s %u LSPs%s%s",
918 VTY_NEWLINE, lsp_count, VTY_NEWLINE, VTY_NEWLINE);
919 }
920 }
jardineb5d44e2003-12-23 08:09:43 +0000921 }
jardineb5d44e2003-12-23 08:09:43 +0000922
923 return CMD_SUCCESS;
924}
925
jardineb5d44e2003-12-23 08:09:43 +0000926DEFUN (show_database_detail,
927 show_database_detail_cmd,
928 "show isis database detail",
929 SHOW_STR
930 "IS-IS information\n"
931 "IS-IS link state database\n")
932{
paul1eb8ef22005-04-07 07:30:20 +0000933 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000934 struct isis_area *area;
935 int level, lsp_count;
936
937 if (isis->area_list->count == 0)
938 return CMD_SUCCESS;
939
paul1eb8ef22005-04-07 07:30:20 +0000940 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
hassof390d2c2004-09-10 20:48:21 +0000941 {
hassof390d2c2004-09-10 20:48:21 +0000942 vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null",
943 VTY_NEWLINE);
944 for (level = 0; level < ISIS_LEVELS; level++)
945 {
946 if (area->lspdb[level] && dict_count (area->lspdb[level]) > 0)
947 {
948 vty_out (vty, "IS-IS Level-%d Link State Database:%s",
949 level + 1, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000950
hassof390d2c2004-09-10 20:48:21 +0000951 lsp_count = lsp_print_all (vty, area->lspdb[level],
952 ISIS_UI_LEVEL_DETAIL,
953 area->dynhostname);
jardineb5d44e2003-12-23 08:09:43 +0000954
hassof390d2c2004-09-10 20:48:21 +0000955 vty_out (vty, "%s %u LSPs%s%s",
956 VTY_NEWLINE, lsp_count, VTY_NEWLINE, VTY_NEWLINE);
957 }
958 }
jardineb5d44e2003-12-23 08:09:43 +0000959 }
jardineb5d44e2003-12-23 08:09:43 +0000960
961 return CMD_SUCCESS;
962}
963
964/*
965 * 'router isis' command
966 */
967DEFUN (router_isis,
968 router_isis_cmd,
969 "router isis WORD",
hassof390d2c2004-09-10 20:48:21 +0000970 ROUTER_STR
jardineb5d44e2003-12-23 08:09:43 +0000971 "ISO IS-IS\n"
972 "ISO Routing area tag")
973{
jardineb5d44e2003-12-23 08:09:43 +0000974 return isis_area_get (vty, argv[0]);
jardineb5d44e2003-12-23 08:09:43 +0000975}
976
977/*
978 *'no router isis' command
979 */
980DEFUN (no_router_isis,
981 no_router_isis_cmd,
982 "no router isis WORD",
hassof390d2c2004-09-10 20:48:21 +0000983 "no\n" ROUTER_STR "ISO IS-IS\n" "ISO Routing area tag")
jardineb5d44e2003-12-23 08:09:43 +0000984{
985 return isis_area_destroy (vty, argv[0]);
986}
987
988/*
989 * 'net' command
990 */
991DEFUN (net,
992 net_cmd,
993 "net WORD",
994 "A Network Entity Title for this process (OSI only)\n"
hassof390d2c2004-09-10 20:48:21 +0000995 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +0000996{
hassof7c43dc2004-09-26 16:24:14 +0000997 return area_net_title (vty, (u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +0000998}
999
jardineb5d44e2003-12-23 08:09:43 +00001000/*
1001 * 'no net' command
1002 */
1003DEFUN (no_net,
1004 no_net_cmd,
1005 "no net WORD",
1006 NO_STR
1007 "A Network Entity Title for this process (OSI only)\n"
hassof390d2c2004-09-10 20:48:21 +00001008 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001009{
hassof7c43dc2004-09-26 16:24:14 +00001010 return area_clear_net_title (vty, (u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +00001011}
1012
1013DEFUN (area_passwd,
1014 area_passwd_cmd,
1015 "area-password WORD",
1016 "Configure the authentication password for an area\n"
hassof390d2c2004-09-10 20:48:21 +00001017 "Area password\n")
jardineb5d44e2003-12-23 08:09:43 +00001018{
1019 struct isis_area *area;
1020 int len;
1021
1022 area = vty->index;
1023
hassof390d2c2004-09-10 20:48:21 +00001024 if (!area)
1025 {
1026 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1027 return CMD_WARNING;
1028 }
1029
jardineb5d44e2003-12-23 08:09:43 +00001030 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001031 if (len > 254)
1032 {
1033 vty_out (vty, "Too long area password (>254)%s", VTY_NEWLINE);
1034 return CMD_WARNING;
1035 }
1036 area->area_passwd.len = (u_char) len;
jardineb5d44e2003-12-23 08:09:43 +00001037 area->area_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001038 strncpy ((char *)area->area_passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001039
hasso1cbc5622005-01-01 10:29:51 +00001040 if (argc > 1)
1041 {
1042 SET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND);
1043 if (strncmp(argv[1], "v", 1) == 0)
1044 SET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1045 else
1046 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1047 }
1048 else
1049 {
1050 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND);
1051 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1052 }
1053
jardineb5d44e2003-12-23 08:09:43 +00001054 return CMD_SUCCESS;
1055}
1056
hasso1cbc5622005-01-01 10:29:51 +00001057ALIAS (area_passwd,
1058 area_passwd_snpauth_cmd,
1059 "area-password WORD authenticate snp (send-only|validate)",
1060 "Configure the authentication password for an area\n"
1061 "Area password\n"
1062 "Authentication\n"
1063 "SNP PDUs\n"
1064 "Send but do not check PDUs on receiving\n"
1065 "Send and check PDUs on receiving\n");
1066
jardineb5d44e2003-12-23 08:09:43 +00001067DEFUN (no_area_passwd,
1068 no_area_passwd_cmd,
1069 "no area-password",
1070 NO_STR
1071 "Configure the authentication password for an area\n")
1072{
1073 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001074
jardineb5d44e2003-12-23 08:09:43 +00001075 area = vty->index;
1076
hassof390d2c2004-09-10 20:48:21 +00001077 if (!area)
1078 {
1079 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1080 return CMD_WARNING;
1081 }
1082
jardineb5d44e2003-12-23 08:09:43 +00001083 memset (&area->area_passwd, 0, sizeof (struct isis_passwd));
1084
1085 return CMD_SUCCESS;
1086}
1087
jardineb5d44e2003-12-23 08:09:43 +00001088DEFUN (domain_passwd,
1089 domain_passwd_cmd,
1090 "domain-password WORD",
1091 "Set the authentication password for a routing domain\n"
hassof390d2c2004-09-10 20:48:21 +00001092 "Routing domain password\n")
jardineb5d44e2003-12-23 08:09:43 +00001093{
1094 struct isis_area *area;
1095 int len;
1096
1097 area = vty->index;
1098
hassof390d2c2004-09-10 20:48:21 +00001099 if (!area)
1100 {
1101 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1102 return CMD_WARNING;
1103 }
1104
jardineb5d44e2003-12-23 08:09:43 +00001105 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001106 if (len > 254)
1107 {
1108 vty_out (vty, "Too long area password (>254)%s", VTY_NEWLINE);
1109 return CMD_WARNING;
1110 }
1111 area->domain_passwd.len = (u_char) len;
jardineb5d44e2003-12-23 08:09:43 +00001112 area->domain_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001113 strncpy ((char *)area->domain_passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001114
hasso1cbc5622005-01-01 10:29:51 +00001115 if (argc > 1)
1116 {
1117 SET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND);
1118 if (strncmp(argv[1], "v", 1) == 0)
1119 SET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1120 else
1121 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1122 }
1123 else
1124 {
1125 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND);
1126 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1127 }
1128
jardineb5d44e2003-12-23 08:09:43 +00001129 return CMD_SUCCESS;
1130}
1131
hasso1cbc5622005-01-01 10:29:51 +00001132ALIAS (domain_passwd,
1133 domain_passwd_snpauth_cmd,
1134 "domain-password WORD authenticate snp (send-only|validate)",
1135 "Set the authentication password for a routing domain\n"
1136 "Routing domain password\n"
1137 "Authentication\n"
1138 "SNP PDUs\n"
1139 "Send but do not check PDUs on receiving\n"
1140 "Send and check PDUs on receiving\n");
1141
jardineb5d44e2003-12-23 08:09:43 +00001142DEFUN (no_domain_passwd,
1143 no_domain_passwd_cmd,
1144 "no domain-password WORD",
1145 NO_STR
1146 "Set the authentication password for a routing domain\n")
1147{
1148 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001149
jardineb5d44e2003-12-23 08:09:43 +00001150 area = vty->index;
1151
hassof390d2c2004-09-10 20:48:21 +00001152 if (!area)
1153 {
1154 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1155 return CMD_WARNING;
1156 }
1157
jardineb5d44e2003-12-23 08:09:43 +00001158 memset (&area->domain_passwd, 0, sizeof (struct isis_passwd));
hassof390d2c2004-09-10 20:48:21 +00001159
jardineb5d44e2003-12-23 08:09:43 +00001160 return CMD_SUCCESS;
1161}
1162
1163DEFUN (is_type,
1164 is_type_cmd,
1165 "is-type (level-1|level-1-2|level-2-only)",
1166 "IS Level for this routing process (OSI only)\n"
1167 "Act as a station router only\n"
1168 "Act as both a station router and an area router\n"
1169 "Act as an area router only\n")
1170{
1171 struct isis_area *area;
1172 int type;
1173
1174 area = vty->index;
1175
hassof390d2c2004-09-10 20:48:21 +00001176 if (!area)
1177 {
1178 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1179 return CMD_WARNING;
1180 }
jardineb5d44e2003-12-23 08:09:43 +00001181
hassof7c43dc2004-09-26 16:24:14 +00001182 type = string2circuit_t ((u_char *)argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001183 if (!type)
1184 {
1185 vty_out (vty, "Unknown IS level %s", VTY_NEWLINE);
1186 return CMD_SUCCESS;
1187 }
jardineb5d44e2003-12-23 08:09:43 +00001188
1189 isis_event_system_type_change (area, type);
hassof390d2c2004-09-10 20:48:21 +00001190
jardineb5d44e2003-12-23 08:09:43 +00001191 return CMD_SUCCESS;
1192}
1193
1194DEFUN (no_is_type,
1195 no_is_type_cmd,
1196 "no is-type (level-1|level-1-2|level-2-only)",
1197 NO_STR
1198 "IS Level for this routing process (OSI only)\n"
1199 "Act as a station router only\n"
1200 "Act as both a station router and an area router\n"
1201 "Act as an area router only\n")
1202{
jardineb5d44e2003-12-23 08:09:43 +00001203 struct isis_area *area;
1204 int type;
1205
1206 area = vty->index;
1207 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001208
jardineb5d44e2003-12-23 08:09:43 +00001209 /*
1210 * Put the is-type back to default. Which is level-1-2 on first
1211 * circuit for the area level-1 for the rest
1212 */
paul1eb8ef22005-04-07 07:30:20 +00001213 if (listgetdata (listhead (isis->area_list)) == area)
jardineb5d44e2003-12-23 08:09:43 +00001214 type = IS_LEVEL_1_AND_2;
1215 else
1216 type = IS_LEVEL_1;
1217
1218 isis_event_system_type_change (area, type);
1219
1220 return CMD_SUCCESS;
1221}
1222
1223DEFUN (lsp_gen_interval,
1224 lsp_gen_interval_cmd,
1225 "lsp-gen-interval <1-120>",
1226 "Minimum interval between regenerating same LSP\n"
1227 "Minimum interval in seconds\n")
1228{
1229 struct isis_area *area;
1230 uint16_t interval;
1231
1232 area = vty->index;
1233 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001234
jardineb5d44e2003-12-23 08:09:43 +00001235 interval = atoi (argv[0]);
1236 area->lsp_gen_interval[0] = interval;
1237 area->lsp_gen_interval[1] = interval;
1238
1239 return CMD_SUCCESS;
1240}
1241
1242DEFUN (no_lsp_gen_interval,
1243 no_lsp_gen_interval_cmd,
1244 "no lsp-gen-interval",
1245 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001246 "Minimum interval between regenerating same LSP\n")
jardineb5d44e2003-12-23 08:09:43 +00001247{
1248 struct isis_area *area;
1249
1250 area = vty->index;
1251 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001252
jardineb5d44e2003-12-23 08:09:43 +00001253 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
1254 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
1255
1256 return CMD_SUCCESS;
1257}
1258
1259ALIAS (no_lsp_gen_interval,
1260 no_lsp_gen_interval_arg_cmd,
1261 "no lsp-gen-interval <1-120>",
1262 NO_STR
1263 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001264 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001265
1266DEFUN (lsp_gen_interval_l1,
1267 lsp_gen_interval_l1_cmd,
1268 "lsp-gen-interval level-1 <1-120>",
1269 "Minimum interval between regenerating same LSP\n"
1270 "Set interval for level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001271 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001272{
1273 struct isis_area *area;
1274 uint16_t interval;
1275
1276 area = vty->index;
1277 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001278
jardineb5d44e2003-12-23 08:09:43 +00001279 interval = atoi (argv[0]);
1280 area->lsp_gen_interval[0] = interval;
1281
1282 return CMD_SUCCESS;
1283}
1284
1285DEFUN (no_lsp_gen_interval_l1,
1286 no_lsp_gen_interval_l1_cmd,
1287 "no lsp-gen-interval level-1",
1288 NO_STR
1289 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001290 "Set interval for level 1 only\n")
jardineb5d44e2003-12-23 08:09:43 +00001291{
1292 struct isis_area *area;
1293
1294 area = vty->index;
1295 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001296
jardineb5d44e2003-12-23 08:09:43 +00001297 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
1298
1299 return CMD_SUCCESS;
1300}
1301
1302ALIAS (no_lsp_gen_interval_l1,
1303 no_lsp_gen_interval_l1_arg_cmd,
1304 "no lsp-gen-interval level-1 <1-120>",
1305 NO_STR
1306 "Minimum interval between regenerating same LSP\n"
1307 "Set interval for level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001308 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001309
1310DEFUN (lsp_gen_interval_l2,
1311 lsp_gen_interval_l2_cmd,
1312 "lsp-gen-interval level-2 <1-120>",
1313 "Minimum interval between regenerating same LSP\n"
1314 "Set interval for level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001315 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001316{
1317 struct isis_area *area;
1318 int interval;
1319
1320 area = vty->index;
1321 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001322
jardineb5d44e2003-12-23 08:09:43 +00001323 interval = atoi (argv[0]);
1324 area->lsp_gen_interval[1] = interval;
1325
1326 return CMD_SUCCESS;
1327}
1328
1329DEFUN (no_lsp_gen_interval_l2,
1330 no_lsp_gen_interval_l2_cmd,
1331 "no lsp-gen-interval level-2",
1332 NO_STR
1333 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001334 "Set interval for level 2 only\n")
jardineb5d44e2003-12-23 08:09:43 +00001335{
1336 struct isis_area *area;
1337 int interval;
1338
1339 area = vty->index;
1340 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001341
jardineb5d44e2003-12-23 08:09:43 +00001342 interval = atoi (argv[0]);
1343 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
1344
1345 return CMD_SUCCESS;
1346}
1347
1348ALIAS (no_lsp_gen_interval_l2,
1349 no_lsp_gen_interval_l2_arg_cmd,
1350 "no lsp-gen-interval level-2 <1-120>",
1351 NO_STR
1352 "Minimum interval between regenerating same LSP\n"
1353 "Set interval for level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001354 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001355
1356DEFUN (metric_style,
1357 metric_style_cmd,
1358 "metric-style (narrow|wide)",
1359 "Use old-style (ISO 10589) or new-style packet formats\n"
1360 "Use old style of TLVs with narrow metric\n"
1361 "Use new style of TLVs to carry wider metric\n")
1362{
1363 struct isis_area *area;
1364
1365 area = vty->index;
1366 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001367 if (!strcmp (argv[0], "wide"))
jardineb5d44e2003-12-23 08:09:43 +00001368 area->newmetric = 1;
1369 else
1370 area->newmetric = 0;
1371
1372 return CMD_SUCCESS;
1373}
1374
1375DEFUN (no_metric_style,
1376 no_metric_style_cmd,
1377 "no metric-style (narrow|wide)",
1378 NO_STR
1379 "Use old-style (ISO 10589) or new-style packet formats\n"
1380 "Use old style of TLVs with narrow metric\n"
1381 "Use new style of TLVs to carry wider metric\n")
1382{
1383 struct isis_area *area;
1384
1385 area = vty->index;
1386 assert (area);
1387
hassof390d2c2004-09-10 20:48:21 +00001388 if (!strcmp (argv[0], "wide"))
jardineb5d44e2003-12-23 08:09:43 +00001389 area->newmetric = 0;
1390 else
1391 area->newmetric = 1;
1392
1393 return CMD_SUCCESS;
1394}
1395
1396DEFUN (dynamic_hostname,
1397 dynamic_hostname_cmd,
1398 "hostname dynamic",
1399 "Dynamic hostname for IS-IS\n"
hassof390d2c2004-09-10 20:48:21 +00001400 "Dynamic hostname\n")
jardineb5d44e2003-12-23 08:09:43 +00001401{
1402 struct isis_area *area;
1403
1404 area = vty->index;
1405 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001406
jardineb5d44e2003-12-23 08:09:43 +00001407 area->dynhostname = 1;
hassof390d2c2004-09-10 20:48:21 +00001408
jardineb5d44e2003-12-23 08:09:43 +00001409 return CMD_SUCCESS;
1410}
1411
1412DEFUN (no_dynamic_hostname,
1413 no_dynamic_hostname_cmd,
1414 "no hostname dynamic",
1415 NO_STR
1416 "Dynamic hostname for IS-IS\n"
hassof390d2c2004-09-10 20:48:21 +00001417 "Dynamic hostname\n")
jardineb5d44e2003-12-23 08:09:43 +00001418{
1419 struct isis_area *area;
1420
1421 area = vty->index;
1422 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001423
jardineb5d44e2003-12-23 08:09:43 +00001424 area->dynhostname = 0;
hassof390d2c2004-09-10 20:48:21 +00001425
jardineb5d44e2003-12-23 08:09:43 +00001426 return CMD_SUCCESS;
1427}
1428
1429DEFUN (spf_interval,
1430 spf_interval_cmd,
1431 "spf-interval <1-120>",
hasso2097cd82003-12-23 11:51:08 +00001432 "Minimum interval between SPF calculations\n"
jardineb5d44e2003-12-23 08:09:43 +00001433 "Minimum interval between consecutive SPFs in seconds\n")
1434{
1435 struct isis_area *area;
1436 u_int16_t interval;
hassof390d2c2004-09-10 20:48:21 +00001437
jardineb5d44e2003-12-23 08:09:43 +00001438 area = vty->index;
1439 interval = atoi (argv[0]);
1440 area->min_spf_interval[0] = interval;
1441 area->min_spf_interval[1] = interval;
hassof390d2c2004-09-10 20:48:21 +00001442
jardineb5d44e2003-12-23 08:09:43 +00001443 return CMD_SUCCESS;
1444}
1445
1446DEFUN (no_spf_interval,
1447 no_spf_interval_cmd,
1448 "no spf-interval",
1449 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001450 "Minimum interval between SPF calculations\n")
jardineb5d44e2003-12-23 08:09:43 +00001451{
1452 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001453
jardineb5d44e2003-12-23 08:09:43 +00001454 area = vty->index;
1455
1456 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
1457 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001458
jardineb5d44e2003-12-23 08:09:43 +00001459 return CMD_SUCCESS;
1460}
1461
1462ALIAS (no_spf_interval,
1463 no_spf_interval_arg_cmd,
1464 "no spf-interval <1-120>",
1465 NO_STR
1466 "Minimum interval between SPF calculations\n"
hassof390d2c2004-09-10 20:48:21 +00001467 "Minimum interval between consecutive SPFs in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001468
1469DEFUN (spf_interval_l1,
1470 spf_interval_l1_cmd,
1471 "spf-interval level-1 <1-120>",
1472 "Minimum interval between SPF calculations\n"
1473 "Set interval for level 1 only\n"
1474 "Minimum interval between consecutive SPFs in seconds\n")
1475{
1476 struct isis_area *area;
1477 u_int16_t interval;
hassof390d2c2004-09-10 20:48:21 +00001478
jardineb5d44e2003-12-23 08:09:43 +00001479 area = vty->index;
1480 interval = atoi (argv[0]);
1481 area->min_spf_interval[0] = interval;
hassof390d2c2004-09-10 20:48:21 +00001482
jardineb5d44e2003-12-23 08:09:43 +00001483 return CMD_SUCCESS;
1484}
1485
1486DEFUN (no_spf_interval_l1,
1487 no_spf_interval_l1_cmd,
1488 "no spf-interval level-1",
1489 NO_STR
1490 "Minimum interval between SPF calculations\n"
1491 "Set interval for level 1 only\n")
1492{
1493 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001494
jardineb5d44e2003-12-23 08:09:43 +00001495 area = vty->index;
1496
1497 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001498
jardineb5d44e2003-12-23 08:09:43 +00001499 return CMD_SUCCESS;
1500}
1501
1502ALIAS (no_spf_interval,
1503 no_spf_interval_l1_arg_cmd,
1504 "no spf-interval level-1 <1-120>",
1505 NO_STR
1506 "Minimum interval between SPF calculations\n"
1507 "Set interval for level 1 only\n"
1508 "Minimum interval between consecutive SPFs in seconds\n")
1509
1510DEFUN (spf_interval_l2,
1511 spf_interval_l2_cmd,
1512 "spf-interval level-2 <1-120>",
1513 "Minimum interval between SPF calculations\n"
1514 "Set interval for level 2 only\n"
1515 "Minimum interval between consecutive SPFs in seconds\n")
1516{
1517 struct isis_area *area;
1518 u_int16_t interval;
hassof390d2c2004-09-10 20:48:21 +00001519
jardineb5d44e2003-12-23 08:09:43 +00001520 area = vty->index;
1521 interval = atoi (argv[0]);
1522 area->min_spf_interval[1] = interval;
hassof390d2c2004-09-10 20:48:21 +00001523
jardineb5d44e2003-12-23 08:09:43 +00001524 return CMD_SUCCESS;
1525}
1526
1527DEFUN (no_spf_interval_l2,
1528 no_spf_interval_l2_cmd,
1529 "no spf-interval level-2",
1530 NO_STR
1531 "Minimum interval between SPF calculations\n"
1532 "Set interval for level 2 only\n")
1533{
1534 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001535
jardineb5d44e2003-12-23 08:09:43 +00001536 area = vty->index;
1537
1538 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001539
jardineb5d44e2003-12-23 08:09:43 +00001540 return CMD_SUCCESS;
1541}
1542
1543ALIAS (no_spf_interval,
1544 no_spf_interval_l2_arg_cmd,
1545 "no spf-interval level-2 <1-120>",
1546 NO_STR
1547 "Minimum interval between SPF calculations\n"
1548 "Set interval for level 2 only\n"
1549 "Minimum interval between consecutive SPFs in seconds\n")
1550
jardineb5d44e2003-12-23 08:09:43 +00001551#ifdef TOPOLOGY_GENERATE
1552DEFUN (topology_generate_grid,
1553 topology_generate_grid_cmd,
1554 "topology generate grid <1-100> <1-100> <1-65000> [param] [param] "
1555 "[param]",
1556 "Topology for IS-IS\n"
1557 "Topology for IS-IS\n"
1558 "Topology grid for IS-IS\n"
1559 "X parameter of the grid\n"
1560 "Y parameter of the grid\n"
1561 "Random seed\n"
1562 "Optional param 1\n"
1563 "Optional param 2\n"
1564 "Optional param 3\n"
1565 "Topology\n")
1566{
1567 struct isis_area *area;
1568
1569 area = vty->index;
1570 assert (area);
1571
hassof390d2c2004-09-10 20:48:21 +00001572 if (!spgrid_check_params (vty, argc, argv))
1573 {
1574 if (area->topology)
1575 list_delete (area->topology);
1576 area->topology = list_new ();
1577 memcpy (area->top_params, vty->buf, 200);
1578 gen_spgrid_topology (vty, area->topology);
1579 remove_topology_lsps (area);
1580 generate_topology_lsps (area);
1581 }
jardineb5d44e2003-12-23 08:09:43 +00001582
1583 return CMD_SUCCESS;
1584}
1585
hassof695b012005-04-02 19:03:39 +00001586DEFUN (show_isis_generated_topology,
1587 show_isis_generated_topology_cmd,
1588 "show isis generated-topology",
jardineb5d44e2003-12-23 08:09:43 +00001589 SHOW_STR
1590 "clns network information\n"
1591 "CLNS neighbor adjacencies\n")
1592{
1593 struct isis_area *area;
paul92c9f222005-05-25 12:21:13 +00001594 struct listnode *node;
jardineb5d44e2003-12-23 08:09:43 +00001595 struct listnode *node2;
1596 struct arc *arc;
paul92c9f222005-05-25 12:21:13 +00001597 for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
hassof390d2c2004-09-10 20:48:21 +00001598 {
1599 if (area->topology)
1600 {
1601 vty_out (vty, "Topology for isis area:%s%s", area->area_tag,
1602 VTY_NEWLINE);
paul92c9f222005-05-25 12:21:13 +00001603 for (ALL_LIST_ELEMENTS_RO (area->topology, node2, arc))
hassof390d2c2004-09-10 20:48:21 +00001604 {
1605 vty_out (vty, "a %ld %ld %ld%s", arc->from_node, arc->to_node,
1606 arc->distance, VTY_NEWLINE);
1607 }
jardineb5d44e2003-12-23 08:09:43 +00001608 }
jardineb5d44e2003-12-23 08:09:43 +00001609 }
1610 return CMD_SUCCESS;
1611}
1612
1613/*
1614 * 'topology base-is' command
1615 */
hassof390d2c2004-09-10 20:48:21 +00001616DEFUN (topology_baseis,
jardineb5d44e2003-12-23 08:09:43 +00001617 topology_baseis_cmd,
1618 "topology base-is WORD",
1619 "Topology for IS-IS\n"
1620 "Topology for IS-IS\n"
1621 "A Network IS Base for this topology"
hassof390d2c2004-09-10 20:48:21 +00001622 "XX.XXXX.XXXX.XX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001623{
1624 struct isis_area *area;
1625 u_char buff[ISIS_SYS_ID_LEN];
1626
1627 area = vty->index;
1628 assert (area);
1629
hassof390d2c2004-09-10 20:48:21 +00001630 if (sysid2buff (buff, argv[0]))
1631 {
1632 sysid2buff (area->topology_baseis, argv[0]);
1633 }
1634
jardineb5d44e2003-12-23 08:09:43 +00001635 return CMD_SUCCESS;
1636}
1637
1638/*
1639 * 'no net' command
1640 */
1641DEFUN (no_topology_baseis,
1642 no_topology_baseis_cmd,
1643 "no topology base-is WORD",
1644 NO_STR
1645 "A Network Entity Title for this process (OSI only)"
hassof390d2c2004-09-10 20:48:21 +00001646 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001647{
1648 struct isis_area *area;
1649
1650 area = vty->index;
1651 assert (area);
1652
hassof390d2c2004-09-10 20:48:21 +00001653 memcpy (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS, ISIS_SYS_ID_LEN);
jardineb5d44e2003-12-23 08:09:43 +00001654 return CMD_SUCCESS;
1655}
1656
1657#endif /* TOPOLOGY_GENERATE */
1658
1659DEFUN (lsp_lifetime,
1660 lsp_lifetime_cmd,
1661 "lsp-lifetime <380-65535>",
1662 "Maximum LSP lifetime\n"
hassof390d2c2004-09-10 20:48:21 +00001663 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001664{
1665 struct isis_area *area;
1666 uint16_t interval;
1667
1668 area = vty->index;
1669 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001670
jardineb5d44e2003-12-23 08:09:43 +00001671 interval = atoi (argv[0]);
1672
hassof390d2c2004-09-10 20:48:21 +00001673 if (interval < ISIS_MIN_LSP_LIFETIME)
1674 {
1675 vty_out (vty, "LSP lifetime (%us) below %us%s",
1676 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001677
hassof390d2c2004-09-10 20:48:21 +00001678 return CMD_WARNING;
1679 }
jardineb5d44e2003-12-23 08:09:43 +00001680
1681
1682 area->max_lsp_lifetime[0] = interval;
1683 area->max_lsp_lifetime[1] = interval;
hassof390d2c2004-09-10 20:48:21 +00001684 area->lsp_refresh[0] = interval - 300;
1685 area->lsp_refresh[1] = interval - 300;
jardineb5d44e2003-12-23 08:09:43 +00001686
hassof390d2c2004-09-10 20:48:21 +00001687 if (area->t_lsp_refresh[0])
1688 {
1689 thread_cancel (area->t_lsp_refresh[0]);
1690 thread_execute (master, lsp_refresh_l1, area, 0);
1691 }
jardineb5d44e2003-12-23 08:09:43 +00001692
hassof390d2c2004-09-10 20:48:21 +00001693 if (area->t_lsp_refresh[1])
1694 {
1695 thread_cancel (area->t_lsp_refresh[1]);
1696 thread_execute (master, lsp_refresh_l2, area, 0);
1697 }
jardineb5d44e2003-12-23 08:09:43 +00001698
1699
1700 return CMD_SUCCESS;
1701}
1702
1703DEFUN (no_lsp_lifetime,
1704 no_lsp_lifetime_cmd,
1705 "no lsp-lifetime",
1706 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001707 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001708{
1709 struct isis_area *area;
1710
1711 area = vty->index;
1712 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001713
1714 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200s */
1715 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200s */
1716 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900s */
1717 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001718
1719 return CMD_SUCCESS;
1720}
1721
1722ALIAS (no_lsp_lifetime,
1723 no_lsp_lifetime_arg_cmd,
1724 "no lsp-lifetime <380-65535>",
1725 NO_STR
1726 "Maximum LSP lifetime\n"
hassof390d2c2004-09-10 20:48:21 +00001727 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001728
1729DEFUN (lsp_lifetime_l1,
1730 lsp_lifetime_l1_cmd,
1731 "lsp-lifetime level-1 <380-65535>",
1732 "Maximum LSP lifetime for Level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001733 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001734{
1735 struct isis_area *area;
1736 uint16_t interval;
1737
1738 area = vty->index;
1739 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001740
jardineb5d44e2003-12-23 08:09:43 +00001741 interval = atoi (argv[0]);
1742
hassof390d2c2004-09-10 20:48:21 +00001743 if (interval < ISIS_MIN_LSP_LIFETIME)
1744 {
1745 vty_out (vty, "Level-1 LSP lifetime (%us) below %us%s",
1746 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001747
hassof390d2c2004-09-10 20:48:21 +00001748 return CMD_WARNING;
1749 }
jardineb5d44e2003-12-23 08:09:43 +00001750
1751
1752 area->max_lsp_lifetime[0] = interval;
hassof390d2c2004-09-10 20:48:21 +00001753 area->lsp_refresh[0] = interval - 300;
jardineb5d44e2003-12-23 08:09:43 +00001754
1755 return CMD_SUCCESS;
1756}
1757
1758DEFUN (no_lsp_lifetime_l1,
1759 no_lsp_lifetime_l1_cmd,
1760 "no lsp-lifetime level-1",
1761 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001762 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001763{
1764 struct isis_area *area;
1765
1766 area = vty->index;
1767 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001768
1769 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200s */
1770 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001771
1772 return CMD_SUCCESS;
1773}
1774
1775ALIAS (no_lsp_lifetime_l1,
1776 no_lsp_lifetime_l1_arg_cmd,
1777 "no lsp-lifetime level-1 <380-65535>",
1778 NO_STR
1779 "Maximum LSP lifetime for Level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001780 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001781
1782DEFUN (lsp_lifetime_l2,
1783 lsp_lifetime_l2_cmd,
1784 "lsp-lifetime level-2 <380-65535>",
1785 "Maximum LSP lifetime for Level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001786 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001787{
1788 struct isis_area *area;
1789 uint16_t interval;
1790
1791 area = vty->index;
1792 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001793
jardineb5d44e2003-12-23 08:09:43 +00001794 interval = atoi (argv[0]);
1795
hassof390d2c2004-09-10 20:48:21 +00001796 if (interval < ISIS_MIN_LSP_LIFETIME)
1797 {
1798 vty_out (vty, "Level-2 LSP lifetime (%us) below %us%s",
1799 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001800
hassof390d2c2004-09-10 20:48:21 +00001801 return CMD_WARNING;
1802 }
jardineb5d44e2003-12-23 08:09:43 +00001803
1804 area->max_lsp_lifetime[1] = interval;
1805 area->lsp_refresh[1] = interval - 300;
1806
1807 return CMD_SUCCESS;
1808}
1809
1810DEFUN (no_lsp_lifetime_l2,
1811 no_lsp_lifetime_l2_cmd,
1812 "no lsp-lifetime level-2",
1813 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001814 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001815{
1816 struct isis_area *area;
1817
1818 area = vty->index;
1819 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001820
1821 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200s */
1822 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001823
1824 return CMD_SUCCESS;
1825}
1826
1827ALIAS (no_lsp_lifetime_l2,
1828 no_lsp_lifetime_l2_arg_cmd,
1829 "no lsp-lifetime level-2 <380-65535>",
1830 NO_STR
1831 "Maximum LSP lifetime for Level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001832 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001833
1834/* IS-IS configuration write function */
1835int
1836isis_config_write (struct vty *vty)
1837{
1838 int write = 0;
jardineb5d44e2003-12-23 08:09:43 +00001839
hassof390d2c2004-09-10 20:48:21 +00001840 if (isis != NULL)
1841 {
1842 struct isis_area *area;
paul1eb8ef22005-04-07 07:30:20 +00001843 struct listnode *node, *nnode;
1844 struct listnode *node2, *nnode2;
jardineb5d44e2003-12-23 08:09:43 +00001845
paul1eb8ef22005-04-07 07:30:20 +00001846 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
hassof390d2c2004-09-10 20:48:21 +00001847 {
1848 /* ISIS - Area name */
1849 vty_out (vty, "router isis %s%s", area->area_tag, VTY_NEWLINE);
1850 write++;
1851 /* ISIS - Net */
1852 if (listcount (area->area_addrs) > 0)
1853 {
1854 struct area_addr *area_addr;
paul1eb8ef22005-04-07 07:30:20 +00001855 for (ALL_LIST_ELEMENTS (area->area_addrs, node2, nnode2, area_addr))
hassof390d2c2004-09-10 20:48:21 +00001856 {
1857 vty_out (vty, " net %s%s",
1858 isonet_print (area_addr->area_addr,
1859 area_addr->addr_len + ISIS_SYS_ID_LEN +
1860 1), VTY_NEWLINE);
1861 write++;
1862 }
1863 }
1864 /* ISIS - Dynamic hostname - Defaults to true so only display if false */
1865 if (!area->dynhostname)
1866 {
1867 vty_out (vty, " no hostname dynamic%s", VTY_NEWLINE);
1868 write++;
1869 }
1870 /* ISIS - Metric-Style - when true displays wide */
1871 if (area->newmetric)
1872 {
1873 vty_out (vty, " metric-style wide%s", VTY_NEWLINE);
1874 write++;
1875 }
1876 /* ISIS - Area is-type (level-1-2 is default) */
1877 if (area->is_type == IS_LEVEL_1)
1878 {
1879 vty_out (vty, " is-type level-1%s", VTY_NEWLINE);
1880 write++;
1881 }
1882 else
1883 {
1884 if (area->is_type == IS_LEVEL_2)
1885 {
1886 vty_out (vty, " is-type level-2-only%s", VTY_NEWLINE);
1887 write++;
1888 }
1889 }
1890 /* ISIS - Lsp generation interval */
1891 if (area->lsp_gen_interval[0] == area->lsp_gen_interval[1])
1892 {
1893 if (area->lsp_gen_interval[0] != LSP_GEN_INTERVAL_DEFAULT)
1894 {
1895 vty_out (vty, " lsp-gen-interval %d%s",
1896 area->lsp_gen_interval[0], VTY_NEWLINE);
1897 write++;
1898 }
1899 }
1900 else
1901 {
1902 if (area->lsp_gen_interval[0] != LSP_GEN_INTERVAL_DEFAULT)
1903 {
1904 vty_out (vty, " lsp-gen-interval level-1 %d%s",
1905 area->lsp_gen_interval[0], VTY_NEWLINE);
1906 write++;
1907 }
1908 if (area->lsp_gen_interval[1] != LSP_GEN_INTERVAL_DEFAULT)
1909 {
1910 vty_out (vty, " lsp-gen-interval level-2 %d%s",
1911 area->lsp_gen_interval[1], VTY_NEWLINE);
1912 write++;
1913 }
1914 }
1915 /* ISIS - LSP lifetime */
1916 if (area->max_lsp_lifetime[0] == area->max_lsp_lifetime[1])
1917 {
1918 if (area->max_lsp_lifetime[0] != MAX_AGE)
1919 {
1920 vty_out (vty, " lsp-lifetime %u%s", area->max_lsp_lifetime[0],
1921 VTY_NEWLINE);
1922 write++;
1923 }
1924 }
1925 else
1926 {
1927 if (area->max_lsp_lifetime[0] != MAX_AGE)
1928 {
1929 vty_out (vty, " lsp-lifetime level-1 %u%s",
1930 area->max_lsp_lifetime[0], VTY_NEWLINE);
1931 write++;
1932 }
1933 if (area->max_lsp_lifetime[1] != MAX_AGE)
1934 {
1935 vty_out (vty, " lsp-lifetime level-2 %u%s",
1936 area->max_lsp_lifetime[1], VTY_NEWLINE);
1937 write++;
1938 }
1939 }
hasso53c997c2004-09-15 16:21:59 +00001940 /* Authentication passwords. */
1941 if (area->area_passwd.len > 0)
1942 {
hasso1cbc5622005-01-01 10:29:51 +00001943 vty_out(vty, " area-password %s", area->area_passwd.passwd);
1944 if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND))
1945 {
1946 vty_out(vty, " authenticate snp ");
1947 if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV))
1948 vty_out(vty, "validate");
1949 else
1950 vty_out(vty, "send-only");
1951 }
1952 vty_out(vty, "%s", VTY_NEWLINE);
hasso53c997c2004-09-15 16:21:59 +00001953 write++;
1954 }
1955 if (area->domain_passwd.len > 0)
1956 {
hasso1cbc5622005-01-01 10:29:51 +00001957 vty_out(vty, " domain-password %s", area->domain_passwd.passwd);
1958 if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND))
1959 {
1960 vty_out(vty, " authenticate snp ");
1961 if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV))
1962 vty_out(vty, "validate");
1963 else
1964 vty_out(vty, "send-only");
1965 }
1966 vty_out(vty, "%s", VTY_NEWLINE);
hasso53c997c2004-09-15 16:21:59 +00001967 write++;
1968 }
hassof390d2c2004-09-10 20:48:21 +00001969#ifdef TOPOLOGY_GENERATE
1970 /* seems we save the whole command line here */
1971 if (area->top_params)
1972 {
1973 vty_out (vty, " %s%s", area->top_params, VTY_NEWLINE);
1974 write++;
1975 }
jardineb5d44e2003-12-23 08:09:43 +00001976
hassof390d2c2004-09-10 20:48:21 +00001977 if (memcmp (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS,
1978 ISIS_SYS_ID_LEN))
1979 {
1980 vty_out (vty, " topology base_is %s%s",
1981 sysid_print (area->topology_baseis), VTY_NEWLINE);
1982 write++;
1983 }
1984
1985#endif /* TOPOLOGY_GENERATE */
1986 }
jardineb5d44e2003-12-23 08:09:43 +00001987 }
hassof390d2c2004-09-10 20:48:21 +00001988
jardineb5d44e2003-12-23 08:09:43 +00001989 return write;
1990}
1991
hassof390d2c2004-09-10 20:48:21 +00001992struct cmd_node isis_node = {
jardineb5d44e2003-12-23 08:09:43 +00001993 ISIS_NODE,
hasso2097cd82003-12-23 11:51:08 +00001994 "%s(config-router)# ",
jardineb5d44e2003-12-23 08:09:43 +00001995 1
1996};
1997
hassof390d2c2004-09-10 20:48:21 +00001998void
jardineb5d44e2003-12-23 08:09:43 +00001999isis_init ()
2000{
jardineb5d44e2003-12-23 08:09:43 +00002001 /* Install IS-IS top node */
2002 install_node (&isis_node, isis_config_write);
hassof390d2c2004-09-10 20:48:21 +00002003
jardineb5d44e2003-12-23 08:09:43 +00002004 install_element (VIEW_NODE, &show_clns_neighbors_cmd);
2005 install_element (VIEW_NODE, &show_isis_neighbors_cmd);
2006 install_element (VIEW_NODE, &show_clns_neighbors_detail_cmd);
2007 install_element (VIEW_NODE, &show_isis_neighbors_detail_cmd);
2008
2009 install_element (VIEW_NODE, &show_hostname_cmd);
2010 install_element (VIEW_NODE, &show_database_cmd);
2011 install_element (VIEW_NODE, &show_database_detail_cmd);
2012
2013 install_element (ENABLE_NODE, &show_clns_neighbors_cmd);
2014 install_element (ENABLE_NODE, &show_isis_neighbors_cmd);
2015 install_element (ENABLE_NODE, &show_clns_neighbors_detail_cmd);
2016 install_element (ENABLE_NODE, &show_isis_neighbors_detail_cmd);
2017
2018 install_element (ENABLE_NODE, &show_hostname_cmd);
2019 install_element (ENABLE_NODE, &show_database_cmd);
2020 install_element (ENABLE_NODE, &show_database_detail_cmd);
2021 install_element (ENABLE_NODE, &show_debugging_cmd);
2022
hassof390d2c2004-09-10 20:48:21 +00002023 install_node (&debug_node, config_write_debug);
jardin9e867fe2003-12-23 08:56:18 +00002024
jardineb5d44e2003-12-23 08:09:43 +00002025 install_element (ENABLE_NODE, &debug_isis_adj_cmd);
2026 install_element (ENABLE_NODE, &no_debug_isis_adj_cmd);
2027 install_element (ENABLE_NODE, &debug_isis_csum_cmd);
2028 install_element (ENABLE_NODE, &no_debug_isis_csum_cmd);
2029 install_element (ENABLE_NODE, &debug_isis_lupd_cmd);
2030 install_element (ENABLE_NODE, &no_debug_isis_lupd_cmd);
2031 install_element (ENABLE_NODE, &debug_isis_err_cmd);
2032 install_element (ENABLE_NODE, &no_debug_isis_err_cmd);
2033 install_element (ENABLE_NODE, &debug_isis_snp_cmd);
2034 install_element (ENABLE_NODE, &no_debug_isis_snp_cmd);
2035 install_element (ENABLE_NODE, &debug_isis_upd_cmd);
2036 install_element (ENABLE_NODE, &no_debug_isis_upd_cmd);
2037 install_element (ENABLE_NODE, &debug_isis_spfevents_cmd);
2038 install_element (ENABLE_NODE, &no_debug_isis_spfevents_cmd);
2039 install_element (ENABLE_NODE, &debug_isis_spfstats_cmd);
2040 install_element (ENABLE_NODE, &no_debug_isis_spfstats_cmd);
2041 install_element (ENABLE_NODE, &debug_isis_spftrigg_cmd);
2042 install_element (ENABLE_NODE, &no_debug_isis_spftrigg_cmd);
2043 install_element (ENABLE_NODE, &debug_isis_rtevents_cmd);
2044 install_element (ENABLE_NODE, &no_debug_isis_rtevents_cmd);
2045 install_element (ENABLE_NODE, &debug_isis_events_cmd);
2046 install_element (ENABLE_NODE, &no_debug_isis_events_cmd);
2047
jardin9e867fe2003-12-23 08:56:18 +00002048 install_element (CONFIG_NODE, &debug_isis_adj_cmd);
2049 install_element (CONFIG_NODE, &no_debug_isis_adj_cmd);
2050 install_element (CONFIG_NODE, &debug_isis_csum_cmd);
2051 install_element (CONFIG_NODE, &no_debug_isis_csum_cmd);
2052 install_element (CONFIG_NODE, &debug_isis_lupd_cmd);
2053 install_element (CONFIG_NODE, &no_debug_isis_lupd_cmd);
2054 install_element (CONFIG_NODE, &debug_isis_err_cmd);
2055 install_element (CONFIG_NODE, &no_debug_isis_err_cmd);
2056 install_element (CONFIG_NODE, &debug_isis_snp_cmd);
2057 install_element (CONFIG_NODE, &no_debug_isis_snp_cmd);
2058 install_element (CONFIG_NODE, &debug_isis_upd_cmd);
2059 install_element (CONFIG_NODE, &no_debug_isis_upd_cmd);
2060 install_element (CONFIG_NODE, &debug_isis_spfevents_cmd);
2061 install_element (CONFIG_NODE, &no_debug_isis_spfevents_cmd);
2062 install_element (CONFIG_NODE, &debug_isis_spfstats_cmd);
2063 install_element (CONFIG_NODE, &no_debug_isis_spfstats_cmd);
2064 install_element (CONFIG_NODE, &debug_isis_spftrigg_cmd);
2065 install_element (CONFIG_NODE, &no_debug_isis_spftrigg_cmd);
2066 install_element (CONFIG_NODE, &debug_isis_rtevents_cmd);
2067 install_element (CONFIG_NODE, &no_debug_isis_rtevents_cmd);
2068 install_element (CONFIG_NODE, &debug_isis_events_cmd);
2069 install_element (CONFIG_NODE, &no_debug_isis_events_cmd);
2070
jardineb5d44e2003-12-23 08:09:43 +00002071 install_element (CONFIG_NODE, &router_isis_cmd);
2072 install_element (CONFIG_NODE, &no_router_isis_cmd);
2073
2074 install_default (ISIS_NODE);
2075
2076 install_element (ISIS_NODE, &net_cmd);
2077 install_element (ISIS_NODE, &no_net_cmd);
2078
2079 install_element (ISIS_NODE, &is_type_cmd);
2080 install_element (ISIS_NODE, &no_is_type_cmd);
2081
2082 install_element (ISIS_NODE, &area_passwd_cmd);
hasso1cbc5622005-01-01 10:29:51 +00002083 install_element (ISIS_NODE, &area_passwd_snpauth_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002084 install_element (ISIS_NODE, &no_area_passwd_cmd);
2085
2086 install_element (ISIS_NODE, &domain_passwd_cmd);
hasso1cbc5622005-01-01 10:29:51 +00002087 install_element (ISIS_NODE, &domain_passwd_snpauth_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002088 install_element (ISIS_NODE, &no_domain_passwd_cmd);
2089
2090 install_element (ISIS_NODE, &lsp_gen_interval_cmd);
2091 install_element (ISIS_NODE, &no_lsp_gen_interval_cmd);
2092 install_element (ISIS_NODE, &no_lsp_gen_interval_arg_cmd);
2093 install_element (ISIS_NODE, &lsp_gen_interval_l1_cmd);
2094 install_element (ISIS_NODE, &no_lsp_gen_interval_l1_cmd);
2095 install_element (ISIS_NODE, &no_lsp_gen_interval_l1_arg_cmd);
2096 install_element (ISIS_NODE, &lsp_gen_interval_l2_cmd);
2097 install_element (ISIS_NODE, &no_lsp_gen_interval_l2_cmd);
2098 install_element (ISIS_NODE, &no_lsp_gen_interval_l2_arg_cmd);
2099
2100 install_element (ISIS_NODE, &spf_interval_cmd);
2101 install_element (ISIS_NODE, &no_spf_interval_cmd);
2102 install_element (ISIS_NODE, &no_spf_interval_arg_cmd);
2103 install_element (ISIS_NODE, &spf_interval_l1_cmd);
2104 install_element (ISIS_NODE, &no_spf_interval_l1_cmd);
2105 install_element (ISIS_NODE, &no_spf_interval_l1_arg_cmd);
2106 install_element (ISIS_NODE, &spf_interval_l2_cmd);
2107 install_element (ISIS_NODE, &no_spf_interval_l2_cmd);
2108 install_element (ISIS_NODE, &no_spf_interval_l2_arg_cmd);
hassof390d2c2004-09-10 20:48:21 +00002109
jardineb5d44e2003-12-23 08:09:43 +00002110 install_element (ISIS_NODE, &lsp_lifetime_cmd);
2111 install_element (ISIS_NODE, &no_lsp_lifetime_cmd);
2112 install_element (ISIS_NODE, &no_lsp_lifetime_arg_cmd);
2113 install_element (ISIS_NODE, &lsp_lifetime_l1_cmd);
2114 install_element (ISIS_NODE, &no_lsp_lifetime_l1_cmd);
2115 install_element (ISIS_NODE, &no_lsp_lifetime_l1_arg_cmd);
2116 install_element (ISIS_NODE, &lsp_lifetime_l2_cmd);
2117 install_element (ISIS_NODE, &no_lsp_lifetime_l2_cmd);
2118 install_element (ISIS_NODE, &no_lsp_lifetime_l2_arg_cmd);
2119
2120 install_element (ISIS_NODE, &dynamic_hostname_cmd);
2121 install_element (ISIS_NODE, &no_dynamic_hostname_cmd);
2122
2123 install_element (ISIS_NODE, &metric_style_cmd);
2124 install_element (ISIS_NODE, &no_metric_style_cmd);
2125#ifdef TOPOLOGY_GENERATE
2126 install_element (ISIS_NODE, &topology_generate_grid_cmd);
2127 install_element (ISIS_NODE, &topology_baseis_cmd);
2128 install_element (ISIS_NODE, &no_topology_baseis_cmd);
hassof695b012005-04-02 19:03:39 +00002129 install_element (VIEW_NODE, &show_isis_generated_topology_cmd);
2130 install_element (ENABLE_NODE, &show_isis_generated_topology_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002131#endif /* TOPOLOGY_GENERATE */
2132
hassof390d2c2004-09-10 20:48:21 +00002133 isis_new (0);
jardineb5d44e2003-12-23 08:09:43 +00002134 isis_circuit_init ();
2135 isis_zebra_init ();
2136 isis_spf_cmds_init ();
2137}