blob: 2a60b8890147830953834537cefc13af8cccd8e1 [file] [log] [blame]
jardineb5d44e2003-12-23 08:09:43 +00001/*
2 * IS-IS Rout(e)ing protocol - isisd.c
3 *
4 * Copyright (C) 2001,2002 Sampo Saaristo
5 * Tampere University of Technology
6 * Institute of Communications Engineering
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public Licenseas published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
17
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 */
22
jardineb5d44e2003-12-23 08:09:43 +000023#include <zebra.h>
jardineb5d44e2003-12-23 08:09:43 +000024
25#include "thread.h"
26#include "vty.h"
27#include "command.h"
28#include "log.h"
29#include "memory.h"
30#include "linklist.h"
31#include "if.h"
32#include "hash.h"
33#include "stream.h"
34#include "prefix.h"
35#include "table.h"
36
37#include "isisd/dict.h"
38#include "isisd/include-netbsd/iso.h"
39#include "isisd/isis_constants.h"
40#include "isisd/isis_common.h"
41#include "isisd/isis_circuit.h"
42#include "isisd/isis_flags.h"
43#include "isisd/isisd.h"
44#include "isisd/isis_dynhn.h"
45#include "isisd/isis_adjacency.h"
46#include "isisd/isis_pdu.h"
47#include "isisd/isis_misc.h"
48#include "isisd/isis_constants.h"
49#include "isisd/isis_tlv.h"
50#include "isisd/isis_lsp.h"
51#include "isisd/isis_spf.h"
52#include "isisd/isis_route.h"
53#include "isisd/isis_zebra.h"
54#include "isisd/isis_events.h"
55
56#ifdef TOPOLOGY_GENERATE
57#include "spgrid.h"
hassof390d2c2004-09-10 20:48:21 +000058u_char DEFAULT_TOPOLOGY_BASEIS[6] = { 0xFE, 0xED, 0xFE, 0xED, 0x00, 0x00 };
jardineb5d44e2003-12-23 08:09:43 +000059#endif /* TOPOLOGY_GENERATE */
60
jardineb5d44e2003-12-23 08:09:43 +000061struct isis *isis = NULL;
hasso73d1aea2004-09-24 10:45:28 +000062extern struct thread_master *master;
jardineb5d44e2003-12-23 08:09:43 +000063
jardineb5d44e2003-12-23 08:09:43 +000064void
65isis_new (unsigned long process_id)
66{
hassoaac372f2005-09-01 17:52:33 +000067 isis = XCALLOC (MTYPE_ISIS, sizeof (struct isis));
jardineb5d44e2003-12-23 08:09:43 +000068 /*
69 * Default values
70 */
71 isis->max_area_addrs = 3;
72
73 isis->process_id = process_id;
74 isis->area_list = list_new ();
75 isis->init_circ_list = list_new ();
76 isis->uptime = time (NULL);
77 isis->nexthops = list_new ();
78#ifdef HAVE_IPV6
79 isis->nexthops6 = list_new ();
80#endif /* HAVE_IPV6 */
81 /*
82 * uncomment the next line for full debugs
83 */
hassof390d2c2004-09-10 20:48:21 +000084 /* isis->debugs = 0xFFFF; */
jardineb5d44e2003-12-23 08:09:43 +000085}
86
87struct isis_area *
88isis_area_create ()
89{
jardineb5d44e2003-12-23 08:09:43 +000090 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +000091
hassoaac372f2005-09-01 17:52:33 +000092 area = XCALLOC (MTYPE_ISIS_AREA, sizeof (struct isis_area));
jardineb5d44e2003-12-23 08:09:43 +000093
94 /*
95 * The first instance is level-1-2 rest are level-1, unless otherwise
96 * configured
97 */
98 if (listcount (isis->area_list) > 0)
99 area->is_type = IS_LEVEL_1;
100 else
101 area->is_type = IS_LEVEL_1_AND_2;
102 /*
103 * intialize the databases
104 */
105 area->lspdb[0] = lsp_db_init ();
106 area->lspdb[1] = lsp_db_init ();
hassof390d2c2004-09-10 20:48:21 +0000107
jardineb5d44e2003-12-23 08:09:43 +0000108 spftree_area_init (area);
109 area->route_table = route_table_init ();
110#ifdef HAVE_IPV6
111 area->route_table6 = route_table_init ();
112#endif /* HAVE_IPV6 */
113 area->circuit_list = list_new ();
114 area->area_addrs = list_new ();
hassof390d2c2004-09-10 20:48:21 +0000115 THREAD_TIMER_ON (master, area->t_tick, lsp_tick, area, 1);
jardineb5d44e2003-12-23 08:09:43 +0000116 area->flags.maxindex = -1;
117 /*
118 * Default values
119 */
hassof390d2c2004-09-10 20:48:21 +0000120 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200 */
121 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200 */
jardineb5d44e2003-12-23 08:09:43 +0000122 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
123 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
hassof390d2c2004-09-10 20:48:21 +0000124 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900 */
125 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900 */
jardineb5d44e2003-12-23 08:09:43 +0000126 area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
127 area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
128 area->dynhostname = 1;
hasso2984d262005-09-26 16:49:07 +0000129 area->oldmetric = 1;
jardineb5d44e2003-12-23 08:09:43 +0000130 area->lsp_frag_threshold = 90;
131#ifdef TOPOLOGY_GENERATE
132 memcpy (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS, ISIS_SYS_ID_LEN);
133#endif /* TOPOLOGY_GENERATE */
134
135 /* FIXME: Think of a better way... */
136 area->min_bcast_mtu = 1497;
137
138 return area;
139}
140
141struct isis_area *
hassof90a5f62004-10-11 13:11:56 +0000142isis_area_lookup (const char *area_tag)
jardineb5d44e2003-12-23 08:09:43 +0000143{
144 struct isis_area *area;
paul1eb8ef22005-04-07 07:30:20 +0000145 struct listnode *node, *nnode;
hassof390d2c2004-09-10 20:48:21 +0000146
paul1eb8ef22005-04-07 07:30:20 +0000147 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
jardineb5d44e2003-12-23 08:09:43 +0000148 if ((area->area_tag == NULL && area_tag == NULL) ||
hassof390d2c2004-09-10 20:48:21 +0000149 (area->area_tag && area_tag
150 && strcmp (area->area_tag, area_tag) == 0))
151 return area;
152
jardineb5d44e2003-12-23 08:09:43 +0000153 return NULL;
154}
155
hassof390d2c2004-09-10 20:48:21 +0000156int
hassof90a5f62004-10-11 13:11:56 +0000157isis_area_get (struct vty *vty, const char *area_tag)
jardineb5d44e2003-12-23 08:09:43 +0000158{
jardineb5d44e2003-12-23 08:09:43 +0000159 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000160
jardineb5d44e2003-12-23 08:09:43 +0000161 area = isis_area_lookup (area_tag);
hassof390d2c2004-09-10 20:48:21 +0000162
163 if (area)
164 {
165 vty->node = ISIS_NODE;
166 vty->index = area;
167 return CMD_SUCCESS;
168 }
169
jardineb5d44e2003-12-23 08:09:43 +0000170 area = isis_area_create ();
171 area->area_tag = strdup (area_tag);
172 listnode_add (isis->area_list, area);
hassof390d2c2004-09-10 20:48:21 +0000173
hassoc89c05d2005-09-04 21:36:36 +0000174 if (isis->debugs & DEBUG_EVENTS)
175 zlog_debug ("New IS-IS area instance %s", area->area_tag);
jardineb5d44e2003-12-23 08:09:43 +0000176
177 vty->node = ISIS_NODE;
178 vty->index = area;
hassof390d2c2004-09-10 20:48:21 +0000179
jardineb5d44e2003-12-23 08:09:43 +0000180 return CMD_SUCCESS;
181}
182
183int
hassof90a5f62004-10-11 13:11:56 +0000184isis_area_destroy (struct vty *vty, const char *area_tag)
jardineb5d44e2003-12-23 08:09:43 +0000185{
jardineb5d44e2003-12-23 08:09:43 +0000186 struct isis_area *area;
paul1eb8ef22005-04-07 07:30:20 +0000187 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000188 struct isis_circuit *circuit;
189
190 area = isis_area_lookup (area_tag);
jardineb5d44e2003-12-23 08:09:43 +0000191
hassof390d2c2004-09-10 20:48:21 +0000192 if (area == NULL)
193 {
194 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
195 return CMD_WARNING;
jardineb5d44e2003-12-23 08:09:43 +0000196 }
hassof390d2c2004-09-10 20:48:21 +0000197
198 if (area->circuit_list)
199 {
paul1eb8ef22005-04-07 07:30:20 +0000200 for (ALL_LIST_ELEMENTS (area->circuit_list, node, nnode, circuit))
201 isis_circuit_del (circuit);
202
hassof390d2c2004-09-10 20:48:21 +0000203 list_delete (area->circuit_list);
204 }
jardineb5d44e2003-12-23 08:09:43 +0000205 listnode_delete (isis->area_list, area);
hassof390d2c2004-09-10 20:48:21 +0000206 THREAD_TIMER_OFF (area->t_tick);
jardineb5d44e2003-12-23 08:09:43 +0000207 if (area->t_remove_aged)
208 thread_cancel (area->t_remove_aged);
hassof390d2c2004-09-10 20:48:21 +0000209 THREAD_TIMER_OFF (area->t_lsp_refresh[0]);
210 THREAD_TIMER_OFF (area->t_lsp_refresh[1]);
jardineb5d44e2003-12-23 08:09:43 +0000211
212 XFREE (MTYPE_ISIS_AREA, area);
hassof390d2c2004-09-10 20:48:21 +0000213
jardineb5d44e2003-12-23 08:09:43 +0000214 return CMD_SUCCESS;
215}
216
hassof390d2c2004-09-10 20:48:21 +0000217int
hassof7c43dc2004-09-26 16:24:14 +0000218area_net_title (struct vty *vty, u_char *net_title)
jardineb5d44e2003-12-23 08:09:43 +0000219{
jardineb5d44e2003-12-23 08:09:43 +0000220 struct isis_area *area;
221 struct area_addr *addr;
222 struct area_addr *addrp;
paul1eb8ef22005-04-07 07:30:20 +0000223 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000224
225 u_char buff[255];
226 area = vty->index;
227
hassof390d2c2004-09-10 20:48:21 +0000228 if (!area)
229 {
230 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
231 return CMD_WARNING;
232 }
jardineb5d44e2003-12-23 08:09:43 +0000233
234 /* We check that we are not over the maximal number of addresses */
hassof390d2c2004-09-10 20:48:21 +0000235 if (listcount (area->area_addrs) >= isis->max_area_addrs)
236 {
237 vty_out (vty, "Maximum of area addresses (%d) already reached %s",
238 isis->max_area_addrs, VTY_NEWLINE);
239 return CMD_WARNING;
240 }
jardineb5d44e2003-12-23 08:09:43 +0000241
242 addr = XMALLOC (MTYPE_ISIS_AREA_ADDR, sizeof (struct area_addr));
243 addr->addr_len = dotformat2buff (buff, net_title);
244 memcpy (addr->area_addr, buff, addr->addr_len);
245#ifdef EXTREME_DEBUG
hasso529d65b2004-12-24 00:14:50 +0000246 zlog_debug ("added area address %s for area %s (address length %d)",
jardineb5d44e2003-12-23 08:09:43 +0000247 net_title, area->area_tag, addr->addr_len);
248#endif /* EXTREME_DEBUG */
hassof390d2c2004-09-10 20:48:21 +0000249 if (addr->addr_len < 8 || addr->addr_len > 20)
250 {
251 zlog_warn ("area address must be at least 8..20 octets long (%d)",
252 addr->addr_len);
jardineb5d44e2003-12-23 08:09:43 +0000253 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
254 return CMD_WARNING;
255 }
256
hassof390d2c2004-09-10 20:48:21 +0000257 if (isis->sysid_set == 0)
258 {
259 /*
260 * First area address - get the SystemID for this router
261 */
262 memcpy (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN), ISIS_SYS_ID_LEN);
263 isis->sysid_set = 1;
hassoc89c05d2005-09-04 21:36:36 +0000264 if (isis->debugs & DEBUG_EVENTS)
265 zlog_debug ("Router has SystemID %s", sysid_print (isis->sysid));
jardineb5d44e2003-12-23 08:09:43 +0000266 }
hassof390d2c2004-09-10 20:48:21 +0000267 else
268 {
269 /*
270 * Check that the SystemID portions match
271 */
272 if (memcmp (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN),
273 ISIS_SYS_ID_LEN))
274 {
275 vty_out (vty,
276 "System ID must not change when defining additional area"
277 " addresses%s", VTY_NEWLINE);
278 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
279 return CMD_WARNING;
280 }
jardineb5d44e2003-12-23 08:09:43 +0000281
hassof390d2c2004-09-10 20:48:21 +0000282 /* now we see that we don't already have this address */
paul1eb8ef22005-04-07 07:30:20 +0000283 for (ALL_LIST_ELEMENTS (area->area_addrs, node, nnode, addrp))
hassof390d2c2004-09-10 20:48:21 +0000284 {
285 if ((addrp->addr_len + ISIS_SYS_ID_LEN + 1) == (addr->addr_len))
286 {
287 if (!memcmp (addrp->area_addr, addr->area_addr, addr->addr_len))
288 {
289 XFREE (MTYPE_ISIS_AREA_ADDR, addr);
290 return CMD_SUCCESS; /* silent fail */
291 }
292 }
293 }
294
295 }
jardineb5d44e2003-12-23 08:09:43 +0000296 /*
297 * Forget the systemID part of the address
298 */
299 addr->addr_len -= (ISIS_SYS_ID_LEN + 1);
300 listnode_add (area->area_addrs, addr);
301
302 /* only now we can safely generate our LSPs for this area */
hassof390d2c2004-09-10 20:48:21 +0000303 if (listcount (area->area_addrs) > 0)
304 {
305 lsp_l1_generate (area);
306 lsp_l2_generate (area);
307 }
jardineb5d44e2003-12-23 08:09:43 +0000308
309 return CMD_SUCCESS;
310}
311
312int
hassof7c43dc2004-09-26 16:24:14 +0000313area_clear_net_title (struct vty *vty, u_char *net_title)
jardineb5d44e2003-12-23 08:09:43 +0000314{
315 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000316 struct area_addr addr, *addrp = NULL;
paul1eb8ef22005-04-07 07:30:20 +0000317 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000318 u_char buff[255];
319
320 area = vty->index;
hassof390d2c2004-09-10 20:48:21 +0000321 if (!area)
322 {
323 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
324 return CMD_WARNING;
325 }
326
jardineb5d44e2003-12-23 08:09:43 +0000327 addr.addr_len = dotformat2buff (buff, net_title);
hassof390d2c2004-09-10 20:48:21 +0000328 if (addr.addr_len < 8 || addr.addr_len > 20)
329 {
330 vty_out (vty, "Unsupported area address length %d, should be 8...20 %s",
331 addr.addr_len, VTY_NEWLINE);
332 return CMD_WARNING;
333 }
334
335 memcpy (addr.area_addr, buff, (int) addr.addr_len);
336
paul1eb8ef22005-04-07 07:30:20 +0000337 for (ALL_LIST_ELEMENTS (area->area_addrs, node, nnode, addrp))
jardineb5d44e2003-12-23 08:09:43 +0000338 if (addrp->addr_len == addr.addr_len &&
339 !memcmp (addrp->area_addr, addr.area_addr, addr.addr_len))
hassof390d2c2004-09-10 20:48:21 +0000340 break;
341
342 if (!addrp)
343 {
344 vty_out (vty, "No area address %s for area %s %s", net_title,
345 area->area_tag, VTY_NEWLINE);
346 return CMD_WARNING;
347 }
348
jardineb5d44e2003-12-23 08:09:43 +0000349 listnode_delete (area->area_addrs, addrp);
hassof390d2c2004-09-10 20:48:21 +0000350
jardineb5d44e2003-12-23 08:09:43 +0000351 return CMD_SUCCESS;
352}
353
jardineb5d44e2003-12-23 08:09:43 +0000354/*
355 * 'show clns neighbors' command
356 */
357
358int
hassof390d2c2004-09-10 20:48:21 +0000359show_clns_neigh (struct vty *vty, char detail)
jardineb5d44e2003-12-23 08:09:43 +0000360{
paul1eb8ef22005-04-07 07:30:20 +0000361 struct listnode *anode, *annode, *cnode, *cnnode;
jardineb5d44e2003-12-23 08:09:43 +0000362 struct isis_area *area;
363 struct isis_circuit *circuit;
364 struct list *db;
365 int i;
366
hassof390d2c2004-09-10 20:48:21 +0000367 if (!isis)
368 {
369 vty_out (vty, "IS-IS Routing Process not enabled%s", VTY_NEWLINE);
370 return CMD_SUCCESS;
371 }
jardineb5d44e2003-12-23 08:09:43 +0000372
paul1eb8ef22005-04-07 07:30:20 +0000373 for (ALL_LIST_ELEMENTS (isis->area_list, anode, annode, area))
hassof390d2c2004-09-10 20:48:21 +0000374 {
hassof390d2c2004-09-10 20:48:21 +0000375 vty_out (vty, "Area %s:%s", area->area_tag, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000376
hassof390d2c2004-09-10 20:48:21 +0000377 if (detail == ISIS_UI_LEVEL_BRIEF)
378 vty_out (vty, " System Id Interface L State "
379 "Holdtime SNPA%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000380
paul1eb8ef22005-04-07 07:30:20 +0000381 for (ALL_LIST_ELEMENTS (area->circuit_list, cnode, cnnode, circuit))
hassof390d2c2004-09-10 20:48:21 +0000382 {
hassof390d2c2004-09-10 20:48:21 +0000383 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
384 {
385 for (i = 0; i < 2; i++)
386 {
387 db = circuit->u.bc.adjdb[i];
388 if (db && db->count)
389 {
390 if (detail == ISIS_UI_LEVEL_BRIEF)
391 isis_adjdb_iterate (db,
392 (void (*)
393 (struct isis_adjacency *,
394 void *)) isis_adj_print_vty,
395 vty);
396 if (detail == ISIS_UI_LEVEL_DETAIL)
397 isis_adjdb_iterate (db,
398 (void (*)
399 (struct isis_adjacency *,
400 void *))
401 isis_adj_print_vty_detail, vty);
402 if (detail == ISIS_UI_LEVEL_EXTENSIVE)
403 isis_adjdb_iterate (db,
404 (void (*)
405 (struct isis_adjacency *,
406 void *))
407 isis_adj_print_vty_extensive,
408 vty);
409 }
410 }
411 }
412 else if (circuit->circ_type == CIRCUIT_T_P2P &&
413 circuit->u.p2p.neighbor)
414 {
415 if (detail == ISIS_UI_LEVEL_BRIEF)
416 isis_adj_p2p_print_vty (circuit->u.p2p.neighbor, vty);
417 if (detail == ISIS_UI_LEVEL_DETAIL)
418 isis_adj_p2p_print_vty_detail (circuit->u.p2p.neighbor, vty);
419 if (detail == ISIS_UI_LEVEL_EXTENSIVE)
420 isis_adj_p2p_print_vty_extensive (circuit->u.p2p.neighbor,
421 vty);
422 }
423 }
jardineb5d44e2003-12-23 08:09:43 +0000424 }
hassof390d2c2004-09-10 20:48:21 +0000425
jardineb5d44e2003-12-23 08:09:43 +0000426 return CMD_SUCCESS;
427}
428
429DEFUN (show_clns_neighbors,
430 show_clns_neighbors_cmd,
431 "show clns neighbors",
432 SHOW_STR
433 "clns network information\n"
434 "CLNS neighbor adjacencies\n")
435{
hassof390d2c2004-09-10 20:48:21 +0000436 return show_clns_neigh (vty, ISIS_UI_LEVEL_BRIEF);
jardineb5d44e2003-12-23 08:09:43 +0000437}
438
439ALIAS (show_clns_neighbors,
440 show_isis_neighbors_cmd,
441 "show isis neighbors",
442 SHOW_STR
443 "IS-IS network information\n"
444 "IS-IS neighbor adjacencies\n")
445
446DEFUN (show_clns_neighbors_detail,
447 show_clns_neighbors_detail_cmd,
448 "show clns neighbors detail",
449 SHOW_STR
450 "clns network information\n"
451 "CLNS neighbor adjacencies\n"
452 "show detailed information\n")
453{
hassof390d2c2004-09-10 20:48:21 +0000454 return show_clns_neigh (vty, ISIS_UI_LEVEL_DETAIL);
jardineb5d44e2003-12-23 08:09:43 +0000455}
456
457ALIAS (show_clns_neighbors_detail,
458 show_isis_neighbors_detail_cmd,
459 "show isis neighbors detail",
460 SHOW_STR
461 "IS-IS network information\n"
462 "IS-IS neighbor adjacencies\n"
463 "show detailed information\n")
jardineb5d44e2003-12-23 08:09:43 +0000464/*
465 * 'isis debug', 'show debugging'
466 */
jardineb5d44e2003-12-23 08:09:43 +0000467void
468print_debug (struct vty *vty, int flags, int onoff)
469{
470 char onoffs[4];
471 if (onoff)
hassof390d2c2004-09-10 20:48:21 +0000472 strcpy (onoffs, "on");
jardineb5d44e2003-12-23 08:09:43 +0000473 else
hassof390d2c2004-09-10 20:48:21 +0000474 strcpy (onoffs, "off");
jardineb5d44e2003-12-23 08:09:43 +0000475
476 if (flags & DEBUG_ADJ_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000477 vty_out (vty, "IS-IS Adjacency related packets debugging is %s%s", onoffs,
478 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000479 if (flags & DEBUG_CHECKSUM_ERRORS)
hassof390d2c2004-09-10 20:48:21 +0000480 vty_out (vty, "IS-IS checksum errors debugging is %s%s", onoffs,
481 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000482 if (flags & DEBUG_LOCAL_UPDATES)
hassof390d2c2004-09-10 20:48:21 +0000483 vty_out (vty, "IS-IS local updates debugging is %s%s", onoffs,
484 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000485 if (flags & DEBUG_PROTOCOL_ERRORS)
hassof390d2c2004-09-10 20:48:21 +0000486 vty_out (vty, "IS-IS protocol errors debugging is %s%s", onoffs,
487 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000488 if (flags & DEBUG_SNP_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000489 vty_out (vty, "IS-IS CSNP/PSNP packets debugging is %s%s", onoffs,
490 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000491 if (flags & DEBUG_SPF_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000492 vty_out (vty, "IS-IS SPF events debugging is %s%s", onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000493 if (flags & DEBUG_SPF_STATS)
hassof390d2c2004-09-10 20:48:21 +0000494 vty_out (vty, "IS-IS SPF Timing and Statistics Data debugging is %s%s",
495 onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000496 if (flags & DEBUG_SPF_TRIGGERS)
hassof390d2c2004-09-10 20:48:21 +0000497 vty_out (vty, "IS-IS SPF triggering events debugging is %s%s", onoffs,
498 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000499 if (flags & DEBUG_UPDATE_PACKETS)
hassof390d2c2004-09-10 20:48:21 +0000500 vty_out (vty, "IS-IS Update related packet debugging is %s%s", onoffs,
501 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000502 if (flags & DEBUG_RTE_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000503 vty_out (vty, "IS-IS Route related debuggin is %s%s", onoffs,
504 VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000505 if (flags & DEBUG_EVENTS)
hassof390d2c2004-09-10 20:48:21 +0000506 vty_out (vty, "IS-IS Event debugging is %s%s", onoffs, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000507
508}
509
510DEFUN (show_debugging,
511 show_debugging_cmd,
512 "show debugging",
513 SHOW_STR
514 "State of each debugging option\n")
515{
hassof390d2c2004-09-10 20:48:21 +0000516 vty_out (vty, "IS-IS:%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000517 print_debug (vty, isis->debugs, 1);
518 return CMD_SUCCESS;
519}
520
jardin9e867fe2003-12-23 08:56:18 +0000521/* Debug node. */
hassof390d2c2004-09-10 20:48:21 +0000522static struct cmd_node debug_node = {
jardin9e867fe2003-12-23 08:56:18 +0000523 DEBUG_NODE,
hassof390d2c2004-09-10 20:48:21 +0000524 "",
525 1
jardin9e867fe2003-12-23 08:56:18 +0000526};
527
528static int
529config_write_debug (struct vty *vty)
530{
531 int write = 0;
532 int flags = isis->debugs;
533
hassof390d2c2004-09-10 20:48:21 +0000534 if (flags & DEBUG_ADJ_PACKETS)
535 {
536 vty_out (vty, "debug isis adj-packets%s", VTY_NEWLINE);
537 write++;
538 }
539 if (flags & DEBUG_CHECKSUM_ERRORS)
540 {
541 vty_out (vty, "debug isis checksum-errors%s", VTY_NEWLINE);
542 write++;
543 }
544 if (flags & DEBUG_LOCAL_UPDATES)
545 {
546 vty_out (vty, "debug isis local-updates%s", VTY_NEWLINE);
547 write++;
548 }
549 if (flags & DEBUG_PROTOCOL_ERRORS)
550 {
551 vty_out (vty, "debug isis protocol-errors%s", VTY_NEWLINE);
552 write++;
553 }
554 if (flags & DEBUG_SNP_PACKETS)
555 {
556 vty_out (vty, "debug isis snp-packets%s", VTY_NEWLINE);
557 write++;
558 }
559 if (flags & DEBUG_SPF_EVENTS)
560 {
561 vty_out (vty, "debug isis spf-events%s", VTY_NEWLINE);
562 write++;
563 }
564 if (flags & DEBUG_SPF_STATS)
565 {
566 vty_out (vty, "debug isis spf-statistics%s", VTY_NEWLINE);
567 write++;
568 }
569 if (flags & DEBUG_SPF_TRIGGERS)
570 {
571 vty_out (vty, "debug isis spf-triggers%s", VTY_NEWLINE);
572 write++;
573 }
574 if (flags & DEBUG_UPDATE_PACKETS)
575 {
576 vty_out (vty, "debug isis update-packets%s", VTY_NEWLINE);
577 write++;
578 }
579 if (flags & DEBUG_RTE_EVENTS)
580 {
581 vty_out (vty, "debug isis route-events%s", VTY_NEWLINE);
582 write++;
583 }
584 if (flags & DEBUG_EVENTS)
585 {
586 vty_out (vty, "debug isis events%s", VTY_NEWLINE);
587 write++;
588 }
jardin9e867fe2003-12-23 08:56:18 +0000589
590 return write;
591}
592
jardineb5d44e2003-12-23 08:09:43 +0000593DEFUN (debug_isis_adj,
594 debug_isis_adj_cmd,
595 "debug isis adj-packets",
596 DEBUG_STR
597 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000598 "IS-IS Adjacency related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000599{
600 isis->debugs |= DEBUG_ADJ_PACKETS;
hassof390d2c2004-09-10 20:48:21 +0000601 print_debug (vty, DEBUG_ADJ_PACKETS, 1);
jardineb5d44e2003-12-23 08:09:43 +0000602
603 return CMD_SUCCESS;
604}
605
606DEFUN (no_debug_isis_adj,
607 no_debug_isis_adj_cmd,
608 "no debug isis adj-packets",
609 UNDEBUG_STR
610 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000611 "IS-IS Adjacency related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000612{
jardineb5d44e2003-12-23 08:09:43 +0000613 isis->debugs &= ~DEBUG_ADJ_PACKETS;
614 print_debug (vty, DEBUG_ADJ_PACKETS, 0);
615
616 return CMD_SUCCESS;
617}
618
jardineb5d44e2003-12-23 08:09:43 +0000619DEFUN (debug_isis_csum,
620 debug_isis_csum_cmd,
621 "debug isis checksum-errors",
622 DEBUG_STR
623 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000624 "IS-IS LSP checksum errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000625{
626 isis->debugs |= DEBUG_CHECKSUM_ERRORS;
627 print_debug (vty, DEBUG_CHECKSUM_ERRORS, 1);
628
629 return CMD_SUCCESS;
630}
631
632DEFUN (no_debug_isis_csum,
633 no_debug_isis_csum_cmd,
634 "no debug isis checksum-errors",
635 UNDEBUG_STR
636 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000637 "IS-IS LSP checksum errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000638{
639 isis->debugs &= ~DEBUG_CHECKSUM_ERRORS;
640 print_debug (vty, DEBUG_CHECKSUM_ERRORS, 0);
hassof390d2c2004-09-10 20:48:21 +0000641
jardineb5d44e2003-12-23 08:09:43 +0000642 return CMD_SUCCESS;
643}
644
645DEFUN (debug_isis_lupd,
646 debug_isis_lupd_cmd,
647 "debug isis local-updates",
648 DEBUG_STR
649 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000650 "IS-IS local update packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000651{
652 isis->debugs |= DEBUG_LOCAL_UPDATES;
653 print_debug (vty, DEBUG_LOCAL_UPDATES, 1);
654
655 return CMD_SUCCESS;
656}
657
658DEFUN (no_debug_isis_lupd,
659 no_debug_isis_lupd_cmd,
660 "no debug isis local-updates",
661 UNDEBUG_STR
662 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000663 "IS-IS local update packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000664{
665 isis->debugs &= ~DEBUG_LOCAL_UPDATES;
hassof390d2c2004-09-10 20:48:21 +0000666 print_debug (vty, DEBUG_LOCAL_UPDATES, 0);
667
jardineb5d44e2003-12-23 08:09:43 +0000668 return CMD_SUCCESS;
669}
670
671DEFUN (debug_isis_err,
672 debug_isis_err_cmd,
hassof390d2c2004-09-10 20:48:21 +0000673 "debug isis protocol-errors",
jardineb5d44e2003-12-23 08:09:43 +0000674 DEBUG_STR
675 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000676 "IS-IS LSP protocol errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000677{
678 isis->debugs |= DEBUG_PROTOCOL_ERRORS;
679 print_debug (vty, DEBUG_PROTOCOL_ERRORS, 1);
680
681 return CMD_SUCCESS;
682}
683
684DEFUN (no_debug_isis_err,
685 no_debug_isis_err_cmd,
686 "no debug isis protocol-errors",
687 UNDEBUG_STR
688 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000689 "IS-IS LSP protocol errors\n")
jardineb5d44e2003-12-23 08:09:43 +0000690{
691 isis->debugs &= ~DEBUG_PROTOCOL_ERRORS;
692 print_debug (vty, DEBUG_PROTOCOL_ERRORS, 0);
hassof390d2c2004-09-10 20:48:21 +0000693
jardineb5d44e2003-12-23 08:09:43 +0000694 return CMD_SUCCESS;
695}
696
697DEFUN (debug_isis_snp,
698 debug_isis_snp_cmd,
699 "debug isis snp-packets",
700 DEBUG_STR
701 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000702 "IS-IS CSNP/PSNP packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000703{
704 isis->debugs |= DEBUG_SNP_PACKETS;
705 print_debug (vty, DEBUG_SNP_PACKETS, 1);
706
707 return CMD_SUCCESS;
708}
709
710DEFUN (no_debug_isis_snp,
711 no_debug_isis_snp_cmd,
712 "no debug isis snp-packets",
713 UNDEBUG_STR
714 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000715 "IS-IS CSNP/PSNP packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000716{
hassof390d2c2004-09-10 20:48:21 +0000717 isis->debugs &= ~DEBUG_SNP_PACKETS;
jardineb5d44e2003-12-23 08:09:43 +0000718 print_debug (vty, DEBUG_SNP_PACKETS, 0);
hassof390d2c2004-09-10 20:48:21 +0000719
jardineb5d44e2003-12-23 08:09:43 +0000720 return CMD_SUCCESS;
721}
722
jardineb5d44e2003-12-23 08:09:43 +0000723DEFUN (debug_isis_upd,
724 debug_isis_upd_cmd,
725 "debug isis update-packets",
726 DEBUG_STR
727 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000728 "IS-IS Update related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000729{
730 isis->debugs |= DEBUG_UPDATE_PACKETS;
731 print_debug (vty, DEBUG_UPDATE_PACKETS, 1);
732
733 return CMD_SUCCESS;
734}
735
736DEFUN (no_debug_isis_upd,
737 no_debug_isis_upd_cmd,
738 "no debug isis update-packets",
739 UNDEBUG_STR
740 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000741 "IS-IS Update related packets\n")
jardineb5d44e2003-12-23 08:09:43 +0000742{
743 isis->debugs &= ~DEBUG_UPDATE_PACKETS;
744 print_debug (vty, DEBUG_UPDATE_PACKETS, 0);
hassof390d2c2004-09-10 20:48:21 +0000745
jardineb5d44e2003-12-23 08:09:43 +0000746 return CMD_SUCCESS;
747}
748
jardineb5d44e2003-12-23 08:09:43 +0000749DEFUN (debug_isis_spfevents,
750 debug_isis_spfevents_cmd,
751 "debug isis spf-events",
752 DEBUG_STR
753 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000754 "IS-IS Shortest Path First Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000755{
756 isis->debugs |= DEBUG_SPF_EVENTS;
hassof390d2c2004-09-10 20:48:21 +0000757 print_debug (vty, DEBUG_SPF_EVENTS, 1);
jardineb5d44e2003-12-23 08:09:43 +0000758
759 return CMD_SUCCESS;
760}
761
762DEFUN (no_debug_isis_spfevents,
763 no_debug_isis_spfevents_cmd,
764 "no debug isis spf-events",
765 UNDEBUG_STR
766 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000767 "IS-IS Shortest Path First Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000768{
769 isis->debugs &= ~DEBUG_SPF_EVENTS;
hassof390d2c2004-09-10 20:48:21 +0000770 print_debug (vty, DEBUG_SPF_EVENTS, 0);
771
jardineb5d44e2003-12-23 08:09:43 +0000772 return CMD_SUCCESS;
773}
774
775
776DEFUN (debug_isis_spfstats,
777 debug_isis_spfstats_cmd,
778 "debug isis spf-statistics ",
779 DEBUG_STR
780 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000781 "IS-IS SPF Timing and Statistic Data\n")
jardineb5d44e2003-12-23 08:09:43 +0000782{
783 isis->debugs |= DEBUG_SPF_STATS;
784 print_debug (vty, DEBUG_SPF_STATS, 1);
785
786 return CMD_SUCCESS;
787}
788
789DEFUN (no_debug_isis_spfstats,
790 no_debug_isis_spfstats_cmd,
791 "no debug isis spf-statistics",
792 UNDEBUG_STR
793 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000794 "IS-IS SPF Timing and Statistic Data\n")
jardineb5d44e2003-12-23 08:09:43 +0000795{
796 isis->debugs &= ~DEBUG_SPF_STATS;
797 print_debug (vty, DEBUG_SPF_STATS, 0);
hassof390d2c2004-09-10 20:48:21 +0000798
jardineb5d44e2003-12-23 08:09:43 +0000799 return CMD_SUCCESS;
800}
801
802DEFUN (debug_isis_spftrigg,
803 debug_isis_spftrigg_cmd,
804 "debug isis spf-triggers",
805 DEBUG_STR
806 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000807 "IS-IS SPF triggering events\n")
jardineb5d44e2003-12-23 08:09:43 +0000808{
809 isis->debugs |= DEBUG_SPF_TRIGGERS;
810 print_debug (vty, DEBUG_SPF_TRIGGERS, 1);
811
812 return CMD_SUCCESS;
813}
814
815DEFUN (no_debug_isis_spftrigg,
816 no_debug_isis_spftrigg_cmd,
817 "no debug isis spf-triggers",
818 UNDEBUG_STR
819 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000820 "IS-IS SPF triggering events\n")
jardineb5d44e2003-12-23 08:09:43 +0000821{
822 isis->debugs &= ~DEBUG_SPF_TRIGGERS;
823 print_debug (vty, DEBUG_SPF_TRIGGERS, 0);
hassof390d2c2004-09-10 20:48:21 +0000824
jardineb5d44e2003-12-23 08:09:43 +0000825 return CMD_SUCCESS;
826}
827
828DEFUN (debug_isis_rtevents,
829 debug_isis_rtevents_cmd,
830 "debug isis route-events",
831 DEBUG_STR
832 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000833 "IS-IS Route related events\n")
jardineb5d44e2003-12-23 08:09:43 +0000834{
835 isis->debugs |= DEBUG_RTE_EVENTS;
836 print_debug (vty, DEBUG_RTE_EVENTS, 1);
837
838 return CMD_SUCCESS;
839}
840
841DEFUN (no_debug_isis_rtevents,
842 no_debug_isis_rtevents_cmd,
843 "no debug isis route-events",
844 UNDEBUG_STR
845 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000846 "IS-IS Route related events\n")
jardineb5d44e2003-12-23 08:09:43 +0000847{
848 isis->debugs &= ~DEBUG_RTE_EVENTS;
849 print_debug (vty, DEBUG_RTE_EVENTS, 0);
hassof390d2c2004-09-10 20:48:21 +0000850
jardineb5d44e2003-12-23 08:09:43 +0000851 return CMD_SUCCESS;
852}
853
854DEFUN (debug_isis_events,
855 debug_isis_events_cmd,
856 "debug isis events",
857 DEBUG_STR
858 "IS-IS information\n"
hassof1082d12005-09-19 04:23:34 +0000859 "IS-IS Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000860{
861 isis->debugs |= DEBUG_EVENTS;
862 print_debug (vty, DEBUG_EVENTS, 1);
863
864 return CMD_SUCCESS;
865}
866
867DEFUN (no_debug_isis_events,
868 no_debug_isis_events_cmd,
869 "no debug isis events",
870 UNDEBUG_STR
871 "IS-IS information\n"
hassof390d2c2004-09-10 20:48:21 +0000872 "IS-IS Events\n")
jardineb5d44e2003-12-23 08:09:43 +0000873{
874 isis->debugs &= ~DEBUG_EVENTS;
875 print_debug (vty, DEBUG_EVENTS, 0);
hassof390d2c2004-09-10 20:48:21 +0000876
jardineb5d44e2003-12-23 08:09:43 +0000877 return CMD_SUCCESS;
878}
879
jardineb5d44e2003-12-23 08:09:43 +0000880DEFUN (show_hostname,
881 show_hostname_cmd,
882 "show isis hostname",
883 SHOW_STR
884 "IS-IS information\n"
885 "IS-IS Dynamic hostname mapping\n")
886{
887 dynhn_print_all (vty);
hassof390d2c2004-09-10 20:48:21 +0000888
jardineb5d44e2003-12-23 08:09:43 +0000889 return CMD_SUCCESS;
890}
891
jardineb5d44e2003-12-23 08:09:43 +0000892DEFUN (show_database,
893 show_database_cmd,
894 "show isis database",
hassof390d2c2004-09-10 20:48:21 +0000895 SHOW_STR "IS-IS information\n" "IS-IS link state database\n")
jardineb5d44e2003-12-23 08:09:43 +0000896{
paul1eb8ef22005-04-07 07:30:20 +0000897 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000898 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000899 int level, lsp_count;
jardineb5d44e2003-12-23 08:09:43 +0000900
901 if (isis->area_list->count == 0)
902 return CMD_SUCCESS;
jardineb5d44e2003-12-23 08:09:43 +0000903
paul1eb8ef22005-04-07 07:30:20 +0000904 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
hassof390d2c2004-09-10 20:48:21 +0000905 {
hassof390d2c2004-09-10 20:48:21 +0000906 vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null",
907 VTY_NEWLINE);
908 for (level = 0; level < ISIS_LEVELS; level++)
909 {
910 if (area->lspdb[level] && dict_count (area->lspdb[level]) > 0)
911 {
912 vty_out (vty, "IS-IS Level-%d link-state database:%s",
913 level + 1, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000914
hassof390d2c2004-09-10 20:48:21 +0000915 lsp_count = lsp_print_all (vty, area->lspdb[level],
916 ISIS_UI_LEVEL_BRIEF,
917 area->dynhostname);
918
919 vty_out (vty, "%s %u LSPs%s%s",
920 VTY_NEWLINE, lsp_count, VTY_NEWLINE, VTY_NEWLINE);
921 }
922 }
jardineb5d44e2003-12-23 08:09:43 +0000923 }
jardineb5d44e2003-12-23 08:09:43 +0000924
925 return CMD_SUCCESS;
926}
927
jardineb5d44e2003-12-23 08:09:43 +0000928DEFUN (show_database_detail,
929 show_database_detail_cmd,
930 "show isis database detail",
931 SHOW_STR
932 "IS-IS information\n"
933 "IS-IS link state database\n")
934{
paul1eb8ef22005-04-07 07:30:20 +0000935 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000936 struct isis_area *area;
937 int level, lsp_count;
938
939 if (isis->area_list->count == 0)
940 return CMD_SUCCESS;
941
paul1eb8ef22005-04-07 07:30:20 +0000942 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
hassof390d2c2004-09-10 20:48:21 +0000943 {
hassof390d2c2004-09-10 20:48:21 +0000944 vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null",
945 VTY_NEWLINE);
946 for (level = 0; level < ISIS_LEVELS; level++)
947 {
948 if (area->lspdb[level] && dict_count (area->lspdb[level]) > 0)
949 {
950 vty_out (vty, "IS-IS Level-%d Link State Database:%s",
951 level + 1, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000952
hassof390d2c2004-09-10 20:48:21 +0000953 lsp_count = lsp_print_all (vty, area->lspdb[level],
954 ISIS_UI_LEVEL_DETAIL,
955 area->dynhostname);
jardineb5d44e2003-12-23 08:09:43 +0000956
hassof390d2c2004-09-10 20:48:21 +0000957 vty_out (vty, "%s %u LSPs%s%s",
958 VTY_NEWLINE, lsp_count, VTY_NEWLINE, VTY_NEWLINE);
959 }
960 }
jardineb5d44e2003-12-23 08:09:43 +0000961 }
jardineb5d44e2003-12-23 08:09:43 +0000962
963 return CMD_SUCCESS;
964}
965
966/*
967 * 'router isis' command
968 */
969DEFUN (router_isis,
970 router_isis_cmd,
971 "router isis WORD",
hassof390d2c2004-09-10 20:48:21 +0000972 ROUTER_STR
jardineb5d44e2003-12-23 08:09:43 +0000973 "ISO IS-IS\n"
974 "ISO Routing area tag")
975{
jardineb5d44e2003-12-23 08:09:43 +0000976 return isis_area_get (vty, argv[0]);
jardineb5d44e2003-12-23 08:09:43 +0000977}
978
979/*
980 *'no router isis' command
981 */
982DEFUN (no_router_isis,
983 no_router_isis_cmd,
984 "no router isis WORD",
hassof390d2c2004-09-10 20:48:21 +0000985 "no\n" ROUTER_STR "ISO IS-IS\n" "ISO Routing area tag")
jardineb5d44e2003-12-23 08:09:43 +0000986{
987 return isis_area_destroy (vty, argv[0]);
988}
989
990/*
991 * 'net' command
992 */
993DEFUN (net,
994 net_cmd,
995 "net WORD",
996 "A Network Entity Title for this process (OSI only)\n"
hassof390d2c2004-09-10 20:48:21 +0000997 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +0000998{
hassof7c43dc2004-09-26 16:24:14 +0000999 return area_net_title (vty, (u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +00001000}
1001
jardineb5d44e2003-12-23 08:09:43 +00001002/*
1003 * 'no net' command
1004 */
1005DEFUN (no_net,
1006 no_net_cmd,
1007 "no net WORD",
1008 NO_STR
1009 "A Network Entity Title for this process (OSI only)\n"
hassof390d2c2004-09-10 20:48:21 +00001010 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001011{
hassof7c43dc2004-09-26 16:24:14 +00001012 return area_clear_net_title (vty, (u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +00001013}
1014
1015DEFUN (area_passwd,
1016 area_passwd_cmd,
1017 "area-password WORD",
1018 "Configure the authentication password for an area\n"
hassof390d2c2004-09-10 20:48:21 +00001019 "Area password\n")
jardineb5d44e2003-12-23 08:09:43 +00001020{
1021 struct isis_area *area;
1022 int len;
1023
1024 area = vty->index;
1025
hassof390d2c2004-09-10 20:48:21 +00001026 if (!area)
1027 {
1028 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1029 return CMD_WARNING;
1030 }
1031
jardineb5d44e2003-12-23 08:09:43 +00001032 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001033 if (len > 254)
1034 {
1035 vty_out (vty, "Too long area password (>254)%s", VTY_NEWLINE);
1036 return CMD_WARNING;
1037 }
1038 area->area_passwd.len = (u_char) len;
jardineb5d44e2003-12-23 08:09:43 +00001039 area->area_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001040 strncpy ((char *)area->area_passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001041
hasso1cbc5622005-01-01 10:29:51 +00001042 if (argc > 1)
1043 {
1044 SET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND);
1045 if (strncmp(argv[1], "v", 1) == 0)
1046 SET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1047 else
1048 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1049 }
1050 else
1051 {
1052 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND);
1053 UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV);
1054 }
1055
jardineb5d44e2003-12-23 08:09:43 +00001056 return CMD_SUCCESS;
1057}
1058
hasso1cbc5622005-01-01 10:29:51 +00001059ALIAS (area_passwd,
1060 area_passwd_snpauth_cmd,
1061 "area-password WORD authenticate snp (send-only|validate)",
1062 "Configure the authentication password for an area\n"
1063 "Area password\n"
1064 "Authentication\n"
1065 "SNP PDUs\n"
1066 "Send but do not check PDUs on receiving\n"
1067 "Send and check PDUs on receiving\n");
1068
jardineb5d44e2003-12-23 08:09:43 +00001069DEFUN (no_area_passwd,
1070 no_area_passwd_cmd,
1071 "no area-password",
1072 NO_STR
1073 "Configure the authentication password for an area\n")
1074{
1075 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001076
jardineb5d44e2003-12-23 08:09:43 +00001077 area = vty->index;
1078
hassof390d2c2004-09-10 20:48:21 +00001079 if (!area)
1080 {
1081 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1082 return CMD_WARNING;
1083 }
1084
jardineb5d44e2003-12-23 08:09:43 +00001085 memset (&area->area_passwd, 0, sizeof (struct isis_passwd));
1086
1087 return CMD_SUCCESS;
1088}
1089
jardineb5d44e2003-12-23 08:09:43 +00001090DEFUN (domain_passwd,
1091 domain_passwd_cmd,
1092 "domain-password WORD",
1093 "Set the authentication password for a routing domain\n"
hassof390d2c2004-09-10 20:48:21 +00001094 "Routing domain password\n")
jardineb5d44e2003-12-23 08:09:43 +00001095{
1096 struct isis_area *area;
1097 int len;
1098
1099 area = vty->index;
1100
hassof390d2c2004-09-10 20:48:21 +00001101 if (!area)
1102 {
1103 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1104 return CMD_WARNING;
1105 }
1106
jardineb5d44e2003-12-23 08:09:43 +00001107 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001108 if (len > 254)
1109 {
1110 vty_out (vty, "Too long area password (>254)%s", VTY_NEWLINE);
1111 return CMD_WARNING;
1112 }
1113 area->domain_passwd.len = (u_char) len;
jardineb5d44e2003-12-23 08:09:43 +00001114 area->domain_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001115 strncpy ((char *)area->domain_passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001116
hasso1cbc5622005-01-01 10:29:51 +00001117 if (argc > 1)
1118 {
1119 SET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND);
1120 if (strncmp(argv[1], "v", 1) == 0)
1121 SET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1122 else
1123 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1124 }
1125 else
1126 {
1127 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND);
1128 UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV);
1129 }
1130
jardineb5d44e2003-12-23 08:09:43 +00001131 return CMD_SUCCESS;
1132}
1133
hasso1cbc5622005-01-01 10:29:51 +00001134ALIAS (domain_passwd,
1135 domain_passwd_snpauth_cmd,
1136 "domain-password WORD authenticate snp (send-only|validate)",
1137 "Set the authentication password for a routing domain\n"
1138 "Routing domain password\n"
1139 "Authentication\n"
1140 "SNP PDUs\n"
1141 "Send but do not check PDUs on receiving\n"
1142 "Send and check PDUs on receiving\n");
1143
jardineb5d44e2003-12-23 08:09:43 +00001144DEFUN (no_domain_passwd,
1145 no_domain_passwd_cmd,
1146 "no domain-password WORD",
1147 NO_STR
1148 "Set the authentication password for a routing domain\n")
1149{
1150 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001151
jardineb5d44e2003-12-23 08:09:43 +00001152 area = vty->index;
1153
hassof390d2c2004-09-10 20:48:21 +00001154 if (!area)
1155 {
1156 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1157 return CMD_WARNING;
1158 }
1159
jardineb5d44e2003-12-23 08:09:43 +00001160 memset (&area->domain_passwd, 0, sizeof (struct isis_passwd));
hassof390d2c2004-09-10 20:48:21 +00001161
jardineb5d44e2003-12-23 08:09:43 +00001162 return CMD_SUCCESS;
1163}
1164
1165DEFUN (is_type,
1166 is_type_cmd,
1167 "is-type (level-1|level-1-2|level-2-only)",
1168 "IS Level for this routing process (OSI only)\n"
1169 "Act as a station router only\n"
1170 "Act as both a station router and an area router\n"
1171 "Act as an area router only\n")
1172{
1173 struct isis_area *area;
1174 int type;
1175
1176 area = vty->index;
1177
hassof390d2c2004-09-10 20:48:21 +00001178 if (!area)
1179 {
1180 vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE);
1181 return CMD_WARNING;
1182 }
jardineb5d44e2003-12-23 08:09:43 +00001183
hassof7c43dc2004-09-26 16:24:14 +00001184 type = string2circuit_t ((u_char *)argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001185 if (!type)
1186 {
1187 vty_out (vty, "Unknown IS level %s", VTY_NEWLINE);
1188 return CMD_SUCCESS;
1189 }
jardineb5d44e2003-12-23 08:09:43 +00001190
1191 isis_event_system_type_change (area, type);
hassof390d2c2004-09-10 20:48:21 +00001192
jardineb5d44e2003-12-23 08:09:43 +00001193 return CMD_SUCCESS;
1194}
1195
1196DEFUN (no_is_type,
1197 no_is_type_cmd,
1198 "no is-type (level-1|level-1-2|level-2-only)",
1199 NO_STR
1200 "IS Level for this routing process (OSI only)\n"
1201 "Act as a station router only\n"
1202 "Act as both a station router and an area router\n"
1203 "Act as an area router only\n")
1204{
jardineb5d44e2003-12-23 08:09:43 +00001205 struct isis_area *area;
1206 int type;
1207
1208 area = vty->index;
1209 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001210
jardineb5d44e2003-12-23 08:09:43 +00001211 /*
1212 * Put the is-type back to default. Which is level-1-2 on first
1213 * circuit for the area level-1 for the rest
1214 */
paul1eb8ef22005-04-07 07:30:20 +00001215 if (listgetdata (listhead (isis->area_list)) == area)
jardineb5d44e2003-12-23 08:09:43 +00001216 type = IS_LEVEL_1_AND_2;
1217 else
1218 type = IS_LEVEL_1;
1219
1220 isis_event_system_type_change (area, type);
1221
1222 return CMD_SUCCESS;
1223}
1224
1225DEFUN (lsp_gen_interval,
1226 lsp_gen_interval_cmd,
1227 "lsp-gen-interval <1-120>",
1228 "Minimum interval between regenerating same LSP\n"
1229 "Minimum interval in seconds\n")
1230{
1231 struct isis_area *area;
1232 uint16_t interval;
1233
1234 area = vty->index;
1235 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001236
jardineb5d44e2003-12-23 08:09:43 +00001237 interval = atoi (argv[0]);
1238 area->lsp_gen_interval[0] = interval;
1239 area->lsp_gen_interval[1] = interval;
1240
1241 return CMD_SUCCESS;
1242}
1243
1244DEFUN (no_lsp_gen_interval,
1245 no_lsp_gen_interval_cmd,
1246 "no lsp-gen-interval",
1247 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001248 "Minimum interval between regenerating same LSP\n")
jardineb5d44e2003-12-23 08:09:43 +00001249{
1250 struct isis_area *area;
1251
1252 area = vty->index;
1253 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001254
jardineb5d44e2003-12-23 08:09:43 +00001255 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
1256 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
1257
1258 return CMD_SUCCESS;
1259}
1260
1261ALIAS (no_lsp_gen_interval,
1262 no_lsp_gen_interval_arg_cmd,
1263 "no lsp-gen-interval <1-120>",
1264 NO_STR
1265 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001266 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001267
1268DEFUN (lsp_gen_interval_l1,
1269 lsp_gen_interval_l1_cmd,
1270 "lsp-gen-interval level-1 <1-120>",
1271 "Minimum interval between regenerating same LSP\n"
1272 "Set interval for level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001273 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001274{
1275 struct isis_area *area;
1276 uint16_t interval;
1277
1278 area = vty->index;
1279 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001280
jardineb5d44e2003-12-23 08:09:43 +00001281 interval = atoi (argv[0]);
1282 area->lsp_gen_interval[0] = interval;
1283
1284 return CMD_SUCCESS;
1285}
1286
1287DEFUN (no_lsp_gen_interval_l1,
1288 no_lsp_gen_interval_l1_cmd,
1289 "no lsp-gen-interval level-1",
1290 NO_STR
1291 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001292 "Set interval for level 1 only\n")
jardineb5d44e2003-12-23 08:09:43 +00001293{
1294 struct isis_area *area;
1295
1296 area = vty->index;
1297 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001298
jardineb5d44e2003-12-23 08:09:43 +00001299 area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT;
1300
1301 return CMD_SUCCESS;
1302}
1303
1304ALIAS (no_lsp_gen_interval_l1,
1305 no_lsp_gen_interval_l1_arg_cmd,
1306 "no lsp-gen-interval level-1 <1-120>",
1307 NO_STR
1308 "Minimum interval between regenerating same LSP\n"
1309 "Set interval for level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001310 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001311
1312DEFUN (lsp_gen_interval_l2,
1313 lsp_gen_interval_l2_cmd,
1314 "lsp-gen-interval level-2 <1-120>",
1315 "Minimum interval between regenerating same LSP\n"
1316 "Set interval for level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001317 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001318{
1319 struct isis_area *area;
1320 int interval;
1321
1322 area = vty->index;
1323 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001324
jardineb5d44e2003-12-23 08:09:43 +00001325 interval = atoi (argv[0]);
1326 area->lsp_gen_interval[1] = interval;
1327
1328 return CMD_SUCCESS;
1329}
1330
1331DEFUN (no_lsp_gen_interval_l2,
1332 no_lsp_gen_interval_l2_cmd,
1333 "no lsp-gen-interval level-2",
1334 NO_STR
1335 "Minimum interval between regenerating same LSP\n"
hassof390d2c2004-09-10 20:48:21 +00001336 "Set interval for level 2 only\n")
jardineb5d44e2003-12-23 08:09:43 +00001337{
1338 struct isis_area *area;
1339 int interval;
1340
1341 area = vty->index;
1342 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001343
jardineb5d44e2003-12-23 08:09:43 +00001344 interval = atoi (argv[0]);
1345 area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT;
1346
1347 return CMD_SUCCESS;
1348}
1349
1350ALIAS (no_lsp_gen_interval_l2,
1351 no_lsp_gen_interval_l2_arg_cmd,
1352 "no lsp-gen-interval level-2 <1-120>",
1353 NO_STR
1354 "Minimum interval between regenerating same LSP\n"
1355 "Set interval for level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001356 "Minimum interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001357
1358DEFUN (metric_style,
1359 metric_style_cmd,
hasso2984d262005-09-26 16:49:07 +00001360 "metric-style (narrow|transition|wide)",
jardineb5d44e2003-12-23 08:09:43 +00001361 "Use old-style (ISO 10589) or new-style packet formats\n"
1362 "Use old style of TLVs with narrow metric\n"
hasso2984d262005-09-26 16:49:07 +00001363 "Send and accept both styles of TLVs during transition\n"
jardineb5d44e2003-12-23 08:09:43 +00001364 "Use new style of TLVs to carry wider metric\n")
1365{
1366 struct isis_area *area;
1367
1368 area = vty->index;
1369 assert (area);
hasso2984d262005-09-26 16:49:07 +00001370
1371 if (strncmp (argv[0], "w", 1) == 0)
1372 {
1373 area->newmetric = 1;
1374 area->oldmetric = 0;
1375 }
1376 else if (strncmp (argv[0], "t", 1) == 0)
1377 {
1378 area->newmetric = 1;
1379 area->oldmetric = 1;
1380 }
1381 else if (strncmp (argv[0], "n", 1) == 0)
1382 {
1383 area->newmetric = 0;
1384 area->oldmetric = 1;
1385 }
jardineb5d44e2003-12-23 08:09:43 +00001386
1387 return CMD_SUCCESS;
1388}
1389
1390DEFUN (no_metric_style,
1391 no_metric_style_cmd,
hasso2984d262005-09-26 16:49:07 +00001392 "no metric-style",
jardineb5d44e2003-12-23 08:09:43 +00001393 NO_STR
hasso2984d262005-09-26 16:49:07 +00001394 "Use old-style (ISO 10589) or new-style packet formats\n")
jardineb5d44e2003-12-23 08:09:43 +00001395{
1396 struct isis_area *area;
1397
1398 area = vty->index;
1399 assert (area);
1400
hasso2984d262005-09-26 16:49:07 +00001401 /* Default is narrow metric. */
1402 area->newmetric = 0;
1403 area->oldmetric = 1;
jardineb5d44e2003-12-23 08:09:43 +00001404
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]",
hassof1082d12005-09-19 04:23:34 +00001568 "Topology generation for IS-IS\n"
1569 "Topology generation\n"
1570 "Grid topology\n"
jardineb5d44e2003-12-23 08:09:43 +00001571 "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);
hassof1082d12005-09-19 04:23:34 +00001593 /* Regenerate L1 LSP to get two way connection to the generated
1594 * topology. */
1595 lsp_regenerate_schedule (area);
hassof390d2c2004-09-10 20:48:21 +00001596 }
jardineb5d44e2003-12-23 08:09:43 +00001597
1598 return CMD_SUCCESS;
1599}
1600
hassof695b012005-04-02 19:03:39 +00001601DEFUN (show_isis_generated_topology,
1602 show_isis_generated_topology_cmd,
hassof1082d12005-09-19 04:23:34 +00001603 "show isis generated-topologies",
jardineb5d44e2003-12-23 08:09:43 +00001604 SHOW_STR
hassof1082d12005-09-19 04:23:34 +00001605 "CLNS network information\n"
1606 "Show generated topologies\n")
jardineb5d44e2003-12-23 08:09:43 +00001607{
1608 struct isis_area *area;
paul92c9f222005-05-25 12:21:13 +00001609 struct listnode *node;
jardineb5d44e2003-12-23 08:09:43 +00001610 struct listnode *node2;
1611 struct arc *arc;
hassof1082d12005-09-19 04:23:34 +00001612
paul92c9f222005-05-25 12:21:13 +00001613 for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
hassof1082d12005-09-19 04:23:34 +00001614 {
1615 if (!area->topology)
1616 continue;
1617
1618 vty_out (vty, "Topology for isis area: %s%s", area->area_tag,
1619 VTY_NEWLINE);
1620 vty_out (vty, "From node To node Distance%s", VTY_NEWLINE);
1621
1622 for (ALL_LIST_ELEMENTS_RO (area->topology, node2, arc))
1623 vty_out (vty, "%9ld %11ld %12ld%s", arc->from_node, arc->to_node,
1624 arc->distance, VTY_NEWLINE);
1625 }
jardineb5d44e2003-12-23 08:09:43 +00001626 return CMD_SUCCESS;
1627}
1628
hassof1082d12005-09-19 04:23:34 +00001629/* Base IS for topology generation. */
hassof390d2c2004-09-10 20:48:21 +00001630DEFUN (topology_baseis,
jardineb5d44e2003-12-23 08:09:43 +00001631 topology_baseis_cmd,
1632 "topology base-is WORD",
hassof1082d12005-09-19 04:23:34 +00001633 "Topology generation for IS-IS\n"
1634 "A Network IS Base for this topology\n"
1635 "XXXX.XXXX.XXXX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001636{
1637 struct isis_area *area;
1638 u_char buff[ISIS_SYS_ID_LEN];
1639
1640 area = vty->index;
1641 assert (area);
1642
hassof390d2c2004-09-10 20:48:21 +00001643 if (sysid2buff (buff, argv[0]))
hassof1082d12005-09-19 04:23:34 +00001644 sysid2buff (area->topology_baseis, argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001645
jardineb5d44e2003-12-23 08:09:43 +00001646 return CMD_SUCCESS;
1647}
1648
jardineb5d44e2003-12-23 08:09:43 +00001649DEFUN (no_topology_baseis,
1650 no_topology_baseis_cmd,
1651 "no topology base-is WORD",
1652 NO_STR
hassof1082d12005-09-19 04:23:34 +00001653 "Topology generation for IS-IS\n"
1654 "A Network IS Base for this topology\n"
1655 "XXXX.XXXX.XXXX Network entity title (NET)\n")
jardineb5d44e2003-12-23 08:09:43 +00001656{
1657 struct isis_area *area;
1658
1659 area = vty->index;
1660 assert (area);
1661
hassof390d2c2004-09-10 20:48:21 +00001662 memcpy (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS, ISIS_SYS_ID_LEN);
jardineb5d44e2003-12-23 08:09:43 +00001663 return CMD_SUCCESS;
1664}
1665
hassof1082d12005-09-19 04:23:34 +00001666ALIAS (no_topology_baseis,
1667 no_topology_baseis_noid_cmd,
1668 "no topology base-is",
1669 NO_STR
1670 "Topology generation for IS-IS\n"
1671 "A Network IS Base for this topology\n")
1672
1673DEFUN (topology_basedynh,
1674 topology_basedynh_cmd,
1675 "topology base-dynh WORD",
1676 "Topology generation for IS-IS\n"
1677 "Dynamic hostname base for this topology\n"
1678 "Dynamic hostname base\n")
1679{
1680 struct isis_area *area;
1681
1682 area = vty->index;
1683 assert (area);
1684
1685 /* I hope that it's enough. */
1686 area->topology_basedynh = strndup (argv[0], 16);
1687 return CMD_SUCCESS;
1688}
jardineb5d44e2003-12-23 08:09:43 +00001689#endif /* TOPOLOGY_GENERATE */
1690
1691DEFUN (lsp_lifetime,
1692 lsp_lifetime_cmd,
1693 "lsp-lifetime <380-65535>",
1694 "Maximum LSP lifetime\n"
hassof390d2c2004-09-10 20:48:21 +00001695 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001696{
1697 struct isis_area *area;
1698 uint16_t interval;
1699
1700 area = vty->index;
1701 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001702
jardineb5d44e2003-12-23 08:09:43 +00001703 interval = atoi (argv[0]);
1704
hassof390d2c2004-09-10 20:48:21 +00001705 if (interval < ISIS_MIN_LSP_LIFETIME)
1706 {
1707 vty_out (vty, "LSP lifetime (%us) below %us%s",
1708 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001709
hassof390d2c2004-09-10 20:48:21 +00001710 return CMD_WARNING;
1711 }
jardineb5d44e2003-12-23 08:09:43 +00001712
1713
1714 area->max_lsp_lifetime[0] = interval;
1715 area->max_lsp_lifetime[1] = interval;
hassof390d2c2004-09-10 20:48:21 +00001716 area->lsp_refresh[0] = interval - 300;
1717 area->lsp_refresh[1] = interval - 300;
jardineb5d44e2003-12-23 08:09:43 +00001718
hassof390d2c2004-09-10 20:48:21 +00001719 if (area->t_lsp_refresh[0])
1720 {
1721 thread_cancel (area->t_lsp_refresh[0]);
1722 thread_execute (master, lsp_refresh_l1, area, 0);
1723 }
jardineb5d44e2003-12-23 08:09:43 +00001724
hassof390d2c2004-09-10 20:48:21 +00001725 if (area->t_lsp_refresh[1])
1726 {
1727 thread_cancel (area->t_lsp_refresh[1]);
1728 thread_execute (master, lsp_refresh_l2, area, 0);
1729 }
jardineb5d44e2003-12-23 08:09:43 +00001730
1731
1732 return CMD_SUCCESS;
1733}
1734
1735DEFUN (no_lsp_lifetime,
1736 no_lsp_lifetime_cmd,
1737 "no lsp-lifetime",
1738 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001739 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001740{
1741 struct isis_area *area;
1742
1743 area = vty->index;
1744 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001745
1746 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200s */
1747 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200s */
1748 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900s */
1749 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001750
1751 return CMD_SUCCESS;
1752}
1753
1754ALIAS (no_lsp_lifetime,
1755 no_lsp_lifetime_arg_cmd,
1756 "no lsp-lifetime <380-65535>",
1757 NO_STR
1758 "Maximum LSP lifetime\n"
hassof390d2c2004-09-10 20:48:21 +00001759 "LSP lifetime in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001760
1761DEFUN (lsp_lifetime_l1,
1762 lsp_lifetime_l1_cmd,
1763 "lsp-lifetime level-1 <380-65535>",
1764 "Maximum LSP lifetime for Level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001765 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001766{
1767 struct isis_area *area;
1768 uint16_t interval;
1769
1770 area = vty->index;
1771 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001772
jardineb5d44e2003-12-23 08:09:43 +00001773 interval = atoi (argv[0]);
1774
hassof390d2c2004-09-10 20:48:21 +00001775 if (interval < ISIS_MIN_LSP_LIFETIME)
1776 {
1777 vty_out (vty, "Level-1 LSP lifetime (%us) below %us%s",
1778 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001779
hassof390d2c2004-09-10 20:48:21 +00001780 return CMD_WARNING;
1781 }
jardineb5d44e2003-12-23 08:09:43 +00001782
1783
1784 area->max_lsp_lifetime[0] = interval;
hassof390d2c2004-09-10 20:48:21 +00001785 area->lsp_refresh[0] = interval - 300;
jardineb5d44e2003-12-23 08:09:43 +00001786
1787 return CMD_SUCCESS;
1788}
1789
1790DEFUN (no_lsp_lifetime_l1,
1791 no_lsp_lifetime_l1_cmd,
1792 "no lsp-lifetime level-1",
1793 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001794 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001795{
1796 struct isis_area *area;
1797
1798 area = vty->index;
1799 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001800
1801 area->max_lsp_lifetime[0] = MAX_AGE; /* 1200s */
1802 area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001803
1804 return CMD_SUCCESS;
1805}
1806
1807ALIAS (no_lsp_lifetime_l1,
1808 no_lsp_lifetime_l1_arg_cmd,
1809 "no lsp-lifetime level-1 <380-65535>",
1810 NO_STR
1811 "Maximum LSP lifetime for Level 1 only\n"
hassof390d2c2004-09-10 20:48:21 +00001812 "LSP lifetime for Level 1 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001813
1814DEFUN (lsp_lifetime_l2,
1815 lsp_lifetime_l2_cmd,
1816 "lsp-lifetime level-2 <380-65535>",
1817 "Maximum LSP lifetime for Level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001818 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001819{
1820 struct isis_area *area;
1821 uint16_t interval;
1822
1823 area = vty->index;
1824 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001825
jardineb5d44e2003-12-23 08:09:43 +00001826 interval = atoi (argv[0]);
1827
hassof390d2c2004-09-10 20:48:21 +00001828 if (interval < ISIS_MIN_LSP_LIFETIME)
1829 {
1830 vty_out (vty, "Level-2 LSP lifetime (%us) below %us%s",
1831 interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001832
hassof390d2c2004-09-10 20:48:21 +00001833 return CMD_WARNING;
1834 }
jardineb5d44e2003-12-23 08:09:43 +00001835
1836 area->max_lsp_lifetime[1] = interval;
1837 area->lsp_refresh[1] = interval - 300;
1838
1839 return CMD_SUCCESS;
1840}
1841
1842DEFUN (no_lsp_lifetime_l2,
1843 no_lsp_lifetime_l2_cmd,
1844 "no lsp-lifetime level-2",
1845 NO_STR
hassof390d2c2004-09-10 20:48:21 +00001846 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001847{
1848 struct isis_area *area;
1849
1850 area = vty->index;
1851 assert (area);
hassof390d2c2004-09-10 20:48:21 +00001852
1853 area->max_lsp_lifetime[1] = MAX_AGE; /* 1200s */
1854 area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900s */
jardineb5d44e2003-12-23 08:09:43 +00001855
1856 return CMD_SUCCESS;
1857}
1858
1859ALIAS (no_lsp_lifetime_l2,
1860 no_lsp_lifetime_l2_arg_cmd,
1861 "no lsp-lifetime level-2 <380-65535>",
1862 NO_STR
1863 "Maximum LSP lifetime for Level 2 only\n"
hassof390d2c2004-09-10 20:48:21 +00001864 "LSP lifetime for Level 2 only in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001865
1866/* IS-IS configuration write function */
1867int
1868isis_config_write (struct vty *vty)
1869{
1870 int write = 0;
jardineb5d44e2003-12-23 08:09:43 +00001871
hassof390d2c2004-09-10 20:48:21 +00001872 if (isis != NULL)
1873 {
1874 struct isis_area *area;
paul1eb8ef22005-04-07 07:30:20 +00001875 struct listnode *node, *nnode;
1876 struct listnode *node2, *nnode2;
jardineb5d44e2003-12-23 08:09:43 +00001877
paul1eb8ef22005-04-07 07:30:20 +00001878 for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area))
hassof390d2c2004-09-10 20:48:21 +00001879 {
1880 /* ISIS - Area name */
1881 vty_out (vty, "router isis %s%s", area->area_tag, VTY_NEWLINE);
1882 write++;
1883 /* ISIS - Net */
1884 if (listcount (area->area_addrs) > 0)
1885 {
1886 struct area_addr *area_addr;
paul1eb8ef22005-04-07 07:30:20 +00001887 for (ALL_LIST_ELEMENTS (area->area_addrs, node2, nnode2, area_addr))
hassof390d2c2004-09-10 20:48:21 +00001888 {
1889 vty_out (vty, " net %s%s",
1890 isonet_print (area_addr->area_addr,
1891 area_addr->addr_len + ISIS_SYS_ID_LEN +
1892 1), VTY_NEWLINE);
1893 write++;
1894 }
1895 }
1896 /* ISIS - Dynamic hostname - Defaults to true so only display if false */
1897 if (!area->dynhostname)
1898 {
1899 vty_out (vty, " no hostname dynamic%s", VTY_NEWLINE);
1900 write++;
1901 }
1902 /* ISIS - Metric-Style - when true displays wide */
1903 if (area->newmetric)
1904 {
hasso2984d262005-09-26 16:49:07 +00001905 if (!area->oldmetric)
1906 vty_out (vty, " metric-style wide%s", VTY_NEWLINE);
1907 else
1908 vty_out (vty, " metric-style transition%s", VTY_NEWLINE);
hassof390d2c2004-09-10 20:48:21 +00001909 write++;
1910 }
hasso2984d262005-09-26 16:49:07 +00001911
hassof390d2c2004-09-10 20:48:21 +00001912 /* ISIS - Area is-type (level-1-2 is default) */
1913 if (area->is_type == IS_LEVEL_1)
1914 {
1915 vty_out (vty, " is-type level-1%s", VTY_NEWLINE);
1916 write++;
1917 }
1918 else
1919 {
1920 if (area->is_type == IS_LEVEL_2)
1921 {
1922 vty_out (vty, " is-type level-2-only%s", VTY_NEWLINE);
1923 write++;
1924 }
1925 }
1926 /* ISIS - Lsp generation interval */
1927 if (area->lsp_gen_interval[0] == area->lsp_gen_interval[1])
1928 {
1929 if (area->lsp_gen_interval[0] != LSP_GEN_INTERVAL_DEFAULT)
1930 {
1931 vty_out (vty, " lsp-gen-interval %d%s",
1932 area->lsp_gen_interval[0], VTY_NEWLINE);
1933 write++;
1934 }
1935 }
1936 else
1937 {
1938 if (area->lsp_gen_interval[0] != LSP_GEN_INTERVAL_DEFAULT)
1939 {
1940 vty_out (vty, " lsp-gen-interval level-1 %d%s",
1941 area->lsp_gen_interval[0], VTY_NEWLINE);
1942 write++;
1943 }
1944 if (area->lsp_gen_interval[1] != LSP_GEN_INTERVAL_DEFAULT)
1945 {
1946 vty_out (vty, " lsp-gen-interval level-2 %d%s",
1947 area->lsp_gen_interval[1], VTY_NEWLINE);
1948 write++;
1949 }
1950 }
1951 /* ISIS - LSP lifetime */
1952 if (area->max_lsp_lifetime[0] == area->max_lsp_lifetime[1])
1953 {
1954 if (area->max_lsp_lifetime[0] != MAX_AGE)
1955 {
1956 vty_out (vty, " lsp-lifetime %u%s", area->max_lsp_lifetime[0],
1957 VTY_NEWLINE);
1958 write++;
1959 }
1960 }
1961 else
1962 {
1963 if (area->max_lsp_lifetime[0] != MAX_AGE)
1964 {
1965 vty_out (vty, " lsp-lifetime level-1 %u%s",
1966 area->max_lsp_lifetime[0], VTY_NEWLINE);
1967 write++;
1968 }
1969 if (area->max_lsp_lifetime[1] != MAX_AGE)
1970 {
1971 vty_out (vty, " lsp-lifetime level-2 %u%s",
1972 area->max_lsp_lifetime[1], VTY_NEWLINE);
1973 write++;
1974 }
1975 }
hasso53c997c2004-09-15 16:21:59 +00001976 /* Authentication passwords. */
1977 if (area->area_passwd.len > 0)
1978 {
hasso1cbc5622005-01-01 10:29:51 +00001979 vty_out(vty, " area-password %s", area->area_passwd.passwd);
1980 if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND))
1981 {
1982 vty_out(vty, " authenticate snp ");
1983 if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV))
1984 vty_out(vty, "validate");
1985 else
1986 vty_out(vty, "send-only");
1987 }
1988 vty_out(vty, "%s", VTY_NEWLINE);
hasso53c997c2004-09-15 16:21:59 +00001989 write++;
1990 }
1991 if (area->domain_passwd.len > 0)
1992 {
hasso1cbc5622005-01-01 10:29:51 +00001993 vty_out(vty, " domain-password %s", area->domain_passwd.passwd);
1994 if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND))
1995 {
1996 vty_out(vty, " authenticate snp ");
1997 if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV))
1998 vty_out(vty, "validate");
1999 else
2000 vty_out(vty, "send-only");
2001 }
2002 vty_out(vty, "%s", VTY_NEWLINE);
hasso53c997c2004-09-15 16:21:59 +00002003 write++;
2004 }
hassof1082d12005-09-19 04:23:34 +00002005
hassof390d2c2004-09-10 20:48:21 +00002006#ifdef TOPOLOGY_GENERATE
hassof1082d12005-09-19 04:23:34 +00002007 if (memcmp (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS,
2008 ISIS_SYS_ID_LEN))
2009 {
2010 vty_out (vty, " topology base-is %s%s",
2011 sysid_print (area->topology_baseis), VTY_NEWLINE);
2012 write++;
2013 }
2014 if (area->topology_basedynh)
2015 {
2016 vty_out (vty, " topology base-dynh %s%s",
2017 area->topology_basedynh, VTY_NEWLINE);
2018 write++;
2019 }
2020 /* We save the whole command line here. */
2021 if (strlen(area->top_params))
hassof390d2c2004-09-10 20:48:21 +00002022 {
2023 vty_out (vty, " %s%s", area->top_params, VTY_NEWLINE);
2024 write++;
2025 }
hassof390d2c2004-09-10 20:48:21 +00002026#endif /* TOPOLOGY_GENERATE */
hassof1082d12005-09-19 04:23:34 +00002027
hassof390d2c2004-09-10 20:48:21 +00002028 }
jardineb5d44e2003-12-23 08:09:43 +00002029 }
hassof390d2c2004-09-10 20:48:21 +00002030
jardineb5d44e2003-12-23 08:09:43 +00002031 return write;
2032}
2033
hassof390d2c2004-09-10 20:48:21 +00002034struct cmd_node isis_node = {
jardineb5d44e2003-12-23 08:09:43 +00002035 ISIS_NODE,
hasso2097cd82003-12-23 11:51:08 +00002036 "%s(config-router)# ",
jardineb5d44e2003-12-23 08:09:43 +00002037 1
2038};
2039
hassof390d2c2004-09-10 20:48:21 +00002040void
jardineb5d44e2003-12-23 08:09:43 +00002041isis_init ()
2042{
jardineb5d44e2003-12-23 08:09:43 +00002043 /* Install IS-IS top node */
2044 install_node (&isis_node, isis_config_write);
hassof390d2c2004-09-10 20:48:21 +00002045
jardineb5d44e2003-12-23 08:09:43 +00002046 install_element (VIEW_NODE, &show_clns_neighbors_cmd);
2047 install_element (VIEW_NODE, &show_isis_neighbors_cmd);
2048 install_element (VIEW_NODE, &show_clns_neighbors_detail_cmd);
2049 install_element (VIEW_NODE, &show_isis_neighbors_detail_cmd);
2050
2051 install_element (VIEW_NODE, &show_hostname_cmd);
2052 install_element (VIEW_NODE, &show_database_cmd);
2053 install_element (VIEW_NODE, &show_database_detail_cmd);
2054
2055 install_element (ENABLE_NODE, &show_clns_neighbors_cmd);
2056 install_element (ENABLE_NODE, &show_isis_neighbors_cmd);
2057 install_element (ENABLE_NODE, &show_clns_neighbors_detail_cmd);
2058 install_element (ENABLE_NODE, &show_isis_neighbors_detail_cmd);
2059
2060 install_element (ENABLE_NODE, &show_hostname_cmd);
2061 install_element (ENABLE_NODE, &show_database_cmd);
2062 install_element (ENABLE_NODE, &show_database_detail_cmd);
2063 install_element (ENABLE_NODE, &show_debugging_cmd);
2064
hassof390d2c2004-09-10 20:48:21 +00002065 install_node (&debug_node, config_write_debug);
jardin9e867fe2003-12-23 08:56:18 +00002066
jardineb5d44e2003-12-23 08:09:43 +00002067 install_element (ENABLE_NODE, &debug_isis_adj_cmd);
2068 install_element (ENABLE_NODE, &no_debug_isis_adj_cmd);
2069 install_element (ENABLE_NODE, &debug_isis_csum_cmd);
2070 install_element (ENABLE_NODE, &no_debug_isis_csum_cmd);
2071 install_element (ENABLE_NODE, &debug_isis_lupd_cmd);
2072 install_element (ENABLE_NODE, &no_debug_isis_lupd_cmd);
2073 install_element (ENABLE_NODE, &debug_isis_err_cmd);
2074 install_element (ENABLE_NODE, &no_debug_isis_err_cmd);
2075 install_element (ENABLE_NODE, &debug_isis_snp_cmd);
2076 install_element (ENABLE_NODE, &no_debug_isis_snp_cmd);
2077 install_element (ENABLE_NODE, &debug_isis_upd_cmd);
2078 install_element (ENABLE_NODE, &no_debug_isis_upd_cmd);
2079 install_element (ENABLE_NODE, &debug_isis_spfevents_cmd);
2080 install_element (ENABLE_NODE, &no_debug_isis_spfevents_cmd);
2081 install_element (ENABLE_NODE, &debug_isis_spfstats_cmd);
2082 install_element (ENABLE_NODE, &no_debug_isis_spfstats_cmd);
2083 install_element (ENABLE_NODE, &debug_isis_spftrigg_cmd);
2084 install_element (ENABLE_NODE, &no_debug_isis_spftrigg_cmd);
2085 install_element (ENABLE_NODE, &debug_isis_rtevents_cmd);
2086 install_element (ENABLE_NODE, &no_debug_isis_rtevents_cmd);
2087 install_element (ENABLE_NODE, &debug_isis_events_cmd);
2088 install_element (ENABLE_NODE, &no_debug_isis_events_cmd);
2089
jardin9e867fe2003-12-23 08:56:18 +00002090 install_element (CONFIG_NODE, &debug_isis_adj_cmd);
2091 install_element (CONFIG_NODE, &no_debug_isis_adj_cmd);
2092 install_element (CONFIG_NODE, &debug_isis_csum_cmd);
2093 install_element (CONFIG_NODE, &no_debug_isis_csum_cmd);
2094 install_element (CONFIG_NODE, &debug_isis_lupd_cmd);
2095 install_element (CONFIG_NODE, &no_debug_isis_lupd_cmd);
2096 install_element (CONFIG_NODE, &debug_isis_err_cmd);
2097 install_element (CONFIG_NODE, &no_debug_isis_err_cmd);
2098 install_element (CONFIG_NODE, &debug_isis_snp_cmd);
2099 install_element (CONFIG_NODE, &no_debug_isis_snp_cmd);
2100 install_element (CONFIG_NODE, &debug_isis_upd_cmd);
2101 install_element (CONFIG_NODE, &no_debug_isis_upd_cmd);
2102 install_element (CONFIG_NODE, &debug_isis_spfevents_cmd);
2103 install_element (CONFIG_NODE, &no_debug_isis_spfevents_cmd);
2104 install_element (CONFIG_NODE, &debug_isis_spfstats_cmd);
2105 install_element (CONFIG_NODE, &no_debug_isis_spfstats_cmd);
2106 install_element (CONFIG_NODE, &debug_isis_spftrigg_cmd);
2107 install_element (CONFIG_NODE, &no_debug_isis_spftrigg_cmd);
2108 install_element (CONFIG_NODE, &debug_isis_rtevents_cmd);
2109 install_element (CONFIG_NODE, &no_debug_isis_rtevents_cmd);
2110 install_element (CONFIG_NODE, &debug_isis_events_cmd);
2111 install_element (CONFIG_NODE, &no_debug_isis_events_cmd);
2112
jardineb5d44e2003-12-23 08:09:43 +00002113 install_element (CONFIG_NODE, &router_isis_cmd);
2114 install_element (CONFIG_NODE, &no_router_isis_cmd);
2115
2116 install_default (ISIS_NODE);
2117
2118 install_element (ISIS_NODE, &net_cmd);
2119 install_element (ISIS_NODE, &no_net_cmd);
2120
2121 install_element (ISIS_NODE, &is_type_cmd);
2122 install_element (ISIS_NODE, &no_is_type_cmd);
2123
2124 install_element (ISIS_NODE, &area_passwd_cmd);
hasso1cbc5622005-01-01 10:29:51 +00002125 install_element (ISIS_NODE, &area_passwd_snpauth_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002126 install_element (ISIS_NODE, &no_area_passwd_cmd);
2127
2128 install_element (ISIS_NODE, &domain_passwd_cmd);
hasso1cbc5622005-01-01 10:29:51 +00002129 install_element (ISIS_NODE, &domain_passwd_snpauth_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002130 install_element (ISIS_NODE, &no_domain_passwd_cmd);
2131
2132 install_element (ISIS_NODE, &lsp_gen_interval_cmd);
2133 install_element (ISIS_NODE, &no_lsp_gen_interval_cmd);
2134 install_element (ISIS_NODE, &no_lsp_gen_interval_arg_cmd);
2135 install_element (ISIS_NODE, &lsp_gen_interval_l1_cmd);
2136 install_element (ISIS_NODE, &no_lsp_gen_interval_l1_cmd);
2137 install_element (ISIS_NODE, &no_lsp_gen_interval_l1_arg_cmd);
2138 install_element (ISIS_NODE, &lsp_gen_interval_l2_cmd);
2139 install_element (ISIS_NODE, &no_lsp_gen_interval_l2_cmd);
2140 install_element (ISIS_NODE, &no_lsp_gen_interval_l2_arg_cmd);
2141
2142 install_element (ISIS_NODE, &spf_interval_cmd);
2143 install_element (ISIS_NODE, &no_spf_interval_cmd);
2144 install_element (ISIS_NODE, &no_spf_interval_arg_cmd);
2145 install_element (ISIS_NODE, &spf_interval_l1_cmd);
2146 install_element (ISIS_NODE, &no_spf_interval_l1_cmd);
2147 install_element (ISIS_NODE, &no_spf_interval_l1_arg_cmd);
2148 install_element (ISIS_NODE, &spf_interval_l2_cmd);
2149 install_element (ISIS_NODE, &no_spf_interval_l2_cmd);
2150 install_element (ISIS_NODE, &no_spf_interval_l2_arg_cmd);
hassof390d2c2004-09-10 20:48:21 +00002151
jardineb5d44e2003-12-23 08:09:43 +00002152 install_element (ISIS_NODE, &lsp_lifetime_cmd);
2153 install_element (ISIS_NODE, &no_lsp_lifetime_cmd);
2154 install_element (ISIS_NODE, &no_lsp_lifetime_arg_cmd);
2155 install_element (ISIS_NODE, &lsp_lifetime_l1_cmd);
2156 install_element (ISIS_NODE, &no_lsp_lifetime_l1_cmd);
2157 install_element (ISIS_NODE, &no_lsp_lifetime_l1_arg_cmd);
2158 install_element (ISIS_NODE, &lsp_lifetime_l2_cmd);
2159 install_element (ISIS_NODE, &no_lsp_lifetime_l2_cmd);
2160 install_element (ISIS_NODE, &no_lsp_lifetime_l2_arg_cmd);
2161
2162 install_element (ISIS_NODE, &dynamic_hostname_cmd);
2163 install_element (ISIS_NODE, &no_dynamic_hostname_cmd);
2164
2165 install_element (ISIS_NODE, &metric_style_cmd);
2166 install_element (ISIS_NODE, &no_metric_style_cmd);
2167#ifdef TOPOLOGY_GENERATE
2168 install_element (ISIS_NODE, &topology_generate_grid_cmd);
2169 install_element (ISIS_NODE, &topology_baseis_cmd);
hassof1082d12005-09-19 04:23:34 +00002170 install_element (ISIS_NODE, &topology_basedynh_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002171 install_element (ISIS_NODE, &no_topology_baseis_cmd);
hassof1082d12005-09-19 04:23:34 +00002172 install_element (ISIS_NODE, &no_topology_baseis_noid_cmd);
hassof695b012005-04-02 19:03:39 +00002173 install_element (VIEW_NODE, &show_isis_generated_topology_cmd);
2174 install_element (ENABLE_NODE, &show_isis_generated_topology_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002175#endif /* TOPOLOGY_GENERATE */
2176
hassof390d2c2004-09-10 20:48:21 +00002177 isis_new (0);
jardineb5d44e2003-12-23 08:09:43 +00002178 isis_circuit_init ();
2179 isis_zebra_init ();
2180 isis_spf_cmds_init ();
2181}