blob: dbaae8a8804e0ccc96887c8066a810e36f93f085 [file] [log] [blame]
jardineb5d44e2003-12-23 08:09:43 +00001/*
2 * IS-IS Rout(e)ing protocol - isisd.c
3 *
4 * Copyright (C) 2001,2002 Sampo Saaristo
5 * Tampere University of Technology
6 * Institute of Communications Engineering
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public Licenseas published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
17
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 */
22
jardineb5d44e2003-12-23 08:09:43 +000023#include <zebra.h>
jardineb5d44e2003-12-23 08:09:43 +000024
25#include "thread.h"
26#include "vty.h"
27#include "command.h"
28#include "log.h"
29#include "memory.h"
30#include "linklist.h"
31#include "if.h"
32#include "hash.h"
33#include "stream.h"
34#include "prefix.h"
35#include "table.h"
36
37#include "isisd/dict.h"
38#include "isisd/include-netbsd/iso.h"
39#include "isisd/isis_constants.h"
40#include "isisd/isis_common.h"
41#include "isisd/isis_circuit.h"
42#include "isisd/isis_flags.h"
43#include "isisd/isisd.h"
44#include "isisd/isis_dynhn.h"
45#include "isisd/isis_adjacency.h"
46#include "isisd/isis_pdu.h"
47#include "isisd/isis_misc.h"
48#include "isisd/isis_constants.h"
49#include "isisd/isis_tlv.h"
50#include "isisd/isis_lsp.h"
51#include "isisd/isis_spf.h"
52#include "isisd/isis_route.h"
53#include "isisd/isis_zebra.h"
54#include "isisd/isis_events.h"
55
56#ifdef TOPOLOGY_GENERATE
57#include "spgrid.h"
hassof390d2c2004-09-10 20:48:21 +000058u_char DEFAULT_TOPOLOGY_BASEIS[6] = { 0xFE, 0xED, 0xFE, 0xED, 0x00, 0x00 };
jardineb5d44e2003-12-23 08:09:43 +000059#endif /* TOPOLOGY_GENERATE */
60
jardineb5d44e2003-12-23 08:09:43 +000061struct isis *isis = NULL;
hasso73d1aea2004-09-24 10:45:28 +000062extern struct thread_master *master;
jardineb5d44e2003-12-23 08:09:43 +000063
jardineb5d44e2003-12-23 08:09:43 +000064void
65isis_new (unsigned long process_id)
66{
hassoaac372f2005-09-01 17:52:33 +000067 isis = XCALLOC (MTYPE_ISIS, sizeof (struct isis));
jardineb5d44e2003-12-23 08:09:43 +000068 /*
69 * Default values
70 */
71 isis->max_area_addrs = 3;
72
73 isis->process_id = process_id;
74 isis->area_list = list_new ();
75 isis->init_circ_list = list_new ();
76 isis->uptime = time (NULL);
77 isis->nexthops = list_new ();
78#ifdef HAVE_IPV6
79 isis->nexthops6 = list_new ();
80#endif /* HAVE_IPV6 */
81 /*
82 * uncomment the next line for full debugs
83 */
hassof390d2c2004-09-10 20:48:21 +000084 /* isis->debugs = 0xFFFF; */
jardineb5d44e2003-12-23 08:09:43 +000085}
86
87struct isis_area *
88isis_area_create ()
89{
jardineb5d44e2003-12-23 08:09:43 +000090 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +000091
hassoaac372f2005-09-01 17:52:33 +000092 area = XCALLOC (MTYPE_ISIS_AREA, sizeof (struct isis_area));
jardineb5d44e2003-12-23 08:09:43 +000093
94 /*
95 * The first instance is level-1-2 rest are level-1, unless otherwise
96 * configured
97 */
98 if (listcount (isis->area_list) > 0)
99 area->is_type = IS_LEVEL_1;
100 else
101 area->is_type = IS_LEVEL_1_AND_2;
102 /*
103 * intialize the databases
104 */
105 area->lspdb[0] = lsp_db_init ();
106 area->lspdb[1] = lsp_db_init ();
hassof390d2c2004-09-10 20:48:21 +0000107
jardineb5d44e2003-12-23 08:09:43 +0000108 spftree_area_init (area);
hassofac1f7c2005-09-26 18:26:26 +0000109 area->route_table[0] = route_table_init ();
110 area->route_table[1] = route_table_init ();
jardineb5d44e2003-12-23 08:09:43 +0000111#ifdef HAVE_IPV6
hassofac1f7c2005-09-26 18:26:26 +0000112 area->route_table6[0] = route_table_init ();
113 area->route_table6[1] = route_table_init ();
jardineb5d44e2003-12-23 08:09:43 +0000114#endif /* HAVE_IPV6 */
115 area->circuit_list = list_new ();
116 area->area_addrs = list_new ();
hassof390d2c2004-09-10 20:48:21 +0000117 THREAD_TIMER_ON (master, area->t_tick, lsp_tick, area, 1);
jardineb5d44e2003-12-23 08:09:43 +0000118 area->flags.maxindex = -1;
119 /*
120 * Default values
121 */
hassof390d2c2004-09-10 20:48:21 +0000122 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200 */
123 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200 */
jardineb5d44e2003-12-23 08:09:43 +0000124 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
125 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
hassof390d2c2004-09-10 20:48:21 +0000126 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900 */
127 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900 */
jardineb5d44e2003-12-23 08:09:43 +0000128 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
129 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
130 area->dynhostname = 1;
hasso2984d262005-09-26 16:49:07 +0000131 area->oldmetric = 1;
jardineb5d44e2003-12-23 08:09:43 +0000132 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
hassoc89c05d2005-09-04 21:36:36 +0000176 if (isis->debugs & DEBUG_EVENTS)
177 zlog_debug ("New IS-IS area instance %s", area->area_tag);
jardineb5d44e2003-12-23 08:09:43 +0000178
179 vty->node = ISIS_NODE;
180 vty->index = area;
hassof390d2c2004-09-10 20:48:21 +0000181
jardineb5d44e2003-12-23 08:09:43 +0000182 return CMD_SUCCESS;
183}
184
185int
hassof90a5f62004-10-11 13:11:56 +0000186isis_area_destroy (struct vty *vty, const char *area_tag)
jardineb5d44e2003-12-23 08:09:43 +0000187{
jardineb5d44e2003-12-23 08:09:43 +0000188 struct isis_area *area;
paul1eb8ef22005-04-07 07:30:20 +0000189 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000190 struct isis_circuit *circuit;
191
192 area = isis_area_lookup (area_tag);
jardineb5d44e2003-12-23 08:09:43 +0000193
hassof390d2c2004-09-10 20:48:21 +0000194 if (area == NULL)
195 {
196 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
197 return CMD_WARNING;
jardineb5d44e2003-12-23 08:09:43 +0000198 }
hassof390d2c2004-09-10 20:48:21 +0000199
200 if (area->circuit_list)
201 {
paul1eb8ef22005-04-07 07:30:20 +0000202 for (ALL_LIST_ELEMENTS (area->circuit_list, node, nnode, circuit))
203 isis_circuit_del (circuit);
204
hassof390d2c2004-09-10 20:48:21 +0000205 list_delete (area->circuit_list);
206 }
jardineb5d44e2003-12-23 08:09:43 +0000207 listnode_delete (isis->area_list, area);
hassof390d2c2004-09-10 20:48:21 +0000208 THREAD_TIMER_OFF (area->t_tick);
jardineb5d44e2003-12-23 08:09:43 +0000209 if (area->t_remove_aged)
210 thread_cancel (area->t_remove_aged);
hassof390d2c2004-09-10 20:48:21 +0000211 THREAD_TIMER_OFF (area->t_lsp_refresh[0]);
212 THREAD_TIMER_OFF (area->t_lsp_refresh[1]);
jardineb5d44e2003-12-23 08:09:43 +0000213
214 XFREE (MTYPE_ISIS_AREA, area);
hassof390d2c2004-09-10 20:48:21 +0000215
jardineb5d44e2003-12-23 08:09:43 +0000216 return CMD_SUCCESS;
217}
218
hassof390d2c2004-09-10 20:48:21 +0000219int
hassof7c43dc2004-09-26 16:24:14 +0000220area_net_title (struct vty *vty, u_char *net_title)
jardineb5d44e2003-12-23 08:09:43 +0000221{
jardineb5d44e2003-12-23 08:09:43 +0000222 struct isis_area *area;
223 struct area_addr *addr;
224 struct area_addr *addrp;
paul1eb8ef22005-04-07 07:30:20 +0000225 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000226
227 u_char buff[255];
228 area = vty->index;
229
hassof390d2c2004-09-10 20:48:21 +0000230 if (!area)
231 {
232 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
233 return CMD_WARNING;
234 }
jardineb5d44e2003-12-23 08:09:43 +0000235
236 /* We check that we are not over the maximal number of addresses */
hassof390d2c2004-09-10 20:48:21 +0000237 if (listcount (area->area_addrs) >= isis->max_area_addrs)
238 {
239 vty_out (vty, "Maximum of area addresses (%d) already reached %s",
240 isis->max_area_addrs, VTY_NEWLINE);
241 return CMD_WARNING;
242 }
jardineb5d44e2003-12-23 08:09:43 +0000243
244 addr = XMALLOC (MTYPE_ISIS_AREA_ADDR, sizeof (struct area_addr));
245 addr->addr_len = dotformat2buff (buff, net_title);
246 memcpy (addr->area_addr, buff, addr->addr_len);
247#ifdef EXTREME_DEBUG
hasso529d65b2004-12-24 00:14:50 +0000248 zlog_debug ("added area address %s for area %s (address length %d)",
jardineb5d44e2003-12-23 08:09:43 +0000249 net_title, area->area_tag, addr->addr_len);
250#endif /* EXTREME_DEBUG */
hassof390d2c2004-09-10 20:48:21 +0000251 if (addr->addr_len < 8 || addr->addr_len > 20)
252 {
253 zlog_warn ("area address must be at least 8..20 octets long (%d)",
254 addr->addr_len);
jardineb5d44e2003-12-23 08:09:43 +0000255 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
256 return CMD_WARNING;
257 }
258
hassof390d2c2004-09-10 20:48:21 +0000259 if (isis->sysid_set == 0)
260 {
261 /*
262 * First area address - get the SystemID for this router
263 */
264 memcpy (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN), ISIS_SYS_ID_LEN);
265 isis->sysid_set = 1;
hassoc89c05d2005-09-04 21:36:36 +0000266 if (isis->debugs & DEBUG_EVENTS)
267 zlog_debug ("Router has SystemID %s", sysid_print (isis->sysid));
jardineb5d44e2003-12-23 08:09:43 +0000268 }
hassof390d2c2004-09-10 20:48:21 +0000269 else
270 {
271 /*
272 * Check that the SystemID portions match
273 */
274 if (memcmp (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN),
275 ISIS_SYS_ID_LEN))
276 {
277 vty_out (vty,
278 "System ID must not change when defining additional area"
279 " addresses%s", VTY_NEWLINE);
280 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
281 return CMD_WARNING;
282 }
jardineb5d44e2003-12-23 08:09:43 +0000283
hassof390d2c2004-09-10 20:48:21 +0000284 /* now we see that we don't already have this address */
paul1eb8ef22005-04-07 07:30:20 +0000285 for (ALL_LIST_ELEMENTS (area->area_addrs, node, nnode, addrp))
hassof390d2c2004-09-10 20:48:21 +0000286 {
287 if ((addrp->addr_len + ISIS_SYS_ID_LEN + 1) == (addr->addr_len))
288 {
289 if (!memcmp (addrp->area_addr, addr->area_addr, addr->addr_len))
290 {
291 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
292 return CMD_SUCCESS; /* silent fail */
293 }
294 }
295 }
296
297 }
jardineb5d44e2003-12-23 08:09:43 +0000298 /*
299 * Forget the systemID part of the address
300 */
301 addr->addr_len -= (ISIS_SYS_ID_LEN + 1);
302 listnode_add (area->area_addrs, addr);
303
304 /* only now we can safely generate our LSPs for this area */
hassof390d2c2004-09-10 20:48:21 +0000305 if (listcount (area->area_addrs) > 0)
306 {
307 lsp_l1_generate (area);
308 lsp_l2_generate (area);
309 }
jardineb5d44e2003-12-23 08:09:43 +0000310
311 return CMD_SUCCESS;
312}
313
314int
hassof7c43dc2004-09-26 16:24:14 +0000315area_clear_net_title (struct vty *vty, u_char *net_title)
jardineb5d44e2003-12-23 08:09:43 +0000316{
317 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000318 struct area_addr addr, *addrp = NULL;
paul1eb8ef22005-04-07 07:30:20 +0000319 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000320 u_char buff[255];
321
322 area = vty->index;
hassof390d2c2004-09-10 20:48:21 +0000323 if (!area)
324 {
325 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
326 return CMD_WARNING;
327 }
328
jardineb5d44e2003-12-23 08:09:43 +0000329 addr.addr_len = dotformat2buff (buff, net_title);
hassof390d2c2004-09-10 20:48:21 +0000330 if (addr.addr_len < 8 || addr.addr_len > 20)
331 {
332 vty_out (vty, "Unsupported area address length %d, should be 8...20 %s",
333 addr.addr_len, VTY_NEWLINE);
334 return CMD_WARNING;
335 }
336
337 memcpy (addr.area_addr, buff, (int) addr.addr_len);
338
paul1eb8ef22005-04-07 07:30:20 +0000339 for (ALL_LIST_ELEMENTS (area->area_addrs, node, nnode, addrp))
jardineb5d44e2003-12-23 08:09:43 +0000340 if (addrp->addr_len == addr.addr_len &&
341 !memcmp (addrp->area_addr, addr.area_addr, addr.addr_len))
hassof390d2c2004-09-10 20:48:21 +0000342 break;
343
344 if (!addrp)
345 {
346 vty_out (vty, "No area address %s for area %s %s", net_title,
347 area->area_tag, VTY_NEWLINE);
348 return CMD_WARNING;
349 }
350
jardineb5d44e2003-12-23 08:09:43 +0000351 listnode_delete (area->area_addrs, addrp);
hassof390d2c2004-09-10 20:48:21 +0000352
jardineb5d44e2003-12-23 08:09:43 +0000353 return CMD_SUCCESS;
354}
355
jardineb5d44e2003-12-23 08:09:43 +0000356/*
357 * 'show clns neighbors' command
358 */
359
360int
hassof390d2c2004-09-10 20:48:21 +0000361show_clns_neigh (struct vty *vty, char detail)
jardineb5d44e2003-12-23 08:09:43 +0000362{
paul1eb8ef22005-04-07 07:30:20 +0000363 struct listnode *anode, *annode, *cnode, *cnnode;
jardineb5d44e2003-12-23 08:09:43 +0000364 struct isis_area *area;
365 struct isis_circuit *circuit;
366 struct list *db;
367 int i;
368
hassof390d2c2004-09-10 20:48:21 +0000369 if (!isis)
370 {
371 vty_out (vty, "IS-IS Routing Process not enabled%s", VTY_NEWLINE);
372 return CMD_SUCCESS;
373 }
jardineb5d44e2003-12-23 08:09:43 +0000374
paul1eb8ef22005-04-07 07:30:20 +0000375 for (ALL_LIST_ELEMENTS (isis->area_list, anode, annode, area))
hassof390d2c2004-09-10 20:48:21 +0000376 {
hassof390d2c2004-09-10 20:48:21 +0000377 vty_out (vty, "Area %s:%s", area->area_tag, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000378
hassof390d2c2004-09-10 20:48:21 +0000379 if (detail == ISIS_UI_LEVEL_BRIEF)
380 vty_out (vty, " System Id Interface L State "
381 "Holdtime SNPA%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000382
paul1eb8ef22005-04-07 07:30:20 +0000383 for (ALL_LIST_ELEMENTS (area->circuit_list, cnode, cnnode, circuit))
hassof390d2c2004-09-10 20:48:21 +0000384 {
hassof390d2c2004-09-10 20:48:21 +0000385 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
386 {
387 for (i = 0; i < 2; i++)
388 {
389 db = circuit->u.bc.adjdb[i];
390 if (db && db->count)
391 {
392 if (detail == ISIS_UI_LEVEL_BRIEF)
393 isis_adjdb_iterate (db,
394 (void (*)
395 (struct isis_adjacency *,
396 void *)) isis_adj_print_vty,
397 vty);
398 if (detail == ISIS_UI_LEVEL_DETAIL)
399 isis_adjdb_iterate (db,
400 (void (*)
401 (struct isis_adjacency *,
402 void *))
403 isis_adj_print_vty_detail, vty);
404 if (detail == ISIS_UI_LEVEL_EXTENSIVE)
405 isis_adjdb_iterate (db,
406 (void (*)
407 (struct isis_adjacency *,
408 void *))
409 isis_adj_print_vty_extensive,
410 vty);
411 }
412 }
413 }
414 else if (circuit->circ_type == CIRCUIT_T_P2P &&
415 circuit->u.p2p.neighbor)
416 {
417 if (detail == ISIS_UI_LEVEL_BRIEF)
418 isis_adj_p2p_print_vty (circuit->u.p2p.neighbor, vty);
419 if (detail == ISIS_UI_LEVEL_DETAIL)
420 isis_adj_p2p_print_vty_detail (circuit->u.p2p.neighbor, vty);
421 if (detail == ISIS_UI_LEVEL_EXTENSIVE)
422 isis_adj_p2p_print_vty_extensive (circuit->u.p2p.neighbor,
423 vty);
424 }
425 }
jardineb5d44e2003-12-23 08:09:43 +0000426 }
hassof390d2c2004-09-10 20:48:21 +0000427
jardineb5d44e2003-12-23 08:09:43 +0000428 return CMD_SUCCESS;
429}
430
431DEFUN (show_clns_neighbors,
432 show_clns_neighbors_cmd,
433 "show clns neighbors",
434 SHOW_STR
435 "clns network information\n"
436 "CLNS neighbor adjacencies\n")
437{
hassof390d2c2004-09-10 20:48:21 +0000438 return show_clns_neigh (vty, ISIS_UI_LEVEL_BRIEF);
jardineb5d44e2003-12-23 08:09:43 +0000439}
440
441ALIAS (show_clns_neighbors,
442 show_isis_neighbors_cmd,
443 "show isis neighbors",
444 SHOW_STR
445 "IS-IS network information\n"
446 "IS-IS neighbor adjacencies\n")
447
448DEFUN (show_clns_neighbors_detail,
449 show_clns_neighbors_detail_cmd,
450 "show clns neighbors detail",
451 SHOW_STR
452 "clns network information\n"
453 "CLNS neighbor adjacencies\n"
454 "show detailed information\n")
455{
hassof390d2c2004-09-10 20:48:21 +0000456 return show_clns_neigh (vty, ISIS_UI_LEVEL_DETAIL);
jardineb5d44e2003-12-23 08:09:43 +0000457}
458
459ALIAS (show_clns_neighbors_detail,
460 show_isis_neighbors_detail_cmd,
461 "show isis neighbors detail",
462 SHOW_STR
463 "IS-IS network information\n"
464 "IS-IS neighbor adjacencies\n"
465 "show detailed information\n")
jardineb5d44e2003-12-23 08:09:43 +0000466/*
467 * 'isis debug', 'show debugging'
468 */
jardineb5d44e2003-12-23 08:09:43 +0000469void
470print_debug (struct vty *vty, int flags, int onoff)
471{
472 char onoffs[4];
473 if (onoff)
hassof390d2c2004-09-10 20:48:21 +0000474 strcpy (onoffs, "on");
jardineb5d44e2003-12-23 08:09:43 +0000475 else
hassof390d2c2004-09-10 20:48:21 +0000476 strcpy (onoffs, "off");
jardineb5d44e2003-12-23 08:09:43 +0000477
478 if (flags & DEBUG_ADJ_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000479 vty_out (vty, "IS-IS Adjacency related packets debugging is %s%s", onoffs,
480 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000481 if (flags & DEBUG_CHECKSUM_ERRORS)
hassof390d2c2004-09-10 20:48:21 +0000482 vty_out (vty, "IS-IS checksum errors debugging is %s%s", onoffs,
483 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000484 if (flags & DEBUG_LOCAL_UPDATES)
hassof390d2c2004-09-10 20:48:21 +0000485 vty_out (vty, "IS-IS local updates debugging is %s%s", onoffs,
486 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000487 if (flags & DEBUG_PROTOCOL_ERRORS)
hassof390d2c2004-09-10 20:48:21 +0000488 vty_out (vty, "IS-IS protocol errors debugging is %s%s", onoffs,
489 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000490 if (flags & DEBUG_SNP_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000491 vty_out (vty, "IS-IS CSNP/PSNP packets debugging is %s%s", onoffs,
492 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000493 if (flags & DEBUG_SPF_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000494 vty_out (vty, "IS-IS SPF events debugging is %s%s", onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000495 if (flags & DEBUG_SPF_STATS)
hassof390d2c2004-09-10 20:48:21 +0000496 vty_out (vty, "IS-IS SPF Timing and Statistics Data debugging is %s%s",
497 onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000498 if (flags & DEBUG_SPF_TRIGGERS)
hassof390d2c2004-09-10 20:48:21 +0000499 vty_out (vty, "IS-IS SPF triggering events debugging is %s%s", onoffs,
500 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000501 if (flags & DEBUG_UPDATE_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000502 vty_out (vty, "IS-IS Update related packet debugging is %s%s", onoffs,
503 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000504 if (flags & DEBUG_RTE_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000505 vty_out (vty, "IS-IS Route related debuggin is %s%s", onoffs,
506 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000507 if (flags & DEBUG_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000508 vty_out (vty, "IS-IS Event debugging is %s%s", onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000509
510}
511
512DEFUN (show_debugging,
513 show_debugging_cmd,
514 "show debugging",
515 SHOW_STR
516 "State of each debugging option\n")
517{
hassof390d2c2004-09-10 20:48:21 +0000518 vty_out (vty, "IS-IS:%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000519 print_debug (vty, isis->debugs, 1);
520 return CMD_SUCCESS;
521}
522
jardin9e867fe2003-12-23 08:56:18 +0000523/* Debug node. */
hassof390d2c2004-09-10 20:48:21 +0000524static struct cmd_node debug_node = {
jardin9e867fe2003-12-23 08:56:18 +0000525 DEBUG_NODE,
hassof390d2c2004-09-10 20:48:21 +0000526 "",
527 1
jardin9e867fe2003-12-23 08:56:18 +0000528};
529
530static int
531config_write_debug (struct vty *vty)
532{
533 int write = 0;
534 int flags = isis->debugs;
535
hassof390d2c2004-09-10 20:48:21 +0000536 if (flags & DEBUG_ADJ_PACKETS)
537 {
538 vty_out (vty, "debug isis adj-packets%s", VTY_NEWLINE);
539 write++;
540 }
541 if (flags & DEBUG_CHECKSUM_ERRORS)
542 {
543 vty_out (vty, "debug isis checksum-errors%s", VTY_NEWLINE);
544 write++;
545 }
546 if (flags & DEBUG_LOCAL_UPDATES)
547 {
548 vty_out (vty, "debug isis local-updates%s", VTY_NEWLINE);
549 write++;
550 }
551 if (flags & DEBUG_PROTOCOL_ERRORS)
552 {
553 vty_out (vty, "debug isis protocol-errors%s", VTY_NEWLINE);
554 write++;
555 }
556 if (flags & DEBUG_SNP_PACKETS)
557 {
558 vty_out (vty, "debug isis snp-packets%s", VTY_NEWLINE);
559 write++;
560 }
561 if (flags & DEBUG_SPF_EVENTS)
562 {
563 vty_out (vty, "debug isis spf-events%s", VTY_NEWLINE);
564 write++;
565 }
566 if (flags & DEBUG_SPF_STATS)
567 {
568 vty_out (vty, "debug isis spf-statistics%s", VTY_NEWLINE);
569 write++;
570 }
571 if (flags & DEBUG_SPF_TRIGGERS)
572 {
573 vty_out (vty, "debug isis spf-triggers%s", VTY_NEWLINE);
574 write++;
575 }
576 if (flags & DEBUG_UPDATE_PACKETS)
577 {
578 vty_out (vty, "debug isis update-packets%s", VTY_NEWLINE);
579 write++;
580 }
581 if (flags & DEBUG_RTE_EVENTS)
582 {
583 vty_out (vty, "debug isis route-events%s", VTY_NEWLINE);
584 write++;
585 }
586 if (flags & DEBUG_EVENTS)
587 {
588 vty_out (vty, "debug isis events%s", VTY_NEWLINE);
589 write++;
590 }
jardin9e867fe2003-12-23 08:56:18 +0000591
592 return write;
593}
594
jardineb5d44e2003-12-23 08:09:43 +0000595DEFUN (debug_isis_adj,
596 debug_isis_adj_cmd,
597 "debug isis adj-packets",
598 DEBUG_STR
599 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000600 "IS-IS Adjacency related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000601{
602 isis->debugs |= DEBUG_ADJ_PACKETS;
hassof390d2c2004-09-10 20:48:21 +0000603 print_debug (vty, DEBUG_ADJ_PACKETS, 1);
jardineb5d44e2003-12-23 08:09:43 +0000604
605 return CMD_SUCCESS;
606}
607
608DEFUN (no_debug_isis_adj,
609 no_debug_isis_adj_cmd,
610 "no debug isis adj-packets",
611 UNDEBUG_STR
612 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000613 "IS-IS Adjacency related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000614{
jardineb5d44e2003-12-23 08:09:43 +0000615 isis->debugs &= ~DEBUG_ADJ_PACKETS;
616 print_debug (vty, DEBUG_ADJ_PACKETS, 0);
617
618 return CMD_SUCCESS;
619}
620
jardineb5d44e2003-12-23 08:09:43 +0000621DEFUN (debug_isis_csum,
622 debug_isis_csum_cmd,
623 "debug isis checksum-errors",
624 DEBUG_STR
625 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000626 "IS-IS LSP checksum errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000627{
628 isis->debugs |= DEBUG_CHECKSUM_ERRORS;
629 print_debug (vty, DEBUG_CHECKSUM_ERRORS, 1);
630
631 return CMD_SUCCESS;
632}
633
634DEFUN (no_debug_isis_csum,
635 no_debug_isis_csum_cmd,
636 "no debug isis checksum-errors",
637 UNDEBUG_STR
638 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000639 "IS-IS LSP checksum errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000640{
641 isis->debugs &= ~DEBUG_CHECKSUM_ERRORS;
642 print_debug (vty, DEBUG_CHECKSUM_ERRORS, 0);
hassof390d2c2004-09-10 20:48:21 +0000643
jardineb5d44e2003-12-23 08:09:43 +0000644 return CMD_SUCCESS;
645}
646
647DEFUN (debug_isis_lupd,
648 debug_isis_lupd_cmd,
649 "debug isis local-updates",
650 DEBUG_STR
651 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000652 "IS-IS local update packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000653{
654 isis->debugs |= DEBUG_LOCAL_UPDATES;
655 print_debug (vty, DEBUG_LOCAL_UPDATES, 1);
656
657 return CMD_SUCCESS;
658}
659
660DEFUN (no_debug_isis_lupd,
661 no_debug_isis_lupd_cmd,
662 "no debug isis local-updates",
663 UNDEBUG_STR
664 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000665 "IS-IS local update packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000666{
667 isis->debugs &= ~DEBUG_LOCAL_UPDATES;
hassof390d2c2004-09-10 20:48:21 +0000668 print_debug (vty, DEBUG_LOCAL_UPDATES, 0);
669
jardineb5d44e2003-12-23 08:09:43 +0000670 return CMD_SUCCESS;
671}
672
673DEFUN (debug_isis_err,
674 debug_isis_err_cmd,
hassof390d2c2004-09-10 20:48:21 +0000675 "debug isis protocol-errors",
jardineb5d44e2003-12-23 08:09:43 +0000676 DEBUG_STR
677 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000678 "IS-IS LSP protocol errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000679{
680 isis->debugs |= DEBUG_PROTOCOL_ERRORS;
681 print_debug (vty, DEBUG_PROTOCOL_ERRORS, 1);
682
683 return CMD_SUCCESS;
684}
685
686DEFUN (no_debug_isis_err,
687 no_debug_isis_err_cmd,
688 "no debug isis protocol-errors",
689 UNDEBUG_STR
690 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000691 "IS-IS LSP protocol errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000692{
693 isis->debugs &= ~DEBUG_PROTOCOL_ERRORS;
694 print_debug (vty, DEBUG_PROTOCOL_ERRORS, 0);
hassof390d2c2004-09-10 20:48:21 +0000695
jardineb5d44e2003-12-23 08:09:43 +0000696 return CMD_SUCCESS;
697}
698
699DEFUN (debug_isis_snp,
700 debug_isis_snp_cmd,
701 "debug isis snp-packets",
702 DEBUG_STR
703 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000704 "IS-IS CSNP/PSNP packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000705{
706 isis->debugs |= DEBUG_SNP_PACKETS;
707 print_debug (vty, DEBUG_SNP_PACKETS, 1);
708
709 return CMD_SUCCESS;
710}
711
712DEFUN (no_debug_isis_snp,
713 no_debug_isis_snp_cmd,
714 "no debug isis snp-packets",
715 UNDEBUG_STR
716 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000717 "IS-IS CSNP/PSNP packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000718{
hassof390d2c2004-09-10 20:48:21 +0000719 isis->debugs &= ~DEBUG_SNP_PACKETS;
jardineb5d44e2003-12-23 08:09:43 +0000720 print_debug (vty, DEBUG_SNP_PACKETS, 0);
hassof390d2c2004-09-10 20:48:21 +0000721
jardineb5d44e2003-12-23 08:09:43 +0000722 return CMD_SUCCESS;
723}
724
jardineb5d44e2003-12-23 08:09:43 +0000725DEFUN (debug_isis_upd,
726 debug_isis_upd_cmd,
727 "debug isis update-packets",
728 DEBUG_STR
729 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000730 "IS-IS Update related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000731{
732 isis->debugs |= DEBUG_UPDATE_PACKETS;
733 print_debug (vty, DEBUG_UPDATE_PACKETS, 1);
734
735 return CMD_SUCCESS;
736}
737
738DEFUN (no_debug_isis_upd,
739 no_debug_isis_upd_cmd,
740 "no debug isis update-packets",
741 UNDEBUG_STR
742 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000743 "IS-IS Update related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000744{
745 isis->debugs &= ~DEBUG_UPDATE_PACKETS;
746 print_debug (vty, DEBUG_UPDATE_PACKETS, 0);
hassof390d2c2004-09-10 20:48:21 +0000747
jardineb5d44e2003-12-23 08:09:43 +0000748 return CMD_SUCCESS;
749}
750
jardineb5d44e2003-12-23 08:09:43 +0000751DEFUN (debug_isis_spfevents,
752 debug_isis_spfevents_cmd,
753 "debug isis spf-events",
754 DEBUG_STR
755 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000756 "IS-IS Shortest Path First Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000757{
758 isis->debugs |= DEBUG_SPF_EVENTS;
hassof390d2c2004-09-10 20:48:21 +0000759 print_debug (vty, DEBUG_SPF_EVENTS, 1);
jardineb5d44e2003-12-23 08:09:43 +0000760
761 return CMD_SUCCESS;
762}
763
764DEFUN (no_debug_isis_spfevents,
765 no_debug_isis_spfevents_cmd,
766 "no debug isis spf-events",
767 UNDEBUG_STR
768 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000769 "IS-IS Shortest Path First Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000770{
771 isis->debugs &= ~DEBUG_SPF_EVENTS;
hassof390d2c2004-09-10 20:48:21 +0000772 print_debug (vty, DEBUG_SPF_EVENTS, 0);
773
jardineb5d44e2003-12-23 08:09:43 +0000774 return CMD_SUCCESS;
775}
776
777
778DEFUN (debug_isis_spfstats,
779 debug_isis_spfstats_cmd,
780 "debug isis spf-statistics ",
781 DEBUG_STR
782 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000783 "IS-IS SPF Timing and Statistic Data\n")
jardineb5d44e2003-12-23 08:09:43 +0000784{
785 isis->debugs |= DEBUG_SPF_STATS;
786 print_debug (vty, DEBUG_SPF_STATS, 1);
787
788 return CMD_SUCCESS;
789}
790
791DEFUN (no_debug_isis_spfstats,
792 no_debug_isis_spfstats_cmd,
793 "no debug isis spf-statistics",
794 UNDEBUG_STR
795 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000796 "IS-IS SPF Timing and Statistic Data\n")
jardineb5d44e2003-12-23 08:09:43 +0000797{
798 isis->debugs &= ~DEBUG_SPF_STATS;
799 print_debug (vty, DEBUG_SPF_STATS, 0);
hassof390d2c2004-09-10 20:48:21 +0000800
jardineb5d44e2003-12-23 08:09:43 +0000801 return CMD_SUCCESS;
802}
803
804DEFUN (debug_isis_spftrigg,
805 debug_isis_spftrigg_cmd,
806 "debug isis spf-triggers",
807 DEBUG_STR
808 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000809 "IS-IS SPF triggering events\n")
jardineb5d44e2003-12-23 08:09:43 +0000810{
811 isis->debugs |= DEBUG_SPF_TRIGGERS;
812 print_debug (vty, DEBUG_SPF_TRIGGERS, 1);
813
814 return CMD_SUCCESS;
815}
816
817DEFUN (no_debug_isis_spftrigg,
818 no_debug_isis_spftrigg_cmd,
819 "no debug isis spf-triggers",
820 UNDEBUG_STR
821 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000822 "IS-IS SPF triggering events\n")
jardineb5d44e2003-12-23 08:09:43 +0000823{
824 isis->debugs &= ~DEBUG_SPF_TRIGGERS;
825 print_debug (vty, DEBUG_SPF_TRIGGERS, 0);
hassof390d2c2004-09-10 20:48:21 +0000826
jardineb5d44e2003-12-23 08:09:43 +0000827 return CMD_SUCCESS;
828}
829
830DEFUN (debug_isis_rtevents,
831 debug_isis_rtevents_cmd,
832 "debug isis route-events",
833 DEBUG_STR
834 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000835 "IS-IS Route related events\n")
jardineb5d44e2003-12-23 08:09:43 +0000836{
837 isis->debugs |= DEBUG_RTE_EVENTS;
838 print_debug (vty, DEBUG_RTE_EVENTS, 1);
839
840 return CMD_SUCCESS;
841}
842
843DEFUN (no_debug_isis_rtevents,
844 no_debug_isis_rtevents_cmd,
845 "no debug isis route-events",
846 UNDEBUG_STR
847 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000848 "IS-IS Route related events\n")
jardineb5d44e2003-12-23 08:09:43 +0000849{
850 isis->debugs &= ~DEBUG_RTE_EVENTS;
851 print_debug (vty, DEBUG_RTE_EVENTS, 0);
hassof390d2c2004-09-10 20:48:21 +0000852
jardineb5d44e2003-12-23 08:09:43 +0000853 return CMD_SUCCESS;
854}
855
856DEFUN (debug_isis_events,
857 debug_isis_events_cmd,
858 "debug isis events",
859 DEBUG_STR
860 "IS-IS information\n"
hassof1082d12005-09-19 04:23:34 +0000861 "IS-IS Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000862{
863 isis->debugs |= DEBUG_EVENTS;
864 print_debug (vty, DEBUG_EVENTS, 1);
865
866 return CMD_SUCCESS;
867}
868
869DEFUN (no_debug_isis_events,
870 no_debug_isis_events_cmd,
871 "no debug isis events",
872 UNDEBUG_STR
873 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000874 "IS-IS Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000875{
876 isis->debugs &= ~DEBUG_EVENTS;
877 print_debug (vty, DEBUG_EVENTS, 0);
hassof390d2c2004-09-10 20:48:21 +0000878
jardineb5d44e2003-12-23 08:09:43 +0000879 return CMD_SUCCESS;
880}
881
jardineb5d44e2003-12-23 08:09:43 +0000882DEFUN (show_hostname,
883 show_hostname_cmd,
884 "show isis hostname",
885 SHOW_STR
886 "IS-IS information\n"
887 "IS-IS Dynamic hostname mapping\n")
888{
889 dynhn_print_all (vty);
hassof390d2c2004-09-10 20:48:21 +0000890
jardineb5d44e2003-12-23 08:09:43 +0000891 return CMD_SUCCESS;
892}
893
jardineb5d44e2003-12-23 08:09:43 +0000894DEFUN (show_database,
895 show_database_cmd,
896 "show isis database",
hassof390d2c2004-09-10 20:48:21 +0000897 SHOW_STR "IS-IS information\n" "IS-IS link state database\n")
jardineb5d44e2003-12-23 08:09:43 +0000898{
paul1eb8ef22005-04-07 07:30:20 +0000899 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000900 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000901 int level, lsp_count;
jardineb5d44e2003-12-23 08:09:43 +0000902
903 if (isis->area_list->count == 0)
904 return CMD_SUCCESS;
jardineb5d44e2003-12-23 08:09:43 +0000905
paul1eb8ef22005-04-07 07:30:20 +0000906 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
hassof390d2c2004-09-10 20:48:21 +0000907 {
hassof390d2c2004-09-10 20:48:21 +0000908 vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null",
909 VTY_NEWLINE);
910 for (level = 0; level < ISIS_LEVELS; level++)
911 {
912 if (area->lspdb[level] && dict_count (area->lspdb[level]) > 0)
913 {
914 vty_out (vty, "IS-IS Level-%d link-state database:%s",
915 level + 1, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000916
hassof390d2c2004-09-10 20:48:21 +0000917 lsp_count = lsp_print_all (vty, area->lspdb[level],
918 ISIS_UI_LEVEL_BRIEF,
919 area->dynhostname);
920
921 vty_out (vty, "%s %u LSPs%s%s",
922 VTY_NEWLINE, lsp_count, VTY_NEWLINE, VTY_NEWLINE);
923 }
924 }
jardineb5d44e2003-12-23 08:09:43 +0000925 }
jardineb5d44e2003-12-23 08:09:43 +0000926
927 return CMD_SUCCESS;
928}
929
jardineb5d44e2003-12-23 08:09:43 +0000930DEFUN (show_database_detail,
931 show_database_detail_cmd,
932 "show isis database detail",
933 SHOW_STR
934 "IS-IS information\n"
935 "IS-IS link state database\n")
936{
paul1eb8ef22005-04-07 07:30:20 +0000937 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000938 struct isis_area *area;
939 int level, lsp_count;
940
941 if (isis->area_list->count == 0)
942 return CMD_SUCCESS;
943
paul1eb8ef22005-04-07 07:30:20 +0000944 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
hassof390d2c2004-09-10 20:48:21 +0000945 {
hassof390d2c2004-09-10 20:48:21 +0000946 vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null",
947 VTY_NEWLINE);
948 for (level = 0; level < ISIS_LEVELS; level++)
949 {
950 if (area->lspdb[level] && dict_count (area->lspdb[level]) > 0)
951 {
952 vty_out (vty, "IS-IS Level-%d Link State Database:%s",
953 level + 1, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000954
hassof390d2c2004-09-10 20:48:21 +0000955 lsp_count = lsp_print_all (vty, area->lspdb[level],
956 ISIS_UI_LEVEL_DETAIL,
957 area->dynhostname);
jardineb5d44e2003-12-23 08:09:43 +0000958
hassof390d2c2004-09-10 20:48:21 +0000959 vty_out (vty, "%s %u LSPs%s%s",
960 VTY_NEWLINE, lsp_count, VTY_NEWLINE, VTY_NEWLINE);
961 }
962 }
jardineb5d44e2003-12-23 08:09:43 +0000963 }
jardineb5d44e2003-12-23 08:09:43 +0000964
965 return CMD_SUCCESS;
966}
967
968/*
969 * 'router isis' command
970 */
971DEFUN (router_isis,
972 router_isis_cmd,
973 "router isis WORD",
hassof390d2c2004-09-10 20:48:21 +0000974 ROUTER_STR
jardineb5d44e2003-12-23 08:09:43 +0000975 "ISO IS-IS\n"
976 "ISO Routing area tag")
977{
jardineb5d44e2003-12-23 08:09:43 +0000978 return isis_area_get (vty, argv[0]);
jardineb5d44e2003-12-23 08:09:43 +0000979}
980
981/*
982 *'no router isis' command
983 */
984DEFUN (no_router_isis,
985 no_router_isis_cmd,
986 "no router isis WORD",
hassof390d2c2004-09-10 20:48:21 +0000987 "no\n" ROUTER_STR "ISO IS-IS\n" "ISO Routing area tag")
jardineb5d44e2003-12-23 08:09:43 +0000988{
989 return isis_area_destroy (vty, argv[0]);
990}
991
992/*
993 * 'net' command
994 */
995DEFUN (net,
996 net_cmd,
997 "net WORD",
998 "A Network Entity Title for this process (OSI only)\n"
hassof390d2c2004-09-10 20:48:21 +0000999 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001000{
hassof7c43dc2004-09-26 16:24:14 +00001001 return area_net_title (vty, (u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +00001002}
1003
jardineb5d44e2003-12-23 08:09:43 +00001004/*
1005 * 'no net' command
1006 */
1007DEFUN (no_net,
1008 no_net_cmd,
1009 "no net WORD",
1010 NO_STR
1011 "A Network Entity Title for this process (OSI only)\n"
hassof390d2c2004-09-10 20:48:21 +00001012 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001013{
hassof7c43dc2004-09-26 16:24:14 +00001014 return area_clear_net_title (vty, (u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +00001015}
1016
1017DEFUN (area_passwd,
1018 area_passwd_cmd,
1019 "area-password WORD",
1020 "Configure the authentication password for an area\n"
hassof390d2c2004-09-10 20:48:21 +00001021 "Area password\n")
jardineb5d44e2003-12-23 08:09:43 +00001022{
1023 struct isis_area *area;
1024 int len;
1025
1026 area = vty->index;
1027
hassof390d2c2004-09-10 20:48:21 +00001028 if (!area)
1029 {
1030 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1031 return CMD_WARNING;
1032 }
1033
jardineb5d44e2003-12-23 08:09:43 +00001034 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001035 if (len > 254)
1036 {
1037 vty_out (vty, "Too long area password (>254)%s", VTY_NEWLINE);
1038 return CMD_WARNING;
1039 }
1040 area->area_passwd.len = (u_char) len;
jardineb5d44e2003-12-23 08:09:43 +00001041 area->area_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001042 strncpy ((char *)area->area_passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001043
hasso1cbc5622005-01-01 10:29:51 +00001044 if (argc > 1)
1045 {
1046 SET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND);
1047 if (strncmp(argv[1], "v", 1) == 0)
1048 SET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1049 else
1050 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1051 }
1052 else
1053 {
1054 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND);
1055 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1056 }
1057
jardineb5d44e2003-12-23 08:09:43 +00001058 return CMD_SUCCESS;
1059}
1060
hasso1cbc5622005-01-01 10:29:51 +00001061ALIAS (area_passwd,
1062 area_passwd_snpauth_cmd,
1063 "area-password WORD authenticate snp (send-only|validate)",
1064 "Configure the authentication password for an area\n"
1065 "Area password\n"
1066 "Authentication\n"
1067 "SNP PDUs\n"
1068 "Send but do not check PDUs on receiving\n"
1069 "Send and check PDUs on receiving\n");
1070
jardineb5d44e2003-12-23 08:09:43 +00001071DEFUN (no_area_passwd,
1072 no_area_passwd_cmd,
1073 "no area-password",
1074 NO_STR
1075 "Configure the authentication password for an area\n")
1076{
1077 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001078
jardineb5d44e2003-12-23 08:09:43 +00001079 area = vty->index;
1080
hassof390d2c2004-09-10 20:48:21 +00001081 if (!area)
1082 {
1083 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1084 return CMD_WARNING;
1085 }
1086
jardineb5d44e2003-12-23 08:09:43 +00001087 memset (&area->area_passwd, 0, sizeof (struct isis_passwd));
1088
1089 return CMD_SUCCESS;
1090}
1091
jardineb5d44e2003-12-23 08:09:43 +00001092DEFUN (domain_passwd,
1093 domain_passwd_cmd,
1094 "domain-password WORD",
1095 "Set the authentication password for a routing domain\n"
hassof390d2c2004-09-10 20:48:21 +00001096 "Routing domain password\n")
jardineb5d44e2003-12-23 08:09:43 +00001097{
1098 struct isis_area *area;
1099 int len;
1100
1101 area = vty->index;
1102
hassof390d2c2004-09-10 20:48:21 +00001103 if (!area)
1104 {
1105 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1106 return CMD_WARNING;
1107 }
1108
jardineb5d44e2003-12-23 08:09:43 +00001109 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001110 if (len > 254)
1111 {
1112 vty_out (vty, "Too long area password (>254)%s", VTY_NEWLINE);
1113 return CMD_WARNING;
1114 }
1115 area->domain_passwd.len = (u_char) len;
jardineb5d44e2003-12-23 08:09:43 +00001116 area->domain_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001117 strncpy ((char *)area->domain_passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001118
hasso1cbc5622005-01-01 10:29:51 +00001119 if (argc > 1)
1120 {
1121 SET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND);
1122 if (strncmp(argv[1], "v", 1) == 0)
1123 SET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1124 else
1125 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1126 }
1127 else
1128 {
1129 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND);
1130 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1131 }
1132
jardineb5d44e2003-12-23 08:09:43 +00001133 return CMD_SUCCESS;
1134}
1135
hasso1cbc5622005-01-01 10:29:51 +00001136ALIAS (domain_passwd,
1137 domain_passwd_snpauth_cmd,
1138 "domain-password WORD authenticate snp (send-only|validate)",
1139 "Set the authentication password for a routing domain\n"
1140 "Routing domain password\n"
1141 "Authentication\n"
1142 "SNP PDUs\n"
1143 "Send but do not check PDUs on receiving\n"
1144 "Send and check PDUs on receiving\n");
1145
jardineb5d44e2003-12-23 08:09:43 +00001146DEFUN (no_domain_passwd,
1147 no_domain_passwd_cmd,
1148 "no domain-password WORD",
1149 NO_STR
1150 "Set the authentication password for a routing domain\n")
1151{
1152 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001153
jardineb5d44e2003-12-23 08:09:43 +00001154 area = vty->index;
1155
hassof390d2c2004-09-10 20:48:21 +00001156 if (!area)
1157 {
1158 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1159 return CMD_WARNING;
1160 }
1161
jardineb5d44e2003-12-23 08:09:43 +00001162 memset (&area->domain_passwd, 0, sizeof (struct isis_passwd));
hassof390d2c2004-09-10 20:48:21 +00001163
jardineb5d44e2003-12-23 08:09:43 +00001164 return CMD_SUCCESS;
1165}
1166
1167DEFUN (is_type,
1168 is_type_cmd,
1169 "is-type (level-1|level-1-2|level-2-only)",
1170 "IS Level for this routing process (OSI only)\n"
1171 "Act as a station router only\n"
1172 "Act as both a station router and an area router\n"
1173 "Act as an area router only\n")
1174{
1175 struct isis_area *area;
1176 int type;
1177
1178 area = vty->index;
1179
hassof390d2c2004-09-10 20:48:21 +00001180 if (!area)
1181 {
1182 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1183 return CMD_WARNING;
1184 }
jardineb5d44e2003-12-23 08:09:43 +00001185
hassof7c43dc2004-09-26 16:24:14 +00001186 type = string2circuit_t ((u_char *)argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001187 if (!type)
1188 {
1189 vty_out (vty, "Unknown IS level %s", VTY_NEWLINE);
1190 return CMD_SUCCESS;
1191 }
jardineb5d44e2003-12-23 08:09:43 +00001192
1193 isis_event_system_type_change (area, type);
hassof390d2c2004-09-10 20:48:21 +00001194
jardineb5d44e2003-12-23 08:09:43 +00001195 return CMD_SUCCESS;
1196}
1197
1198DEFUN (no_is_type,
1199 no_is_type_cmd,
1200 "no is-type (level-1|level-1-2|level-2-only)",
1201 NO_STR
1202 "IS Level for this routing process (OSI only)\n"
1203 "Act as a station router only\n"
1204 "Act as both a station router and an area router\n"
1205 "Act as an area router only\n")
1206{
jardineb5d44e2003-12-23 08:09:43 +00001207 struct isis_area *area;
1208 int type;
1209
1210 area = vty->index;
1211 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001212
jardineb5d44e2003-12-23 08:09:43 +00001213 /*
1214 * Put the is-type back to default. Which is level-1-2 on first
1215 * circuit for the area level-1 for the rest
1216 */
paul1eb8ef22005-04-07 07:30:20 +00001217 if (listgetdata (listhead (isis->area_list)) == area)
jardineb5d44e2003-12-23 08:09:43 +00001218 type = IS_LEVEL_1_AND_2;
1219 else
1220 type = IS_LEVEL_1;
1221
1222 isis_event_system_type_change (area, type);
1223
1224 return CMD_SUCCESS;
1225}
1226
1227DEFUN (lsp_gen_interval,
1228 lsp_gen_interval_cmd,
1229 "lsp-gen-interval <1-120>",
1230 "Minimum interval between regenerating same LSP\n"
1231 "Minimum interval in seconds\n")
1232{
1233 struct isis_area *area;
1234 uint16_t interval;
1235
1236 area = vty->index;
1237 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001238
jardineb5d44e2003-12-23 08:09:43 +00001239 interval = atoi (argv[0]);
1240 area->lsp_gen_interval[0] = interval;
1241 area->lsp_gen_interval[1] = interval;
1242
1243 return CMD_SUCCESS;
1244}
1245
1246DEFUN (no_lsp_gen_interval,
1247 no_lsp_gen_interval_cmd,
1248 "no lsp-gen-interval",
1249 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001250 "Minimum interval between regenerating same LSP\n")
jardineb5d44e2003-12-23 08:09:43 +00001251{
1252 struct isis_area *area;
1253
1254 area = vty->index;
1255 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001256
jardineb5d44e2003-12-23 08:09:43 +00001257 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
1258 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
1259
1260 return CMD_SUCCESS;
1261}
1262
1263ALIAS (no_lsp_gen_interval,
1264 no_lsp_gen_interval_arg_cmd,
1265 "no lsp-gen-interval <1-120>",
1266 NO_STR
1267 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001268 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001269
1270DEFUN (lsp_gen_interval_l1,
1271 lsp_gen_interval_l1_cmd,
1272 "lsp-gen-interval level-1 <1-120>",
1273 "Minimum interval between regenerating same LSP\n"
1274 "Set interval for level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001275 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001276{
1277 struct isis_area *area;
1278 uint16_t interval;
1279
1280 area = vty->index;
1281 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001282
jardineb5d44e2003-12-23 08:09:43 +00001283 interval = atoi (argv[0]);
1284 area->lsp_gen_interval[0] = interval;
1285
1286 return CMD_SUCCESS;
1287}
1288
1289DEFUN (no_lsp_gen_interval_l1,
1290 no_lsp_gen_interval_l1_cmd,
1291 "no lsp-gen-interval level-1",
1292 NO_STR
1293 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001294 "Set interval for level 1 only\n")
jardineb5d44e2003-12-23 08:09:43 +00001295{
1296 struct isis_area *area;
1297
1298 area = vty->index;
1299 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001300
jardineb5d44e2003-12-23 08:09:43 +00001301 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
1302
1303 return CMD_SUCCESS;
1304}
1305
1306ALIAS (no_lsp_gen_interval_l1,
1307 no_lsp_gen_interval_l1_arg_cmd,
1308 "no lsp-gen-interval level-1 <1-120>",
1309 NO_STR
1310 "Minimum interval between regenerating same LSP\n"
1311 "Set interval for level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001312 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001313
1314DEFUN (lsp_gen_interval_l2,
1315 lsp_gen_interval_l2_cmd,
1316 "lsp-gen-interval level-2 <1-120>",
1317 "Minimum interval between regenerating same LSP\n"
1318 "Set interval for level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001319 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001320{
1321 struct isis_area *area;
1322 int interval;
1323
1324 area = vty->index;
1325 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001326
jardineb5d44e2003-12-23 08:09:43 +00001327 interval = atoi (argv[0]);
1328 area->lsp_gen_interval[1] = interval;
1329
1330 return CMD_SUCCESS;
1331}
1332
1333DEFUN (no_lsp_gen_interval_l2,
1334 no_lsp_gen_interval_l2_cmd,
1335 "no lsp-gen-interval level-2",
1336 NO_STR
1337 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001338 "Set interval for level 2 only\n")
jardineb5d44e2003-12-23 08:09:43 +00001339{
1340 struct isis_area *area;
1341 int interval;
1342
1343 area = vty->index;
1344 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001345
jardineb5d44e2003-12-23 08:09:43 +00001346 interval = atoi (argv[0]);
1347 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
1348
1349 return CMD_SUCCESS;
1350}
1351
1352ALIAS (no_lsp_gen_interval_l2,
1353 no_lsp_gen_interval_l2_arg_cmd,
1354 "no lsp-gen-interval level-2 <1-120>",
1355 NO_STR
1356 "Minimum interval between regenerating same LSP\n"
1357 "Set interval for level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001358 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001359
1360DEFUN (metric_style,
1361 metric_style_cmd,
hasso2984d262005-09-26 16:49:07 +00001362 "metric-style (narrow|transition|wide)",
jardineb5d44e2003-12-23 08:09:43 +00001363 "Use old-style (ISO 10589) or new-style packet formats\n"
1364 "Use old style of TLVs with narrow metric\n"
hasso2984d262005-09-26 16:49:07 +00001365 "Send and accept both styles of TLVs during transition\n"
jardineb5d44e2003-12-23 08:09:43 +00001366 "Use new style of TLVs to carry wider metric\n")
1367{
1368 struct isis_area *area;
1369
1370 area = vty->index;
1371 assert (area);
hasso2984d262005-09-26 16:49:07 +00001372
1373 if (strncmp (argv[0], "w", 1) == 0)
1374 {
1375 area->newmetric = 1;
1376 area->oldmetric = 0;
1377 }
1378 else if (strncmp (argv[0], "t", 1) == 0)
1379 {
1380 area->newmetric = 1;
1381 area->oldmetric = 1;
1382 }
1383 else if (strncmp (argv[0], "n", 1) == 0)
1384 {
1385 area->newmetric = 0;
1386 area->oldmetric = 1;
1387 }
jardineb5d44e2003-12-23 08:09:43 +00001388
1389 return CMD_SUCCESS;
1390}
1391
1392DEFUN (no_metric_style,
1393 no_metric_style_cmd,
hasso2984d262005-09-26 16:49:07 +00001394 "no metric-style",
jardineb5d44e2003-12-23 08:09:43 +00001395 NO_STR
hasso2984d262005-09-26 16:49:07 +00001396 "Use old-style (ISO 10589) or new-style packet formats\n")
jardineb5d44e2003-12-23 08:09:43 +00001397{
1398 struct isis_area *area;
1399
1400 area = vty->index;
1401 assert (area);
1402
hasso2984d262005-09-26 16:49:07 +00001403 /* Default is narrow metric. */
1404 area->newmetric = 0;
1405 area->oldmetric = 1;
jardineb5d44e2003-12-23 08:09:43 +00001406
1407 return CMD_SUCCESS;
1408}
1409
1410DEFUN (dynamic_hostname,
1411 dynamic_hostname_cmd,
1412 "hostname dynamic",
1413 "Dynamic hostname for IS-IS\n"
hassof390d2c2004-09-10 20:48:21 +00001414 "Dynamic hostname\n")
jardineb5d44e2003-12-23 08:09:43 +00001415{
1416 struct isis_area *area;
1417
1418 area = vty->index;
1419 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001420
jardineb5d44e2003-12-23 08:09:43 +00001421 area->dynhostname = 1;
hassof390d2c2004-09-10 20:48:21 +00001422
jardineb5d44e2003-12-23 08:09:43 +00001423 return CMD_SUCCESS;
1424}
1425
1426DEFUN (no_dynamic_hostname,
1427 no_dynamic_hostname_cmd,
1428 "no hostname dynamic",
1429 NO_STR
1430 "Dynamic hostname for IS-IS\n"
hassof390d2c2004-09-10 20:48:21 +00001431 "Dynamic hostname\n")
jardineb5d44e2003-12-23 08:09:43 +00001432{
1433 struct isis_area *area;
1434
1435 area = vty->index;
1436 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001437
jardineb5d44e2003-12-23 08:09:43 +00001438 area->dynhostname = 0;
hassof390d2c2004-09-10 20:48:21 +00001439
jardineb5d44e2003-12-23 08:09:43 +00001440 return CMD_SUCCESS;
1441}
1442
1443DEFUN (spf_interval,
1444 spf_interval_cmd,
1445 "spf-interval <1-120>",
hasso2097cd82003-12-23 11:51:08 +00001446 "Minimum interval between SPF calculations\n"
jardineb5d44e2003-12-23 08:09:43 +00001447 "Minimum interval between consecutive SPFs in seconds\n")
1448{
1449 struct isis_area *area;
1450 u_int16_t interval;
hassof390d2c2004-09-10 20:48:21 +00001451
jardineb5d44e2003-12-23 08:09:43 +00001452 area = vty->index;
1453 interval = atoi (argv[0]);
1454 area->min_spf_interval[0] = interval;
1455 area->min_spf_interval[1] = interval;
hassof390d2c2004-09-10 20:48:21 +00001456
jardineb5d44e2003-12-23 08:09:43 +00001457 return CMD_SUCCESS;
1458}
1459
1460DEFUN (no_spf_interval,
1461 no_spf_interval_cmd,
1462 "no spf-interval",
1463 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001464 "Minimum interval between SPF calculations\n")
jardineb5d44e2003-12-23 08:09:43 +00001465{
1466 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001467
jardineb5d44e2003-12-23 08:09:43 +00001468 area = vty->index;
1469
1470 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
1471 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001472
jardineb5d44e2003-12-23 08:09:43 +00001473 return CMD_SUCCESS;
1474}
1475
1476ALIAS (no_spf_interval,
1477 no_spf_interval_arg_cmd,
1478 "no spf-interval <1-120>",
1479 NO_STR
1480 "Minimum interval between SPF calculations\n"
hassof390d2c2004-09-10 20:48:21 +00001481 "Minimum interval between consecutive SPFs in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001482
1483DEFUN (spf_interval_l1,
1484 spf_interval_l1_cmd,
1485 "spf-interval level-1 <1-120>",
1486 "Minimum interval between SPF calculations\n"
1487 "Set interval for level 1 only\n"
1488 "Minimum interval between consecutive SPFs in seconds\n")
1489{
1490 struct isis_area *area;
1491 u_int16_t interval;
hassof390d2c2004-09-10 20:48:21 +00001492
jardineb5d44e2003-12-23 08:09:43 +00001493 area = vty->index;
1494 interval = atoi (argv[0]);
1495 area->min_spf_interval[0] = interval;
hassof390d2c2004-09-10 20:48:21 +00001496
jardineb5d44e2003-12-23 08:09:43 +00001497 return CMD_SUCCESS;
1498}
1499
1500DEFUN (no_spf_interval_l1,
1501 no_spf_interval_l1_cmd,
1502 "no spf-interval level-1",
1503 NO_STR
1504 "Minimum interval between SPF calculations\n"
1505 "Set interval for level 1 only\n")
1506{
1507 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001508
jardineb5d44e2003-12-23 08:09:43 +00001509 area = vty->index;
1510
1511 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001512
jardineb5d44e2003-12-23 08:09:43 +00001513 return CMD_SUCCESS;
1514}
1515
1516ALIAS (no_spf_interval,
1517 no_spf_interval_l1_arg_cmd,
1518 "no spf-interval level-1 <1-120>",
1519 NO_STR
1520 "Minimum interval between SPF calculations\n"
1521 "Set interval for level 1 only\n"
1522 "Minimum interval between consecutive SPFs in seconds\n")
1523
1524DEFUN (spf_interval_l2,
1525 spf_interval_l2_cmd,
1526 "spf-interval level-2 <1-120>",
1527 "Minimum interval between SPF calculations\n"
1528 "Set interval for level 2 only\n"
1529 "Minimum interval between consecutive SPFs in seconds\n")
1530{
1531 struct isis_area *area;
1532 u_int16_t interval;
hassof390d2c2004-09-10 20:48:21 +00001533
jardineb5d44e2003-12-23 08:09:43 +00001534 area = vty->index;
1535 interval = atoi (argv[0]);
1536 area->min_spf_interval[1] = interval;
hassof390d2c2004-09-10 20:48:21 +00001537
jardineb5d44e2003-12-23 08:09:43 +00001538 return CMD_SUCCESS;
1539}
1540
1541DEFUN (no_spf_interval_l2,
1542 no_spf_interval_l2_cmd,
1543 "no spf-interval level-2",
1544 NO_STR
1545 "Minimum interval between SPF calculations\n"
1546 "Set interval for level 2 only\n")
1547{
1548 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001549
jardineb5d44e2003-12-23 08:09:43 +00001550 area = vty->index;
1551
1552 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001553
jardineb5d44e2003-12-23 08:09:43 +00001554 return CMD_SUCCESS;
1555}
1556
1557ALIAS (no_spf_interval,
1558 no_spf_interval_l2_arg_cmd,
1559 "no spf-interval level-2 <1-120>",
1560 NO_STR
1561 "Minimum interval between SPF calculations\n"
1562 "Set interval for level 2 only\n"
1563 "Minimum interval between consecutive SPFs in seconds\n")
1564
jardineb5d44e2003-12-23 08:09:43 +00001565#ifdef TOPOLOGY_GENERATE
1566DEFUN (topology_generate_grid,
1567 topology_generate_grid_cmd,
1568 "topology generate grid <1-100> <1-100> <1-65000> [param] [param] "
1569 "[param]",
hassof1082d12005-09-19 04:23:34 +00001570 "Topology generation for IS-IS\n"
1571 "Topology generation\n"
1572 "Grid topology\n"
jardineb5d44e2003-12-23 08:09:43 +00001573 "X parameter of the grid\n"
1574 "Y parameter of the grid\n"
1575 "Random seed\n"
1576 "Optional param 1\n"
1577 "Optional param 2\n"
1578 "Optional param 3\n"
1579 "Topology\n")
1580{
1581 struct isis_area *area;
1582
1583 area = vty->index;
1584 assert (area);
1585
hassof390d2c2004-09-10 20:48:21 +00001586 if (!spgrid_check_params (vty, argc, argv))
1587 {
1588 if (area->topology)
1589 list_delete (area->topology);
1590 area->topology = list_new ();
1591 memcpy (area->top_params, vty->buf, 200);
1592 gen_spgrid_topology (vty, area->topology);
1593 remove_topology_lsps (area);
1594 generate_topology_lsps (area);
hassof1082d12005-09-19 04:23:34 +00001595 /* Regenerate L1 LSP to get two way connection to the generated
1596 * topology. */
1597 lsp_regenerate_schedule (area);
hassof390d2c2004-09-10 20:48:21 +00001598 }
jardineb5d44e2003-12-23 08:09:43 +00001599
1600 return CMD_SUCCESS;
1601}
1602
hassof695b012005-04-02 19:03:39 +00001603DEFUN (show_isis_generated_topology,
1604 show_isis_generated_topology_cmd,
hassof1082d12005-09-19 04:23:34 +00001605 "show isis generated-topologies",
jardineb5d44e2003-12-23 08:09:43 +00001606 SHOW_STR
hassof1082d12005-09-19 04:23:34 +00001607 "CLNS network information\n"
1608 "Show generated topologies\n")
jardineb5d44e2003-12-23 08:09:43 +00001609{
1610 struct isis_area *area;
paul92c9f222005-05-25 12:21:13 +00001611 struct listnode *node;
jardineb5d44e2003-12-23 08:09:43 +00001612 struct listnode *node2;
1613 struct arc *arc;
hassof1082d12005-09-19 04:23:34 +00001614
paul92c9f222005-05-25 12:21:13 +00001615 for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
hassof1082d12005-09-19 04:23:34 +00001616 {
1617 if (!area->topology)
1618 continue;
1619
1620 vty_out (vty, "Topology for isis area: %s%s", area->area_tag,
1621 VTY_NEWLINE);
1622 vty_out (vty, "From node To node Distance%s", VTY_NEWLINE);
1623
1624 for (ALL_LIST_ELEMENTS_RO (area->topology, node2, arc))
1625 vty_out (vty, "%9ld %11ld %12ld%s", arc->from_node, arc->to_node,
1626 arc->distance, VTY_NEWLINE);
1627 }
jardineb5d44e2003-12-23 08:09:43 +00001628 return CMD_SUCCESS;
1629}
1630
hassof1082d12005-09-19 04:23:34 +00001631/* Base IS for topology generation. */
hassof390d2c2004-09-10 20:48:21 +00001632DEFUN (topology_baseis,
jardineb5d44e2003-12-23 08:09:43 +00001633 topology_baseis_cmd,
1634 "topology base-is WORD",
hassof1082d12005-09-19 04:23:34 +00001635 "Topology generation for IS-IS\n"
1636 "A Network IS Base for this topology\n"
1637 "XXXX.XXXX.XXXX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001638{
1639 struct isis_area *area;
1640 u_char buff[ISIS_SYS_ID_LEN];
1641
1642 area = vty->index;
1643 assert (area);
1644
hassof390d2c2004-09-10 20:48:21 +00001645 if (sysid2buff (buff, argv[0]))
hassof1082d12005-09-19 04:23:34 +00001646 sysid2buff (area->topology_baseis, argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001647
jardineb5d44e2003-12-23 08:09:43 +00001648 return CMD_SUCCESS;
1649}
1650
jardineb5d44e2003-12-23 08:09:43 +00001651DEFUN (no_topology_baseis,
1652 no_topology_baseis_cmd,
1653 "no topology base-is WORD",
1654 NO_STR
hassof1082d12005-09-19 04:23:34 +00001655 "Topology generation for IS-IS\n"
1656 "A Network IS Base for this topology\n"
1657 "XXXX.XXXX.XXXX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001658{
1659 struct isis_area *area;
1660
1661 area = vty->index;
1662 assert (area);
1663
hassof390d2c2004-09-10 20:48:21 +00001664 memcpy (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS, ISIS_SYS_ID_LEN);
jardineb5d44e2003-12-23 08:09:43 +00001665 return CMD_SUCCESS;
1666}
1667
hassof1082d12005-09-19 04:23:34 +00001668ALIAS (no_topology_baseis,
1669 no_topology_baseis_noid_cmd,
1670 "no topology base-is",
1671 NO_STR
1672 "Topology generation for IS-IS\n"
1673 "A Network IS Base for this topology\n")
1674
1675DEFUN (topology_basedynh,
1676 topology_basedynh_cmd,
1677 "topology base-dynh WORD",
1678 "Topology generation for IS-IS\n"
1679 "Dynamic hostname base for this topology\n"
1680 "Dynamic hostname base\n")
1681{
1682 struct isis_area *area;
1683
1684 area = vty->index;
1685 assert (area);
1686
1687 /* I hope that it's enough. */
1688 area->topology_basedynh = strndup (argv[0], 16);
1689 return CMD_SUCCESS;
1690}
jardineb5d44e2003-12-23 08:09:43 +00001691#endif /* TOPOLOGY_GENERATE */
1692
1693DEFUN (lsp_lifetime,
1694 lsp_lifetime_cmd,
1695 "lsp-lifetime <380-65535>",
1696 "Maximum LSP lifetime\n"
hassof390d2c2004-09-10 20:48:21 +00001697 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001698{
1699 struct isis_area *area;
1700 uint16_t interval;
1701
1702 area = vty->index;
1703 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001704
jardineb5d44e2003-12-23 08:09:43 +00001705 interval = atoi (argv[0]);
1706
hassof390d2c2004-09-10 20:48:21 +00001707 if (interval < ISIS_MIN_LSP_LIFETIME)
1708 {
1709 vty_out (vty, "LSP lifetime (%us) below %us%s",
1710 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001711
hassof390d2c2004-09-10 20:48:21 +00001712 return CMD_WARNING;
1713 }
jardineb5d44e2003-12-23 08:09:43 +00001714
1715
1716 area->max_lsp_lifetime[0] = interval;
1717 area->max_lsp_lifetime[1] = interval;
hassof390d2c2004-09-10 20:48:21 +00001718 area->lsp_refresh[0] = interval - 300;
1719 area->lsp_refresh[1] = interval - 300;
jardineb5d44e2003-12-23 08:09:43 +00001720
hassof390d2c2004-09-10 20:48:21 +00001721 if (area->t_lsp_refresh[0])
1722 {
1723 thread_cancel (area->t_lsp_refresh[0]);
1724 thread_execute (master, lsp_refresh_l1, area, 0);
1725 }
jardineb5d44e2003-12-23 08:09:43 +00001726
hassof390d2c2004-09-10 20:48:21 +00001727 if (area->t_lsp_refresh[1])
1728 {
1729 thread_cancel (area->t_lsp_refresh[1]);
1730 thread_execute (master, lsp_refresh_l2, area, 0);
1731 }
jardineb5d44e2003-12-23 08:09:43 +00001732
1733
1734 return CMD_SUCCESS;
1735}
1736
1737DEFUN (no_lsp_lifetime,
1738 no_lsp_lifetime_cmd,
1739 "no lsp-lifetime",
1740 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001741 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001742{
1743 struct isis_area *area;
1744
1745 area = vty->index;
1746 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001747
1748 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200s */
1749 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200s */
1750 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900s */
1751 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001752
1753 return CMD_SUCCESS;
1754}
1755
1756ALIAS (no_lsp_lifetime,
1757 no_lsp_lifetime_arg_cmd,
1758 "no lsp-lifetime <380-65535>",
1759 NO_STR
1760 "Maximum LSP lifetime\n"
hassof390d2c2004-09-10 20:48:21 +00001761 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001762
1763DEFUN (lsp_lifetime_l1,
1764 lsp_lifetime_l1_cmd,
1765 "lsp-lifetime level-1 <380-65535>",
1766 "Maximum LSP lifetime for Level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001767 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001768{
1769 struct isis_area *area;
1770 uint16_t interval;
1771
1772 area = vty->index;
1773 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001774
jardineb5d44e2003-12-23 08:09:43 +00001775 interval = atoi (argv[0]);
1776
hassof390d2c2004-09-10 20:48:21 +00001777 if (interval < ISIS_MIN_LSP_LIFETIME)
1778 {
1779 vty_out (vty, "Level-1 LSP lifetime (%us) below %us%s",
1780 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001781
hassof390d2c2004-09-10 20:48:21 +00001782 return CMD_WARNING;
1783 }
jardineb5d44e2003-12-23 08:09:43 +00001784
1785
1786 area->max_lsp_lifetime[0] = interval;
hassof390d2c2004-09-10 20:48:21 +00001787 area->lsp_refresh[0] = interval - 300;
jardineb5d44e2003-12-23 08:09:43 +00001788
1789 return CMD_SUCCESS;
1790}
1791
1792DEFUN (no_lsp_lifetime_l1,
1793 no_lsp_lifetime_l1_cmd,
1794 "no lsp-lifetime level-1",
1795 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001796 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001797{
1798 struct isis_area *area;
1799
1800 area = vty->index;
1801 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001802
1803 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200s */
1804 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001805
1806 return CMD_SUCCESS;
1807}
1808
1809ALIAS (no_lsp_lifetime_l1,
1810 no_lsp_lifetime_l1_arg_cmd,
1811 "no lsp-lifetime level-1 <380-65535>",
1812 NO_STR
1813 "Maximum LSP lifetime for Level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001814 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001815
1816DEFUN (lsp_lifetime_l2,
1817 lsp_lifetime_l2_cmd,
1818 "lsp-lifetime level-2 <380-65535>",
1819 "Maximum LSP lifetime for Level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001820 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001821{
1822 struct isis_area *area;
1823 uint16_t interval;
1824
1825 area = vty->index;
1826 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001827
jardineb5d44e2003-12-23 08:09:43 +00001828 interval = atoi (argv[0]);
1829
hassof390d2c2004-09-10 20:48:21 +00001830 if (interval < ISIS_MIN_LSP_LIFETIME)
1831 {
1832 vty_out (vty, "Level-2 LSP lifetime (%us) below %us%s",
1833 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001834
hassof390d2c2004-09-10 20:48:21 +00001835 return CMD_WARNING;
1836 }
jardineb5d44e2003-12-23 08:09:43 +00001837
1838 area->max_lsp_lifetime[1] = interval;
1839 area->lsp_refresh[1] = interval - 300;
1840
1841 return CMD_SUCCESS;
1842}
1843
1844DEFUN (no_lsp_lifetime_l2,
1845 no_lsp_lifetime_l2_cmd,
1846 "no lsp-lifetime level-2",
1847 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001848 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001849{
1850 struct isis_area *area;
1851
1852 area = vty->index;
1853 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001854
1855 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200s */
1856 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001857
1858 return CMD_SUCCESS;
1859}
1860
1861ALIAS (no_lsp_lifetime_l2,
1862 no_lsp_lifetime_l2_arg_cmd,
1863 "no lsp-lifetime level-2 <380-65535>",
1864 NO_STR
1865 "Maximum LSP lifetime for Level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001866 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001867
1868/* IS-IS configuration write function */
1869int
1870isis_config_write (struct vty *vty)
1871{
1872 int write = 0;
jardineb5d44e2003-12-23 08:09:43 +00001873
hassof390d2c2004-09-10 20:48:21 +00001874 if (isis != NULL)
1875 {
1876 struct isis_area *area;
paul1eb8ef22005-04-07 07:30:20 +00001877 struct listnode *node, *nnode;
1878 struct listnode *node2, *nnode2;
jardineb5d44e2003-12-23 08:09:43 +00001879
paul1eb8ef22005-04-07 07:30:20 +00001880 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
hassof390d2c2004-09-10 20:48:21 +00001881 {
1882 /* ISIS - Area name */
1883 vty_out (vty, "router isis %s%s", area->area_tag, VTY_NEWLINE);
1884 write++;
1885 /* ISIS - Net */
1886 if (listcount (area->area_addrs) > 0)
1887 {
1888 struct area_addr *area_addr;
paul1eb8ef22005-04-07 07:30:20 +00001889 for (ALL_LIST_ELEMENTS (area->area_addrs, node2, nnode2, area_addr))
hassof390d2c2004-09-10 20:48:21 +00001890 {
1891 vty_out (vty, " net %s%s",
1892 isonet_print (area_addr->area_addr,
1893 area_addr->addr_len + ISIS_SYS_ID_LEN +
1894 1), VTY_NEWLINE);
1895 write++;
1896 }
1897 }
1898 /* ISIS - Dynamic hostname - Defaults to true so only display if false */
1899 if (!area->dynhostname)
1900 {
1901 vty_out (vty, " no hostname dynamic%s", VTY_NEWLINE);
1902 write++;
1903 }
1904 /* ISIS - Metric-Style - when true displays wide */
1905 if (area->newmetric)
1906 {
hasso2984d262005-09-26 16:49:07 +00001907 if (!area->oldmetric)
1908 vty_out (vty, " metric-style wide%s", VTY_NEWLINE);
1909 else
1910 vty_out (vty, " metric-style transition%s", VTY_NEWLINE);
hassof390d2c2004-09-10 20:48:21 +00001911 write++;
1912 }
hasso2984d262005-09-26 16:49:07 +00001913
hassof390d2c2004-09-10 20:48:21 +00001914 /* ISIS - Area is-type (level-1-2 is default) */
1915 if (area->is_type == IS_LEVEL_1)
1916 {
1917 vty_out (vty, " is-type level-1%s", VTY_NEWLINE);
1918 write++;
1919 }
1920 else
1921 {
1922 if (area->is_type == IS_LEVEL_2)
1923 {
1924 vty_out (vty, " is-type level-2-only%s", VTY_NEWLINE);
1925 write++;
1926 }
1927 }
1928 /* ISIS - Lsp generation interval */
1929 if (area->lsp_gen_interval[0] == area->lsp_gen_interval[1])
1930 {
1931 if (area->lsp_gen_interval[0] != LSP_GEN_INTERVAL_DEFAULT)
1932 {
1933 vty_out (vty, " lsp-gen-interval %d%s",
1934 area->lsp_gen_interval[0], VTY_NEWLINE);
1935 write++;
1936 }
1937 }
1938 else
1939 {
1940 if (area->lsp_gen_interval[0] != LSP_GEN_INTERVAL_DEFAULT)
1941 {
1942 vty_out (vty, " lsp-gen-interval level-1 %d%s",
1943 area->lsp_gen_interval[0], VTY_NEWLINE);
1944 write++;
1945 }
1946 if (area->lsp_gen_interval[1] != LSP_GEN_INTERVAL_DEFAULT)
1947 {
1948 vty_out (vty, " lsp-gen-interval level-2 %d%s",
1949 area->lsp_gen_interval[1], VTY_NEWLINE);
1950 write++;
1951 }
1952 }
1953 /* ISIS - LSP lifetime */
1954 if (area->max_lsp_lifetime[0] == area->max_lsp_lifetime[1])
1955 {
1956 if (area->max_lsp_lifetime[0] != MAX_AGE)
1957 {
1958 vty_out (vty, " lsp-lifetime %u%s", area->max_lsp_lifetime[0],
1959 VTY_NEWLINE);
1960 write++;
1961 }
1962 }
1963 else
1964 {
1965 if (area->max_lsp_lifetime[0] != MAX_AGE)
1966 {
1967 vty_out (vty, " lsp-lifetime level-1 %u%s",
1968 area->max_lsp_lifetime[0], VTY_NEWLINE);
1969 write++;
1970 }
1971 if (area->max_lsp_lifetime[1] != MAX_AGE)
1972 {
1973 vty_out (vty, " lsp-lifetime level-2 %u%s",
1974 area->max_lsp_lifetime[1], VTY_NEWLINE);
1975 write++;
1976 }
1977 }
hasso53c997c2004-09-15 16:21:59 +00001978 /* Authentication passwords. */
1979 if (area->area_passwd.len > 0)
1980 {
hasso1cbc5622005-01-01 10:29:51 +00001981 vty_out(vty, " area-password %s", area->area_passwd.passwd);
1982 if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND))
1983 {
1984 vty_out(vty, " authenticate snp ");
1985 if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV))
1986 vty_out(vty, "validate");
1987 else
1988 vty_out(vty, "send-only");
1989 }
1990 vty_out(vty, "%s", VTY_NEWLINE);
hasso53c997c2004-09-15 16:21:59 +00001991 write++;
1992 }
1993 if (area->domain_passwd.len > 0)
1994 {
hasso1cbc5622005-01-01 10:29:51 +00001995 vty_out(vty, " domain-password %s", area->domain_passwd.passwd);
1996 if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND))
1997 {
1998 vty_out(vty, " authenticate snp ");
1999 if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV))
2000 vty_out(vty, "validate");
2001 else
2002 vty_out(vty, "send-only");
2003 }
2004 vty_out(vty, "%s", VTY_NEWLINE);
hasso53c997c2004-09-15 16:21:59 +00002005 write++;
2006 }
hassof1082d12005-09-19 04:23:34 +00002007
hassof390d2c2004-09-10 20:48:21 +00002008#ifdef TOPOLOGY_GENERATE
hassof1082d12005-09-19 04:23:34 +00002009 if (memcmp (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS,
2010 ISIS_SYS_ID_LEN))
2011 {
2012 vty_out (vty, " topology base-is %s%s",
2013 sysid_print (area->topology_baseis), VTY_NEWLINE);
2014 write++;
2015 }
2016 if (area->topology_basedynh)
2017 {
2018 vty_out (vty, " topology base-dynh %s%s",
2019 area->topology_basedynh, VTY_NEWLINE);
2020 write++;
2021 }
2022 /* We save the whole command line here. */
2023 if (strlen(area->top_params))
hassof390d2c2004-09-10 20:48:21 +00002024 {
2025 vty_out (vty, " %s%s", area->top_params, VTY_NEWLINE);
2026 write++;
2027 }
hassof390d2c2004-09-10 20:48:21 +00002028#endif /* TOPOLOGY_GENERATE */
hassof1082d12005-09-19 04:23:34 +00002029
hassof390d2c2004-09-10 20:48:21 +00002030 }
jardineb5d44e2003-12-23 08:09:43 +00002031 }
hassof390d2c2004-09-10 20:48:21 +00002032
jardineb5d44e2003-12-23 08:09:43 +00002033 return write;
2034}
2035
hassof390d2c2004-09-10 20:48:21 +00002036struct cmd_node isis_node = {
jardineb5d44e2003-12-23 08:09:43 +00002037 ISIS_NODE,
hasso2097cd82003-12-23 11:51:08 +00002038 "%s(config-router)# ",
jardineb5d44e2003-12-23 08:09:43 +00002039 1
2040};
2041
hassof390d2c2004-09-10 20:48:21 +00002042void
jardineb5d44e2003-12-23 08:09:43 +00002043isis_init ()
2044{
jardineb5d44e2003-12-23 08:09:43 +00002045 /* Install IS-IS top node */
2046 install_node (&isis_node, isis_config_write);
hassof390d2c2004-09-10 20:48:21 +00002047
jardineb5d44e2003-12-23 08:09:43 +00002048 install_element (VIEW_NODE, &show_clns_neighbors_cmd);
2049 install_element (VIEW_NODE, &show_isis_neighbors_cmd);
2050 install_element (VIEW_NODE, &show_clns_neighbors_detail_cmd);
2051 install_element (VIEW_NODE, &show_isis_neighbors_detail_cmd);
2052
2053 install_element (VIEW_NODE, &show_hostname_cmd);
2054 install_element (VIEW_NODE, &show_database_cmd);
2055 install_element (VIEW_NODE, &show_database_detail_cmd);
2056
2057 install_element (ENABLE_NODE, &show_clns_neighbors_cmd);
2058 install_element (ENABLE_NODE, &show_isis_neighbors_cmd);
2059 install_element (ENABLE_NODE, &show_clns_neighbors_detail_cmd);
2060 install_element (ENABLE_NODE, &show_isis_neighbors_detail_cmd);
2061
2062 install_element (ENABLE_NODE, &show_hostname_cmd);
2063 install_element (ENABLE_NODE, &show_database_cmd);
2064 install_element (ENABLE_NODE, &show_database_detail_cmd);
2065 install_element (ENABLE_NODE, &show_debugging_cmd);
2066
hassof390d2c2004-09-10 20:48:21 +00002067 install_node (&debug_node, config_write_debug);
jardin9e867fe2003-12-23 08:56:18 +00002068
jardineb5d44e2003-12-23 08:09:43 +00002069 install_element (ENABLE_NODE, &debug_isis_adj_cmd);
2070 install_element (ENABLE_NODE, &no_debug_isis_adj_cmd);
2071 install_element (ENABLE_NODE, &debug_isis_csum_cmd);
2072 install_element (ENABLE_NODE, &no_debug_isis_csum_cmd);
2073 install_element (ENABLE_NODE, &debug_isis_lupd_cmd);
2074 install_element (ENABLE_NODE, &no_debug_isis_lupd_cmd);
2075 install_element (ENABLE_NODE, &debug_isis_err_cmd);
2076 install_element (ENABLE_NODE, &no_debug_isis_err_cmd);
2077 install_element (ENABLE_NODE, &debug_isis_snp_cmd);
2078 install_element (ENABLE_NODE, &no_debug_isis_snp_cmd);
2079 install_element (ENABLE_NODE, &debug_isis_upd_cmd);
2080 install_element (ENABLE_NODE, &no_debug_isis_upd_cmd);
2081 install_element (ENABLE_NODE, &debug_isis_spfevents_cmd);
2082 install_element (ENABLE_NODE, &no_debug_isis_spfevents_cmd);
2083 install_element (ENABLE_NODE, &debug_isis_spfstats_cmd);
2084 install_element (ENABLE_NODE, &no_debug_isis_spfstats_cmd);
2085 install_element (ENABLE_NODE, &debug_isis_spftrigg_cmd);
2086 install_element (ENABLE_NODE, &no_debug_isis_spftrigg_cmd);
2087 install_element (ENABLE_NODE, &debug_isis_rtevents_cmd);
2088 install_element (ENABLE_NODE, &no_debug_isis_rtevents_cmd);
2089 install_element (ENABLE_NODE, &debug_isis_events_cmd);
2090 install_element (ENABLE_NODE, &no_debug_isis_events_cmd);
2091
jardin9e867fe2003-12-23 08:56:18 +00002092 install_element (CONFIG_NODE, &debug_isis_adj_cmd);
2093 install_element (CONFIG_NODE, &no_debug_isis_adj_cmd);
2094 install_element (CONFIG_NODE, &debug_isis_csum_cmd);
2095 install_element (CONFIG_NODE, &no_debug_isis_csum_cmd);
2096 install_element (CONFIG_NODE, &debug_isis_lupd_cmd);
2097 install_element (CONFIG_NODE, &no_debug_isis_lupd_cmd);
2098 install_element (CONFIG_NODE, &debug_isis_err_cmd);
2099 install_element (CONFIG_NODE, &no_debug_isis_err_cmd);
2100 install_element (CONFIG_NODE, &debug_isis_snp_cmd);
2101 install_element (CONFIG_NODE, &no_debug_isis_snp_cmd);
2102 install_element (CONFIG_NODE, &debug_isis_upd_cmd);
2103 install_element (CONFIG_NODE, &no_debug_isis_upd_cmd);
2104 install_element (CONFIG_NODE, &debug_isis_spfevents_cmd);
2105 install_element (CONFIG_NODE, &no_debug_isis_spfevents_cmd);
2106 install_element (CONFIG_NODE, &debug_isis_spfstats_cmd);
2107 install_element (CONFIG_NODE, &no_debug_isis_spfstats_cmd);
2108 install_element (CONFIG_NODE, &debug_isis_spftrigg_cmd);
2109 install_element (CONFIG_NODE, &no_debug_isis_spftrigg_cmd);
2110 install_element (CONFIG_NODE, &debug_isis_rtevents_cmd);
2111 install_element (CONFIG_NODE, &no_debug_isis_rtevents_cmd);
2112 install_element (CONFIG_NODE, &debug_isis_events_cmd);
2113 install_element (CONFIG_NODE, &no_debug_isis_events_cmd);
2114
jardineb5d44e2003-12-23 08:09:43 +00002115 install_element (CONFIG_NODE, &router_isis_cmd);
2116 install_element (CONFIG_NODE, &no_router_isis_cmd);
2117
2118 install_default (ISIS_NODE);
2119
2120 install_element (ISIS_NODE, &net_cmd);
2121 install_element (ISIS_NODE, &no_net_cmd);
2122
2123 install_element (ISIS_NODE, &is_type_cmd);
2124 install_element (ISIS_NODE, &no_is_type_cmd);
2125
2126 install_element (ISIS_NODE, &area_passwd_cmd);
hasso1cbc5622005-01-01 10:29:51 +00002127 install_element (ISIS_NODE, &area_passwd_snpauth_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002128 install_element (ISIS_NODE, &no_area_passwd_cmd);
2129
2130 install_element (ISIS_NODE, &domain_passwd_cmd);
hasso1cbc5622005-01-01 10:29:51 +00002131 install_element (ISIS_NODE, &domain_passwd_snpauth_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002132 install_element (ISIS_NODE, &no_domain_passwd_cmd);
2133
2134 install_element (ISIS_NODE, &lsp_gen_interval_cmd);
2135 install_element (ISIS_NODE, &no_lsp_gen_interval_cmd);
2136 install_element (ISIS_NODE, &no_lsp_gen_interval_arg_cmd);
2137 install_element (ISIS_NODE, &lsp_gen_interval_l1_cmd);
2138 install_element (ISIS_NODE, &no_lsp_gen_interval_l1_cmd);
2139 install_element (ISIS_NODE, &no_lsp_gen_interval_l1_arg_cmd);
2140 install_element (ISIS_NODE, &lsp_gen_interval_l2_cmd);
2141 install_element (ISIS_NODE, &no_lsp_gen_interval_l2_cmd);
2142 install_element (ISIS_NODE, &no_lsp_gen_interval_l2_arg_cmd);
2143
2144 install_element (ISIS_NODE, &spf_interval_cmd);
2145 install_element (ISIS_NODE, &no_spf_interval_cmd);
2146 install_element (ISIS_NODE, &no_spf_interval_arg_cmd);
2147 install_element (ISIS_NODE, &spf_interval_l1_cmd);
2148 install_element (ISIS_NODE, &no_spf_interval_l1_cmd);
2149 install_element (ISIS_NODE, &no_spf_interval_l1_arg_cmd);
2150 install_element (ISIS_NODE, &spf_interval_l2_cmd);
2151 install_element (ISIS_NODE, &no_spf_interval_l2_cmd);
2152 install_element (ISIS_NODE, &no_spf_interval_l2_arg_cmd);
hassof390d2c2004-09-10 20:48:21 +00002153
jardineb5d44e2003-12-23 08:09:43 +00002154 install_element (ISIS_NODE, &lsp_lifetime_cmd);
2155 install_element (ISIS_NODE, &no_lsp_lifetime_cmd);
2156 install_element (ISIS_NODE, &no_lsp_lifetime_arg_cmd);
2157 install_element (ISIS_NODE, &lsp_lifetime_l1_cmd);
2158 install_element (ISIS_NODE, &no_lsp_lifetime_l1_cmd);
2159 install_element (ISIS_NODE, &no_lsp_lifetime_l1_arg_cmd);
2160 install_element (ISIS_NODE, &lsp_lifetime_l2_cmd);
2161 install_element (ISIS_NODE, &no_lsp_lifetime_l2_cmd);
2162 install_element (ISIS_NODE, &no_lsp_lifetime_l2_arg_cmd);
2163
2164 install_element (ISIS_NODE, &dynamic_hostname_cmd);
2165 install_element (ISIS_NODE, &no_dynamic_hostname_cmd);
2166
2167 install_element (ISIS_NODE, &metric_style_cmd);
2168 install_element (ISIS_NODE, &no_metric_style_cmd);
2169#ifdef TOPOLOGY_GENERATE
2170 install_element (ISIS_NODE, &topology_generate_grid_cmd);
2171 install_element (ISIS_NODE, &topology_baseis_cmd);
hassof1082d12005-09-19 04:23:34 +00002172 install_element (ISIS_NODE, &topology_basedynh_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002173 install_element (ISIS_NODE, &no_topology_baseis_cmd);
hassof1082d12005-09-19 04:23:34 +00002174 install_element (ISIS_NODE, &no_topology_baseis_noid_cmd);
hassof695b012005-04-02 19:03:39 +00002175 install_element (VIEW_NODE, &show_isis_generated_topology_cmd);
2176 install_element (ENABLE_NODE, &show_isis_generated_topology_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002177#endif /* TOPOLOGY_GENERATE */
2178
hassof390d2c2004-09-10 20:48:21 +00002179 isis_new (0);
jardineb5d44e2003-12-23 08:09:43 +00002180 isis_circuit_init ();
2181 isis_zebra_init ();
2182 isis_spf_cmds_init ();
2183}