blob: 5ab1f272162962639239817674e5ecc976447983 [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{
hassof390d2c2004-09-10 20:48:21 +000068 isis = XMALLOC (MTYPE_ISIS, sizeof (struct isis));
jardineb5d44e2003-12-23 08:09:43 +000069 bzero (isis, sizeof (struct isis));
70 /*
71 * Default values
72 */
73 isis->max_area_addrs = 3;
74
75 isis->process_id = process_id;
76 isis->area_list = list_new ();
77 isis->init_circ_list = list_new ();
78 isis->uptime = time (NULL);
79 isis->nexthops = list_new ();
80#ifdef HAVE_IPV6
81 isis->nexthops6 = list_new ();
82#endif /* HAVE_IPV6 */
83 /*
84 * uncomment the next line for full debugs
85 */
hassof390d2c2004-09-10 20:48:21 +000086 /* isis->debugs = 0xFFFF; */
jardineb5d44e2003-12-23 08:09:43 +000087}
88
89struct isis_area *
90isis_area_create ()
91{
jardineb5d44e2003-12-23 08:09:43 +000092 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +000093
jardineb5d44e2003-12-23 08:09:43 +000094 area = XMALLOC (MTYPE_ISIS_AREA, sizeof (struct isis_area));
95 memset (area, 0, sizeof (struct isis_area));
96
97 /*
98 * The first instance is level-1-2 rest are level-1, unless otherwise
99 * configured
100 */
101 if (listcount (isis->area_list) > 0)
102 area->is_type = IS_LEVEL_1;
103 else
104 area->is_type = IS_LEVEL_1_AND_2;
105 /*
106 * intialize the databases
107 */
108 area->lspdb[0] = lsp_db_init ();
109 area->lspdb[1] = lsp_db_init ();
hassof390d2c2004-09-10 20:48:21 +0000110
jardineb5d44e2003-12-23 08:09:43 +0000111 spftree_area_init (area);
112 area->route_table = route_table_init ();
113#ifdef HAVE_IPV6
114 area->route_table6 = route_table_init ();
115#endif /* HAVE_IPV6 */
116 area->circuit_list = list_new ();
117 area->area_addrs = list_new ();
hassof390d2c2004-09-10 20:48:21 +0000118 THREAD_TIMER_ON (master, area->t_tick, lsp_tick, area, 1);
jardineb5d44e2003-12-23 08:09:43 +0000119 area->flags.maxindex = -1;
120 /*
121 * Default values
122 */
hassof390d2c2004-09-10 20:48:21 +0000123 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200 */
124 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200 */
jardineb5d44e2003-12-23 08:09:43 +0000125 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
126 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
hassof390d2c2004-09-10 20:48:21 +0000127 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900 */
128 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900 */
jardineb5d44e2003-12-23 08:09:43 +0000129 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
130 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
131 area->dynhostname = 1;
132 area->lsp_frag_threshold = 90;
133#ifdef TOPOLOGY_GENERATE
134 memcpy (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS, ISIS_SYS_ID_LEN);
135#endif /* TOPOLOGY_GENERATE */
136
137 /* FIXME: Think of a better way... */
138 area->min_bcast_mtu = 1497;
139
140 return area;
141}
142
143struct isis_area *
hassof90a5f62004-10-11 13:11:56 +0000144isis_area_lookup (const char *area_tag)
jardineb5d44e2003-12-23 08:09:43 +0000145{
146 struct isis_area *area;
paul1eb8ef22005-04-07 07:30:20 +0000147 struct listnode *node, *nnode;
hassof390d2c2004-09-10 20:48:21 +0000148
paul1eb8ef22005-04-07 07:30:20 +0000149 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
jardineb5d44e2003-12-23 08:09:43 +0000150 if ((area->area_tag == NULL && area_tag == NULL) ||
hassof390d2c2004-09-10 20:48:21 +0000151 (area->area_tag && area_tag
152 && strcmp (area->area_tag, area_tag) == 0))
153 return area;
154
jardineb5d44e2003-12-23 08:09:43 +0000155 return NULL;
156}
157
hassof390d2c2004-09-10 20:48:21 +0000158int
hassof90a5f62004-10-11 13:11:56 +0000159isis_area_get (struct vty *vty, const char *area_tag)
jardineb5d44e2003-12-23 08:09:43 +0000160{
jardineb5d44e2003-12-23 08:09:43 +0000161 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000162
jardineb5d44e2003-12-23 08:09:43 +0000163 area = isis_area_lookup (area_tag);
hassof390d2c2004-09-10 20:48:21 +0000164
165 if (area)
166 {
167 vty->node = ISIS_NODE;
168 vty->index = area;
169 return CMD_SUCCESS;
170 }
171
jardineb5d44e2003-12-23 08:09:43 +0000172 area = isis_area_create ();
173 area->area_tag = strdup (area_tag);
174 listnode_add (isis->area_list, area);
hassof390d2c2004-09-10 20:48:21 +0000175
hasso529d65b2004-12-24 00:14:50 +0000176 zlog_debug ("new IS-IS area instance %s", area->area_tag);
jardineb5d44e2003-12-23 08:09:43 +0000177
178 vty->node = ISIS_NODE;
179 vty->index = area;
hassof390d2c2004-09-10 20:48:21 +0000180
jardineb5d44e2003-12-23 08:09:43 +0000181 return CMD_SUCCESS;
182}
183
184int
hassof90a5f62004-10-11 13:11:56 +0000185isis_area_destroy (struct vty *vty, const char *area_tag)
jardineb5d44e2003-12-23 08:09:43 +0000186{
jardineb5d44e2003-12-23 08:09:43 +0000187 struct isis_area *area;
paul1eb8ef22005-04-07 07:30:20 +0000188 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000189 struct isis_circuit *circuit;
190
191 area = isis_area_lookup (area_tag);
jardineb5d44e2003-12-23 08:09:43 +0000192
hassof390d2c2004-09-10 20:48:21 +0000193 if (area == NULL)
194 {
195 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
196 return CMD_WARNING;
jardineb5d44e2003-12-23 08:09:43 +0000197 }
hassof390d2c2004-09-10 20:48:21 +0000198
199 if (area->circuit_list)
200 {
paul1eb8ef22005-04-07 07:30:20 +0000201 for (ALL_LIST_ELEMENTS (area->circuit_list, node, nnode, circuit))
202 isis_circuit_del (circuit);
203
hassof390d2c2004-09-10 20:48:21 +0000204 list_delete (area->circuit_list);
205 }
jardineb5d44e2003-12-23 08:09:43 +0000206 listnode_delete (isis->area_list, area);
hassof390d2c2004-09-10 20:48:21 +0000207 THREAD_TIMER_OFF (area->t_tick);
jardineb5d44e2003-12-23 08:09:43 +0000208 if (area->t_remove_aged)
209 thread_cancel (area->t_remove_aged);
hassof390d2c2004-09-10 20:48:21 +0000210 THREAD_TIMER_OFF (area->t_lsp_refresh[0]);
211 THREAD_TIMER_OFF (area->t_lsp_refresh[1]);
jardineb5d44e2003-12-23 08:09:43 +0000212
213 XFREE (MTYPE_ISIS_AREA, area);
hassof390d2c2004-09-10 20:48:21 +0000214
jardineb5d44e2003-12-23 08:09:43 +0000215 return CMD_SUCCESS;
216}
217
hassof390d2c2004-09-10 20:48:21 +0000218int
hassof7c43dc2004-09-26 16:24:14 +0000219area_net_title (struct vty *vty, u_char *net_title)
jardineb5d44e2003-12-23 08:09:43 +0000220{
jardineb5d44e2003-12-23 08:09:43 +0000221 struct isis_area *area;
222 struct area_addr *addr;
223 struct area_addr *addrp;
paul1eb8ef22005-04-07 07:30:20 +0000224 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000225
226 u_char buff[255];
227 area = vty->index;
228
hassof390d2c2004-09-10 20:48:21 +0000229 if (!area)
230 {
231 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
232 return CMD_WARNING;
233 }
jardineb5d44e2003-12-23 08:09:43 +0000234
235 /* We check that we are not over the maximal number of addresses */
hassof390d2c2004-09-10 20:48:21 +0000236 if (listcount (area->area_addrs) >= isis->max_area_addrs)
237 {
238 vty_out (vty, "Maximum of area addresses (%d) already reached %s",
239 isis->max_area_addrs, VTY_NEWLINE);
240 return CMD_WARNING;
241 }
jardineb5d44e2003-12-23 08:09:43 +0000242
243 addr = XMALLOC (MTYPE_ISIS_AREA_ADDR, sizeof (struct area_addr));
244 addr->addr_len = dotformat2buff (buff, net_title);
245 memcpy (addr->area_addr, buff, addr->addr_len);
246#ifdef EXTREME_DEBUG
hasso529d65b2004-12-24 00:14:50 +0000247 zlog_debug ("added area address %s for area %s (address length %d)",
jardineb5d44e2003-12-23 08:09:43 +0000248 net_title, area->area_tag, addr->addr_len);
249#endif /* EXTREME_DEBUG */
hassof390d2c2004-09-10 20:48:21 +0000250 if (addr->addr_len < 8 || addr->addr_len > 20)
251 {
252 zlog_warn ("area address must be at least 8..20 octets long (%d)",
253 addr->addr_len);
jardineb5d44e2003-12-23 08:09:43 +0000254 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
255 return CMD_WARNING;
256 }
257
hassof390d2c2004-09-10 20:48:21 +0000258 if (isis->sysid_set == 0)
259 {
260 /*
261 * First area address - get the SystemID for this router
262 */
263 memcpy (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN), ISIS_SYS_ID_LEN);
264 isis->sysid_set = 1;
hasso529d65b2004-12-24 00:14:50 +0000265 zlog_debug ("Router has SystemID %s", sysid_print (isis->sysid));
jardineb5d44e2003-12-23 08:09:43 +0000266 }
hassof390d2c2004-09-10 20:48:21 +0000267 else
268 {
269 /*
270 * Check that the SystemID portions match
271 */
272 if (memcmp (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN),
273 ISIS_SYS_ID_LEN))
274 {
275 vty_out (vty,
276 "System ID must not change when defining additional area"
277 " addresses%s", VTY_NEWLINE);
278 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
279 return CMD_WARNING;
280 }
jardineb5d44e2003-12-23 08:09:43 +0000281
hassof390d2c2004-09-10 20:48:21 +0000282 /* now we see that we don't already have this address */
paul1eb8ef22005-04-07 07:30:20 +0000283 for (ALL_LIST_ELEMENTS (area->area_addrs, node, nnode, addrp))
hassof390d2c2004-09-10 20:48:21 +0000284 {
285 if ((addrp->addr_len + ISIS_SYS_ID_LEN + 1) == (addr->addr_len))
286 {
287 if (!memcmp (addrp->area_addr, addr->area_addr, addr->addr_len))
288 {
289 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
290 return CMD_SUCCESS; /* silent fail */
291 }
292 }
293 }
294
295 }
jardineb5d44e2003-12-23 08:09:43 +0000296 /*
297 * Forget the systemID part of the address
298 */
299 addr->addr_len -= (ISIS_SYS_ID_LEN + 1);
300 listnode_add (area->area_addrs, addr);
301
302 /* only now we can safely generate our LSPs for this area */
hassof390d2c2004-09-10 20:48:21 +0000303 if (listcount (area->area_addrs) > 0)
304 {
305 lsp_l1_generate (area);
306 lsp_l2_generate (area);
307 }
jardineb5d44e2003-12-23 08:09:43 +0000308
309 return CMD_SUCCESS;
310}
311
312int
hassof7c43dc2004-09-26 16:24:14 +0000313area_clear_net_title (struct vty *vty, u_char *net_title)
jardineb5d44e2003-12-23 08:09:43 +0000314{
315 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000316 struct area_addr addr, *addrp = NULL;
paul1eb8ef22005-04-07 07:30:20 +0000317 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000318 u_char buff[255];
319
320 area = vty->index;
hassof390d2c2004-09-10 20:48:21 +0000321 if (!area)
322 {
323 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
324 return CMD_WARNING;
325 }
326
jardineb5d44e2003-12-23 08:09:43 +0000327 addr.addr_len = dotformat2buff (buff, net_title);
hassof390d2c2004-09-10 20:48:21 +0000328 if (addr.addr_len < 8 || addr.addr_len > 20)
329 {
330 vty_out (vty, "Unsupported area address length %d, should be 8...20 %s",
331 addr.addr_len, VTY_NEWLINE);
332 return CMD_WARNING;
333 }
334
335 memcpy (addr.area_addr, buff, (int) addr.addr_len);
336
paul1eb8ef22005-04-07 07:30:20 +0000337 for (ALL_LIST_ELEMENTS (area->area_addrs, node, nnode, addrp))
jardineb5d44e2003-12-23 08:09:43 +0000338 if (addrp->addr_len == addr.addr_len &&
339 !memcmp (addrp->area_addr, addr.area_addr, addr.addr_len))
hassof390d2c2004-09-10 20:48:21 +0000340 break;
341
342 if (!addrp)
343 {
344 vty_out (vty, "No area address %s for area %s %s", net_title,
345 area->area_tag, VTY_NEWLINE);
346 return CMD_WARNING;
347 }
348
jardineb5d44e2003-12-23 08:09:43 +0000349 listnode_delete (area->area_addrs, addrp);
hassof390d2c2004-09-10 20:48:21 +0000350
jardineb5d44e2003-12-23 08:09:43 +0000351 return CMD_SUCCESS;
352}
353
jardineb5d44e2003-12-23 08:09:43 +0000354/*
355 * 'show clns neighbors' command
356 */
357
358int
hassof390d2c2004-09-10 20:48:21 +0000359show_clns_neigh (struct vty *vty, char detail)
jardineb5d44e2003-12-23 08:09:43 +0000360{
paul1eb8ef22005-04-07 07:30:20 +0000361 struct listnode *anode, *annode, *cnode, *cnnode;
jardineb5d44e2003-12-23 08:09:43 +0000362 struct isis_area *area;
363 struct isis_circuit *circuit;
364 struct list *db;
365 int i;
366
hassof390d2c2004-09-10 20:48:21 +0000367 if (!isis)
368 {
369 vty_out (vty, "IS-IS Routing Process not enabled%s", VTY_NEWLINE);
370 return CMD_SUCCESS;
371 }
jardineb5d44e2003-12-23 08:09:43 +0000372
paul1eb8ef22005-04-07 07:30:20 +0000373 for (ALL_LIST_ELEMENTS (isis->area_list, anode, annode, area))
hassof390d2c2004-09-10 20:48:21 +0000374 {
hassof390d2c2004-09-10 20:48:21 +0000375 vty_out (vty, "Area %s:%s", area->area_tag, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000376
hassof390d2c2004-09-10 20:48:21 +0000377 if (detail == ISIS_UI_LEVEL_BRIEF)
378 vty_out (vty, " System Id Interface L State "
379 "Holdtime SNPA%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000380
paul1eb8ef22005-04-07 07:30:20 +0000381 for (ALL_LIST_ELEMENTS (area->circuit_list, cnode, cnnode, circuit))
hassof390d2c2004-09-10 20:48:21 +0000382 {
hassof390d2c2004-09-10 20:48:21 +0000383 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
384 {
385 for (i = 0; i < 2; i++)
386 {
387 db = circuit->u.bc.adjdb[i];
388 if (db && db->count)
389 {
390 if (detail == ISIS_UI_LEVEL_BRIEF)
391 isis_adjdb_iterate (db,
392 (void (*)
393 (struct isis_adjacency *,
394 void *)) isis_adj_print_vty,
395 vty);
396 if (detail == ISIS_UI_LEVEL_DETAIL)
397 isis_adjdb_iterate (db,
398 (void (*)
399 (struct isis_adjacency *,
400 void *))
401 isis_adj_print_vty_detail, vty);
402 if (detail == ISIS_UI_LEVEL_EXTENSIVE)
403 isis_adjdb_iterate (db,
404 (void (*)
405 (struct isis_adjacency *,
406 void *))
407 isis_adj_print_vty_extensive,
408 vty);
409 }
410 }
411 }
412 else if (circuit->circ_type == CIRCUIT_T_P2P &&
413 circuit->u.p2p.neighbor)
414 {
415 if (detail == ISIS_UI_LEVEL_BRIEF)
416 isis_adj_p2p_print_vty (circuit->u.p2p.neighbor, vty);
417 if (detail == ISIS_UI_LEVEL_DETAIL)
418 isis_adj_p2p_print_vty_detail (circuit->u.p2p.neighbor, vty);
419 if (detail == ISIS_UI_LEVEL_EXTENSIVE)
420 isis_adj_p2p_print_vty_extensive (circuit->u.p2p.neighbor,
421 vty);
422 }
423 }
jardineb5d44e2003-12-23 08:09:43 +0000424 }
hassof390d2c2004-09-10 20:48:21 +0000425
jardineb5d44e2003-12-23 08:09:43 +0000426 return CMD_SUCCESS;
427}
428
429DEFUN (show_clns_neighbors,
430 show_clns_neighbors_cmd,
431 "show clns neighbors",
432 SHOW_STR
433 "clns network information\n"
434 "CLNS neighbor adjacencies\n")
435{
hassof390d2c2004-09-10 20:48:21 +0000436 return show_clns_neigh (vty, ISIS_UI_LEVEL_BRIEF);
jardineb5d44e2003-12-23 08:09:43 +0000437}
438
439ALIAS (show_clns_neighbors,
440 show_isis_neighbors_cmd,
441 "show isis neighbors",
442 SHOW_STR
443 "IS-IS network information\n"
444 "IS-IS neighbor adjacencies\n")
445
446DEFUN (show_clns_neighbors_detail,
447 show_clns_neighbors_detail_cmd,
448 "show clns neighbors detail",
449 SHOW_STR
450 "clns network information\n"
451 "CLNS neighbor adjacencies\n"
452 "show detailed information\n")
453{
hassof390d2c2004-09-10 20:48:21 +0000454 return show_clns_neigh (vty, ISIS_UI_LEVEL_DETAIL);
jardineb5d44e2003-12-23 08:09:43 +0000455}
456
457ALIAS (show_clns_neighbors_detail,
458 show_isis_neighbors_detail_cmd,
459 "show isis neighbors detail",
460 SHOW_STR
461 "IS-IS network information\n"
462 "IS-IS neighbor adjacencies\n"
463 "show detailed information\n")
jardineb5d44e2003-12-23 08:09:43 +0000464/*
465 * 'isis debug', 'show debugging'
466 */
jardineb5d44e2003-12-23 08:09:43 +0000467void
468print_debug (struct vty *vty, int flags, int onoff)
469{
470 char onoffs[4];
471 if (onoff)
hassof390d2c2004-09-10 20:48:21 +0000472 strcpy (onoffs, "on");
jardineb5d44e2003-12-23 08:09:43 +0000473 else
hassof390d2c2004-09-10 20:48:21 +0000474 strcpy (onoffs, "off");
jardineb5d44e2003-12-23 08:09:43 +0000475
476 if (flags & DEBUG_ADJ_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000477 vty_out (vty, "IS-IS Adjacency related packets debugging is %s%s", onoffs,
478 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000479 if (flags & DEBUG_CHECKSUM_ERRORS)
hassof390d2c2004-09-10 20:48:21 +0000480 vty_out (vty, "IS-IS checksum errors debugging is %s%s", onoffs,
481 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000482 if (flags & DEBUG_LOCAL_UPDATES)
hassof390d2c2004-09-10 20:48:21 +0000483 vty_out (vty, "IS-IS local updates debugging is %s%s", onoffs,
484 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000485 if (flags & DEBUG_PROTOCOL_ERRORS)
hassof390d2c2004-09-10 20:48:21 +0000486 vty_out (vty, "IS-IS protocol errors debugging is %s%s", onoffs,
487 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000488 if (flags & DEBUG_SNP_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000489 vty_out (vty, "IS-IS CSNP/PSNP packets debugging is %s%s", onoffs,
490 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000491 if (flags & DEBUG_SPF_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000492 vty_out (vty, "IS-IS SPF events debugging is %s%s", onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000493 if (flags & DEBUG_SPF_STATS)
hassof390d2c2004-09-10 20:48:21 +0000494 vty_out (vty, "IS-IS SPF Timing and Statistics Data debugging is %s%s",
495 onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000496 if (flags & DEBUG_SPF_TRIGGERS)
hassof390d2c2004-09-10 20:48:21 +0000497 vty_out (vty, "IS-IS SPF triggering events debugging is %s%s", onoffs,
498 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000499 if (flags & DEBUG_UPDATE_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000500 vty_out (vty, "IS-IS Update related packet debugging is %s%s", onoffs,
501 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000502 if (flags & DEBUG_RTE_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000503 vty_out (vty, "IS-IS Route related debuggin is %s%s", onoffs,
504 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000505 if (flags & DEBUG_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000506 vty_out (vty, "IS-IS Event debugging is %s%s", onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000507
508}
509
510DEFUN (show_debugging,
511 show_debugging_cmd,
512 "show debugging",
513 SHOW_STR
514 "State of each debugging option\n")
515{
hassof390d2c2004-09-10 20:48:21 +0000516 vty_out (vty, "IS-IS:%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000517 print_debug (vty, isis->debugs, 1);
518 return CMD_SUCCESS;
519}
520
jardin9e867fe2003-12-23 08:56:18 +0000521/* Debug node. */
hassof390d2c2004-09-10 20:48:21 +0000522static struct cmd_node debug_node = {
jardin9e867fe2003-12-23 08:56:18 +0000523 DEBUG_NODE,
hassof390d2c2004-09-10 20:48:21 +0000524 "",
525 1
jardin9e867fe2003-12-23 08:56:18 +0000526};
527
528static int
529config_write_debug (struct vty *vty)
530{
531 int write = 0;
532 int flags = isis->debugs;
533
hassof390d2c2004-09-10 20:48:21 +0000534 if (flags & DEBUG_ADJ_PACKETS)
535 {
536 vty_out (vty, "debug isis adj-packets%s", VTY_NEWLINE);
537 write++;
538 }
539 if (flags & DEBUG_CHECKSUM_ERRORS)
540 {
541 vty_out (vty, "debug isis checksum-errors%s", VTY_NEWLINE);
542 write++;
543 }
544 if (flags & DEBUG_LOCAL_UPDATES)
545 {
546 vty_out (vty, "debug isis local-updates%s", VTY_NEWLINE);
547 write++;
548 }
549 if (flags & DEBUG_PROTOCOL_ERRORS)
550 {
551 vty_out (vty, "debug isis protocol-errors%s", VTY_NEWLINE);
552 write++;
553 }
554 if (flags & DEBUG_SNP_PACKETS)
555 {
556 vty_out (vty, "debug isis snp-packets%s", VTY_NEWLINE);
557 write++;
558 }
559 if (flags & DEBUG_SPF_EVENTS)
560 {
561 vty_out (vty, "debug isis spf-events%s", VTY_NEWLINE);
562 write++;
563 }
564 if (flags & DEBUG_SPF_STATS)
565 {
566 vty_out (vty, "debug isis spf-statistics%s", VTY_NEWLINE);
567 write++;
568 }
569 if (flags & DEBUG_SPF_TRIGGERS)
570 {
571 vty_out (vty, "debug isis spf-triggers%s", VTY_NEWLINE);
572 write++;
573 }
574 if (flags & DEBUG_UPDATE_PACKETS)
575 {
576 vty_out (vty, "debug isis update-packets%s", VTY_NEWLINE);
577 write++;
578 }
579 if (flags & DEBUG_RTE_EVENTS)
580 {
581 vty_out (vty, "debug isis route-events%s", VTY_NEWLINE);
582 write++;
583 }
584 if (flags & DEBUG_EVENTS)
585 {
586 vty_out (vty, "debug isis events%s", VTY_NEWLINE);
587 write++;
588 }
jardin9e867fe2003-12-23 08:56:18 +0000589
590 return write;
591}
592
jardineb5d44e2003-12-23 08:09:43 +0000593DEFUN (debug_isis_adj,
594 debug_isis_adj_cmd,
595 "debug isis adj-packets",
596 DEBUG_STR
597 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000598 "IS-IS Adjacency related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000599{
600 isis->debugs |= DEBUG_ADJ_PACKETS;
hassof390d2c2004-09-10 20:48:21 +0000601 print_debug (vty, DEBUG_ADJ_PACKETS, 1);
jardineb5d44e2003-12-23 08:09:43 +0000602
603 return CMD_SUCCESS;
604}
605
606DEFUN (no_debug_isis_adj,
607 no_debug_isis_adj_cmd,
608 "no debug isis adj-packets",
609 UNDEBUG_STR
610 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000611 "IS-IS Adjacency related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000612{
jardineb5d44e2003-12-23 08:09:43 +0000613 isis->debugs &= ~DEBUG_ADJ_PACKETS;
614 print_debug (vty, DEBUG_ADJ_PACKETS, 0);
615
616 return CMD_SUCCESS;
617}
618
jardineb5d44e2003-12-23 08:09:43 +0000619DEFUN (debug_isis_csum,
620 debug_isis_csum_cmd,
621 "debug isis checksum-errors",
622 DEBUG_STR
623 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000624 "IS-IS LSP checksum errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000625{
626 isis->debugs |= DEBUG_CHECKSUM_ERRORS;
627 print_debug (vty, DEBUG_CHECKSUM_ERRORS, 1);
628
629 return CMD_SUCCESS;
630}
631
632DEFUN (no_debug_isis_csum,
633 no_debug_isis_csum_cmd,
634 "no debug isis checksum-errors",
635 UNDEBUG_STR
636 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000637 "IS-IS LSP checksum errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000638{
639 isis->debugs &= ~DEBUG_CHECKSUM_ERRORS;
640 print_debug (vty, DEBUG_CHECKSUM_ERRORS, 0);
hassof390d2c2004-09-10 20:48:21 +0000641
jardineb5d44e2003-12-23 08:09:43 +0000642 return CMD_SUCCESS;
643}
644
645DEFUN (debug_isis_lupd,
646 debug_isis_lupd_cmd,
647 "debug isis local-updates",
648 DEBUG_STR
649 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000650 "IS-IS local update packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000651{
652 isis->debugs |= DEBUG_LOCAL_UPDATES;
653 print_debug (vty, DEBUG_LOCAL_UPDATES, 1);
654
655 return CMD_SUCCESS;
656}
657
658DEFUN (no_debug_isis_lupd,
659 no_debug_isis_lupd_cmd,
660 "no debug isis local-updates",
661 UNDEBUG_STR
662 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000663 "IS-IS local update packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000664{
665 isis->debugs &= ~DEBUG_LOCAL_UPDATES;
hassof390d2c2004-09-10 20:48:21 +0000666 print_debug (vty, DEBUG_LOCAL_UPDATES, 0);
667
jardineb5d44e2003-12-23 08:09:43 +0000668 return CMD_SUCCESS;
669}
670
671DEFUN (debug_isis_err,
672 debug_isis_err_cmd,
hassof390d2c2004-09-10 20:48:21 +0000673 "debug isis protocol-errors",
jardineb5d44e2003-12-23 08:09:43 +0000674 DEBUG_STR
675 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000676 "IS-IS LSP protocol errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000677{
678 isis->debugs |= DEBUG_PROTOCOL_ERRORS;
679 print_debug (vty, DEBUG_PROTOCOL_ERRORS, 1);
680
681 return CMD_SUCCESS;
682}
683
684DEFUN (no_debug_isis_err,
685 no_debug_isis_err_cmd,
686 "no debug isis protocol-errors",
687 UNDEBUG_STR
688 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000689 "IS-IS LSP protocol errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000690{
691 isis->debugs &= ~DEBUG_PROTOCOL_ERRORS;
692 print_debug (vty, DEBUG_PROTOCOL_ERRORS, 0);
hassof390d2c2004-09-10 20:48:21 +0000693
jardineb5d44e2003-12-23 08:09:43 +0000694 return CMD_SUCCESS;
695}
696
697DEFUN (debug_isis_snp,
698 debug_isis_snp_cmd,
699 "debug isis snp-packets",
700 DEBUG_STR
701 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000702 "IS-IS CSNP/PSNP packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000703{
704 isis->debugs |= DEBUG_SNP_PACKETS;
705 print_debug (vty, DEBUG_SNP_PACKETS, 1);
706
707 return CMD_SUCCESS;
708}
709
710DEFUN (no_debug_isis_snp,
711 no_debug_isis_snp_cmd,
712 "no debug isis snp-packets",
713 UNDEBUG_STR
714 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000715 "IS-IS CSNP/PSNP packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000716{
hassof390d2c2004-09-10 20:48:21 +0000717 isis->debugs &= ~DEBUG_SNP_PACKETS;
jardineb5d44e2003-12-23 08:09:43 +0000718 print_debug (vty, DEBUG_SNP_PACKETS, 0);
hassof390d2c2004-09-10 20:48:21 +0000719
jardineb5d44e2003-12-23 08:09:43 +0000720 return CMD_SUCCESS;
721}
722
jardineb5d44e2003-12-23 08:09:43 +0000723DEFUN (debug_isis_upd,
724 debug_isis_upd_cmd,
725 "debug isis update-packets",
726 DEBUG_STR
727 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000728 "IS-IS Update related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000729{
730 isis->debugs |= DEBUG_UPDATE_PACKETS;
731 print_debug (vty, DEBUG_UPDATE_PACKETS, 1);
732
733 return CMD_SUCCESS;
734}
735
736DEFUN (no_debug_isis_upd,
737 no_debug_isis_upd_cmd,
738 "no debug isis update-packets",
739 UNDEBUG_STR
740 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000741 "IS-IS Update related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000742{
743 isis->debugs &= ~DEBUG_UPDATE_PACKETS;
744 print_debug (vty, DEBUG_UPDATE_PACKETS, 0);
hassof390d2c2004-09-10 20:48:21 +0000745
jardineb5d44e2003-12-23 08:09:43 +0000746 return CMD_SUCCESS;
747}
748
jardineb5d44e2003-12-23 08:09:43 +0000749DEFUN (debug_isis_spfevents,
750 debug_isis_spfevents_cmd,
751 "debug isis spf-events",
752 DEBUG_STR
753 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000754 "IS-IS Shortest Path First Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000755{
756 isis->debugs |= DEBUG_SPF_EVENTS;
hassof390d2c2004-09-10 20:48:21 +0000757 print_debug (vty, DEBUG_SPF_EVENTS, 1);
jardineb5d44e2003-12-23 08:09:43 +0000758
759 return CMD_SUCCESS;
760}
761
762DEFUN (no_debug_isis_spfevents,
763 no_debug_isis_spfevents_cmd,
764 "no debug isis spf-events",
765 UNDEBUG_STR
766 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000767 "IS-IS Shortest Path First Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000768{
769 isis->debugs &= ~DEBUG_SPF_EVENTS;
hassof390d2c2004-09-10 20:48:21 +0000770 print_debug (vty, DEBUG_SPF_EVENTS, 0);
771
jardineb5d44e2003-12-23 08:09:43 +0000772 return CMD_SUCCESS;
773}
774
775
776DEFUN (debug_isis_spfstats,
777 debug_isis_spfstats_cmd,
778 "debug isis spf-statistics ",
779 DEBUG_STR
780 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000781 "IS-IS SPF Timing and Statistic Data\n")
jardineb5d44e2003-12-23 08:09:43 +0000782{
783 isis->debugs |= DEBUG_SPF_STATS;
784 print_debug (vty, DEBUG_SPF_STATS, 1);
785
786 return CMD_SUCCESS;
787}
788
789DEFUN (no_debug_isis_spfstats,
790 no_debug_isis_spfstats_cmd,
791 "no debug isis spf-statistics",
792 UNDEBUG_STR
793 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000794 "IS-IS SPF Timing and Statistic Data\n")
jardineb5d44e2003-12-23 08:09:43 +0000795{
796 isis->debugs &= ~DEBUG_SPF_STATS;
797 print_debug (vty, DEBUG_SPF_STATS, 0);
hassof390d2c2004-09-10 20:48:21 +0000798
jardineb5d44e2003-12-23 08:09:43 +0000799 return CMD_SUCCESS;
800}
801
802DEFUN (debug_isis_spftrigg,
803 debug_isis_spftrigg_cmd,
804 "debug isis spf-triggers",
805 DEBUG_STR
806 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000807 "IS-IS SPF triggering events\n")
jardineb5d44e2003-12-23 08:09:43 +0000808{
809 isis->debugs |= DEBUG_SPF_TRIGGERS;
810 print_debug (vty, DEBUG_SPF_TRIGGERS, 1);
811
812 return CMD_SUCCESS;
813}
814
815DEFUN (no_debug_isis_spftrigg,
816 no_debug_isis_spftrigg_cmd,
817 "no debug isis spf-triggers",
818 UNDEBUG_STR
819 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000820 "IS-IS SPF triggering events\n")
jardineb5d44e2003-12-23 08:09:43 +0000821{
822 isis->debugs &= ~DEBUG_SPF_TRIGGERS;
823 print_debug (vty, DEBUG_SPF_TRIGGERS, 0);
hassof390d2c2004-09-10 20:48:21 +0000824
jardineb5d44e2003-12-23 08:09:43 +0000825 return CMD_SUCCESS;
826}
827
828DEFUN (debug_isis_rtevents,
829 debug_isis_rtevents_cmd,
830 "debug isis route-events",
831 DEBUG_STR
832 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000833 "IS-IS Route related events\n")
jardineb5d44e2003-12-23 08:09:43 +0000834{
835 isis->debugs |= DEBUG_RTE_EVENTS;
836 print_debug (vty, DEBUG_RTE_EVENTS, 1);
837
838 return CMD_SUCCESS;
839}
840
841DEFUN (no_debug_isis_rtevents,
842 no_debug_isis_rtevents_cmd,
843 "no debug isis route-events",
844 UNDEBUG_STR
845 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000846 "IS-IS Route related events\n")
jardineb5d44e2003-12-23 08:09:43 +0000847{
848 isis->debugs &= ~DEBUG_RTE_EVENTS;
849 print_debug (vty, DEBUG_RTE_EVENTS, 0);
hassof390d2c2004-09-10 20:48:21 +0000850
jardineb5d44e2003-12-23 08:09:43 +0000851 return CMD_SUCCESS;
852}
853
854DEFUN (debug_isis_events,
855 debug_isis_events_cmd,
856 "debug isis events",
857 DEBUG_STR
858 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000859 "IS-IS Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000860{
861 isis->debugs |= DEBUG_EVENTS;
862 print_debug (vty, DEBUG_EVENTS, 1);
863
864 return CMD_SUCCESS;
865}
866
867DEFUN (no_debug_isis_events,
868 no_debug_isis_events_cmd,
869 "no debug isis events",
870 UNDEBUG_STR
871 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000872 "IS-IS Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000873{
874 isis->debugs &= ~DEBUG_EVENTS;
875 print_debug (vty, DEBUG_EVENTS, 0);
hassof390d2c2004-09-10 20:48:21 +0000876
jardineb5d44e2003-12-23 08:09:43 +0000877 return CMD_SUCCESS;
878}
879
jardineb5d44e2003-12-23 08:09:43 +0000880DEFUN (show_hostname,
881 show_hostname_cmd,
882 "show isis hostname",
883 SHOW_STR
884 "IS-IS information\n"
885 "IS-IS Dynamic hostname mapping\n")
886{
887 dynhn_print_all (vty);
hassof390d2c2004-09-10 20:48:21 +0000888
jardineb5d44e2003-12-23 08:09:43 +0000889 return CMD_SUCCESS;
890}
891
jardineb5d44e2003-12-23 08:09:43 +0000892DEFUN (show_database,
893 show_database_cmd,
894 "show isis database",
hassof390d2c2004-09-10 20:48:21 +0000895 SHOW_STR "IS-IS information\n" "IS-IS link state database\n")
jardineb5d44e2003-12-23 08:09:43 +0000896{
paul1eb8ef22005-04-07 07:30:20 +0000897 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000898 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000899 int level, lsp_count;
jardineb5d44e2003-12-23 08:09:43 +0000900
901 if (isis->area_list->count == 0)
902 return CMD_SUCCESS;
jardineb5d44e2003-12-23 08:09:43 +0000903
paul1eb8ef22005-04-07 07:30:20 +0000904 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
hassof390d2c2004-09-10 20:48:21 +0000905 {
hassof390d2c2004-09-10 20:48:21 +0000906 vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null",
907 VTY_NEWLINE);
908 for (level = 0; level < ISIS_LEVELS; level++)
909 {
910 if (area->lspdb[level] && dict_count (area->lspdb[level]) > 0)
911 {
912 vty_out (vty, "IS-IS Level-%d link-state database:%s",
913 level + 1, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000914
hassof390d2c2004-09-10 20:48:21 +0000915 lsp_count = lsp_print_all (vty, area->lspdb[level],
916 ISIS_UI_LEVEL_BRIEF,
917 area->dynhostname);
918
919 vty_out (vty, "%s %u LSPs%s%s",
920 VTY_NEWLINE, lsp_count, VTY_NEWLINE, VTY_NEWLINE);
921 }
922 }
jardineb5d44e2003-12-23 08:09:43 +0000923 }
jardineb5d44e2003-12-23 08:09:43 +0000924
925 return CMD_SUCCESS;
926}
927
jardineb5d44e2003-12-23 08:09:43 +0000928DEFUN (show_database_detail,
929 show_database_detail_cmd,
930 "show isis database detail",
931 SHOW_STR
932 "IS-IS information\n"
933 "IS-IS link state database\n")
934{
paul1eb8ef22005-04-07 07:30:20 +0000935 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000936 struct isis_area *area;
937 int level, lsp_count;
938
939 if (isis->area_list->count == 0)
940 return CMD_SUCCESS;
941
paul1eb8ef22005-04-07 07:30:20 +0000942 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
hassof390d2c2004-09-10 20:48:21 +0000943 {
hassof390d2c2004-09-10 20:48:21 +0000944 vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null",
945 VTY_NEWLINE);
946 for (level = 0; level < ISIS_LEVELS; level++)
947 {
948 if (area->lspdb[level] && dict_count (area->lspdb[level]) > 0)
949 {
950 vty_out (vty, "IS-IS Level-%d Link State Database:%s",
951 level + 1, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000952
hassof390d2c2004-09-10 20:48:21 +0000953 lsp_count = lsp_print_all (vty, area->lspdb[level],
954 ISIS_UI_LEVEL_DETAIL,
955 area->dynhostname);
jardineb5d44e2003-12-23 08:09:43 +0000956
hassof390d2c2004-09-10 20:48:21 +0000957 vty_out (vty, "%s %u LSPs%s%s",
958 VTY_NEWLINE, lsp_count, VTY_NEWLINE, VTY_NEWLINE);
959 }
960 }
jardineb5d44e2003-12-23 08:09:43 +0000961 }
jardineb5d44e2003-12-23 08:09:43 +0000962
963 return CMD_SUCCESS;
964}
965
966/*
967 * 'router isis' command
968 */
969DEFUN (router_isis,
970 router_isis_cmd,
971 "router isis WORD",
hassof390d2c2004-09-10 20:48:21 +0000972 ROUTER_STR
jardineb5d44e2003-12-23 08:09:43 +0000973 "ISO IS-IS\n"
974 "ISO Routing area tag")
975{
jardineb5d44e2003-12-23 08:09:43 +0000976 return isis_area_get (vty, argv[0]);
jardineb5d44e2003-12-23 08:09:43 +0000977}
978
979/*
980 *'no router isis' command
981 */
982DEFUN (no_router_isis,
983 no_router_isis_cmd,
984 "no router isis WORD",
hassof390d2c2004-09-10 20:48:21 +0000985 "no\n" ROUTER_STR "ISO IS-IS\n" "ISO Routing area tag")
jardineb5d44e2003-12-23 08:09:43 +0000986{
987 return isis_area_destroy (vty, argv[0]);
988}
989
990/*
991 * 'net' command
992 */
993DEFUN (net,
994 net_cmd,
995 "net WORD",
996 "A Network Entity Title for this process (OSI only)\n"
hassof390d2c2004-09-10 20:48:21 +0000997 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +0000998{
hassof7c43dc2004-09-26 16:24:14 +0000999 return area_net_title (vty, (u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +00001000}
1001
jardineb5d44e2003-12-23 08:09:43 +00001002/*
1003 * 'no net' command
1004 */
1005DEFUN (no_net,
1006 no_net_cmd,
1007 "no net WORD",
1008 NO_STR
1009 "A Network Entity Title for this process (OSI only)\n"
hassof390d2c2004-09-10 20:48:21 +00001010 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001011{
hassof7c43dc2004-09-26 16:24:14 +00001012 return area_clear_net_title (vty, (u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +00001013}
1014
1015DEFUN (area_passwd,
1016 area_passwd_cmd,
1017 "area-password WORD",
1018 "Configure the authentication password for an area\n"
hassof390d2c2004-09-10 20:48:21 +00001019 "Area password\n")
jardineb5d44e2003-12-23 08:09:43 +00001020{
1021 struct isis_area *area;
1022 int len;
1023
1024 area = vty->index;
1025
hassof390d2c2004-09-10 20:48:21 +00001026 if (!area)
1027 {
1028 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1029 return CMD_WARNING;
1030 }
1031
jardineb5d44e2003-12-23 08:09:43 +00001032 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001033 if (len > 254)
1034 {
1035 vty_out (vty, "Too long area password (>254)%s", VTY_NEWLINE);
1036 return CMD_WARNING;
1037 }
1038 area->area_passwd.len = (u_char) len;
jardineb5d44e2003-12-23 08:09:43 +00001039 area->area_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001040 strncpy ((char *)area->area_passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001041
hasso1cbc5622005-01-01 10:29:51 +00001042 if (argc > 1)
1043 {
1044 SET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND);
1045 if (strncmp(argv[1], "v", 1) == 0)
1046 SET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1047 else
1048 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1049 }
1050 else
1051 {
1052 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND);
1053 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1054 }
1055
jardineb5d44e2003-12-23 08:09:43 +00001056 return CMD_SUCCESS;
1057}
1058
hasso1cbc5622005-01-01 10:29:51 +00001059ALIAS (area_passwd,
1060 area_passwd_snpauth_cmd,
1061 "area-password WORD authenticate snp (send-only|validate)",
1062 "Configure the authentication password for an area\n"
1063 "Area password\n"
1064 "Authentication\n"
1065 "SNP PDUs\n"
1066 "Send but do not check PDUs on receiving\n"
1067 "Send and check PDUs on receiving\n");
1068
jardineb5d44e2003-12-23 08:09:43 +00001069DEFUN (no_area_passwd,
1070 no_area_passwd_cmd,
1071 "no area-password",
1072 NO_STR
1073 "Configure the authentication password for an area\n")
1074{
1075 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001076
jardineb5d44e2003-12-23 08:09:43 +00001077 area = vty->index;
1078
hassof390d2c2004-09-10 20:48:21 +00001079 if (!area)
1080 {
1081 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1082 return CMD_WARNING;
1083 }
1084
jardineb5d44e2003-12-23 08:09:43 +00001085 memset (&area->area_passwd, 0, sizeof (struct isis_passwd));
1086
1087 return CMD_SUCCESS;
1088}
1089
jardineb5d44e2003-12-23 08:09:43 +00001090DEFUN (domain_passwd,
1091 domain_passwd_cmd,
1092 "domain-password WORD",
1093 "Set the authentication password for a routing domain\n"
hassof390d2c2004-09-10 20:48:21 +00001094 "Routing domain password\n")
jardineb5d44e2003-12-23 08:09:43 +00001095{
1096 struct isis_area *area;
1097 int len;
1098
1099 area = vty->index;
1100
hassof390d2c2004-09-10 20:48:21 +00001101 if (!area)
1102 {
1103 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1104 return CMD_WARNING;
1105 }
1106
jardineb5d44e2003-12-23 08:09:43 +00001107 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001108 if (len > 254)
1109 {
1110 vty_out (vty, "Too long area password (>254)%s", VTY_NEWLINE);
1111 return CMD_WARNING;
1112 }
1113 area->domain_passwd.len = (u_char) len;
jardineb5d44e2003-12-23 08:09:43 +00001114 area->domain_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001115 strncpy ((char *)area->domain_passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001116
hasso1cbc5622005-01-01 10:29:51 +00001117 if (argc > 1)
1118 {
1119 SET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND);
1120 if (strncmp(argv[1], "v", 1) == 0)
1121 SET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1122 else
1123 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1124 }
1125 else
1126 {
1127 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND);
1128 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1129 }
1130
jardineb5d44e2003-12-23 08:09:43 +00001131 return CMD_SUCCESS;
1132}
1133
hasso1cbc5622005-01-01 10:29:51 +00001134ALIAS (domain_passwd,
1135 domain_passwd_snpauth_cmd,
1136 "domain-password WORD authenticate snp (send-only|validate)",
1137 "Set the authentication password for a routing domain\n"
1138 "Routing domain password\n"
1139 "Authentication\n"
1140 "SNP PDUs\n"
1141 "Send but do not check PDUs on receiving\n"
1142 "Send and check PDUs on receiving\n");
1143
jardineb5d44e2003-12-23 08:09:43 +00001144DEFUN (no_domain_passwd,
1145 no_domain_passwd_cmd,
1146 "no domain-password WORD",
1147 NO_STR
1148 "Set the authentication password for a routing domain\n")
1149{
1150 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001151
jardineb5d44e2003-12-23 08:09:43 +00001152 area = vty->index;
1153
hassof390d2c2004-09-10 20:48:21 +00001154 if (!area)
1155 {
1156 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1157 return CMD_WARNING;
1158 }
1159
jardineb5d44e2003-12-23 08:09:43 +00001160 memset (&area->domain_passwd, 0, sizeof (struct isis_passwd));
hassof390d2c2004-09-10 20:48:21 +00001161
jardineb5d44e2003-12-23 08:09:43 +00001162 return CMD_SUCCESS;
1163}
1164
1165DEFUN (is_type,
1166 is_type_cmd,
1167 "is-type (level-1|level-1-2|level-2-only)",
1168 "IS Level for this routing process (OSI only)\n"
1169 "Act as a station router only\n"
1170 "Act as both a station router and an area router\n"
1171 "Act as an area router only\n")
1172{
1173 struct isis_area *area;
1174 int type;
1175
1176 area = vty->index;
1177
hassof390d2c2004-09-10 20:48:21 +00001178 if (!area)
1179 {
1180 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1181 return CMD_WARNING;
1182 }
jardineb5d44e2003-12-23 08:09:43 +00001183
hassof7c43dc2004-09-26 16:24:14 +00001184 type = string2circuit_t ((u_char *)argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001185 if (!type)
1186 {
1187 vty_out (vty, "Unknown IS level %s", VTY_NEWLINE);
1188 return CMD_SUCCESS;
1189 }
jardineb5d44e2003-12-23 08:09:43 +00001190
1191 isis_event_system_type_change (area, type);
hassof390d2c2004-09-10 20:48:21 +00001192
jardineb5d44e2003-12-23 08:09:43 +00001193 return CMD_SUCCESS;
1194}
1195
1196DEFUN (no_is_type,
1197 no_is_type_cmd,
1198 "no is-type (level-1|level-1-2|level-2-only)",
1199 NO_STR
1200 "IS Level for this routing process (OSI only)\n"
1201 "Act as a station router only\n"
1202 "Act as both a station router and an area router\n"
1203 "Act as an area router only\n")
1204{
jardineb5d44e2003-12-23 08:09:43 +00001205 struct isis_area *area;
1206 int type;
1207
1208 area = vty->index;
1209 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001210
jardineb5d44e2003-12-23 08:09:43 +00001211 /*
1212 * Put the is-type back to default. Which is level-1-2 on first
1213 * circuit for the area level-1 for the rest
1214 */
paul1eb8ef22005-04-07 07:30:20 +00001215 if (listgetdata (listhead (isis->area_list)) == area)
jardineb5d44e2003-12-23 08:09:43 +00001216 type = IS_LEVEL_1_AND_2;
1217 else
1218 type = IS_LEVEL_1;
1219
1220 isis_event_system_type_change (area, type);
1221
1222 return CMD_SUCCESS;
1223}
1224
1225DEFUN (lsp_gen_interval,
1226 lsp_gen_interval_cmd,
1227 "lsp-gen-interval <1-120>",
1228 "Minimum interval between regenerating same LSP\n"
1229 "Minimum interval in seconds\n")
1230{
1231 struct isis_area *area;
1232 uint16_t interval;
1233
1234 area = vty->index;
1235 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001236
jardineb5d44e2003-12-23 08:09:43 +00001237 interval = atoi (argv[0]);
1238 area->lsp_gen_interval[0] = interval;
1239 area->lsp_gen_interval[1] = interval;
1240
1241 return CMD_SUCCESS;
1242}
1243
1244DEFUN (no_lsp_gen_interval,
1245 no_lsp_gen_interval_cmd,
1246 "no lsp-gen-interval",
1247 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001248 "Minimum interval between regenerating same LSP\n")
jardineb5d44e2003-12-23 08:09:43 +00001249{
1250 struct isis_area *area;
1251
1252 area = vty->index;
1253 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001254
jardineb5d44e2003-12-23 08:09:43 +00001255 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
1256 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
1257
1258 return CMD_SUCCESS;
1259}
1260
1261ALIAS (no_lsp_gen_interval,
1262 no_lsp_gen_interval_arg_cmd,
1263 "no lsp-gen-interval <1-120>",
1264 NO_STR
1265 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001266 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001267
1268DEFUN (lsp_gen_interval_l1,
1269 lsp_gen_interval_l1_cmd,
1270 "lsp-gen-interval level-1 <1-120>",
1271 "Minimum interval between regenerating same LSP\n"
1272 "Set interval for level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001273 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001274{
1275 struct isis_area *area;
1276 uint16_t interval;
1277
1278 area = vty->index;
1279 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001280
jardineb5d44e2003-12-23 08:09:43 +00001281 interval = atoi (argv[0]);
1282 area->lsp_gen_interval[0] = interval;
1283
1284 return CMD_SUCCESS;
1285}
1286
1287DEFUN (no_lsp_gen_interval_l1,
1288 no_lsp_gen_interval_l1_cmd,
1289 "no lsp-gen-interval level-1",
1290 NO_STR
1291 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001292 "Set interval for level 1 only\n")
jardineb5d44e2003-12-23 08:09:43 +00001293{
1294 struct isis_area *area;
1295
1296 area = vty->index;
1297 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001298
jardineb5d44e2003-12-23 08:09:43 +00001299 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
1300
1301 return CMD_SUCCESS;
1302}
1303
1304ALIAS (no_lsp_gen_interval_l1,
1305 no_lsp_gen_interval_l1_arg_cmd,
1306 "no lsp-gen-interval level-1 <1-120>",
1307 NO_STR
1308 "Minimum interval between regenerating same LSP\n"
1309 "Set interval for level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001310 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001311
1312DEFUN (lsp_gen_interval_l2,
1313 lsp_gen_interval_l2_cmd,
1314 "lsp-gen-interval level-2 <1-120>",
1315 "Minimum interval between regenerating same LSP\n"
1316 "Set interval for level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001317 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001318{
1319 struct isis_area *area;
1320 int interval;
1321
1322 area = vty->index;
1323 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001324
jardineb5d44e2003-12-23 08:09:43 +00001325 interval = atoi (argv[0]);
1326 area->lsp_gen_interval[1] = interval;
1327
1328 return CMD_SUCCESS;
1329}
1330
1331DEFUN (no_lsp_gen_interval_l2,
1332 no_lsp_gen_interval_l2_cmd,
1333 "no lsp-gen-interval level-2",
1334 NO_STR
1335 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001336 "Set interval for level 2 only\n")
jardineb5d44e2003-12-23 08:09:43 +00001337{
1338 struct isis_area *area;
1339 int interval;
1340
1341 area = vty->index;
1342 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001343
jardineb5d44e2003-12-23 08:09:43 +00001344 interval = atoi (argv[0]);
1345 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
1346
1347 return CMD_SUCCESS;
1348}
1349
1350ALIAS (no_lsp_gen_interval_l2,
1351 no_lsp_gen_interval_l2_arg_cmd,
1352 "no lsp-gen-interval level-2 <1-120>",
1353 NO_STR
1354 "Minimum interval between regenerating same LSP\n"
1355 "Set interval for level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001356 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001357
1358DEFUN (metric_style,
1359 metric_style_cmd,
1360 "metric-style (narrow|wide)",
1361 "Use old-style (ISO 10589) or new-style packet formats\n"
1362 "Use old style of TLVs with narrow metric\n"
1363 "Use new style of TLVs to carry wider metric\n")
1364{
1365 struct isis_area *area;
1366
1367 area = vty->index;
1368 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001369 if (!strcmp (argv[0], "wide"))
jardineb5d44e2003-12-23 08:09:43 +00001370 area->newmetric = 1;
1371 else
1372 area->newmetric = 0;
1373
1374 return CMD_SUCCESS;
1375}
1376
1377DEFUN (no_metric_style,
1378 no_metric_style_cmd,
1379 "no metric-style (narrow|wide)",
1380 NO_STR
1381 "Use old-style (ISO 10589) or new-style packet formats\n"
1382 "Use old style of TLVs with narrow metric\n"
1383 "Use new style of TLVs to carry wider metric\n")
1384{
1385 struct isis_area *area;
1386
1387 area = vty->index;
1388 assert (area);
1389
hassof390d2c2004-09-10 20:48:21 +00001390 if (!strcmp (argv[0], "wide"))
jardineb5d44e2003-12-23 08:09:43 +00001391 area->newmetric = 0;
1392 else
1393 area->newmetric = 1;
1394
1395 return CMD_SUCCESS;
1396}
1397
1398DEFUN (dynamic_hostname,
1399 dynamic_hostname_cmd,
1400 "hostname dynamic",
1401 "Dynamic hostname for IS-IS\n"
hassof390d2c2004-09-10 20:48:21 +00001402 "Dynamic hostname\n")
jardineb5d44e2003-12-23 08:09:43 +00001403{
1404 struct isis_area *area;
1405
1406 area = vty->index;
1407 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001408
jardineb5d44e2003-12-23 08:09:43 +00001409 area->dynhostname = 1;
hassof390d2c2004-09-10 20:48:21 +00001410
jardineb5d44e2003-12-23 08:09:43 +00001411 return CMD_SUCCESS;
1412}
1413
1414DEFUN (no_dynamic_hostname,
1415 no_dynamic_hostname_cmd,
1416 "no hostname dynamic",
1417 NO_STR
1418 "Dynamic hostname for IS-IS\n"
hassof390d2c2004-09-10 20:48:21 +00001419 "Dynamic hostname\n")
jardineb5d44e2003-12-23 08:09:43 +00001420{
1421 struct isis_area *area;
1422
1423 area = vty->index;
1424 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001425
jardineb5d44e2003-12-23 08:09:43 +00001426 area->dynhostname = 0;
hassof390d2c2004-09-10 20:48:21 +00001427
jardineb5d44e2003-12-23 08:09:43 +00001428 return CMD_SUCCESS;
1429}
1430
1431DEFUN (spf_interval,
1432 spf_interval_cmd,
1433 "spf-interval <1-120>",
hasso2097cd82003-12-23 11:51:08 +00001434 "Minimum interval between SPF calculations\n"
jardineb5d44e2003-12-23 08:09:43 +00001435 "Minimum interval between consecutive SPFs in seconds\n")
1436{
1437 struct isis_area *area;
1438 u_int16_t interval;
hassof390d2c2004-09-10 20:48:21 +00001439
jardineb5d44e2003-12-23 08:09:43 +00001440 area = vty->index;
1441 interval = atoi (argv[0]);
1442 area->min_spf_interval[0] = interval;
1443 area->min_spf_interval[1] = interval;
hassof390d2c2004-09-10 20:48:21 +00001444
jardineb5d44e2003-12-23 08:09:43 +00001445 return CMD_SUCCESS;
1446}
1447
1448DEFUN (no_spf_interval,
1449 no_spf_interval_cmd,
1450 "no spf-interval",
1451 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001452 "Minimum interval between SPF calculations\n")
jardineb5d44e2003-12-23 08:09:43 +00001453{
1454 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001455
jardineb5d44e2003-12-23 08:09:43 +00001456 area = vty->index;
1457
1458 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
1459 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001460
jardineb5d44e2003-12-23 08:09:43 +00001461 return CMD_SUCCESS;
1462}
1463
1464ALIAS (no_spf_interval,
1465 no_spf_interval_arg_cmd,
1466 "no spf-interval <1-120>",
1467 NO_STR
1468 "Minimum interval between SPF calculations\n"
hassof390d2c2004-09-10 20:48:21 +00001469 "Minimum interval between consecutive SPFs in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001470
1471DEFUN (spf_interval_l1,
1472 spf_interval_l1_cmd,
1473 "spf-interval level-1 <1-120>",
1474 "Minimum interval between SPF calculations\n"
1475 "Set interval for level 1 only\n"
1476 "Minimum interval between consecutive SPFs in seconds\n")
1477{
1478 struct isis_area *area;
1479 u_int16_t interval;
hassof390d2c2004-09-10 20:48:21 +00001480
jardineb5d44e2003-12-23 08:09:43 +00001481 area = vty->index;
1482 interval = atoi (argv[0]);
1483 area->min_spf_interval[0] = interval;
hassof390d2c2004-09-10 20:48:21 +00001484
jardineb5d44e2003-12-23 08:09:43 +00001485 return CMD_SUCCESS;
1486}
1487
1488DEFUN (no_spf_interval_l1,
1489 no_spf_interval_l1_cmd,
1490 "no spf-interval level-1",
1491 NO_STR
1492 "Minimum interval between SPF calculations\n"
1493 "Set interval for level 1 only\n")
1494{
1495 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001496
jardineb5d44e2003-12-23 08:09:43 +00001497 area = vty->index;
1498
1499 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001500
jardineb5d44e2003-12-23 08:09:43 +00001501 return CMD_SUCCESS;
1502}
1503
1504ALIAS (no_spf_interval,
1505 no_spf_interval_l1_arg_cmd,
1506 "no spf-interval level-1 <1-120>",
1507 NO_STR
1508 "Minimum interval between SPF calculations\n"
1509 "Set interval for level 1 only\n"
1510 "Minimum interval between consecutive SPFs in seconds\n")
1511
1512DEFUN (spf_interval_l2,
1513 spf_interval_l2_cmd,
1514 "spf-interval level-2 <1-120>",
1515 "Minimum interval between SPF calculations\n"
1516 "Set interval for level 2 only\n"
1517 "Minimum interval between consecutive SPFs in seconds\n")
1518{
1519 struct isis_area *area;
1520 u_int16_t interval;
hassof390d2c2004-09-10 20:48:21 +00001521
jardineb5d44e2003-12-23 08:09:43 +00001522 area = vty->index;
1523 interval = atoi (argv[0]);
1524 area->min_spf_interval[1] = interval;
hassof390d2c2004-09-10 20:48:21 +00001525
jardineb5d44e2003-12-23 08:09:43 +00001526 return CMD_SUCCESS;
1527}
1528
1529DEFUN (no_spf_interval_l2,
1530 no_spf_interval_l2_cmd,
1531 "no spf-interval level-2",
1532 NO_STR
1533 "Minimum interval between SPF calculations\n"
1534 "Set interval for level 2 only\n")
1535{
1536 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001537
jardineb5d44e2003-12-23 08:09:43 +00001538 area = vty->index;
1539
1540 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001541
jardineb5d44e2003-12-23 08:09:43 +00001542 return CMD_SUCCESS;
1543}
1544
1545ALIAS (no_spf_interval,
1546 no_spf_interval_l2_arg_cmd,
1547 "no spf-interval level-2 <1-120>",
1548 NO_STR
1549 "Minimum interval between SPF calculations\n"
1550 "Set interval for level 2 only\n"
1551 "Minimum interval between consecutive SPFs in seconds\n")
1552
jardineb5d44e2003-12-23 08:09:43 +00001553#ifdef TOPOLOGY_GENERATE
1554DEFUN (topology_generate_grid,
1555 topology_generate_grid_cmd,
1556 "topology generate grid <1-100> <1-100> <1-65000> [param] [param] "
1557 "[param]",
1558 "Topology for IS-IS\n"
1559 "Topology for IS-IS\n"
1560 "Topology grid for IS-IS\n"
1561 "X parameter of the grid\n"
1562 "Y parameter of the grid\n"
1563 "Random seed\n"
1564 "Optional param 1\n"
1565 "Optional param 2\n"
1566 "Optional param 3\n"
1567 "Topology\n")
1568{
1569 struct isis_area *area;
1570
1571 area = vty->index;
1572 assert (area);
1573
hassof390d2c2004-09-10 20:48:21 +00001574 if (!spgrid_check_params (vty, argc, argv))
1575 {
1576 if (area->topology)
1577 list_delete (area->topology);
1578 area->topology = list_new ();
1579 memcpy (area->top_params, vty->buf, 200);
1580 gen_spgrid_topology (vty, area->topology);
1581 remove_topology_lsps (area);
1582 generate_topology_lsps (area);
1583 }
jardineb5d44e2003-12-23 08:09:43 +00001584
1585 return CMD_SUCCESS;
1586}
1587
hassof695b012005-04-02 19:03:39 +00001588DEFUN (show_isis_generated_topology,
1589 show_isis_generated_topology_cmd,
1590 "show isis generated-topology",
jardineb5d44e2003-12-23 08:09:43 +00001591 SHOW_STR
1592 "clns network information\n"
1593 "CLNS neighbor adjacencies\n")
1594{
1595 struct isis_area *area;
paul92c9f222005-05-25 12:21:13 +00001596 struct listnode *node;
jardineb5d44e2003-12-23 08:09:43 +00001597 struct listnode *node2;
1598 struct arc *arc;
paul92c9f222005-05-25 12:21:13 +00001599 for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
hassof390d2c2004-09-10 20:48:21 +00001600 {
1601 if (area->topology)
1602 {
1603 vty_out (vty, "Topology for isis area:%s%s", area->area_tag,
1604 VTY_NEWLINE);
paul92c9f222005-05-25 12:21:13 +00001605 for (ALL_LIST_ELEMENTS_RO (area->topology, node2, arc))
hassof390d2c2004-09-10 20:48:21 +00001606 {
1607 vty_out (vty, "a %ld %ld %ld%s", arc->from_node, arc->to_node,
1608 arc->distance, VTY_NEWLINE);
1609 }
jardineb5d44e2003-12-23 08:09:43 +00001610 }
jardineb5d44e2003-12-23 08:09:43 +00001611 }
1612 return CMD_SUCCESS;
1613}
1614
1615/*
1616 * 'topology base-is' command
1617 */
hassof390d2c2004-09-10 20:48:21 +00001618DEFUN (topology_baseis,
jardineb5d44e2003-12-23 08:09:43 +00001619 topology_baseis_cmd,
1620 "topology base-is WORD",
1621 "Topology for IS-IS\n"
1622 "Topology for IS-IS\n"
1623 "A Network IS Base for this topology"
hassof390d2c2004-09-10 20:48:21 +00001624 "XX.XXXX.XXXX.XX 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]))
1633 {
1634 sysid2buff (area->topology_baseis, argv[0]);
1635 }
1636
jardineb5d44e2003-12-23 08:09:43 +00001637 return CMD_SUCCESS;
1638}
1639
1640/*
1641 * 'no net' command
1642 */
1643DEFUN (no_topology_baseis,
1644 no_topology_baseis_cmd,
1645 "no topology base-is WORD",
1646 NO_STR
1647 "A Network Entity Title for this process (OSI only)"
hassof390d2c2004-09-10 20:48:21 +00001648 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001649{
1650 struct isis_area *area;
1651
1652 area = vty->index;
1653 assert (area);
1654
hassof390d2c2004-09-10 20:48:21 +00001655 memcpy (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS, ISIS_SYS_ID_LEN);
jardineb5d44e2003-12-23 08:09:43 +00001656 return CMD_SUCCESS;
1657}
1658
1659#endif /* TOPOLOGY_GENERATE */
1660
1661DEFUN (lsp_lifetime,
1662 lsp_lifetime_cmd,
1663 "lsp-lifetime <380-65535>",
1664 "Maximum LSP lifetime\n"
hassof390d2c2004-09-10 20:48:21 +00001665 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001666{
1667 struct isis_area *area;
1668 uint16_t interval;
1669
1670 area = vty->index;
1671 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001672
jardineb5d44e2003-12-23 08:09:43 +00001673 interval = atoi (argv[0]);
1674
hassof390d2c2004-09-10 20:48:21 +00001675 if (interval < ISIS_MIN_LSP_LIFETIME)
1676 {
1677 vty_out (vty, "LSP lifetime (%us) below %us%s",
1678 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001679
hassof390d2c2004-09-10 20:48:21 +00001680 return CMD_WARNING;
1681 }
jardineb5d44e2003-12-23 08:09:43 +00001682
1683
1684 area->max_lsp_lifetime[0] = interval;
1685 area->max_lsp_lifetime[1] = interval;
hassof390d2c2004-09-10 20:48:21 +00001686 area->lsp_refresh[0] = interval - 300;
1687 area->lsp_refresh[1] = interval - 300;
jardineb5d44e2003-12-23 08:09:43 +00001688
hassof390d2c2004-09-10 20:48:21 +00001689 if (area->t_lsp_refresh[0])
1690 {
1691 thread_cancel (area->t_lsp_refresh[0]);
1692 thread_execute (master, lsp_refresh_l1, area, 0);
1693 }
jardineb5d44e2003-12-23 08:09:43 +00001694
hassof390d2c2004-09-10 20:48:21 +00001695 if (area->t_lsp_refresh[1])
1696 {
1697 thread_cancel (area->t_lsp_refresh[1]);
1698 thread_execute (master, lsp_refresh_l2, area, 0);
1699 }
jardineb5d44e2003-12-23 08:09:43 +00001700
1701
1702 return CMD_SUCCESS;
1703}
1704
1705DEFUN (no_lsp_lifetime,
1706 no_lsp_lifetime_cmd,
1707 "no lsp-lifetime",
1708 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001709 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001710{
1711 struct isis_area *area;
1712
1713 area = vty->index;
1714 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001715
1716 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200s */
1717 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200s */
1718 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900s */
1719 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001720
1721 return CMD_SUCCESS;
1722}
1723
1724ALIAS (no_lsp_lifetime,
1725 no_lsp_lifetime_arg_cmd,
1726 "no lsp-lifetime <380-65535>",
1727 NO_STR
1728 "Maximum LSP lifetime\n"
hassof390d2c2004-09-10 20:48:21 +00001729 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001730
1731DEFUN (lsp_lifetime_l1,
1732 lsp_lifetime_l1_cmd,
1733 "lsp-lifetime level-1 <380-65535>",
1734 "Maximum LSP lifetime for Level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001735 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001736{
1737 struct isis_area *area;
1738 uint16_t interval;
1739
1740 area = vty->index;
1741 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001742
jardineb5d44e2003-12-23 08:09:43 +00001743 interval = atoi (argv[0]);
1744
hassof390d2c2004-09-10 20:48:21 +00001745 if (interval < ISIS_MIN_LSP_LIFETIME)
1746 {
1747 vty_out (vty, "Level-1 LSP lifetime (%us) below %us%s",
1748 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001749
hassof390d2c2004-09-10 20:48:21 +00001750 return CMD_WARNING;
1751 }
jardineb5d44e2003-12-23 08:09:43 +00001752
1753
1754 area->max_lsp_lifetime[0] = interval;
hassof390d2c2004-09-10 20:48:21 +00001755 area->lsp_refresh[0] = interval - 300;
jardineb5d44e2003-12-23 08:09:43 +00001756
1757 return CMD_SUCCESS;
1758}
1759
1760DEFUN (no_lsp_lifetime_l1,
1761 no_lsp_lifetime_l1_cmd,
1762 "no lsp-lifetime level-1",
1763 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001764 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001765{
1766 struct isis_area *area;
1767
1768 area = vty->index;
1769 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001770
1771 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200s */
1772 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001773
1774 return CMD_SUCCESS;
1775}
1776
1777ALIAS (no_lsp_lifetime_l1,
1778 no_lsp_lifetime_l1_arg_cmd,
1779 "no lsp-lifetime level-1 <380-65535>",
1780 NO_STR
1781 "Maximum LSP lifetime for Level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001782 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001783
1784DEFUN (lsp_lifetime_l2,
1785 lsp_lifetime_l2_cmd,
1786 "lsp-lifetime level-2 <380-65535>",
1787 "Maximum LSP lifetime for Level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001788 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001789{
1790 struct isis_area *area;
1791 uint16_t interval;
1792
1793 area = vty->index;
1794 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001795
jardineb5d44e2003-12-23 08:09:43 +00001796 interval = atoi (argv[0]);
1797
hassof390d2c2004-09-10 20:48:21 +00001798 if (interval < ISIS_MIN_LSP_LIFETIME)
1799 {
1800 vty_out (vty, "Level-2 LSP lifetime (%us) below %us%s",
1801 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001802
hassof390d2c2004-09-10 20:48:21 +00001803 return CMD_WARNING;
1804 }
jardineb5d44e2003-12-23 08:09:43 +00001805
1806 area->max_lsp_lifetime[1] = interval;
1807 area->lsp_refresh[1] = interval - 300;
1808
1809 return CMD_SUCCESS;
1810}
1811
1812DEFUN (no_lsp_lifetime_l2,
1813 no_lsp_lifetime_l2_cmd,
1814 "no lsp-lifetime level-2",
1815 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001816 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001817{
1818 struct isis_area *area;
1819
1820 area = vty->index;
1821 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001822
1823 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200s */
1824 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001825
1826 return CMD_SUCCESS;
1827}
1828
1829ALIAS (no_lsp_lifetime_l2,
1830 no_lsp_lifetime_l2_arg_cmd,
1831 "no lsp-lifetime level-2 <380-65535>",
1832 NO_STR
1833 "Maximum LSP lifetime for Level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001834 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001835
1836/* IS-IS configuration write function */
1837int
1838isis_config_write (struct vty *vty)
1839{
1840 int write = 0;
jardineb5d44e2003-12-23 08:09:43 +00001841
hassof390d2c2004-09-10 20:48:21 +00001842 if (isis != NULL)
1843 {
1844 struct isis_area *area;
paul1eb8ef22005-04-07 07:30:20 +00001845 struct listnode *node, *nnode;
1846 struct listnode *node2, *nnode2;
jardineb5d44e2003-12-23 08:09:43 +00001847
paul1eb8ef22005-04-07 07:30:20 +00001848 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
hassof390d2c2004-09-10 20:48:21 +00001849 {
1850 /* ISIS - Area name */
1851 vty_out (vty, "router isis %s%s", area->area_tag, VTY_NEWLINE);
1852 write++;
1853 /* ISIS - Net */
1854 if (listcount (area->area_addrs) > 0)
1855 {
1856 struct area_addr *area_addr;
paul1eb8ef22005-04-07 07:30:20 +00001857 for (ALL_LIST_ELEMENTS (area->area_addrs, node2, nnode2, area_addr))
hassof390d2c2004-09-10 20:48:21 +00001858 {
1859 vty_out (vty, " net %s%s",
1860 isonet_print (area_addr->area_addr,
1861 area_addr->addr_len + ISIS_SYS_ID_LEN +
1862 1), VTY_NEWLINE);
1863 write++;
1864 }
1865 }
1866 /* ISIS - Dynamic hostname - Defaults to true so only display if false */
1867 if (!area->dynhostname)
1868 {
1869 vty_out (vty, " no hostname dynamic%s", VTY_NEWLINE);
1870 write++;
1871 }
1872 /* ISIS - Metric-Style - when true displays wide */
1873 if (area->newmetric)
1874 {
1875 vty_out (vty, " metric-style wide%s", VTY_NEWLINE);
1876 write++;
1877 }
1878 /* ISIS - Area is-type (level-1-2 is default) */
1879 if (area->is_type == IS_LEVEL_1)
1880 {
1881 vty_out (vty, " is-type level-1%s", VTY_NEWLINE);
1882 write++;
1883 }
1884 else
1885 {
1886 if (area->is_type == IS_LEVEL_2)
1887 {
1888 vty_out (vty, " is-type level-2-only%s", VTY_NEWLINE);
1889 write++;
1890 }
1891 }
1892 /* ISIS - Lsp generation interval */
1893 if (area->lsp_gen_interval[0] == area->lsp_gen_interval[1])
1894 {
1895 if (area->lsp_gen_interval[0] != LSP_GEN_INTERVAL_DEFAULT)
1896 {
1897 vty_out (vty, " lsp-gen-interval %d%s",
1898 area->lsp_gen_interval[0], VTY_NEWLINE);
1899 write++;
1900 }
1901 }
1902 else
1903 {
1904 if (area->lsp_gen_interval[0] != LSP_GEN_INTERVAL_DEFAULT)
1905 {
1906 vty_out (vty, " lsp-gen-interval level-1 %d%s",
1907 area->lsp_gen_interval[0], VTY_NEWLINE);
1908 write++;
1909 }
1910 if (area->lsp_gen_interval[1] != LSP_GEN_INTERVAL_DEFAULT)
1911 {
1912 vty_out (vty, " lsp-gen-interval level-2 %d%s",
1913 area->lsp_gen_interval[1], VTY_NEWLINE);
1914 write++;
1915 }
1916 }
1917 /* ISIS - LSP lifetime */
1918 if (area->max_lsp_lifetime[0] == area->max_lsp_lifetime[1])
1919 {
1920 if (area->max_lsp_lifetime[0] != MAX_AGE)
1921 {
1922 vty_out (vty, " lsp-lifetime %u%s", area->max_lsp_lifetime[0],
1923 VTY_NEWLINE);
1924 write++;
1925 }
1926 }
1927 else
1928 {
1929 if (area->max_lsp_lifetime[0] != MAX_AGE)
1930 {
1931 vty_out (vty, " lsp-lifetime level-1 %u%s",
1932 area->max_lsp_lifetime[0], VTY_NEWLINE);
1933 write++;
1934 }
1935 if (area->max_lsp_lifetime[1] != MAX_AGE)
1936 {
1937 vty_out (vty, " lsp-lifetime level-2 %u%s",
1938 area->max_lsp_lifetime[1], VTY_NEWLINE);
1939 write++;
1940 }
1941 }
hasso53c997c2004-09-15 16:21:59 +00001942 /* Authentication passwords. */
1943 if (area->area_passwd.len > 0)
1944 {
hasso1cbc5622005-01-01 10:29:51 +00001945 vty_out(vty, " area-password %s", area->area_passwd.passwd);
1946 if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND))
1947 {
1948 vty_out(vty, " authenticate snp ");
1949 if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV))
1950 vty_out(vty, "validate");
1951 else
1952 vty_out(vty, "send-only");
1953 }
1954 vty_out(vty, "%s", VTY_NEWLINE);
hasso53c997c2004-09-15 16:21:59 +00001955 write++;
1956 }
1957 if (area->domain_passwd.len > 0)
1958 {
hasso1cbc5622005-01-01 10:29:51 +00001959 vty_out(vty, " domain-password %s", area->domain_passwd.passwd);
1960 if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND))
1961 {
1962 vty_out(vty, " authenticate snp ");
1963 if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV))
1964 vty_out(vty, "validate");
1965 else
1966 vty_out(vty, "send-only");
1967 }
1968 vty_out(vty, "%s", VTY_NEWLINE);
hasso53c997c2004-09-15 16:21:59 +00001969 write++;
1970 }
hassof390d2c2004-09-10 20:48:21 +00001971#ifdef TOPOLOGY_GENERATE
1972 /* seems we save the whole command line here */
1973 if (area->top_params)
1974 {
1975 vty_out (vty, " %s%s", area->top_params, VTY_NEWLINE);
1976 write++;
1977 }
jardineb5d44e2003-12-23 08:09:43 +00001978
hassof390d2c2004-09-10 20:48:21 +00001979 if (memcmp (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS,
1980 ISIS_SYS_ID_LEN))
1981 {
1982 vty_out (vty, " topology base_is %s%s",
1983 sysid_print (area->topology_baseis), VTY_NEWLINE);
1984 write++;
1985 }
1986
1987#endif /* TOPOLOGY_GENERATE */
1988 }
jardineb5d44e2003-12-23 08:09:43 +00001989 }
hassof390d2c2004-09-10 20:48:21 +00001990
jardineb5d44e2003-12-23 08:09:43 +00001991 return write;
1992}
1993
hassof390d2c2004-09-10 20:48:21 +00001994struct cmd_node isis_node = {
jardineb5d44e2003-12-23 08:09:43 +00001995 ISIS_NODE,
hasso2097cd82003-12-23 11:51:08 +00001996 "%s(config-router)# ",
jardineb5d44e2003-12-23 08:09:43 +00001997 1
1998};
1999
hassof390d2c2004-09-10 20:48:21 +00002000void
jardineb5d44e2003-12-23 08:09:43 +00002001isis_init ()
2002{
jardineb5d44e2003-12-23 08:09:43 +00002003 /* Install IS-IS top node */
2004 install_node (&isis_node, isis_config_write);
hassof390d2c2004-09-10 20:48:21 +00002005
jardineb5d44e2003-12-23 08:09:43 +00002006 install_element (VIEW_NODE, &show_clns_neighbors_cmd);
2007 install_element (VIEW_NODE, &show_isis_neighbors_cmd);
2008 install_element (VIEW_NODE, &show_clns_neighbors_detail_cmd);
2009 install_element (VIEW_NODE, &show_isis_neighbors_detail_cmd);
2010
2011 install_element (VIEW_NODE, &show_hostname_cmd);
2012 install_element (VIEW_NODE, &show_database_cmd);
2013 install_element (VIEW_NODE, &show_database_detail_cmd);
2014
2015 install_element (ENABLE_NODE, &show_clns_neighbors_cmd);
2016 install_element (ENABLE_NODE, &show_isis_neighbors_cmd);
2017 install_element (ENABLE_NODE, &show_clns_neighbors_detail_cmd);
2018 install_element (ENABLE_NODE, &show_isis_neighbors_detail_cmd);
2019
2020 install_element (ENABLE_NODE, &show_hostname_cmd);
2021 install_element (ENABLE_NODE, &show_database_cmd);
2022 install_element (ENABLE_NODE, &show_database_detail_cmd);
2023 install_element (ENABLE_NODE, &show_debugging_cmd);
2024
hassof390d2c2004-09-10 20:48:21 +00002025 install_node (&debug_node, config_write_debug);
jardin9e867fe2003-12-23 08:56:18 +00002026
jardineb5d44e2003-12-23 08:09:43 +00002027 install_element (ENABLE_NODE, &debug_isis_adj_cmd);
2028 install_element (ENABLE_NODE, &no_debug_isis_adj_cmd);
2029 install_element (ENABLE_NODE, &debug_isis_csum_cmd);
2030 install_element (ENABLE_NODE, &no_debug_isis_csum_cmd);
2031 install_element (ENABLE_NODE, &debug_isis_lupd_cmd);
2032 install_element (ENABLE_NODE, &no_debug_isis_lupd_cmd);
2033 install_element (ENABLE_NODE, &debug_isis_err_cmd);
2034 install_element (ENABLE_NODE, &no_debug_isis_err_cmd);
2035 install_element (ENABLE_NODE, &debug_isis_snp_cmd);
2036 install_element (ENABLE_NODE, &no_debug_isis_snp_cmd);
2037 install_element (ENABLE_NODE, &debug_isis_upd_cmd);
2038 install_element (ENABLE_NODE, &no_debug_isis_upd_cmd);
2039 install_element (ENABLE_NODE, &debug_isis_spfevents_cmd);
2040 install_element (ENABLE_NODE, &no_debug_isis_spfevents_cmd);
2041 install_element (ENABLE_NODE, &debug_isis_spfstats_cmd);
2042 install_element (ENABLE_NODE, &no_debug_isis_spfstats_cmd);
2043 install_element (ENABLE_NODE, &debug_isis_spftrigg_cmd);
2044 install_element (ENABLE_NODE, &no_debug_isis_spftrigg_cmd);
2045 install_element (ENABLE_NODE, &debug_isis_rtevents_cmd);
2046 install_element (ENABLE_NODE, &no_debug_isis_rtevents_cmd);
2047 install_element (ENABLE_NODE, &debug_isis_events_cmd);
2048 install_element (ENABLE_NODE, &no_debug_isis_events_cmd);
2049
jardin9e867fe2003-12-23 08:56:18 +00002050 install_element (CONFIG_NODE, &debug_isis_adj_cmd);
2051 install_element (CONFIG_NODE, &no_debug_isis_adj_cmd);
2052 install_element (CONFIG_NODE, &debug_isis_csum_cmd);
2053 install_element (CONFIG_NODE, &no_debug_isis_csum_cmd);
2054 install_element (CONFIG_NODE, &debug_isis_lupd_cmd);
2055 install_element (CONFIG_NODE, &no_debug_isis_lupd_cmd);
2056 install_element (CONFIG_NODE, &debug_isis_err_cmd);
2057 install_element (CONFIG_NODE, &no_debug_isis_err_cmd);
2058 install_element (CONFIG_NODE, &debug_isis_snp_cmd);
2059 install_element (CONFIG_NODE, &no_debug_isis_snp_cmd);
2060 install_element (CONFIG_NODE, &debug_isis_upd_cmd);
2061 install_element (CONFIG_NODE, &no_debug_isis_upd_cmd);
2062 install_element (CONFIG_NODE, &debug_isis_spfevents_cmd);
2063 install_element (CONFIG_NODE, &no_debug_isis_spfevents_cmd);
2064 install_element (CONFIG_NODE, &debug_isis_spfstats_cmd);
2065 install_element (CONFIG_NODE, &no_debug_isis_spfstats_cmd);
2066 install_element (CONFIG_NODE, &debug_isis_spftrigg_cmd);
2067 install_element (CONFIG_NODE, &no_debug_isis_spftrigg_cmd);
2068 install_element (CONFIG_NODE, &debug_isis_rtevents_cmd);
2069 install_element (CONFIG_NODE, &no_debug_isis_rtevents_cmd);
2070 install_element (CONFIG_NODE, &debug_isis_events_cmd);
2071 install_element (CONFIG_NODE, &no_debug_isis_events_cmd);
2072
jardineb5d44e2003-12-23 08:09:43 +00002073 install_element (CONFIG_NODE, &router_isis_cmd);
2074 install_element (CONFIG_NODE, &no_router_isis_cmd);
2075
2076 install_default (ISIS_NODE);
2077
2078 install_element (ISIS_NODE, &net_cmd);
2079 install_element (ISIS_NODE, &no_net_cmd);
2080
2081 install_element (ISIS_NODE, &is_type_cmd);
2082 install_element (ISIS_NODE, &no_is_type_cmd);
2083
2084 install_element (ISIS_NODE, &area_passwd_cmd);
hasso1cbc5622005-01-01 10:29:51 +00002085 install_element (ISIS_NODE, &area_passwd_snpauth_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002086 install_element (ISIS_NODE, &no_area_passwd_cmd);
2087
2088 install_element (ISIS_NODE, &domain_passwd_cmd);
hasso1cbc5622005-01-01 10:29:51 +00002089 install_element (ISIS_NODE, &domain_passwd_snpauth_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002090 install_element (ISIS_NODE, &no_domain_passwd_cmd);
2091
2092 install_element (ISIS_NODE, &lsp_gen_interval_cmd);
2093 install_element (ISIS_NODE, &no_lsp_gen_interval_cmd);
2094 install_element (ISIS_NODE, &no_lsp_gen_interval_arg_cmd);
2095 install_element (ISIS_NODE, &lsp_gen_interval_l1_cmd);
2096 install_element (ISIS_NODE, &no_lsp_gen_interval_l1_cmd);
2097 install_element (ISIS_NODE, &no_lsp_gen_interval_l1_arg_cmd);
2098 install_element (ISIS_NODE, &lsp_gen_interval_l2_cmd);
2099 install_element (ISIS_NODE, &no_lsp_gen_interval_l2_cmd);
2100 install_element (ISIS_NODE, &no_lsp_gen_interval_l2_arg_cmd);
2101
2102 install_element (ISIS_NODE, &spf_interval_cmd);
2103 install_element (ISIS_NODE, &no_spf_interval_cmd);
2104 install_element (ISIS_NODE, &no_spf_interval_arg_cmd);
2105 install_element (ISIS_NODE, &spf_interval_l1_cmd);
2106 install_element (ISIS_NODE, &no_spf_interval_l1_cmd);
2107 install_element (ISIS_NODE, &no_spf_interval_l1_arg_cmd);
2108 install_element (ISIS_NODE, &spf_interval_l2_cmd);
2109 install_element (ISIS_NODE, &no_spf_interval_l2_cmd);
2110 install_element (ISIS_NODE, &no_spf_interval_l2_arg_cmd);
hassof390d2c2004-09-10 20:48:21 +00002111
jardineb5d44e2003-12-23 08:09:43 +00002112 install_element (ISIS_NODE, &lsp_lifetime_cmd);
2113 install_element (ISIS_NODE, &no_lsp_lifetime_cmd);
2114 install_element (ISIS_NODE, &no_lsp_lifetime_arg_cmd);
2115 install_element (ISIS_NODE, &lsp_lifetime_l1_cmd);
2116 install_element (ISIS_NODE, &no_lsp_lifetime_l1_cmd);
2117 install_element (ISIS_NODE, &no_lsp_lifetime_l1_arg_cmd);
2118 install_element (ISIS_NODE, &lsp_lifetime_l2_cmd);
2119 install_element (ISIS_NODE, &no_lsp_lifetime_l2_cmd);
2120 install_element (ISIS_NODE, &no_lsp_lifetime_l2_arg_cmd);
2121
2122 install_element (ISIS_NODE, &dynamic_hostname_cmd);
2123 install_element (ISIS_NODE, &no_dynamic_hostname_cmd);
2124
2125 install_element (ISIS_NODE, &metric_style_cmd);
2126 install_element (ISIS_NODE, &no_metric_style_cmd);
2127#ifdef TOPOLOGY_GENERATE
2128 install_element (ISIS_NODE, &topology_generate_grid_cmd);
2129 install_element (ISIS_NODE, &topology_baseis_cmd);
2130 install_element (ISIS_NODE, &no_topology_baseis_cmd);
hassof695b012005-04-02 19:03:39 +00002131 install_element (VIEW_NODE, &show_isis_generated_topology_cmd);
2132 install_element (ENABLE_NODE, &show_isis_generated_topology_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002133#endif /* TOPOLOGY_GENERATE */
2134
hassof390d2c2004-09-10 20:48:21 +00002135 isis_new (0);
jardineb5d44e2003-12-23 08:09:43 +00002136 isis_circuit_init ();
2137 isis_zebra_init ();
2138 isis_spf_cmds_init ();
2139}