blob: e4d73c30b41f089eb7c2b7626e1a43e5d8d16cfc [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;
147 struct listnode *node;
hassof390d2c2004-09-10 20:48:21 +0000148
jardineb5d44e2003-12-23 08:09:43 +0000149 LIST_LOOP (isis->area_list, area, node)
150 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;
188 struct listnode *node;
189 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 {
201 node = listhead (area->circuit_list);
202 while (node)
203 {
204 circuit = getdata (node);
205 nextnode (node);
206 isis_circuit_del (circuit);
207 }
208 list_delete (area->circuit_list);
209 }
jardineb5d44e2003-12-23 08:09:43 +0000210 listnode_delete (isis->area_list, area);
hassof390d2c2004-09-10 20:48:21 +0000211 THREAD_TIMER_OFF (area->t_tick);
jardineb5d44e2003-12-23 08:09:43 +0000212 if (area->t_remove_aged)
213 thread_cancel (area->t_remove_aged);
hassof390d2c2004-09-10 20:48:21 +0000214 THREAD_TIMER_OFF (area->t_lsp_refresh[0]);
215 THREAD_TIMER_OFF (area->t_lsp_refresh[1]);
jardineb5d44e2003-12-23 08:09:43 +0000216
217 XFREE (MTYPE_ISIS_AREA, area);
hassof390d2c2004-09-10 20:48:21 +0000218
jardineb5d44e2003-12-23 08:09:43 +0000219 return CMD_SUCCESS;
220}
221
hassof390d2c2004-09-10 20:48:21 +0000222int
hassof7c43dc2004-09-26 16:24:14 +0000223area_net_title (struct vty *vty, u_char *net_title)
jardineb5d44e2003-12-23 08:09:43 +0000224{
jardineb5d44e2003-12-23 08:09:43 +0000225 struct isis_area *area;
226 struct area_addr *addr;
227 struct area_addr *addrp;
228 struct listnode *node;
229
230 u_char buff[255];
231 area = vty->index;
232
hassof390d2c2004-09-10 20:48:21 +0000233 if (!area)
234 {
235 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
236 return CMD_WARNING;
237 }
jardineb5d44e2003-12-23 08:09:43 +0000238
239 /* We check that we are not over the maximal number of addresses */
hassof390d2c2004-09-10 20:48:21 +0000240 if (listcount (area->area_addrs) >= isis->max_area_addrs)
241 {
242 vty_out (vty, "Maximum of area addresses (%d) already reached %s",
243 isis->max_area_addrs, VTY_NEWLINE);
244 return CMD_WARNING;
245 }
jardineb5d44e2003-12-23 08:09:43 +0000246
247 addr = XMALLOC (MTYPE_ISIS_AREA_ADDR, sizeof (struct area_addr));
248 addr->addr_len = dotformat2buff (buff, net_title);
249 memcpy (addr->area_addr, buff, addr->addr_len);
250#ifdef EXTREME_DEBUG
hasso529d65b2004-12-24 00:14:50 +0000251 zlog_debug ("added area address %s for area %s (address length %d)",
jardineb5d44e2003-12-23 08:09:43 +0000252 net_title, area->area_tag, addr->addr_len);
253#endif /* EXTREME_DEBUG */
hassof390d2c2004-09-10 20:48:21 +0000254 if (addr->addr_len < 8 || addr->addr_len > 20)
255 {
256 zlog_warn ("area address must be at least 8..20 octets long (%d)",
257 addr->addr_len);
jardineb5d44e2003-12-23 08:09:43 +0000258 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
259 return CMD_WARNING;
260 }
261
hassof390d2c2004-09-10 20:48:21 +0000262 if (isis->sysid_set == 0)
263 {
264 /*
265 * First area address - get the SystemID for this router
266 */
267 memcpy (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN), ISIS_SYS_ID_LEN);
268 isis->sysid_set = 1;
hasso529d65b2004-12-24 00:14:50 +0000269 zlog_debug ("Router has SystemID %s", sysid_print (isis->sysid));
jardineb5d44e2003-12-23 08:09:43 +0000270 }
hassof390d2c2004-09-10 20:48:21 +0000271 else
272 {
273 /*
274 * Check that the SystemID portions match
275 */
276 if (memcmp (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN),
277 ISIS_SYS_ID_LEN))
278 {
279 vty_out (vty,
280 "System ID must not change when defining additional area"
281 " addresses%s", VTY_NEWLINE);
282 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
283 return CMD_WARNING;
284 }
jardineb5d44e2003-12-23 08:09:43 +0000285
hassof390d2c2004-09-10 20:48:21 +0000286 /* now we see that we don't already have this address */
287 LIST_LOOP (area->area_addrs, addrp, node)
288 {
289 if ((addrp->addr_len + ISIS_SYS_ID_LEN + 1) == (addr->addr_len))
290 {
291 if (!memcmp (addrp->area_addr, addr->area_addr, addr->addr_len))
292 {
293 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
294 return CMD_SUCCESS; /* silent fail */
295 }
296 }
297 }
298
299 }
jardineb5d44e2003-12-23 08:09:43 +0000300 /*
301 * Forget the systemID part of the address
302 */
303 addr->addr_len -= (ISIS_SYS_ID_LEN + 1);
304 listnode_add (area->area_addrs, addr);
305
306 /* only now we can safely generate our LSPs for this area */
hassof390d2c2004-09-10 20:48:21 +0000307 if (listcount (area->area_addrs) > 0)
308 {
309 lsp_l1_generate (area);
310 lsp_l2_generate (area);
311 }
jardineb5d44e2003-12-23 08:09:43 +0000312
313 return CMD_SUCCESS;
314}
315
316int
hassof7c43dc2004-09-26 16:24:14 +0000317area_clear_net_title (struct vty *vty, u_char *net_title)
jardineb5d44e2003-12-23 08:09:43 +0000318{
319 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000320 struct area_addr addr, *addrp = NULL;
jardineb5d44e2003-12-23 08:09:43 +0000321 struct listnode *node;
322 u_char buff[255];
323
324 area = vty->index;
hassof390d2c2004-09-10 20:48:21 +0000325 if (!area)
326 {
327 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
328 return CMD_WARNING;
329 }
330
jardineb5d44e2003-12-23 08:09:43 +0000331 addr.addr_len = dotformat2buff (buff, net_title);
hassof390d2c2004-09-10 20:48:21 +0000332 if (addr.addr_len < 8 || addr.addr_len > 20)
333 {
334 vty_out (vty, "Unsupported area address length %d, should be 8...20 %s",
335 addr.addr_len, VTY_NEWLINE);
336 return CMD_WARNING;
337 }
338
339 memcpy (addr.area_addr, buff, (int) addr.addr_len);
340
jardineb5d44e2003-12-23 08:09:43 +0000341 LIST_LOOP (area->area_addrs, addrp, node)
342 if (addrp->addr_len == addr.addr_len &&
343 !memcmp (addrp->area_addr, addr.area_addr, addr.addr_len))
hassof390d2c2004-09-10 20:48:21 +0000344 break;
345
346 if (!addrp)
347 {
348 vty_out (vty, "No area address %s for area %s %s", net_title,
349 area->area_tag, VTY_NEWLINE);
350 return CMD_WARNING;
351 }
352
jardineb5d44e2003-12-23 08:09:43 +0000353 listnode_delete (area->area_addrs, addrp);
hassof390d2c2004-09-10 20:48:21 +0000354
jardineb5d44e2003-12-23 08:09:43 +0000355 return CMD_SUCCESS;
356}
357
jardineb5d44e2003-12-23 08:09:43 +0000358/*
359 * 'show clns neighbors' command
360 */
361
362int
hassof390d2c2004-09-10 20:48:21 +0000363show_clns_neigh (struct vty *vty, char detail)
jardineb5d44e2003-12-23 08:09:43 +0000364{
365 struct listnode *node_area, *node_circ;
366 struct isis_area *area;
367 struct isis_circuit *circuit;
368 struct list *db;
369 int i;
370
hassof390d2c2004-09-10 20:48:21 +0000371 if (!isis)
372 {
373 vty_out (vty, "IS-IS Routing Process not enabled%s", VTY_NEWLINE);
374 return CMD_SUCCESS;
375 }
jardineb5d44e2003-12-23 08:09:43 +0000376
377 for (node_area = listhead (isis->area_list); node_area;
hassof390d2c2004-09-10 20:48:21 +0000378 nextnode (node_area))
379 {
380 area = getdata (node_area);
381 vty_out (vty, "Area %s:%s", area->area_tag, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000382
hassof390d2c2004-09-10 20:48:21 +0000383 if (detail == ISIS_UI_LEVEL_BRIEF)
384 vty_out (vty, " System Id Interface L State "
385 "Holdtime SNPA%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000386
hassof390d2c2004-09-10 20:48:21 +0000387 for (node_circ = listhead (area->circuit_list); node_circ;
388 nextnode (node_circ))
389 {
390 circuit = getdata (node_circ);
391 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
392 {
393 for (i = 0; i < 2; i++)
394 {
395 db = circuit->u.bc.adjdb[i];
396 if (db && db->count)
397 {
398 if (detail == ISIS_UI_LEVEL_BRIEF)
399 isis_adjdb_iterate (db,
400 (void (*)
401 (struct isis_adjacency *,
402 void *)) isis_adj_print_vty,
403 vty);
404 if (detail == ISIS_UI_LEVEL_DETAIL)
405 isis_adjdb_iterate (db,
406 (void (*)
407 (struct isis_adjacency *,
408 void *))
409 isis_adj_print_vty_detail, vty);
410 if (detail == ISIS_UI_LEVEL_EXTENSIVE)
411 isis_adjdb_iterate (db,
412 (void (*)
413 (struct isis_adjacency *,
414 void *))
415 isis_adj_print_vty_extensive,
416 vty);
417 }
418 }
419 }
420 else if (circuit->circ_type == CIRCUIT_T_P2P &&
421 circuit->u.p2p.neighbor)
422 {
423 if (detail == ISIS_UI_LEVEL_BRIEF)
424 isis_adj_p2p_print_vty (circuit->u.p2p.neighbor, vty);
425 if (detail == ISIS_UI_LEVEL_DETAIL)
426 isis_adj_p2p_print_vty_detail (circuit->u.p2p.neighbor, vty);
427 if (detail == ISIS_UI_LEVEL_EXTENSIVE)
428 isis_adj_p2p_print_vty_extensive (circuit->u.p2p.neighbor,
429 vty);
430 }
431 }
jardineb5d44e2003-12-23 08:09:43 +0000432 }
hassof390d2c2004-09-10 20:48:21 +0000433
jardineb5d44e2003-12-23 08:09:43 +0000434 return CMD_SUCCESS;
435}
436
437DEFUN (show_clns_neighbors,
438 show_clns_neighbors_cmd,
439 "show clns neighbors",
440 SHOW_STR
441 "clns network information\n"
442 "CLNS neighbor adjacencies\n")
443{
hassof390d2c2004-09-10 20:48:21 +0000444 return show_clns_neigh (vty, ISIS_UI_LEVEL_BRIEF);
jardineb5d44e2003-12-23 08:09:43 +0000445}
446
447ALIAS (show_clns_neighbors,
448 show_isis_neighbors_cmd,
449 "show isis neighbors",
450 SHOW_STR
451 "IS-IS network information\n"
452 "IS-IS neighbor adjacencies\n")
453
454DEFUN (show_clns_neighbors_detail,
455 show_clns_neighbors_detail_cmd,
456 "show clns neighbors detail",
457 SHOW_STR
458 "clns network information\n"
459 "CLNS neighbor adjacencies\n"
460 "show detailed information\n")
461{
hassof390d2c2004-09-10 20:48:21 +0000462 return show_clns_neigh (vty, ISIS_UI_LEVEL_DETAIL);
jardineb5d44e2003-12-23 08:09:43 +0000463}
464
465ALIAS (show_clns_neighbors_detail,
466 show_isis_neighbors_detail_cmd,
467 "show isis neighbors detail",
468 SHOW_STR
469 "IS-IS network information\n"
470 "IS-IS neighbor adjacencies\n"
471 "show detailed information\n")
jardineb5d44e2003-12-23 08:09:43 +0000472/*
473 * 'isis debug', 'show debugging'
474 */
jardineb5d44e2003-12-23 08:09:43 +0000475void
476print_debug (struct vty *vty, int flags, int onoff)
477{
478 char onoffs[4];
479 if (onoff)
hassof390d2c2004-09-10 20:48:21 +0000480 strcpy (onoffs, "on");
jardineb5d44e2003-12-23 08:09:43 +0000481 else
hassof390d2c2004-09-10 20:48:21 +0000482 strcpy (onoffs, "off");
jardineb5d44e2003-12-23 08:09:43 +0000483
484 if (flags & DEBUG_ADJ_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000485 vty_out (vty, "IS-IS Adjacency related packets debugging is %s%s", onoffs,
486 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000487 if (flags & DEBUG_CHECKSUM_ERRORS)
hassof390d2c2004-09-10 20:48:21 +0000488 vty_out (vty, "IS-IS checksum errors debugging is %s%s", onoffs,
489 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000490 if (flags & DEBUG_LOCAL_UPDATES)
hassof390d2c2004-09-10 20:48:21 +0000491 vty_out (vty, "IS-IS local updates debugging is %s%s", onoffs,
492 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000493 if (flags & DEBUG_PROTOCOL_ERRORS)
hassof390d2c2004-09-10 20:48:21 +0000494 vty_out (vty, "IS-IS protocol errors debugging is %s%s", onoffs,
495 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000496 if (flags & DEBUG_SNP_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000497 vty_out (vty, "IS-IS CSNP/PSNP packets debugging is %s%s", onoffs,
498 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000499 if (flags & DEBUG_SPF_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000500 vty_out (vty, "IS-IS SPF events debugging is %s%s", onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000501 if (flags & DEBUG_SPF_STATS)
hassof390d2c2004-09-10 20:48:21 +0000502 vty_out (vty, "IS-IS SPF Timing and Statistics Data debugging is %s%s",
503 onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000504 if (flags & DEBUG_SPF_TRIGGERS)
hassof390d2c2004-09-10 20:48:21 +0000505 vty_out (vty, "IS-IS SPF triggering events debugging is %s%s", onoffs,
506 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000507 if (flags & DEBUG_UPDATE_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000508 vty_out (vty, "IS-IS Update related packet debugging is %s%s", onoffs,
509 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000510 if (flags & DEBUG_RTE_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000511 vty_out (vty, "IS-IS Route related debuggin is %s%s", onoffs,
512 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000513 if (flags & DEBUG_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000514 vty_out (vty, "IS-IS Event debugging is %s%s", onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000515
516}
517
518DEFUN (show_debugging,
519 show_debugging_cmd,
520 "show debugging",
521 SHOW_STR
522 "State of each debugging option\n")
523{
hassof390d2c2004-09-10 20:48:21 +0000524 vty_out (vty, "IS-IS:%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000525 print_debug (vty, isis->debugs, 1);
526 return CMD_SUCCESS;
527}
528
jardin9e867fe2003-12-23 08:56:18 +0000529/* Debug node. */
hassof390d2c2004-09-10 20:48:21 +0000530static struct cmd_node debug_node = {
jardin9e867fe2003-12-23 08:56:18 +0000531 DEBUG_NODE,
hassof390d2c2004-09-10 20:48:21 +0000532 "",
533 1
jardin9e867fe2003-12-23 08:56:18 +0000534};
535
536static int
537config_write_debug (struct vty *vty)
538{
539 int write = 0;
540 int flags = isis->debugs;
541
hassof390d2c2004-09-10 20:48:21 +0000542 if (flags & DEBUG_ADJ_PACKETS)
543 {
544 vty_out (vty, "debug isis adj-packets%s", VTY_NEWLINE);
545 write++;
546 }
547 if (flags & DEBUG_CHECKSUM_ERRORS)
548 {
549 vty_out (vty, "debug isis checksum-errors%s", VTY_NEWLINE);
550 write++;
551 }
552 if (flags & DEBUG_LOCAL_UPDATES)
553 {
554 vty_out (vty, "debug isis local-updates%s", VTY_NEWLINE);
555 write++;
556 }
557 if (flags & DEBUG_PROTOCOL_ERRORS)
558 {
559 vty_out (vty, "debug isis protocol-errors%s", VTY_NEWLINE);
560 write++;
561 }
562 if (flags & DEBUG_SNP_PACKETS)
563 {
564 vty_out (vty, "debug isis snp-packets%s", VTY_NEWLINE);
565 write++;
566 }
567 if (flags & DEBUG_SPF_EVENTS)
568 {
569 vty_out (vty, "debug isis spf-events%s", VTY_NEWLINE);
570 write++;
571 }
572 if (flags & DEBUG_SPF_STATS)
573 {
574 vty_out (vty, "debug isis spf-statistics%s", VTY_NEWLINE);
575 write++;
576 }
577 if (flags & DEBUG_SPF_TRIGGERS)
578 {
579 vty_out (vty, "debug isis spf-triggers%s", VTY_NEWLINE);
580 write++;
581 }
582 if (flags & DEBUG_UPDATE_PACKETS)
583 {
584 vty_out (vty, "debug isis update-packets%s", VTY_NEWLINE);
585 write++;
586 }
587 if (flags & DEBUG_RTE_EVENTS)
588 {
589 vty_out (vty, "debug isis route-events%s", VTY_NEWLINE);
590 write++;
591 }
592 if (flags & DEBUG_EVENTS)
593 {
594 vty_out (vty, "debug isis events%s", VTY_NEWLINE);
595 write++;
596 }
jardin9e867fe2003-12-23 08:56:18 +0000597
598 return write;
599}
600
jardineb5d44e2003-12-23 08:09:43 +0000601DEFUN (debug_isis_adj,
602 debug_isis_adj_cmd,
603 "debug isis adj-packets",
604 DEBUG_STR
605 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000606 "IS-IS Adjacency related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000607{
608 isis->debugs |= DEBUG_ADJ_PACKETS;
hassof390d2c2004-09-10 20:48:21 +0000609 print_debug (vty, DEBUG_ADJ_PACKETS, 1);
jardineb5d44e2003-12-23 08:09:43 +0000610
611 return CMD_SUCCESS;
612}
613
614DEFUN (no_debug_isis_adj,
615 no_debug_isis_adj_cmd,
616 "no debug isis adj-packets",
617 UNDEBUG_STR
618 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000619 "IS-IS Adjacency related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000620{
jardineb5d44e2003-12-23 08:09:43 +0000621 isis->debugs &= ~DEBUG_ADJ_PACKETS;
622 print_debug (vty, DEBUG_ADJ_PACKETS, 0);
623
624 return CMD_SUCCESS;
625}
626
jardineb5d44e2003-12-23 08:09:43 +0000627DEFUN (debug_isis_csum,
628 debug_isis_csum_cmd,
629 "debug isis checksum-errors",
630 DEBUG_STR
631 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000632 "IS-IS LSP checksum errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000633{
634 isis->debugs |= DEBUG_CHECKSUM_ERRORS;
635 print_debug (vty, DEBUG_CHECKSUM_ERRORS, 1);
636
637 return CMD_SUCCESS;
638}
639
640DEFUN (no_debug_isis_csum,
641 no_debug_isis_csum_cmd,
642 "no debug isis checksum-errors",
643 UNDEBUG_STR
644 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000645 "IS-IS LSP checksum errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000646{
647 isis->debugs &= ~DEBUG_CHECKSUM_ERRORS;
648 print_debug (vty, DEBUG_CHECKSUM_ERRORS, 0);
hassof390d2c2004-09-10 20:48:21 +0000649
jardineb5d44e2003-12-23 08:09:43 +0000650 return CMD_SUCCESS;
651}
652
653DEFUN (debug_isis_lupd,
654 debug_isis_lupd_cmd,
655 "debug isis local-updates",
656 DEBUG_STR
657 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000658 "IS-IS local update packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000659{
660 isis->debugs |= DEBUG_LOCAL_UPDATES;
661 print_debug (vty, DEBUG_LOCAL_UPDATES, 1);
662
663 return CMD_SUCCESS;
664}
665
666DEFUN (no_debug_isis_lupd,
667 no_debug_isis_lupd_cmd,
668 "no debug isis local-updates",
669 UNDEBUG_STR
670 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000671 "IS-IS local update packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000672{
673 isis->debugs &= ~DEBUG_LOCAL_UPDATES;
hassof390d2c2004-09-10 20:48:21 +0000674 print_debug (vty, DEBUG_LOCAL_UPDATES, 0);
675
jardineb5d44e2003-12-23 08:09:43 +0000676 return CMD_SUCCESS;
677}
678
679DEFUN (debug_isis_err,
680 debug_isis_err_cmd,
hassof390d2c2004-09-10 20:48:21 +0000681 "debug isis protocol-errors",
jardineb5d44e2003-12-23 08:09:43 +0000682 DEBUG_STR
683 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000684 "IS-IS LSP protocol errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000685{
686 isis->debugs |= DEBUG_PROTOCOL_ERRORS;
687 print_debug (vty, DEBUG_PROTOCOL_ERRORS, 1);
688
689 return CMD_SUCCESS;
690}
691
692DEFUN (no_debug_isis_err,
693 no_debug_isis_err_cmd,
694 "no debug isis protocol-errors",
695 UNDEBUG_STR
696 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000697 "IS-IS LSP protocol errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000698{
699 isis->debugs &= ~DEBUG_PROTOCOL_ERRORS;
700 print_debug (vty, DEBUG_PROTOCOL_ERRORS, 0);
hassof390d2c2004-09-10 20:48:21 +0000701
jardineb5d44e2003-12-23 08:09:43 +0000702 return CMD_SUCCESS;
703}
704
705DEFUN (debug_isis_snp,
706 debug_isis_snp_cmd,
707 "debug isis snp-packets",
708 DEBUG_STR
709 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000710 "IS-IS CSNP/PSNP packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000711{
712 isis->debugs |= DEBUG_SNP_PACKETS;
713 print_debug (vty, DEBUG_SNP_PACKETS, 1);
714
715 return CMD_SUCCESS;
716}
717
718DEFUN (no_debug_isis_snp,
719 no_debug_isis_snp_cmd,
720 "no debug isis snp-packets",
721 UNDEBUG_STR
722 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000723 "IS-IS CSNP/PSNP packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000724{
hassof390d2c2004-09-10 20:48:21 +0000725 isis->debugs &= ~DEBUG_SNP_PACKETS;
jardineb5d44e2003-12-23 08:09:43 +0000726 print_debug (vty, DEBUG_SNP_PACKETS, 0);
hassof390d2c2004-09-10 20:48:21 +0000727
jardineb5d44e2003-12-23 08:09:43 +0000728 return CMD_SUCCESS;
729}
730
jardineb5d44e2003-12-23 08:09:43 +0000731DEFUN (debug_isis_upd,
732 debug_isis_upd_cmd,
733 "debug isis update-packets",
734 DEBUG_STR
735 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000736 "IS-IS Update related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000737{
738 isis->debugs |= DEBUG_UPDATE_PACKETS;
739 print_debug (vty, DEBUG_UPDATE_PACKETS, 1);
740
741 return CMD_SUCCESS;
742}
743
744DEFUN (no_debug_isis_upd,
745 no_debug_isis_upd_cmd,
746 "no debug isis update-packets",
747 UNDEBUG_STR
748 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000749 "IS-IS Update related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000750{
751 isis->debugs &= ~DEBUG_UPDATE_PACKETS;
752 print_debug (vty, DEBUG_UPDATE_PACKETS, 0);
hassof390d2c2004-09-10 20:48:21 +0000753
jardineb5d44e2003-12-23 08:09:43 +0000754 return CMD_SUCCESS;
755}
756
jardineb5d44e2003-12-23 08:09:43 +0000757DEFUN (debug_isis_spfevents,
758 debug_isis_spfevents_cmd,
759 "debug isis spf-events",
760 DEBUG_STR
761 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000762 "IS-IS Shortest Path First Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000763{
764 isis->debugs |= DEBUG_SPF_EVENTS;
hassof390d2c2004-09-10 20:48:21 +0000765 print_debug (vty, DEBUG_SPF_EVENTS, 1);
jardineb5d44e2003-12-23 08:09:43 +0000766
767 return CMD_SUCCESS;
768}
769
770DEFUN (no_debug_isis_spfevents,
771 no_debug_isis_spfevents_cmd,
772 "no debug isis spf-events",
773 UNDEBUG_STR
774 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000775 "IS-IS Shortest Path First Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000776{
777 isis->debugs &= ~DEBUG_SPF_EVENTS;
hassof390d2c2004-09-10 20:48:21 +0000778 print_debug (vty, DEBUG_SPF_EVENTS, 0);
779
jardineb5d44e2003-12-23 08:09:43 +0000780 return CMD_SUCCESS;
781}
782
783
784DEFUN (debug_isis_spfstats,
785 debug_isis_spfstats_cmd,
786 "debug isis spf-statistics ",
787 DEBUG_STR
788 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000789 "IS-IS SPF Timing and Statistic Data\n")
jardineb5d44e2003-12-23 08:09:43 +0000790{
791 isis->debugs |= DEBUG_SPF_STATS;
792 print_debug (vty, DEBUG_SPF_STATS, 1);
793
794 return CMD_SUCCESS;
795}
796
797DEFUN (no_debug_isis_spfstats,
798 no_debug_isis_spfstats_cmd,
799 "no debug isis spf-statistics",
800 UNDEBUG_STR
801 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000802 "IS-IS SPF Timing and Statistic Data\n")
jardineb5d44e2003-12-23 08:09:43 +0000803{
804 isis->debugs &= ~DEBUG_SPF_STATS;
805 print_debug (vty, DEBUG_SPF_STATS, 0);
hassof390d2c2004-09-10 20:48:21 +0000806
jardineb5d44e2003-12-23 08:09:43 +0000807 return CMD_SUCCESS;
808}
809
810DEFUN (debug_isis_spftrigg,
811 debug_isis_spftrigg_cmd,
812 "debug isis spf-triggers",
813 DEBUG_STR
814 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000815 "IS-IS SPF triggering events\n")
jardineb5d44e2003-12-23 08:09:43 +0000816{
817 isis->debugs |= DEBUG_SPF_TRIGGERS;
818 print_debug (vty, DEBUG_SPF_TRIGGERS, 1);
819
820 return CMD_SUCCESS;
821}
822
823DEFUN (no_debug_isis_spftrigg,
824 no_debug_isis_spftrigg_cmd,
825 "no debug isis spf-triggers",
826 UNDEBUG_STR
827 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000828 "IS-IS SPF triggering events\n")
jardineb5d44e2003-12-23 08:09:43 +0000829{
830 isis->debugs &= ~DEBUG_SPF_TRIGGERS;
831 print_debug (vty, DEBUG_SPF_TRIGGERS, 0);
hassof390d2c2004-09-10 20:48:21 +0000832
jardineb5d44e2003-12-23 08:09:43 +0000833 return CMD_SUCCESS;
834}
835
836DEFUN (debug_isis_rtevents,
837 debug_isis_rtevents_cmd,
838 "debug isis route-events",
839 DEBUG_STR
840 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000841 "IS-IS Route related events\n")
jardineb5d44e2003-12-23 08:09:43 +0000842{
843 isis->debugs |= DEBUG_RTE_EVENTS;
844 print_debug (vty, DEBUG_RTE_EVENTS, 1);
845
846 return CMD_SUCCESS;
847}
848
849DEFUN (no_debug_isis_rtevents,
850 no_debug_isis_rtevents_cmd,
851 "no debug isis route-events",
852 UNDEBUG_STR
853 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000854 "IS-IS Route related events\n")
jardineb5d44e2003-12-23 08:09:43 +0000855{
856 isis->debugs &= ~DEBUG_RTE_EVENTS;
857 print_debug (vty, DEBUG_RTE_EVENTS, 0);
hassof390d2c2004-09-10 20:48:21 +0000858
jardineb5d44e2003-12-23 08:09:43 +0000859 return CMD_SUCCESS;
860}
861
862DEFUN (debug_isis_events,
863 debug_isis_events_cmd,
864 "debug isis events",
865 DEBUG_STR
866 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000867 "IS-IS Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000868{
869 isis->debugs |= DEBUG_EVENTS;
870 print_debug (vty, DEBUG_EVENTS, 1);
871
872 return CMD_SUCCESS;
873}
874
875DEFUN (no_debug_isis_events,
876 no_debug_isis_events_cmd,
877 "no debug isis events",
878 UNDEBUG_STR
879 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000880 "IS-IS Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000881{
882 isis->debugs &= ~DEBUG_EVENTS;
883 print_debug (vty, DEBUG_EVENTS, 0);
hassof390d2c2004-09-10 20:48:21 +0000884
jardineb5d44e2003-12-23 08:09:43 +0000885 return CMD_SUCCESS;
886}
887
jardineb5d44e2003-12-23 08:09:43 +0000888DEFUN (show_hostname,
889 show_hostname_cmd,
890 "show isis hostname",
891 SHOW_STR
892 "IS-IS information\n"
893 "IS-IS Dynamic hostname mapping\n")
894{
895 dynhn_print_all (vty);
hassof390d2c2004-09-10 20:48:21 +0000896
jardineb5d44e2003-12-23 08:09:43 +0000897 return CMD_SUCCESS;
898}
899
jardineb5d44e2003-12-23 08:09:43 +0000900DEFUN (show_database,
901 show_database_cmd,
902 "show isis database",
hassof390d2c2004-09-10 20:48:21 +0000903 SHOW_STR "IS-IS information\n" "IS-IS link state database\n")
jardineb5d44e2003-12-23 08:09:43 +0000904{
905 struct listnode *node;
906 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000907 int level, lsp_count;
jardineb5d44e2003-12-23 08:09:43 +0000908
909 if (isis->area_list->count == 0)
910 return CMD_SUCCESS;
jardineb5d44e2003-12-23 08:09:43 +0000911
hassof390d2c2004-09-10 20:48:21 +0000912 for (node = listhead (isis->area_list); node; nextnode (node))
913 {
914 area = getdata (node);
915 vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null",
916 VTY_NEWLINE);
917 for (level = 0; level < ISIS_LEVELS; level++)
918 {
919 if (area->lspdb[level] && dict_count (area->lspdb[level]) > 0)
920 {
921 vty_out (vty, "IS-IS Level-%d link-state database:%s",
922 level + 1, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000923
hassof390d2c2004-09-10 20:48:21 +0000924 lsp_count = lsp_print_all (vty, area->lspdb[level],
925 ISIS_UI_LEVEL_BRIEF,
926 area->dynhostname);
927
928 vty_out (vty, "%s %u LSPs%s%s",
929 VTY_NEWLINE, lsp_count, VTY_NEWLINE, VTY_NEWLINE);
930 }
931 }
jardineb5d44e2003-12-23 08:09:43 +0000932 }
jardineb5d44e2003-12-23 08:09:43 +0000933
934 return CMD_SUCCESS;
935}
936
jardineb5d44e2003-12-23 08:09:43 +0000937DEFUN (show_database_detail,
938 show_database_detail_cmd,
939 "show isis database detail",
940 SHOW_STR
941 "IS-IS information\n"
942 "IS-IS link state database\n")
943{
944 struct listnode *node;
945 struct isis_area *area;
946 int level, lsp_count;
947
948 if (isis->area_list->count == 0)
949 return CMD_SUCCESS;
950
hassof390d2c2004-09-10 20:48:21 +0000951 for (node = listhead (isis->area_list); node; nextnode (node))
952 {
953 area = getdata (node);
954 vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null",
955 VTY_NEWLINE);
956 for (level = 0; level < ISIS_LEVELS; level++)
957 {
958 if (area->lspdb[level] && dict_count (area->lspdb[level]) > 0)
959 {
960 vty_out (vty, "IS-IS Level-%d Link State Database:%s",
961 level + 1, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000962
hassof390d2c2004-09-10 20:48:21 +0000963 lsp_count = lsp_print_all (vty, area->lspdb[level],
964 ISIS_UI_LEVEL_DETAIL,
965 area->dynhostname);
jardineb5d44e2003-12-23 08:09:43 +0000966
hassof390d2c2004-09-10 20:48:21 +0000967 vty_out (vty, "%s %u LSPs%s%s",
968 VTY_NEWLINE, lsp_count, VTY_NEWLINE, VTY_NEWLINE);
969 }
970 }
jardineb5d44e2003-12-23 08:09:43 +0000971 }
jardineb5d44e2003-12-23 08:09:43 +0000972
973 return CMD_SUCCESS;
974}
975
976/*
977 * 'router isis' command
978 */
979DEFUN (router_isis,
980 router_isis_cmd,
981 "router isis WORD",
hassof390d2c2004-09-10 20:48:21 +0000982 ROUTER_STR
jardineb5d44e2003-12-23 08:09:43 +0000983 "ISO IS-IS\n"
984 "ISO Routing area tag")
985{
jardineb5d44e2003-12-23 08:09:43 +0000986 return isis_area_get (vty, argv[0]);
jardineb5d44e2003-12-23 08:09:43 +0000987}
988
989/*
990 *'no router isis' command
991 */
992DEFUN (no_router_isis,
993 no_router_isis_cmd,
994 "no router isis WORD",
hassof390d2c2004-09-10 20:48:21 +0000995 "no\n" ROUTER_STR "ISO IS-IS\n" "ISO Routing area tag")
jardineb5d44e2003-12-23 08:09:43 +0000996{
997 return isis_area_destroy (vty, argv[0]);
998}
999
1000/*
1001 * 'net' command
1002 */
1003DEFUN (net,
1004 net_cmd,
1005 "net WORD",
1006 "A Network Entity Title for this process (OSI only)\n"
hassof390d2c2004-09-10 20:48:21 +00001007 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001008{
hassof7c43dc2004-09-26 16:24:14 +00001009 return area_net_title (vty, (u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +00001010}
1011
jardineb5d44e2003-12-23 08:09:43 +00001012/*
1013 * 'no net' command
1014 */
1015DEFUN (no_net,
1016 no_net_cmd,
1017 "no net WORD",
1018 NO_STR
1019 "A Network Entity Title for this process (OSI only)\n"
hassof390d2c2004-09-10 20:48:21 +00001020 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001021{
hassof7c43dc2004-09-26 16:24:14 +00001022 return area_clear_net_title (vty, (u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +00001023}
1024
1025DEFUN (area_passwd,
1026 area_passwd_cmd,
1027 "area-password WORD",
1028 "Configure the authentication password for an area\n"
hassof390d2c2004-09-10 20:48:21 +00001029 "Area password\n")
jardineb5d44e2003-12-23 08:09:43 +00001030{
1031 struct isis_area *area;
1032 int len;
1033
1034 area = vty->index;
1035
hassof390d2c2004-09-10 20:48:21 +00001036 if (!area)
1037 {
1038 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1039 return CMD_WARNING;
1040 }
1041
jardineb5d44e2003-12-23 08:09:43 +00001042 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001043 if (len > 254)
1044 {
1045 vty_out (vty, "Too long area password (>254)%s", VTY_NEWLINE);
1046 return CMD_WARNING;
1047 }
1048 area->area_passwd.len = (u_char) len;
jardineb5d44e2003-12-23 08:09:43 +00001049 area->area_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001050 strncpy ((char *)area->area_passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001051
hasso1cbc5622005-01-01 10:29:51 +00001052 if (argc > 1)
1053 {
1054 SET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND);
1055 if (strncmp(argv[1], "v", 1) == 0)
1056 SET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1057 else
1058 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1059 }
1060 else
1061 {
1062 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND);
1063 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1064 }
1065
jardineb5d44e2003-12-23 08:09:43 +00001066 return CMD_SUCCESS;
1067}
1068
hasso1cbc5622005-01-01 10:29:51 +00001069ALIAS (area_passwd,
1070 area_passwd_snpauth_cmd,
1071 "area-password WORD authenticate snp (send-only|validate)",
1072 "Configure the authentication password for an area\n"
1073 "Area password\n"
1074 "Authentication\n"
1075 "SNP PDUs\n"
1076 "Send but do not check PDUs on receiving\n"
1077 "Send and check PDUs on receiving\n");
1078
jardineb5d44e2003-12-23 08:09:43 +00001079DEFUN (no_area_passwd,
1080 no_area_passwd_cmd,
1081 "no area-password",
1082 NO_STR
1083 "Configure the authentication password for an area\n")
1084{
1085 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001086
jardineb5d44e2003-12-23 08:09:43 +00001087 area = vty->index;
1088
hassof390d2c2004-09-10 20:48:21 +00001089 if (!area)
1090 {
1091 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1092 return CMD_WARNING;
1093 }
1094
jardineb5d44e2003-12-23 08:09:43 +00001095 memset (&area->area_passwd, 0, sizeof (struct isis_passwd));
1096
1097 return CMD_SUCCESS;
1098}
1099
jardineb5d44e2003-12-23 08:09:43 +00001100DEFUN (domain_passwd,
1101 domain_passwd_cmd,
1102 "domain-password WORD",
1103 "Set the authentication password for a routing domain\n"
hassof390d2c2004-09-10 20:48:21 +00001104 "Routing domain password\n")
jardineb5d44e2003-12-23 08:09:43 +00001105{
1106 struct isis_area *area;
1107 int len;
1108
1109 area = vty->index;
1110
hassof390d2c2004-09-10 20:48:21 +00001111 if (!area)
1112 {
1113 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1114 return CMD_WARNING;
1115 }
1116
jardineb5d44e2003-12-23 08:09:43 +00001117 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001118 if (len > 254)
1119 {
1120 vty_out (vty, "Too long area password (>254)%s", VTY_NEWLINE);
1121 return CMD_WARNING;
1122 }
1123 area->domain_passwd.len = (u_char) len;
jardineb5d44e2003-12-23 08:09:43 +00001124 area->domain_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001125 strncpy ((char *)area->domain_passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001126
hasso1cbc5622005-01-01 10:29:51 +00001127 if (argc > 1)
1128 {
1129 SET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND);
1130 if (strncmp(argv[1], "v", 1) == 0)
1131 SET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1132 else
1133 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1134 }
1135 else
1136 {
1137 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND);
1138 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1139 }
1140
jardineb5d44e2003-12-23 08:09:43 +00001141 return CMD_SUCCESS;
1142}
1143
hasso1cbc5622005-01-01 10:29:51 +00001144ALIAS (domain_passwd,
1145 domain_passwd_snpauth_cmd,
1146 "domain-password WORD authenticate snp (send-only|validate)",
1147 "Set the authentication password for a routing domain\n"
1148 "Routing domain password\n"
1149 "Authentication\n"
1150 "SNP PDUs\n"
1151 "Send but do not check PDUs on receiving\n"
1152 "Send and check PDUs on receiving\n");
1153
jardineb5d44e2003-12-23 08:09:43 +00001154DEFUN (no_domain_passwd,
1155 no_domain_passwd_cmd,
1156 "no domain-password WORD",
1157 NO_STR
1158 "Set the authentication password for a routing domain\n")
1159{
1160 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001161
jardineb5d44e2003-12-23 08:09:43 +00001162 area = vty->index;
1163
hassof390d2c2004-09-10 20:48:21 +00001164 if (!area)
1165 {
1166 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1167 return CMD_WARNING;
1168 }
1169
jardineb5d44e2003-12-23 08:09:43 +00001170 memset (&area->domain_passwd, 0, sizeof (struct isis_passwd));
hassof390d2c2004-09-10 20:48:21 +00001171
jardineb5d44e2003-12-23 08:09:43 +00001172 return CMD_SUCCESS;
1173}
1174
1175DEFUN (is_type,
1176 is_type_cmd,
1177 "is-type (level-1|level-1-2|level-2-only)",
1178 "IS Level for this routing process (OSI only)\n"
1179 "Act as a station router only\n"
1180 "Act as both a station router and an area router\n"
1181 "Act as an area router only\n")
1182{
1183 struct isis_area *area;
1184 int type;
1185
1186 area = vty->index;
1187
hassof390d2c2004-09-10 20:48:21 +00001188 if (!area)
1189 {
1190 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1191 return CMD_WARNING;
1192 }
jardineb5d44e2003-12-23 08:09:43 +00001193
hassof7c43dc2004-09-26 16:24:14 +00001194 type = string2circuit_t ((u_char *)argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001195 if (!type)
1196 {
1197 vty_out (vty, "Unknown IS level %s", VTY_NEWLINE);
1198 return CMD_SUCCESS;
1199 }
jardineb5d44e2003-12-23 08:09:43 +00001200
1201 isis_event_system_type_change (area, type);
hassof390d2c2004-09-10 20:48:21 +00001202
jardineb5d44e2003-12-23 08:09:43 +00001203 return CMD_SUCCESS;
1204}
1205
1206DEFUN (no_is_type,
1207 no_is_type_cmd,
1208 "no is-type (level-1|level-1-2|level-2-only)",
1209 NO_STR
1210 "IS Level for this routing process (OSI only)\n"
1211 "Act as a station router only\n"
1212 "Act as both a station router and an area router\n"
1213 "Act as an area router only\n")
1214{
jardineb5d44e2003-12-23 08:09:43 +00001215 struct isis_area *area;
1216 int type;
1217
1218 area = vty->index;
1219 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001220
jardineb5d44e2003-12-23 08:09:43 +00001221 /*
1222 * Put the is-type back to default. Which is level-1-2 on first
1223 * circuit for the area level-1 for the rest
1224 */
hassof390d2c2004-09-10 20:48:21 +00001225 if (getdata (listhead (isis->area_list)) == area)
jardineb5d44e2003-12-23 08:09:43 +00001226 type = IS_LEVEL_1_AND_2;
1227 else
1228 type = IS_LEVEL_1;
1229
1230 isis_event_system_type_change (area, type);
1231
1232 return CMD_SUCCESS;
1233}
1234
1235DEFUN (lsp_gen_interval,
1236 lsp_gen_interval_cmd,
1237 "lsp-gen-interval <1-120>",
1238 "Minimum interval between regenerating same LSP\n"
1239 "Minimum interval in seconds\n")
1240{
1241 struct isis_area *area;
1242 uint16_t interval;
1243
1244 area = vty->index;
1245 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001246
jardineb5d44e2003-12-23 08:09:43 +00001247 interval = atoi (argv[0]);
1248 area->lsp_gen_interval[0] = interval;
1249 area->lsp_gen_interval[1] = interval;
1250
1251 return CMD_SUCCESS;
1252}
1253
1254DEFUN (no_lsp_gen_interval,
1255 no_lsp_gen_interval_cmd,
1256 "no lsp-gen-interval",
1257 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001258 "Minimum interval between regenerating same LSP\n")
jardineb5d44e2003-12-23 08:09:43 +00001259{
1260 struct isis_area *area;
1261
1262 area = vty->index;
1263 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001264
jardineb5d44e2003-12-23 08:09:43 +00001265 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
1266 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
1267
1268 return CMD_SUCCESS;
1269}
1270
1271ALIAS (no_lsp_gen_interval,
1272 no_lsp_gen_interval_arg_cmd,
1273 "no lsp-gen-interval <1-120>",
1274 NO_STR
1275 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001276 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001277
1278DEFUN (lsp_gen_interval_l1,
1279 lsp_gen_interval_l1_cmd,
1280 "lsp-gen-interval level-1 <1-120>",
1281 "Minimum interval between regenerating same LSP\n"
1282 "Set interval for level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001283 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001284{
1285 struct isis_area *area;
1286 uint16_t interval;
1287
1288 area = vty->index;
1289 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001290
jardineb5d44e2003-12-23 08:09:43 +00001291 interval = atoi (argv[0]);
1292 area->lsp_gen_interval[0] = interval;
1293
1294 return CMD_SUCCESS;
1295}
1296
1297DEFUN (no_lsp_gen_interval_l1,
1298 no_lsp_gen_interval_l1_cmd,
1299 "no lsp-gen-interval level-1",
1300 NO_STR
1301 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001302 "Set interval for level 1 only\n")
jardineb5d44e2003-12-23 08:09:43 +00001303{
1304 struct isis_area *area;
1305
1306 area = vty->index;
1307 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001308
jardineb5d44e2003-12-23 08:09:43 +00001309 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
1310
1311 return CMD_SUCCESS;
1312}
1313
1314ALIAS (no_lsp_gen_interval_l1,
1315 no_lsp_gen_interval_l1_arg_cmd,
1316 "no lsp-gen-interval level-1 <1-120>",
1317 NO_STR
1318 "Minimum interval between regenerating same LSP\n"
1319 "Set interval for level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001320 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001321
1322DEFUN (lsp_gen_interval_l2,
1323 lsp_gen_interval_l2_cmd,
1324 "lsp-gen-interval level-2 <1-120>",
1325 "Minimum interval between regenerating same LSP\n"
1326 "Set interval for level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001327 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001328{
1329 struct isis_area *area;
1330 int interval;
1331
1332 area = vty->index;
1333 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001334
jardineb5d44e2003-12-23 08:09:43 +00001335 interval = atoi (argv[0]);
1336 area->lsp_gen_interval[1] = interval;
1337
1338 return CMD_SUCCESS;
1339}
1340
1341DEFUN (no_lsp_gen_interval_l2,
1342 no_lsp_gen_interval_l2_cmd,
1343 "no lsp-gen-interval level-2",
1344 NO_STR
1345 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001346 "Set interval for level 2 only\n")
jardineb5d44e2003-12-23 08:09:43 +00001347{
1348 struct isis_area *area;
1349 int interval;
1350
1351 area = vty->index;
1352 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001353
jardineb5d44e2003-12-23 08:09:43 +00001354 interval = atoi (argv[0]);
1355 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
1356
1357 return CMD_SUCCESS;
1358}
1359
1360ALIAS (no_lsp_gen_interval_l2,
1361 no_lsp_gen_interval_l2_arg_cmd,
1362 "no lsp-gen-interval level-2 <1-120>",
1363 NO_STR
1364 "Minimum interval between regenerating same LSP\n"
1365 "Set interval for level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001366 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001367
1368DEFUN (metric_style,
1369 metric_style_cmd,
1370 "metric-style (narrow|wide)",
1371 "Use old-style (ISO 10589) or new-style packet formats\n"
1372 "Use old style of TLVs with narrow metric\n"
1373 "Use new style of TLVs to carry wider metric\n")
1374{
1375 struct isis_area *area;
1376
1377 area = vty->index;
1378 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001379 if (!strcmp (argv[0], "wide"))
jardineb5d44e2003-12-23 08:09:43 +00001380 area->newmetric = 1;
1381 else
1382 area->newmetric = 0;
1383
1384 return CMD_SUCCESS;
1385}
1386
1387DEFUN (no_metric_style,
1388 no_metric_style_cmd,
1389 "no metric-style (narrow|wide)",
1390 NO_STR
1391 "Use old-style (ISO 10589) or new-style packet formats\n"
1392 "Use old style of TLVs with narrow metric\n"
1393 "Use new style of TLVs to carry wider metric\n")
1394{
1395 struct isis_area *area;
1396
1397 area = vty->index;
1398 assert (area);
1399
hassof390d2c2004-09-10 20:48:21 +00001400 if (!strcmp (argv[0], "wide"))
jardineb5d44e2003-12-23 08:09:43 +00001401 area->newmetric = 0;
1402 else
1403 area->newmetric = 1;
1404
1405 return CMD_SUCCESS;
1406}
1407
1408DEFUN (dynamic_hostname,
1409 dynamic_hostname_cmd,
1410 "hostname dynamic",
1411 "Dynamic hostname for IS-IS\n"
hassof390d2c2004-09-10 20:48:21 +00001412 "Dynamic hostname\n")
jardineb5d44e2003-12-23 08:09:43 +00001413{
1414 struct isis_area *area;
1415
1416 area = vty->index;
1417 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001418
jardineb5d44e2003-12-23 08:09:43 +00001419 area->dynhostname = 1;
hassof390d2c2004-09-10 20:48:21 +00001420
jardineb5d44e2003-12-23 08:09:43 +00001421 return CMD_SUCCESS;
1422}
1423
1424DEFUN (no_dynamic_hostname,
1425 no_dynamic_hostname_cmd,
1426 "no hostname dynamic",
1427 NO_STR
1428 "Dynamic hostname for IS-IS\n"
hassof390d2c2004-09-10 20:48:21 +00001429 "Dynamic hostname\n")
jardineb5d44e2003-12-23 08:09:43 +00001430{
1431 struct isis_area *area;
1432
1433 area = vty->index;
1434 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001435
jardineb5d44e2003-12-23 08:09:43 +00001436 area->dynhostname = 0;
hassof390d2c2004-09-10 20:48:21 +00001437
jardineb5d44e2003-12-23 08:09:43 +00001438 return CMD_SUCCESS;
1439}
1440
1441DEFUN (spf_interval,
1442 spf_interval_cmd,
1443 "spf-interval <1-120>",
hasso2097cd82003-12-23 11:51:08 +00001444 "Minimum interval between SPF calculations\n"
jardineb5d44e2003-12-23 08:09:43 +00001445 "Minimum interval between consecutive SPFs in seconds\n")
1446{
1447 struct isis_area *area;
1448 u_int16_t interval;
hassof390d2c2004-09-10 20:48:21 +00001449
jardineb5d44e2003-12-23 08:09:43 +00001450 area = vty->index;
1451 interval = atoi (argv[0]);
1452 area->min_spf_interval[0] = interval;
1453 area->min_spf_interval[1] = interval;
hassof390d2c2004-09-10 20:48:21 +00001454
jardineb5d44e2003-12-23 08:09:43 +00001455 return CMD_SUCCESS;
1456}
1457
1458DEFUN (no_spf_interval,
1459 no_spf_interval_cmd,
1460 "no spf-interval",
1461 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001462 "Minimum interval between SPF calculations\n")
jardineb5d44e2003-12-23 08:09:43 +00001463{
1464 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001465
jardineb5d44e2003-12-23 08:09:43 +00001466 area = vty->index;
1467
1468 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
1469 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001470
jardineb5d44e2003-12-23 08:09:43 +00001471 return CMD_SUCCESS;
1472}
1473
1474ALIAS (no_spf_interval,
1475 no_spf_interval_arg_cmd,
1476 "no spf-interval <1-120>",
1477 NO_STR
1478 "Minimum interval between SPF calculations\n"
hassof390d2c2004-09-10 20:48:21 +00001479 "Minimum interval between consecutive SPFs in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001480
1481DEFUN (spf_interval_l1,
1482 spf_interval_l1_cmd,
1483 "spf-interval level-1 <1-120>",
1484 "Minimum interval between SPF calculations\n"
1485 "Set interval for level 1 only\n"
1486 "Minimum interval between consecutive SPFs in seconds\n")
1487{
1488 struct isis_area *area;
1489 u_int16_t interval;
hassof390d2c2004-09-10 20:48:21 +00001490
jardineb5d44e2003-12-23 08:09:43 +00001491 area = vty->index;
1492 interval = atoi (argv[0]);
1493 area->min_spf_interval[0] = interval;
hassof390d2c2004-09-10 20:48:21 +00001494
jardineb5d44e2003-12-23 08:09:43 +00001495 return CMD_SUCCESS;
1496}
1497
1498DEFUN (no_spf_interval_l1,
1499 no_spf_interval_l1_cmd,
1500 "no spf-interval level-1",
1501 NO_STR
1502 "Minimum interval between SPF calculations\n"
1503 "Set interval for level 1 only\n")
1504{
1505 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001506
jardineb5d44e2003-12-23 08:09:43 +00001507 area = vty->index;
1508
1509 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001510
jardineb5d44e2003-12-23 08:09:43 +00001511 return CMD_SUCCESS;
1512}
1513
1514ALIAS (no_spf_interval,
1515 no_spf_interval_l1_arg_cmd,
1516 "no spf-interval level-1 <1-120>",
1517 NO_STR
1518 "Minimum interval between SPF calculations\n"
1519 "Set interval for level 1 only\n"
1520 "Minimum interval between consecutive SPFs in seconds\n")
1521
1522DEFUN (spf_interval_l2,
1523 spf_interval_l2_cmd,
1524 "spf-interval level-2 <1-120>",
1525 "Minimum interval between SPF calculations\n"
1526 "Set interval for level 2 only\n"
1527 "Minimum interval between consecutive SPFs in seconds\n")
1528{
1529 struct isis_area *area;
1530 u_int16_t interval;
hassof390d2c2004-09-10 20:48:21 +00001531
jardineb5d44e2003-12-23 08:09:43 +00001532 area = vty->index;
1533 interval = atoi (argv[0]);
1534 area->min_spf_interval[1] = interval;
hassof390d2c2004-09-10 20:48:21 +00001535
jardineb5d44e2003-12-23 08:09:43 +00001536 return CMD_SUCCESS;
1537}
1538
1539DEFUN (no_spf_interval_l2,
1540 no_spf_interval_l2_cmd,
1541 "no spf-interval level-2",
1542 NO_STR
1543 "Minimum interval between SPF calculations\n"
1544 "Set interval for level 2 only\n")
1545{
1546 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001547
jardineb5d44e2003-12-23 08:09:43 +00001548 area = vty->index;
1549
1550 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001551
jardineb5d44e2003-12-23 08:09:43 +00001552 return CMD_SUCCESS;
1553}
1554
1555ALIAS (no_spf_interval,
1556 no_spf_interval_l2_arg_cmd,
1557 "no spf-interval level-2 <1-120>",
1558 NO_STR
1559 "Minimum interval between SPF calculations\n"
1560 "Set interval for level 2 only\n"
1561 "Minimum interval between consecutive SPFs in seconds\n")
1562
jardineb5d44e2003-12-23 08:09:43 +00001563#ifdef TOPOLOGY_GENERATE
1564DEFUN (topology_generate_grid,
1565 topology_generate_grid_cmd,
1566 "topology generate grid <1-100> <1-100> <1-65000> [param] [param] "
1567 "[param]",
1568 "Topology for IS-IS\n"
1569 "Topology for IS-IS\n"
1570 "Topology grid for IS-IS\n"
1571 "X parameter of the grid\n"
1572 "Y parameter of the grid\n"
1573 "Random seed\n"
1574 "Optional param 1\n"
1575 "Optional param 2\n"
1576 "Optional param 3\n"
1577 "Topology\n")
1578{
1579 struct isis_area *area;
1580
1581 area = vty->index;
1582 assert (area);
1583
hassof390d2c2004-09-10 20:48:21 +00001584 if (!spgrid_check_params (vty, argc, argv))
1585 {
1586 if (area->topology)
1587 list_delete (area->topology);
1588 area->topology = list_new ();
1589 memcpy (area->top_params, vty->buf, 200);
1590 gen_spgrid_topology (vty, area->topology);
1591 remove_topology_lsps (area);
1592 generate_topology_lsps (area);
1593 }
jardineb5d44e2003-12-23 08:09:43 +00001594
1595 return CMD_SUCCESS;
1596}
1597
1598DEFUN (show_isis_topology,
1599 show_isis_topology_cmd,
1600 "show isis topology",
1601 SHOW_STR
1602 "clns network information\n"
1603 "CLNS neighbor adjacencies\n")
1604{
1605 struct isis_area *area;
1606 struct listnode *node;
1607 struct listnode *node2;
1608 struct arc *arc;
hassof390d2c2004-09-10 20:48:21 +00001609 LIST_LOOP (isis->area_list, area, node)
1610 {
1611 if (area->topology)
1612 {
1613 vty_out (vty, "Topology for isis area:%s%s", area->area_tag,
1614 VTY_NEWLINE);
1615 LIST_LOOP (area->topology, arc, node2)
1616 {
1617 vty_out (vty, "a %ld %ld %ld%s", arc->from_node, arc->to_node,
1618 arc->distance, VTY_NEWLINE);
1619 }
jardineb5d44e2003-12-23 08:09:43 +00001620 }
jardineb5d44e2003-12-23 08:09:43 +00001621 }
1622 return CMD_SUCCESS;
1623}
1624
1625/*
1626 * 'topology base-is' command
1627 */
hassof390d2c2004-09-10 20:48:21 +00001628DEFUN (topology_baseis,
jardineb5d44e2003-12-23 08:09:43 +00001629 topology_baseis_cmd,
1630 "topology base-is WORD",
1631 "Topology for IS-IS\n"
1632 "Topology for IS-IS\n"
1633 "A Network IS Base for this topology"
hassof390d2c2004-09-10 20:48:21 +00001634 "XX.XXXX.XXXX.XX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001635{
1636 struct isis_area *area;
1637 u_char buff[ISIS_SYS_ID_LEN];
1638
1639 area = vty->index;
1640 assert (area);
1641
hassof390d2c2004-09-10 20:48:21 +00001642 if (sysid2buff (buff, argv[0]))
1643 {
1644 sysid2buff (area->topology_baseis, argv[0]);
1645 }
1646
jardineb5d44e2003-12-23 08:09:43 +00001647 return CMD_SUCCESS;
1648}
1649
1650/*
1651 * 'no net' command
1652 */
1653DEFUN (no_topology_baseis,
1654 no_topology_baseis_cmd,
1655 "no topology base-is WORD",
1656 NO_STR
1657 "A Network Entity Title for this process (OSI only)"
hassof390d2c2004-09-10 20:48:21 +00001658 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001659{
1660 struct isis_area *area;
1661
1662 area = vty->index;
1663 assert (area);
1664
hassof390d2c2004-09-10 20:48:21 +00001665 memcpy (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS, ISIS_SYS_ID_LEN);
jardineb5d44e2003-12-23 08:09:43 +00001666 return CMD_SUCCESS;
1667}
1668
1669#endif /* TOPOLOGY_GENERATE */
1670
1671DEFUN (lsp_lifetime,
1672 lsp_lifetime_cmd,
1673 "lsp-lifetime <380-65535>",
1674 "Maximum LSP lifetime\n"
hassof390d2c2004-09-10 20:48:21 +00001675 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001676{
1677 struct isis_area *area;
1678 uint16_t interval;
1679
1680 area = vty->index;
1681 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001682
jardineb5d44e2003-12-23 08:09:43 +00001683 interval = atoi (argv[0]);
1684
hassof390d2c2004-09-10 20:48:21 +00001685 if (interval < ISIS_MIN_LSP_LIFETIME)
1686 {
1687 vty_out (vty, "LSP lifetime (%us) below %us%s",
1688 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001689
hassof390d2c2004-09-10 20:48:21 +00001690 return CMD_WARNING;
1691 }
jardineb5d44e2003-12-23 08:09:43 +00001692
1693
1694 area->max_lsp_lifetime[0] = interval;
1695 area->max_lsp_lifetime[1] = interval;
hassof390d2c2004-09-10 20:48:21 +00001696 area->lsp_refresh[0] = interval - 300;
1697 area->lsp_refresh[1] = interval - 300;
jardineb5d44e2003-12-23 08:09:43 +00001698
hassof390d2c2004-09-10 20:48:21 +00001699 if (area->t_lsp_refresh[0])
1700 {
1701 thread_cancel (area->t_lsp_refresh[0]);
1702 thread_execute (master, lsp_refresh_l1, area, 0);
1703 }
jardineb5d44e2003-12-23 08:09:43 +00001704
hassof390d2c2004-09-10 20:48:21 +00001705 if (area->t_lsp_refresh[1])
1706 {
1707 thread_cancel (area->t_lsp_refresh[1]);
1708 thread_execute (master, lsp_refresh_l2, area, 0);
1709 }
jardineb5d44e2003-12-23 08:09:43 +00001710
1711
1712 return CMD_SUCCESS;
1713}
1714
1715DEFUN (no_lsp_lifetime,
1716 no_lsp_lifetime_cmd,
1717 "no lsp-lifetime",
1718 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001719 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001720{
1721 struct isis_area *area;
1722
1723 area = vty->index;
1724 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001725
1726 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200s */
1727 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200s */
1728 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900s */
1729 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001730
1731 return CMD_SUCCESS;
1732}
1733
1734ALIAS (no_lsp_lifetime,
1735 no_lsp_lifetime_arg_cmd,
1736 "no lsp-lifetime <380-65535>",
1737 NO_STR
1738 "Maximum LSP lifetime\n"
hassof390d2c2004-09-10 20:48:21 +00001739 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001740
1741DEFUN (lsp_lifetime_l1,
1742 lsp_lifetime_l1_cmd,
1743 "lsp-lifetime level-1 <380-65535>",
1744 "Maximum LSP lifetime for Level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001745 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001746{
1747 struct isis_area *area;
1748 uint16_t interval;
1749
1750 area = vty->index;
1751 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001752
jardineb5d44e2003-12-23 08:09:43 +00001753 interval = atoi (argv[0]);
1754
hassof390d2c2004-09-10 20:48:21 +00001755 if (interval < ISIS_MIN_LSP_LIFETIME)
1756 {
1757 vty_out (vty, "Level-1 LSP lifetime (%us) below %us%s",
1758 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001759
hassof390d2c2004-09-10 20:48:21 +00001760 return CMD_WARNING;
1761 }
jardineb5d44e2003-12-23 08:09:43 +00001762
1763
1764 area->max_lsp_lifetime[0] = interval;
hassof390d2c2004-09-10 20:48:21 +00001765 area->lsp_refresh[0] = interval - 300;
jardineb5d44e2003-12-23 08:09:43 +00001766
1767 return CMD_SUCCESS;
1768}
1769
1770DEFUN (no_lsp_lifetime_l1,
1771 no_lsp_lifetime_l1_cmd,
1772 "no lsp-lifetime level-1",
1773 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001774 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001775{
1776 struct isis_area *area;
1777
1778 area = vty->index;
1779 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001780
1781 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200s */
1782 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001783
1784 return CMD_SUCCESS;
1785}
1786
1787ALIAS (no_lsp_lifetime_l1,
1788 no_lsp_lifetime_l1_arg_cmd,
1789 "no lsp-lifetime level-1 <380-65535>",
1790 NO_STR
1791 "Maximum LSP lifetime for Level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001792 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001793
1794DEFUN (lsp_lifetime_l2,
1795 lsp_lifetime_l2_cmd,
1796 "lsp-lifetime level-2 <380-65535>",
1797 "Maximum LSP lifetime for Level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001798 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001799{
1800 struct isis_area *area;
1801 uint16_t interval;
1802
1803 area = vty->index;
1804 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001805
jardineb5d44e2003-12-23 08:09:43 +00001806 interval = atoi (argv[0]);
1807
hassof390d2c2004-09-10 20:48:21 +00001808 if (interval < ISIS_MIN_LSP_LIFETIME)
1809 {
1810 vty_out (vty, "Level-2 LSP lifetime (%us) below %us%s",
1811 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001812
hassof390d2c2004-09-10 20:48:21 +00001813 return CMD_WARNING;
1814 }
jardineb5d44e2003-12-23 08:09:43 +00001815
1816 area->max_lsp_lifetime[1] = interval;
1817 area->lsp_refresh[1] = interval - 300;
1818
1819 return CMD_SUCCESS;
1820}
1821
1822DEFUN (no_lsp_lifetime_l2,
1823 no_lsp_lifetime_l2_cmd,
1824 "no lsp-lifetime level-2",
1825 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001826 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001827{
1828 struct isis_area *area;
1829
1830 area = vty->index;
1831 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001832
1833 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200s */
1834 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001835
1836 return CMD_SUCCESS;
1837}
1838
1839ALIAS (no_lsp_lifetime_l2,
1840 no_lsp_lifetime_l2_arg_cmd,
1841 "no lsp-lifetime level-2 <380-65535>",
1842 NO_STR
1843 "Maximum LSP lifetime for Level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001844 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001845
1846/* IS-IS configuration write function */
1847int
1848isis_config_write (struct vty *vty)
1849{
1850 int write = 0;
jardineb5d44e2003-12-23 08:09:43 +00001851
hassof390d2c2004-09-10 20:48:21 +00001852 if (isis != NULL)
1853 {
1854 struct isis_area *area;
1855 struct listnode *node;
1856 struct listnode *node2;
jardineb5d44e2003-12-23 08:09:43 +00001857
hassof390d2c2004-09-10 20:48:21 +00001858 LIST_LOOP (isis->area_list, area, node)
1859 {
1860 /* ISIS - Area name */
1861 vty_out (vty, "router isis %s%s", area->area_tag, VTY_NEWLINE);
1862 write++;
1863 /* ISIS - Net */
1864 if (listcount (area->area_addrs) > 0)
1865 {
1866 struct area_addr *area_addr;
1867 LIST_LOOP (area->area_addrs, area_addr, node2)
1868 {
1869 vty_out (vty, " net %s%s",
1870 isonet_print (area_addr->area_addr,
1871 area_addr->addr_len + ISIS_SYS_ID_LEN +
1872 1), VTY_NEWLINE);
1873 write++;
1874 }
1875 }
1876 /* ISIS - Dynamic hostname - Defaults to true so only display if false */
1877 if (!area->dynhostname)
1878 {
1879 vty_out (vty, " no hostname dynamic%s", VTY_NEWLINE);
1880 write++;
1881 }
1882 /* ISIS - Metric-Style - when true displays wide */
1883 if (area->newmetric)
1884 {
1885 vty_out (vty, " metric-style wide%s", VTY_NEWLINE);
1886 write++;
1887 }
1888 /* ISIS - Area is-type (level-1-2 is default) */
1889 if (area->is_type == IS_LEVEL_1)
1890 {
1891 vty_out (vty, " is-type level-1%s", VTY_NEWLINE);
1892 write++;
1893 }
1894 else
1895 {
1896 if (area->is_type == IS_LEVEL_2)
1897 {
1898 vty_out (vty, " is-type level-2-only%s", VTY_NEWLINE);
1899 write++;
1900 }
1901 }
1902 /* ISIS - Lsp generation interval */
1903 if (area->lsp_gen_interval[0] == area->lsp_gen_interval[1])
1904 {
1905 if (area->lsp_gen_interval[0] != LSP_GEN_INTERVAL_DEFAULT)
1906 {
1907 vty_out (vty, " lsp-gen-interval %d%s",
1908 area->lsp_gen_interval[0], VTY_NEWLINE);
1909 write++;
1910 }
1911 }
1912 else
1913 {
1914 if (area->lsp_gen_interval[0] != LSP_GEN_INTERVAL_DEFAULT)
1915 {
1916 vty_out (vty, " lsp-gen-interval level-1 %d%s",
1917 area->lsp_gen_interval[0], VTY_NEWLINE);
1918 write++;
1919 }
1920 if (area->lsp_gen_interval[1] != LSP_GEN_INTERVAL_DEFAULT)
1921 {
1922 vty_out (vty, " lsp-gen-interval level-2 %d%s",
1923 area->lsp_gen_interval[1], VTY_NEWLINE);
1924 write++;
1925 }
1926 }
1927 /* ISIS - LSP lifetime */
1928 if (area->max_lsp_lifetime[0] == area->max_lsp_lifetime[1])
1929 {
1930 if (area->max_lsp_lifetime[0] != MAX_AGE)
1931 {
1932 vty_out (vty, " lsp-lifetime %u%s", area->max_lsp_lifetime[0],
1933 VTY_NEWLINE);
1934 write++;
1935 }
1936 }
1937 else
1938 {
1939 if (area->max_lsp_lifetime[0] != MAX_AGE)
1940 {
1941 vty_out (vty, " lsp-lifetime level-1 %u%s",
1942 area->max_lsp_lifetime[0], VTY_NEWLINE);
1943 write++;
1944 }
1945 if (area->max_lsp_lifetime[1] != MAX_AGE)
1946 {
1947 vty_out (vty, " lsp-lifetime level-2 %u%s",
1948 area->max_lsp_lifetime[1], VTY_NEWLINE);
1949 write++;
1950 }
1951 }
hasso53c997c2004-09-15 16:21:59 +00001952 /* Authentication passwords. */
1953 if (area->area_passwd.len > 0)
1954 {
hasso1cbc5622005-01-01 10:29:51 +00001955 vty_out(vty, " area-password %s", area->area_passwd.passwd);
1956 if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND))
1957 {
1958 vty_out(vty, " authenticate snp ");
1959 if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV))
1960 vty_out(vty, "validate");
1961 else
1962 vty_out(vty, "send-only");
1963 }
1964 vty_out(vty, "%s", VTY_NEWLINE);
hasso53c997c2004-09-15 16:21:59 +00001965 write++;
1966 }
1967 if (area->domain_passwd.len > 0)
1968 {
hasso1cbc5622005-01-01 10:29:51 +00001969 vty_out(vty, " domain-password %s", area->domain_passwd.passwd);
1970 if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND))
1971 {
1972 vty_out(vty, " authenticate snp ");
1973 if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV))
1974 vty_out(vty, "validate");
1975 else
1976 vty_out(vty, "send-only");
1977 }
1978 vty_out(vty, "%s", VTY_NEWLINE);
hasso53c997c2004-09-15 16:21:59 +00001979 write++;
1980 }
hassof390d2c2004-09-10 20:48:21 +00001981#ifdef TOPOLOGY_GENERATE
1982 /* seems we save the whole command line here */
1983 if (area->top_params)
1984 {
1985 vty_out (vty, " %s%s", area->top_params, VTY_NEWLINE);
1986 write++;
1987 }
jardineb5d44e2003-12-23 08:09:43 +00001988
hassof390d2c2004-09-10 20:48:21 +00001989 if (memcmp (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS,
1990 ISIS_SYS_ID_LEN))
1991 {
1992 vty_out (vty, " topology base_is %s%s",
1993 sysid_print (area->topology_baseis), VTY_NEWLINE);
1994 write++;
1995 }
1996
1997#endif /* TOPOLOGY_GENERATE */
1998 }
jardineb5d44e2003-12-23 08:09:43 +00001999 }
hassof390d2c2004-09-10 20:48:21 +00002000
jardineb5d44e2003-12-23 08:09:43 +00002001 return write;
2002}
2003
hassof390d2c2004-09-10 20:48:21 +00002004struct cmd_node isis_node = {
jardineb5d44e2003-12-23 08:09:43 +00002005 ISIS_NODE,
hasso2097cd82003-12-23 11:51:08 +00002006 "%s(config-router)# ",
jardineb5d44e2003-12-23 08:09:43 +00002007 1
2008};
2009
hassof390d2c2004-09-10 20:48:21 +00002010void
jardineb5d44e2003-12-23 08:09:43 +00002011isis_init ()
2012{
jardineb5d44e2003-12-23 08:09:43 +00002013 /* Install IS-IS top node */
2014 install_node (&isis_node, isis_config_write);
hassof390d2c2004-09-10 20:48:21 +00002015
jardineb5d44e2003-12-23 08:09:43 +00002016 install_element (VIEW_NODE, &show_clns_neighbors_cmd);
2017 install_element (VIEW_NODE, &show_isis_neighbors_cmd);
2018 install_element (VIEW_NODE, &show_clns_neighbors_detail_cmd);
2019 install_element (VIEW_NODE, &show_isis_neighbors_detail_cmd);
2020
2021 install_element (VIEW_NODE, &show_hostname_cmd);
2022 install_element (VIEW_NODE, &show_database_cmd);
2023 install_element (VIEW_NODE, &show_database_detail_cmd);
2024
2025 install_element (ENABLE_NODE, &show_clns_neighbors_cmd);
2026 install_element (ENABLE_NODE, &show_isis_neighbors_cmd);
2027 install_element (ENABLE_NODE, &show_clns_neighbors_detail_cmd);
2028 install_element (ENABLE_NODE, &show_isis_neighbors_detail_cmd);
2029
2030 install_element (ENABLE_NODE, &show_hostname_cmd);
2031 install_element (ENABLE_NODE, &show_database_cmd);
2032 install_element (ENABLE_NODE, &show_database_detail_cmd);
2033 install_element (ENABLE_NODE, &show_debugging_cmd);
2034
hassof390d2c2004-09-10 20:48:21 +00002035 install_node (&debug_node, config_write_debug);
jardin9e867fe2003-12-23 08:56:18 +00002036
jardineb5d44e2003-12-23 08:09:43 +00002037 install_element (ENABLE_NODE, &debug_isis_adj_cmd);
2038 install_element (ENABLE_NODE, &no_debug_isis_adj_cmd);
2039 install_element (ENABLE_NODE, &debug_isis_csum_cmd);
2040 install_element (ENABLE_NODE, &no_debug_isis_csum_cmd);
2041 install_element (ENABLE_NODE, &debug_isis_lupd_cmd);
2042 install_element (ENABLE_NODE, &no_debug_isis_lupd_cmd);
2043 install_element (ENABLE_NODE, &debug_isis_err_cmd);
2044 install_element (ENABLE_NODE, &no_debug_isis_err_cmd);
2045 install_element (ENABLE_NODE, &debug_isis_snp_cmd);
2046 install_element (ENABLE_NODE, &no_debug_isis_snp_cmd);
2047 install_element (ENABLE_NODE, &debug_isis_upd_cmd);
2048 install_element (ENABLE_NODE, &no_debug_isis_upd_cmd);
2049 install_element (ENABLE_NODE, &debug_isis_spfevents_cmd);
2050 install_element (ENABLE_NODE, &no_debug_isis_spfevents_cmd);
2051 install_element (ENABLE_NODE, &debug_isis_spfstats_cmd);
2052 install_element (ENABLE_NODE, &no_debug_isis_spfstats_cmd);
2053 install_element (ENABLE_NODE, &debug_isis_spftrigg_cmd);
2054 install_element (ENABLE_NODE, &no_debug_isis_spftrigg_cmd);
2055 install_element (ENABLE_NODE, &debug_isis_rtevents_cmd);
2056 install_element (ENABLE_NODE, &no_debug_isis_rtevents_cmd);
2057 install_element (ENABLE_NODE, &debug_isis_events_cmd);
2058 install_element (ENABLE_NODE, &no_debug_isis_events_cmd);
2059
jardin9e867fe2003-12-23 08:56:18 +00002060 install_element (CONFIG_NODE, &debug_isis_adj_cmd);
2061 install_element (CONFIG_NODE, &no_debug_isis_adj_cmd);
2062 install_element (CONFIG_NODE, &debug_isis_csum_cmd);
2063 install_element (CONFIG_NODE, &no_debug_isis_csum_cmd);
2064 install_element (CONFIG_NODE, &debug_isis_lupd_cmd);
2065 install_element (CONFIG_NODE, &no_debug_isis_lupd_cmd);
2066 install_element (CONFIG_NODE, &debug_isis_err_cmd);
2067 install_element (CONFIG_NODE, &no_debug_isis_err_cmd);
2068 install_element (CONFIG_NODE, &debug_isis_snp_cmd);
2069 install_element (CONFIG_NODE, &no_debug_isis_snp_cmd);
2070 install_element (CONFIG_NODE, &debug_isis_upd_cmd);
2071 install_element (CONFIG_NODE, &no_debug_isis_upd_cmd);
2072 install_element (CONFIG_NODE, &debug_isis_spfevents_cmd);
2073 install_element (CONFIG_NODE, &no_debug_isis_spfevents_cmd);
2074 install_element (CONFIG_NODE, &debug_isis_spfstats_cmd);
2075 install_element (CONFIG_NODE, &no_debug_isis_spfstats_cmd);
2076 install_element (CONFIG_NODE, &debug_isis_spftrigg_cmd);
2077 install_element (CONFIG_NODE, &no_debug_isis_spftrigg_cmd);
2078 install_element (CONFIG_NODE, &debug_isis_rtevents_cmd);
2079 install_element (CONFIG_NODE, &no_debug_isis_rtevents_cmd);
2080 install_element (CONFIG_NODE, &debug_isis_events_cmd);
2081 install_element (CONFIG_NODE, &no_debug_isis_events_cmd);
2082
jardineb5d44e2003-12-23 08:09:43 +00002083 install_element (CONFIG_NODE, &router_isis_cmd);
2084 install_element (CONFIG_NODE, &no_router_isis_cmd);
2085
2086 install_default (ISIS_NODE);
2087
2088 install_element (ISIS_NODE, &net_cmd);
2089 install_element (ISIS_NODE, &no_net_cmd);
2090
2091 install_element (ISIS_NODE, &is_type_cmd);
2092 install_element (ISIS_NODE, &no_is_type_cmd);
2093
2094 install_element (ISIS_NODE, &area_passwd_cmd);
hasso1cbc5622005-01-01 10:29:51 +00002095 install_element (ISIS_NODE, &area_passwd_snpauth_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002096 install_element (ISIS_NODE, &no_area_passwd_cmd);
2097
2098 install_element (ISIS_NODE, &domain_passwd_cmd);
hasso1cbc5622005-01-01 10:29:51 +00002099 install_element (ISIS_NODE, &domain_passwd_snpauth_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002100 install_element (ISIS_NODE, &no_domain_passwd_cmd);
2101
2102 install_element (ISIS_NODE, &lsp_gen_interval_cmd);
2103 install_element (ISIS_NODE, &no_lsp_gen_interval_cmd);
2104 install_element (ISIS_NODE, &no_lsp_gen_interval_arg_cmd);
2105 install_element (ISIS_NODE, &lsp_gen_interval_l1_cmd);
2106 install_element (ISIS_NODE, &no_lsp_gen_interval_l1_cmd);
2107 install_element (ISIS_NODE, &no_lsp_gen_interval_l1_arg_cmd);
2108 install_element (ISIS_NODE, &lsp_gen_interval_l2_cmd);
2109 install_element (ISIS_NODE, &no_lsp_gen_interval_l2_cmd);
2110 install_element (ISIS_NODE, &no_lsp_gen_interval_l2_arg_cmd);
2111
2112 install_element (ISIS_NODE, &spf_interval_cmd);
2113 install_element (ISIS_NODE, &no_spf_interval_cmd);
2114 install_element (ISIS_NODE, &no_spf_interval_arg_cmd);
2115 install_element (ISIS_NODE, &spf_interval_l1_cmd);
2116 install_element (ISIS_NODE, &no_spf_interval_l1_cmd);
2117 install_element (ISIS_NODE, &no_spf_interval_l1_arg_cmd);
2118 install_element (ISIS_NODE, &spf_interval_l2_cmd);
2119 install_element (ISIS_NODE, &no_spf_interval_l2_cmd);
2120 install_element (ISIS_NODE, &no_spf_interval_l2_arg_cmd);
hassof390d2c2004-09-10 20:48:21 +00002121
jardineb5d44e2003-12-23 08:09:43 +00002122 install_element (ISIS_NODE, &lsp_lifetime_cmd);
2123 install_element (ISIS_NODE, &no_lsp_lifetime_cmd);
2124 install_element (ISIS_NODE, &no_lsp_lifetime_arg_cmd);
2125 install_element (ISIS_NODE, &lsp_lifetime_l1_cmd);
2126 install_element (ISIS_NODE, &no_lsp_lifetime_l1_cmd);
2127 install_element (ISIS_NODE, &no_lsp_lifetime_l1_arg_cmd);
2128 install_element (ISIS_NODE, &lsp_lifetime_l2_cmd);
2129 install_element (ISIS_NODE, &no_lsp_lifetime_l2_cmd);
2130 install_element (ISIS_NODE, &no_lsp_lifetime_l2_arg_cmd);
2131
2132 install_element (ISIS_NODE, &dynamic_hostname_cmd);
2133 install_element (ISIS_NODE, &no_dynamic_hostname_cmd);
2134
2135 install_element (ISIS_NODE, &metric_style_cmd);
2136 install_element (ISIS_NODE, &no_metric_style_cmd);
2137#ifdef TOPOLOGY_GENERATE
2138 install_element (ISIS_NODE, &topology_generate_grid_cmd);
2139 install_element (ISIS_NODE, &topology_baseis_cmd);
2140 install_element (ISIS_NODE, &no_topology_baseis_cmd);
2141 install_element (VIEW_NODE, &show_isis_topology_cmd);
2142 install_element (ENABLE_NODE, &show_isis_topology_cmd);
2143#endif /* TOPOLOGY_GENERATE */
2144
hassof390d2c2004-09-10 20:48:21 +00002145 isis_new (0);
jardineb5d44e2003-12-23 08:09:43 +00002146 isis_circuit_init ();
2147 isis_zebra_init ();
2148 isis_spf_cmds_init ();
2149}