]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * IS-IS Rout(e)ing protocol - isisd.c | |
3 | * | |
4 | * Copyright (C) 2001,2002 Sampo Saaristo | |
5 | * Tampere University of Technology | |
6 | * Institute of Communications Engineering | |
7 | * | |
8 | * This program is free software; you can redistribute it and/or modify it | |
9 | * under the terms of the GNU General Public Licenseas published by the Free | |
10 | * Software Foundation; either version 2 of the License, or (at your option) | |
11 | * any later version. | |
12 | * | |
13 | * This program is distributed in the hope that it will be useful,but WITHOUT | |
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
16 | * more details. | |
17 | ||
18 | * You should have received a copy of the GNU General Public License along | |
19 | * with this program; if not, write to the Free Software Foundation, Inc., | |
20 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
21 | */ | |
22 | ||
23 | #include <zebra.h> | |
24 | ||
25 | #include "thread.h" | |
26 | #include "vty.h" | |
27 | #include "command.h" | |
28 | #include "log.h" | |
29 | #include "memory.h" | |
30 | #include "time.h" | |
31 | #include "linklist.h" | |
32 | #include "if.h" | |
33 | #include "hash.h" | |
34 | #include "stream.h" | |
35 | #include "prefix.h" | |
36 | #include "table.h" | |
37 | #include "qobj.h" | |
38 | #include "spf_backoff.h" | |
39 | ||
40 | #include "isisd/dict.h" | |
41 | #include "isisd/isis_constants.h" | |
42 | #include "isisd/isis_common.h" | |
43 | #include "isisd/isis_flags.h" | |
44 | #include "isisd/isis_circuit.h" | |
45 | #include "isisd/isis_csm.h" | |
46 | #include "isisd/isisd.h" | |
47 | #include "isisd/isis_dynhn.h" | |
48 | #include "isisd/isis_adjacency.h" | |
49 | #include "isisd/isis_pdu.h" | |
50 | #include "isisd/isis_misc.h" | |
51 | #include "isisd/isis_constants.h" | |
52 | #include "isisd/isis_tlv.h" | |
53 | #include "isisd/isis_lsp.h" | |
54 | #include "isisd/isis_spf.h" | |
55 | #include "isisd/isis_route.h" | |
56 | #include "isisd/isis_zebra.h" | |
57 | #include "isisd/isis_events.h" | |
58 | #include "isisd/isis_te.h" | |
59 | ||
60 | struct isis *isis = NULL; | |
61 | ||
62 | DEFINE_QOBJ_TYPE(isis) | |
63 | DEFINE_QOBJ_TYPE(isis_area) | |
64 | ||
65 | /* | |
66 | * Prototypes. | |
67 | */ | |
68 | int isis_area_get(struct vty *, const char *); | |
69 | int isis_area_destroy(struct vty *, const char *); | |
70 | int area_net_title(struct vty *, const char *); | |
71 | int area_clear_net_title(struct vty *, const char *); | |
72 | int show_isis_interface_common(struct vty *, const char *ifname, char); | |
73 | int show_isis_neighbor_common(struct vty *, const char *id, char); | |
74 | int clear_isis_neighbor_common(struct vty *, const char *id); | |
75 | int isis_config_write(struct vty *); | |
76 | ||
77 | ||
78 | ||
79 | void | |
80 | isis_new (unsigned long process_id) | |
81 | { | |
82 | isis = XCALLOC (MTYPE_ISIS, sizeof (struct isis)); | |
83 | /* | |
84 | * Default values | |
85 | */ | |
86 | isis->max_area_addrs = 3; | |
87 | isis->process_id = process_id; | |
88 | isis->router_id = 0; | |
89 | isis->area_list = list_new (); | |
90 | isis->init_circ_list = list_new (); | |
91 | isis->uptime = time (NULL); | |
92 | isis->nexthops = list_new (); | |
93 | isis->nexthops6 = list_new (); | |
94 | dyn_cache_init (); | |
95 | /* | |
96 | * uncomment the next line for full debugs | |
97 | */ | |
98 | /* isis->debugs = 0xFFFF; */ | |
99 | isisMplsTE.status = disable; /* Only support TE metric */ | |
100 | QOBJ_REG (isis, isis); | |
101 | } | |
102 | ||
103 | struct isis_area * | |
104 | isis_area_create (const char *area_tag) | |
105 | { | |
106 | struct isis_area *area; | |
107 | ||
108 | area = XCALLOC (MTYPE_ISIS_AREA, sizeof (struct isis_area)); | |
109 | ||
110 | /* | |
111 | * The first instance is level-1-2 rest are level-1, unless otherwise | |
112 | * configured | |
113 | */ | |
114 | if (listcount (isis->area_list) > 0) | |
115 | area->is_type = IS_LEVEL_1; | |
116 | else | |
117 | area->is_type = IS_LEVEL_1_AND_2; | |
118 | ||
119 | /* | |
120 | * intialize the databases | |
121 | */ | |
122 | if (area->is_type & IS_LEVEL_1) | |
123 | { | |
124 | area->lspdb[0] = lsp_db_init (); | |
125 | area->route_table[0] = route_table_init (); | |
126 | area->route_table6[0] = route_table_init (); | |
127 | } | |
128 | if (area->is_type & IS_LEVEL_2) | |
129 | { | |
130 | area->lspdb[1] = lsp_db_init (); | |
131 | area->route_table[1] = route_table_init (); | |
132 | area->route_table6[1] = route_table_init (); | |
133 | } | |
134 | ||
135 | spftree_area_init (area); | |
136 | ||
137 | area->circuit_list = list_new (); | |
138 | area->area_addrs = list_new (); | |
139 | THREAD_TIMER_ON (master, area->t_tick, lsp_tick, area, 1); | |
140 | flags_initialize (&area->flags); | |
141 | ||
142 | /* | |
143 | * Default values | |
144 | */ | |
145 | area->max_lsp_lifetime[0] = DEFAULT_LSP_LIFETIME; /* 1200 */ | |
146 | area->max_lsp_lifetime[1] = DEFAULT_LSP_LIFETIME; /* 1200 */ | |
147 | area->lsp_refresh[0] = DEFAULT_MAX_LSP_GEN_INTERVAL; /* 900 */ | |
148 | area->lsp_refresh[1] = DEFAULT_MAX_LSP_GEN_INTERVAL; /* 900 */ | |
149 | area->lsp_gen_interval[0] = DEFAULT_MIN_LSP_GEN_INTERVAL; | |
150 | area->lsp_gen_interval[1] = DEFAULT_MIN_LSP_GEN_INTERVAL; | |
151 | area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL; | |
152 | area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL; | |
153 | area->dynhostname = 1; | |
154 | area->oldmetric = 0; | |
155 | area->newmetric = 1; | |
156 | area->lsp_frag_threshold = 90; | |
157 | area->lsp_mtu = DEFAULT_LSP_MTU; | |
158 | ||
159 | area->area_tag = strdup (area_tag); | |
160 | listnode_add (isis->area_list, area); | |
161 | area->isis = isis; | |
162 | ||
163 | QOBJ_REG (area, isis_area); | |
164 | ||
165 | return area; | |
166 | } | |
167 | ||
168 | struct isis_area * | |
169 | isis_area_lookup (const char *area_tag) | |
170 | { | |
171 | struct isis_area *area; | |
172 | struct listnode *node; | |
173 | ||
174 | for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area)) | |
175 | if ((area->area_tag == NULL && area_tag == NULL) || | |
176 | (area->area_tag && area_tag | |
177 | && strcmp (area->area_tag, area_tag) == 0)) | |
178 | return area; | |
179 | ||
180 | return NULL; | |
181 | } | |
182 | ||
183 | int | |
184 | isis_area_get (struct vty *vty, const char *area_tag) | |
185 | { | |
186 | struct isis_area *area; | |
187 | ||
188 | area = isis_area_lookup (area_tag); | |
189 | ||
190 | if (area) | |
191 | { | |
192 | VTY_PUSH_CONTEXT (ISIS_NODE, area); | |
193 | return CMD_SUCCESS; | |
194 | } | |
195 | ||
196 | area = isis_area_create (area_tag); | |
197 | ||
198 | if (isis->debugs & DEBUG_EVENTS) | |
199 | zlog_debug ("New IS-IS area instance %s", area->area_tag); | |
200 | ||
201 | VTY_PUSH_CONTEXT (ISIS_NODE, area); | |
202 | ||
203 | return CMD_SUCCESS; | |
204 | } | |
205 | ||
206 | int | |
207 | isis_area_destroy (struct vty *vty, const char *area_tag) | |
208 | { | |
209 | struct isis_area *area; | |
210 | struct listnode *node, *nnode; | |
211 | struct isis_circuit *circuit; | |
212 | struct area_addr *addr; | |
213 | ||
214 | area = isis_area_lookup (area_tag); | |
215 | ||
216 | if (area == NULL) | |
217 | { | |
218 | vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); | |
219 | return CMD_ERR_NO_MATCH; | |
220 | } | |
221 | ||
222 | QOBJ_UNREG (area); | |
223 | ||
224 | if (area->circuit_list) | |
225 | { | |
226 | for (ALL_LIST_ELEMENTS (area->circuit_list, node, nnode, circuit)) | |
227 | { | |
228 | circuit->ip_router = 0; | |
229 | circuit->ipv6_router = 0; | |
230 | isis_csm_state_change (ISIS_DISABLE, circuit, area); | |
231 | } | |
232 | list_delete (area->circuit_list); | |
233 | area->circuit_list = NULL; | |
234 | } | |
235 | ||
236 | if (area->lspdb[0] != NULL) | |
237 | { | |
238 | lsp_db_destroy (area->lspdb[0]); | |
239 | area->lspdb[0] = NULL; | |
240 | } | |
241 | if (area->lspdb[1] != NULL) | |
242 | { | |
243 | lsp_db_destroy (area->lspdb[1]); | |
244 | area->lspdb[1] = NULL; | |
245 | } | |
246 | ||
247 | spftree_area_del (area); | |
248 | ||
249 | THREAD_TIMER_OFF(area->spf_timer[0]); | |
250 | THREAD_TIMER_OFF(area->spf_timer[1]); | |
251 | ||
252 | spf_backoff_free(area->spf_delay_ietf[0]); | |
253 | spf_backoff_free(area->spf_delay_ietf[1]); | |
254 | ||
255 | /* invalidate and validate would delete all routes from zebra */ | |
256 | isis_route_invalidate (area); | |
257 | isis_route_validate (area); | |
258 | ||
259 | if (area->route_table[0]) | |
260 | { | |
261 | route_table_finish (area->route_table[0]); | |
262 | area->route_table[0] = NULL; | |
263 | } | |
264 | if (area->route_table[1]) | |
265 | { | |
266 | route_table_finish (area->route_table[1]); | |
267 | area->route_table[1] = NULL; | |
268 | } | |
269 | if (area->route_table6[0]) | |
270 | { | |
271 | route_table_finish (area->route_table6[0]); | |
272 | area->route_table6[0] = NULL; | |
273 | } | |
274 | if (area->route_table6[1]) | |
275 | { | |
276 | route_table_finish (area->route_table6[1]); | |
277 | area->route_table6[1] = NULL; | |
278 | } | |
279 | ||
280 | isis_redist_area_finish(area); | |
281 | ||
282 | for (ALL_LIST_ELEMENTS (area->area_addrs, node, nnode, addr)) | |
283 | { | |
284 | list_delete_node (area->area_addrs, node); | |
285 | XFREE (MTYPE_ISIS_AREA_ADDR, addr); | |
286 | } | |
287 | area->area_addrs = NULL; | |
288 | ||
289 | THREAD_TIMER_OFF (area->t_tick); | |
290 | THREAD_TIMER_OFF (area->t_lsp_refresh[0]); | |
291 | THREAD_TIMER_OFF (area->t_lsp_refresh[1]); | |
292 | ||
293 | thread_cancel_event (master, area); | |
294 | ||
295 | listnode_delete (isis->area_list, area); | |
296 | ||
297 | free (area->area_tag); | |
298 | ||
299 | XFREE (MTYPE_ISIS_AREA, area); | |
300 | ||
301 | if (listcount (isis->area_list) == 0) | |
302 | { | |
303 | memset (isis->sysid, 0, ISIS_SYS_ID_LEN); | |
304 | isis->sysid_set = 0; | |
305 | } | |
306 | ||
307 | return CMD_SUCCESS; | |
308 | } | |
309 | ||
310 | int | |
311 | area_net_title (struct vty *vty, const char *net_title) | |
312 | { | |
313 | VTY_DECLVAR_CONTEXT (isis_area, area); | |
314 | struct area_addr *addr; | |
315 | struct area_addr *addrp; | |
316 | struct listnode *node; | |
317 | ||
318 | u_char buff[255]; | |
319 | ||
320 | /* We check that we are not over the maximal number of addresses */ | |
321 | if (listcount (area->area_addrs) >= isis->max_area_addrs) | |
322 | { | |
323 | vty_out (vty, "Maximum of area addresses (%d) already reached %s", | |
324 | isis->max_area_addrs, VTY_NEWLINE); | |
325 | return CMD_ERR_NOTHING_TODO; | |
326 | } | |
327 | ||
328 | addr = XMALLOC (MTYPE_ISIS_AREA_ADDR, sizeof (struct area_addr)); | |
329 | addr->addr_len = dotformat2buff (buff, net_title); | |
330 | memcpy (addr->area_addr, buff, addr->addr_len); | |
331 | #ifdef EXTREME_DEBUG | |
332 | zlog_debug ("added area address %s for area %s (address length %d)", | |
333 | net_title, area->area_tag, addr->addr_len); | |
334 | #endif /* EXTREME_DEBUG */ | |
335 | if (addr->addr_len < 8 || addr->addr_len > 20) | |
336 | { | |
337 | vty_out (vty, "area address must be at least 8..20 octets long (%d)%s", | |
338 | addr->addr_len, VTY_NEWLINE); | |
339 | XFREE (MTYPE_ISIS_AREA_ADDR, addr); | |
340 | return CMD_ERR_AMBIGUOUS; | |
341 | } | |
342 | ||
343 | if (addr->area_addr[addr->addr_len-1] != 0) | |
344 | { | |
345 | vty_out (vty, "nsel byte (last byte) in area address must be 0%s", | |
346 | VTY_NEWLINE); | |
347 | XFREE (MTYPE_ISIS_AREA_ADDR, addr); | |
348 | return CMD_ERR_AMBIGUOUS; | |
349 | } | |
350 | ||
351 | if (isis->sysid_set == 0) | |
352 | { | |
353 | /* | |
354 | * First area address - get the SystemID for this router | |
355 | */ | |
356 | memcpy (isis->sysid, GETSYSID (addr), ISIS_SYS_ID_LEN); | |
357 | isis->sysid_set = 1; | |
358 | if (isis->debugs & DEBUG_EVENTS) | |
359 | zlog_debug ("Router has SystemID %s", sysid_print (isis->sysid)); | |
360 | } | |
361 | else | |
362 | { | |
363 | /* | |
364 | * Check that the SystemID portions match | |
365 | */ | |
366 | if (memcmp (isis->sysid, GETSYSID (addr), ISIS_SYS_ID_LEN)) | |
367 | { | |
368 | vty_out (vty, | |
369 | "System ID must not change when defining additional area" | |
370 | " addresses%s", VTY_NEWLINE); | |
371 | XFREE (MTYPE_ISIS_AREA_ADDR, addr); | |
372 | return CMD_ERR_AMBIGUOUS; | |
373 | } | |
374 | ||
375 | /* now we see that we don't already have this address */ | |
376 | for (ALL_LIST_ELEMENTS_RO (area->area_addrs, node, addrp)) | |
377 | { | |
378 | if ((addrp->addr_len + ISIS_SYS_ID_LEN + ISIS_NSEL_LEN) != (addr->addr_len)) | |
379 | continue; | |
380 | if (!memcmp (addrp->area_addr, addr->area_addr, addr->addr_len)) | |
381 | { | |
382 | XFREE (MTYPE_ISIS_AREA_ADDR, addr); | |
383 | return CMD_SUCCESS; /* silent fail */ | |
384 | } | |
385 | } | |
386 | } | |
387 | ||
388 | /* | |
389 | * Forget the systemID part of the address | |
390 | */ | |
391 | addr->addr_len -= (ISIS_SYS_ID_LEN + ISIS_NSEL_LEN); | |
392 | listnode_add (area->area_addrs, addr); | |
393 | ||
394 | /* only now we can safely generate our LSPs for this area */ | |
395 | if (listcount (area->area_addrs) > 0) | |
396 | { | |
397 | if (area->is_type & IS_LEVEL_1) | |
398 | lsp_generate (area, IS_LEVEL_1); | |
399 | if (area->is_type & IS_LEVEL_2) | |
400 | lsp_generate (area, IS_LEVEL_2); | |
401 | } | |
402 | ||
403 | return CMD_SUCCESS; | |
404 | } | |
405 | ||
406 | int | |
407 | area_clear_net_title (struct vty *vty, const char *net_title) | |
408 | { | |
409 | VTY_DECLVAR_CONTEXT (isis_area, area); | |
410 | struct area_addr addr, *addrp = NULL; | |
411 | struct listnode *node; | |
412 | u_char buff[255]; | |
413 | ||
414 | addr.addr_len = dotformat2buff (buff, net_title); | |
415 | if (addr.addr_len < 8 || addr.addr_len > 20) | |
416 | { | |
417 | vty_out (vty, "Unsupported area address length %d, should be 8...20 %s", | |
418 | addr.addr_len, VTY_NEWLINE); | |
419 | return CMD_ERR_AMBIGUOUS; | |
420 | } | |
421 | ||
422 | memcpy (addr.area_addr, buff, (int) addr.addr_len); | |
423 | ||
424 | for (ALL_LIST_ELEMENTS_RO (area->area_addrs, node, addrp)) | |
425 | if ((addrp->addr_len + ISIS_SYS_ID_LEN + 1) == addr.addr_len && | |
426 | !memcmp (addrp->area_addr, addr.area_addr, addr.addr_len)) | |
427 | break; | |
428 | ||
429 | if (!addrp) | |
430 | { | |
431 | vty_out (vty, "No area address %s for area %s %s", net_title, | |
432 | area->area_tag, VTY_NEWLINE); | |
433 | return CMD_ERR_NO_MATCH; | |
434 | } | |
435 | ||
436 | listnode_delete (area->area_addrs, addrp); | |
437 | XFREE (MTYPE_ISIS_AREA_ADDR, addrp); | |
438 | ||
439 | /* | |
440 | * Last area address - reset the SystemID for this router | |
441 | */ | |
442 | if (listcount (area->area_addrs) == 0) | |
443 | { | |
444 | memset (isis->sysid, 0, ISIS_SYS_ID_LEN); | |
445 | isis->sysid_set = 0; | |
446 | if (isis->debugs & DEBUG_EVENTS) | |
447 | zlog_debug ("Router has no SystemID"); | |
448 | } | |
449 | ||
450 | return CMD_SUCCESS; | |
451 | } | |
452 | ||
453 | /* | |
454 | * 'show isis interface' command | |
455 | */ | |
456 | ||
457 | int | |
458 | show_isis_interface_common (struct vty *vty, const char *ifname, char detail) | |
459 | { | |
460 | struct listnode *anode, *cnode; | |
461 | struct isis_area *area; | |
462 | struct isis_circuit *circuit; | |
463 | ||
464 | if (!isis) | |
465 | { | |
466 | vty_out (vty, "IS-IS Routing Process not enabled%s", VTY_NEWLINE); | |
467 | return CMD_SUCCESS; | |
468 | } | |
469 | ||
470 | for (ALL_LIST_ELEMENTS_RO (isis->area_list, anode, area)) | |
471 | { | |
472 | vty_out (vty, "Area %s:%s", area->area_tag, VTY_NEWLINE); | |
473 | ||
474 | if (detail == ISIS_UI_LEVEL_BRIEF) | |
475 | vty_out (vty, " Interface CircId State Type Level%s", | |
476 | VTY_NEWLINE); | |
477 | ||
478 | for (ALL_LIST_ELEMENTS_RO (area->circuit_list, cnode, circuit)) | |
479 | if (!ifname) | |
480 | isis_circuit_print_vty (circuit, vty, detail); | |
481 | else if (strcmp(circuit->interface->name, ifname) == 0) | |
482 | isis_circuit_print_vty (circuit, vty, detail); | |
483 | } | |
484 | ||
485 | return CMD_SUCCESS; | |
486 | } | |
487 | ||
488 | DEFUN (show_isis_interface, | |
489 | show_isis_interface_cmd, | |
490 | "show isis interface", | |
491 | SHOW_STR | |
492 | "ISIS network information\n" | |
493 | "ISIS interface\n") | |
494 | { | |
495 | return show_isis_interface_common (vty, NULL, ISIS_UI_LEVEL_BRIEF); | |
496 | } | |
497 | ||
498 | DEFUN (show_isis_interface_detail, | |
499 | show_isis_interface_detail_cmd, | |
500 | "show isis interface detail", | |
501 | SHOW_STR | |
502 | "ISIS network information\n" | |
503 | "ISIS interface\n" | |
504 | "show detailed information\n") | |
505 | { | |
506 | return show_isis_interface_common (vty, NULL, ISIS_UI_LEVEL_DETAIL); | |
507 | } | |
508 | ||
509 | DEFUN (show_isis_interface_arg, | |
510 | show_isis_interface_arg_cmd, | |
511 | "show isis interface WORD", | |
512 | SHOW_STR | |
513 | "ISIS network information\n" | |
514 | "ISIS interface\n" | |
515 | "ISIS interface name\n") | |
516 | { | |
517 | int idx_word = 3; | |
518 | return show_isis_interface_common (vty, argv[idx_word]->arg, ISIS_UI_LEVEL_DETAIL); | |
519 | } | |
520 | ||
521 | /* | |
522 | * 'show isis neighbor' command | |
523 | */ | |
524 | ||
525 | int | |
526 | show_isis_neighbor_common (struct vty *vty, const char *id, char detail) | |
527 | { | |
528 | struct listnode *anode, *cnode, *node; | |
529 | struct isis_area *area; | |
530 | struct isis_circuit *circuit; | |
531 | struct list *adjdb; | |
532 | struct isis_adjacency *adj; | |
533 | struct isis_dynhn *dynhn; | |
534 | u_char sysid[ISIS_SYS_ID_LEN]; | |
535 | int i; | |
536 | ||
537 | if (!isis) | |
538 | { | |
539 | vty_out (vty, "IS-IS Routing Process not enabled%s", VTY_NEWLINE); | |
540 | return CMD_SUCCESS; | |
541 | } | |
542 | ||
543 | memset (sysid, 0, ISIS_SYS_ID_LEN); | |
544 | if (id) | |
545 | { | |
546 | if (sysid2buff (sysid, id) == 0) | |
547 | { | |
548 | dynhn = dynhn_find_by_name (id); | |
549 | if (dynhn == NULL) | |
550 | { | |
551 | vty_out (vty, "Invalid system id %s%s", id, VTY_NEWLINE); | |
552 | return CMD_SUCCESS; | |
553 | } | |
554 | memcpy (sysid, dynhn->id, ISIS_SYS_ID_LEN); | |
555 | } | |
556 | } | |
557 | ||
558 | for (ALL_LIST_ELEMENTS_RO (isis->area_list, anode, area)) | |
559 | { | |
560 | vty_out (vty, "Area %s:%s", area->area_tag, VTY_NEWLINE); | |
561 | ||
562 | if (detail == ISIS_UI_LEVEL_BRIEF) | |
563 | vty_out (vty, " System Id Interface L State" | |
564 | " Holdtime SNPA%s", VTY_NEWLINE); | |
565 | ||
566 | for (ALL_LIST_ELEMENTS_RO (area->circuit_list, cnode, circuit)) | |
567 | { | |
568 | if (circuit->circ_type == CIRCUIT_T_BROADCAST) | |
569 | { | |
570 | for (i = 0; i < 2; i++) | |
571 | { | |
572 | adjdb = circuit->u.bc.adjdb[i]; | |
573 | if (adjdb && adjdb->count) | |
574 | { | |
575 | for (ALL_LIST_ELEMENTS_RO (adjdb, node, adj)) | |
576 | if (!id || !memcmp (adj->sysid, sysid, | |
577 | ISIS_SYS_ID_LEN)) | |
578 | isis_adj_print_vty (adj, vty, detail); | |
579 | } | |
580 | } | |
581 | } | |
582 | else if (circuit->circ_type == CIRCUIT_T_P2P && | |
583 | circuit->u.p2p.neighbor) | |
584 | { | |
585 | adj = circuit->u.p2p.neighbor; | |
586 | if (!id || !memcmp (adj->sysid, sysid, ISIS_SYS_ID_LEN)) | |
587 | isis_adj_print_vty (adj, vty, detail); | |
588 | } | |
589 | } | |
590 | } | |
591 | ||
592 | return CMD_SUCCESS; | |
593 | } | |
594 | ||
595 | /* | |
596 | * 'clear isis neighbor' command | |
597 | */ | |
598 | int | |
599 | clear_isis_neighbor_common (struct vty *vty, const char *id) | |
600 | { | |
601 | struct listnode *anode, *cnode, *cnextnode, *node, *nnode; | |
602 | struct isis_area *area; | |
603 | struct isis_circuit *circuit; | |
604 | struct list *adjdb; | |
605 | struct isis_adjacency *adj; | |
606 | struct isis_dynhn *dynhn; | |
607 | u_char sysid[ISIS_SYS_ID_LEN]; | |
608 | int i; | |
609 | ||
610 | if (!isis) | |
611 | { | |
612 | vty_out (vty, "IS-IS Routing Process not enabled%s", VTY_NEWLINE); | |
613 | return CMD_SUCCESS; | |
614 | } | |
615 | ||
616 | memset (sysid, 0, ISIS_SYS_ID_LEN); | |
617 | if (id) | |
618 | { | |
619 | if (sysid2buff (sysid, id) == 0) | |
620 | { | |
621 | dynhn = dynhn_find_by_name (id); | |
622 | if (dynhn == NULL) | |
623 | { | |
624 | vty_out (vty, "Invalid system id %s%s", id, VTY_NEWLINE); | |
625 | return CMD_SUCCESS; | |
626 | } | |
627 | memcpy (sysid, dynhn->id, ISIS_SYS_ID_LEN); | |
628 | } | |
629 | } | |
630 | ||
631 | for (ALL_LIST_ELEMENTS_RO (isis->area_list, anode, area)) | |
632 | { | |
633 | for (ALL_LIST_ELEMENTS (area->circuit_list, cnode, cnextnode, circuit)) | |
634 | { | |
635 | if (circuit->circ_type == CIRCUIT_T_BROADCAST) | |
636 | { | |
637 | for (i = 0; i < 2; i++) | |
638 | { | |
639 | adjdb = circuit->u.bc.adjdb[i]; | |
640 | if (adjdb && adjdb->count) | |
641 | { | |
642 | for (ALL_LIST_ELEMENTS (adjdb, node, nnode, adj)) | |
643 | if (!id || !memcmp (adj->sysid, sysid, ISIS_SYS_ID_LEN)) | |
644 | isis_adj_state_change (adj, ISIS_ADJ_DOWN, | |
645 | "clear user request"); | |
646 | } | |
647 | } | |
648 | } | |
649 | else if (circuit->circ_type == CIRCUIT_T_P2P && | |
650 | circuit->u.p2p.neighbor) | |
651 | { | |
652 | adj = circuit->u.p2p.neighbor; | |
653 | if (!id || !memcmp (adj->sysid, sysid, ISIS_SYS_ID_LEN)) | |
654 | isis_adj_state_change (adj, ISIS_ADJ_DOWN, | |
655 | "clear user request"); | |
656 | } | |
657 | } | |
658 | } | |
659 | ||
660 | return CMD_SUCCESS; | |
661 | } | |
662 | ||
663 | DEFUN (show_isis_neighbor, | |
664 | show_isis_neighbor_cmd, | |
665 | "show isis neighbor", | |
666 | SHOW_STR | |
667 | "ISIS network information\n" | |
668 | "ISIS neighbor adjacencies\n") | |
669 | { | |
670 | return show_isis_neighbor_common (vty, NULL, ISIS_UI_LEVEL_BRIEF); | |
671 | } | |
672 | ||
673 | DEFUN (show_isis_neighbor_detail, | |
674 | show_isis_neighbor_detail_cmd, | |
675 | "show isis neighbor detail", | |
676 | SHOW_STR | |
677 | "ISIS network information\n" | |
678 | "ISIS neighbor adjacencies\n" | |
679 | "show detailed information\n") | |
680 | { | |
681 | return show_isis_neighbor_common (vty, NULL, ISIS_UI_LEVEL_DETAIL); | |
682 | } | |
683 | ||
684 | DEFUN (show_isis_neighbor_arg, | |
685 | show_isis_neighbor_arg_cmd, | |
686 | "show isis neighbor WORD", | |
687 | SHOW_STR | |
688 | "ISIS network information\n" | |
689 | "ISIS neighbor adjacencies\n" | |
690 | "System id\n") | |
691 | { | |
692 | int idx_word = 3; | |
693 | return show_isis_neighbor_common (vty, argv[idx_word]->arg, ISIS_UI_LEVEL_DETAIL); | |
694 | } | |
695 | ||
696 | DEFUN (clear_isis_neighbor, | |
697 | clear_isis_neighbor_cmd, | |
698 | "clear isis neighbor", | |
699 | CLEAR_STR | |
700 | "Reset ISIS network information\n" | |
701 | "Reset ISIS neighbor adjacencies\n") | |
702 | { | |
703 | return clear_isis_neighbor_common (vty, NULL); | |
704 | } | |
705 | ||
706 | DEFUN (clear_isis_neighbor_arg, | |
707 | clear_isis_neighbor_arg_cmd, | |
708 | "clear isis neighbor WORD", | |
709 | CLEAR_STR | |
710 | "ISIS network information\n" | |
711 | "ISIS neighbor adjacencies\n" | |
712 | "System id\n") | |
713 | { | |
714 | int idx_word = 3; | |
715 | return clear_isis_neighbor_common (vty, argv[idx_word]->arg); | |
716 | } | |
717 | ||
718 | /* | |
719 | * 'isis debug', 'show debugging' | |
720 | */ | |
721 | void | |
722 | print_debug (struct vty *vty, int flags, int onoff) | |
723 | { | |
724 | char onoffs[4]; | |
725 | if (onoff) | |
726 | strcpy (onoffs, "on"); | |
727 | else | |
728 | strcpy (onoffs, "off"); | |
729 | ||
730 | if (flags & DEBUG_ADJ_PACKETS) | |
731 | vty_out (vty, "IS-IS Adjacency related packets debugging is %s%s", onoffs, | |
732 | VTY_NEWLINE); | |
733 | if (flags & DEBUG_CHECKSUM_ERRORS) | |
734 | vty_out (vty, "IS-IS checksum errors debugging is %s%s", onoffs, | |
735 | VTY_NEWLINE); | |
736 | if (flags & DEBUG_LOCAL_UPDATES) | |
737 | vty_out (vty, "IS-IS local updates debugging is %s%s", onoffs, | |
738 | VTY_NEWLINE); | |
739 | if (flags & DEBUG_PROTOCOL_ERRORS) | |
740 | vty_out (vty, "IS-IS protocol errors debugging is %s%s", onoffs, | |
741 | VTY_NEWLINE); | |
742 | if (flags & DEBUG_SNP_PACKETS) | |
743 | vty_out (vty, "IS-IS CSNP/PSNP packets debugging is %s%s", onoffs, | |
744 | VTY_NEWLINE); | |
745 | if (flags & DEBUG_SPF_EVENTS) | |
746 | vty_out (vty, "IS-IS SPF events debugging is %s%s", onoffs, VTY_NEWLINE); | |
747 | if (flags & DEBUG_SPF_STATS) | |
748 | vty_out (vty, "IS-IS SPF Timing and Statistics Data debugging is %s%s", | |
749 | onoffs, VTY_NEWLINE); | |
750 | if (flags & DEBUG_SPF_TRIGGERS) | |
751 | vty_out (vty, "IS-IS SPF triggering events debugging is %s%s", onoffs, | |
752 | VTY_NEWLINE); | |
753 | if (flags & DEBUG_UPDATE_PACKETS) | |
754 | vty_out (vty, "IS-IS Update related packet debugging is %s%s", onoffs, | |
755 | VTY_NEWLINE); | |
756 | if (flags & DEBUG_RTE_EVENTS) | |
757 | vty_out (vty, "IS-IS Route related debuggin is %s%s", onoffs, | |
758 | VTY_NEWLINE); | |
759 | if (flags & DEBUG_EVENTS) | |
760 | vty_out (vty, "IS-IS Event debugging is %s%s", onoffs, VTY_NEWLINE); | |
761 | if (flags & DEBUG_PACKET_DUMP) | |
762 | vty_out (vty, "IS-IS Packet dump debugging is %s%s", onoffs, VTY_NEWLINE); | |
763 | if (flags & DEBUG_LSP_GEN) | |
764 | vty_out (vty, "IS-IS LSP generation debugging is %s%s", onoffs, VTY_NEWLINE); | |
765 | if (flags & DEBUG_LSP_SCHED) | |
766 | vty_out (vty, "IS-IS LSP scheduling debugging is %s%s", onoffs, VTY_NEWLINE); | |
767 | } | |
768 | ||
769 | DEFUN (show_debugging, | |
770 | show_debugging_isis_cmd, | |
771 | "show debugging isis", | |
772 | SHOW_STR | |
773 | "State of each debugging option\n" | |
774 | ISIS_STR) | |
775 | { | |
776 | if (isis->debugs) { | |
777 | vty_out (vty, "IS-IS:%s", VTY_NEWLINE); | |
778 | print_debug (vty, isis->debugs, 1); | |
779 | } | |
780 | return CMD_SUCCESS; | |
781 | } | |
782 | ||
783 | /* Debug node. */ | |
784 | static struct cmd_node debug_node = { | |
785 | DEBUG_NODE, | |
786 | "", | |
787 | 1 | |
788 | }; | |
789 | ||
790 | static int | |
791 | config_write_debug (struct vty *vty) | |
792 | { | |
793 | int write = 0; | |
794 | int flags = isis->debugs; | |
795 | ||
796 | if (flags & DEBUG_ADJ_PACKETS) | |
797 | { | |
798 | vty_out (vty, "debug isis adj-packets%s", VTY_NEWLINE); | |
799 | write++; | |
800 | } | |
801 | if (flags & DEBUG_CHECKSUM_ERRORS) | |
802 | { | |
803 | vty_out (vty, "debug isis checksum-errors%s", VTY_NEWLINE); | |
804 | write++; | |
805 | } | |
806 | if (flags & DEBUG_LOCAL_UPDATES) | |
807 | { | |
808 | vty_out (vty, "debug isis local-updates%s", VTY_NEWLINE); | |
809 | write++; | |
810 | } | |
811 | if (flags & DEBUG_PROTOCOL_ERRORS) | |
812 | { | |
813 | vty_out (vty, "debug isis protocol-errors%s", VTY_NEWLINE); | |
814 | write++; | |
815 | } | |
816 | if (flags & DEBUG_SNP_PACKETS) | |
817 | { | |
818 | vty_out (vty, "debug isis snp-packets%s", VTY_NEWLINE); | |
819 | write++; | |
820 | } | |
821 | if (flags & DEBUG_SPF_EVENTS) | |
822 | { | |
823 | vty_out (vty, "debug isis spf-events%s", VTY_NEWLINE); | |
824 | write++; | |
825 | } | |
826 | if (flags & DEBUG_SPF_STATS) | |
827 | { | |
828 | vty_out (vty, "debug isis spf-statistics%s", VTY_NEWLINE); | |
829 | write++; | |
830 | } | |
831 | if (flags & DEBUG_SPF_TRIGGERS) | |
832 | { | |
833 | vty_out (vty, "debug isis spf-triggers%s", VTY_NEWLINE); | |
834 | write++; | |
835 | } | |
836 | if (flags & DEBUG_UPDATE_PACKETS) | |
837 | { | |
838 | vty_out (vty, "debug isis update-packets%s", VTY_NEWLINE); | |
839 | write++; | |
840 | } | |
841 | if (flags & DEBUG_RTE_EVENTS) | |
842 | { | |
843 | vty_out (vty, "debug isis route-events%s", VTY_NEWLINE); | |
844 | write++; | |
845 | } | |
846 | if (flags & DEBUG_EVENTS) | |
847 | { | |
848 | vty_out (vty, "debug isis events%s", VTY_NEWLINE); | |
849 | write++; | |
850 | } | |
851 | if (flags & DEBUG_PACKET_DUMP) | |
852 | { | |
853 | vty_out (vty, "debug isis packet-dump%s", VTY_NEWLINE); | |
854 | write++; | |
855 | } | |
856 | if (flags & DEBUG_LSP_GEN) | |
857 | { | |
858 | vty_out (vty, "debug isis lsp-gen%s", VTY_NEWLINE); | |
859 | write++; | |
860 | } | |
861 | if (flags & DEBUG_LSP_SCHED) | |
862 | { | |
863 | vty_out (vty, "debug isis lsp-sched%s", VTY_NEWLINE); | |
864 | write++; | |
865 | } | |
866 | write += spf_backoff_write_config(vty); | |
867 | ||
868 | return write; | |
869 | } | |
870 | ||
871 | DEFUN (debug_isis_adj, | |
872 | debug_isis_adj_cmd, | |
873 | "debug isis adj-packets", | |
874 | DEBUG_STR | |
875 | "IS-IS information\n" | |
876 | "IS-IS Adjacency related packets\n") | |
877 | { | |
878 | isis->debugs |= DEBUG_ADJ_PACKETS; | |
879 | print_debug (vty, DEBUG_ADJ_PACKETS, 1); | |
880 | ||
881 | return CMD_SUCCESS; | |
882 | } | |
883 | ||
884 | DEFUN (no_debug_isis_adj, | |
885 | no_debug_isis_adj_cmd, | |
886 | "no debug isis adj-packets", | |
887 | NO_STR | |
888 | UNDEBUG_STR | |
889 | "IS-IS information\n" | |
890 | "IS-IS Adjacency related packets\n") | |
891 | { | |
892 | isis->debugs &= ~DEBUG_ADJ_PACKETS; | |
893 | print_debug (vty, DEBUG_ADJ_PACKETS, 0); | |
894 | ||
895 | return CMD_SUCCESS; | |
896 | } | |
897 | ||
898 | DEFUN (debug_isis_csum, | |
899 | debug_isis_csum_cmd, | |
900 | "debug isis checksum-errors", | |
901 | DEBUG_STR | |
902 | "IS-IS information\n" | |
903 | "IS-IS LSP checksum errors\n") | |
904 | { | |
905 | isis->debugs |= DEBUG_CHECKSUM_ERRORS; | |
906 | print_debug (vty, DEBUG_CHECKSUM_ERRORS, 1); | |
907 | ||
908 | return CMD_SUCCESS; | |
909 | } | |
910 | ||
911 | DEFUN (no_debug_isis_csum, | |
912 | no_debug_isis_csum_cmd, | |
913 | "no debug isis checksum-errors", | |
914 | NO_STR | |
915 | UNDEBUG_STR | |
916 | "IS-IS information\n" | |
917 | "IS-IS LSP checksum errors\n") | |
918 | { | |
919 | isis->debugs &= ~DEBUG_CHECKSUM_ERRORS; | |
920 | print_debug (vty, DEBUG_CHECKSUM_ERRORS, 0); | |
921 | ||
922 | return CMD_SUCCESS; | |
923 | } | |
924 | ||
925 | DEFUN (debug_isis_lupd, | |
926 | debug_isis_lupd_cmd, | |
927 | "debug isis local-updates", | |
928 | DEBUG_STR | |
929 | "IS-IS information\n" | |
930 | "IS-IS local update packets\n") | |
931 | { | |
932 | isis->debugs |= DEBUG_LOCAL_UPDATES; | |
933 | print_debug (vty, DEBUG_LOCAL_UPDATES, 1); | |
934 | ||
935 | return CMD_SUCCESS; | |
936 | } | |
937 | ||
938 | DEFUN (no_debug_isis_lupd, | |
939 | no_debug_isis_lupd_cmd, | |
940 | "no debug isis local-updates", | |
941 | NO_STR | |
942 | UNDEBUG_STR | |
943 | "IS-IS information\n" | |
944 | "IS-IS local update packets\n") | |
945 | { | |
946 | isis->debugs &= ~DEBUG_LOCAL_UPDATES; | |
947 | print_debug (vty, DEBUG_LOCAL_UPDATES, 0); | |
948 | ||
949 | return CMD_SUCCESS; | |
950 | } | |
951 | ||
952 | DEFUN (debug_isis_err, | |
953 | debug_isis_err_cmd, | |
954 | "debug isis protocol-errors", | |
955 | DEBUG_STR | |
956 | "IS-IS information\n" | |
957 | "IS-IS LSP protocol errors\n") | |
958 | { | |
959 | isis->debugs |= DEBUG_PROTOCOL_ERRORS; | |
960 | print_debug (vty, DEBUG_PROTOCOL_ERRORS, 1); | |
961 | ||
962 | return CMD_SUCCESS; | |
963 | } | |
964 | ||
965 | DEFUN (no_debug_isis_err, | |
966 | no_debug_isis_err_cmd, | |
967 | "no debug isis protocol-errors", | |
968 | NO_STR | |
969 | UNDEBUG_STR | |
970 | "IS-IS information\n" | |
971 | "IS-IS LSP protocol errors\n") | |
972 | { | |
973 | isis->debugs &= ~DEBUG_PROTOCOL_ERRORS; | |
974 | print_debug (vty, DEBUG_PROTOCOL_ERRORS, 0); | |
975 | ||
976 | return CMD_SUCCESS; | |
977 | } | |
978 | ||
979 | DEFUN (debug_isis_snp, | |
980 | debug_isis_snp_cmd, | |
981 | "debug isis snp-packets", | |
982 | DEBUG_STR | |
983 | "IS-IS information\n" | |
984 | "IS-IS CSNP/PSNP packets\n") | |
985 | { | |
986 | isis->debugs |= DEBUG_SNP_PACKETS; | |
987 | print_debug (vty, DEBUG_SNP_PACKETS, 1); | |
988 | ||
989 | return CMD_SUCCESS; | |
990 | } | |
991 | ||
992 | DEFUN (no_debug_isis_snp, | |
993 | no_debug_isis_snp_cmd, | |
994 | "no debug isis snp-packets", | |
995 | NO_STR | |
996 | UNDEBUG_STR | |
997 | "IS-IS information\n" | |
998 | "IS-IS CSNP/PSNP packets\n") | |
999 | { | |
1000 | isis->debugs &= ~DEBUG_SNP_PACKETS; | |
1001 | print_debug (vty, DEBUG_SNP_PACKETS, 0); | |
1002 | ||
1003 | return CMD_SUCCESS; | |
1004 | } | |
1005 | ||
1006 | DEFUN (debug_isis_upd, | |
1007 | debug_isis_upd_cmd, | |
1008 | "debug isis update-packets", | |
1009 | DEBUG_STR | |
1010 | "IS-IS information\n" | |
1011 | "IS-IS Update related packets\n") | |
1012 | { | |
1013 | isis->debugs |= DEBUG_UPDATE_PACKETS; | |
1014 | print_debug (vty, DEBUG_UPDATE_PACKETS, 1); | |
1015 | ||
1016 | return CMD_SUCCESS; | |
1017 | } | |
1018 | ||
1019 | DEFUN (no_debug_isis_upd, | |
1020 | no_debug_isis_upd_cmd, | |
1021 | "no debug isis update-packets", | |
1022 | NO_STR | |
1023 | UNDEBUG_STR | |
1024 | "IS-IS information\n" | |
1025 | "IS-IS Update related packets\n") | |
1026 | { | |
1027 | isis->debugs &= ~DEBUG_UPDATE_PACKETS; | |
1028 | print_debug (vty, DEBUG_UPDATE_PACKETS, 0); | |
1029 | ||
1030 | return CMD_SUCCESS; | |
1031 | } | |
1032 | ||
1033 | DEFUN (debug_isis_spfevents, | |
1034 | debug_isis_spfevents_cmd, | |
1035 | "debug isis spf-events", | |
1036 | DEBUG_STR | |
1037 | "IS-IS information\n" | |
1038 | "IS-IS Shortest Path First Events\n") | |
1039 | { | |
1040 | isis->debugs |= DEBUG_SPF_EVENTS; | |
1041 | print_debug (vty, DEBUG_SPF_EVENTS, 1); | |
1042 | ||
1043 | return CMD_SUCCESS; | |
1044 | } | |
1045 | ||
1046 | DEFUN (no_debug_isis_spfevents, | |
1047 | no_debug_isis_spfevents_cmd, | |
1048 | "no debug isis spf-events", | |
1049 | NO_STR | |
1050 | UNDEBUG_STR | |
1051 | "IS-IS information\n" | |
1052 | "IS-IS Shortest Path First Events\n") | |
1053 | { | |
1054 | isis->debugs &= ~DEBUG_SPF_EVENTS; | |
1055 | print_debug (vty, DEBUG_SPF_EVENTS, 0); | |
1056 | ||
1057 | return CMD_SUCCESS; | |
1058 | } | |
1059 | ||
1060 | DEFUN (debug_isis_spfstats, | |
1061 | debug_isis_spfstats_cmd, | |
1062 | "debug isis spf-statistics ", | |
1063 | DEBUG_STR | |
1064 | "IS-IS information\n" | |
1065 | "IS-IS SPF Timing and Statistic Data\n") | |
1066 | { | |
1067 | isis->debugs |= DEBUG_SPF_STATS; | |
1068 | print_debug (vty, DEBUG_SPF_STATS, 1); | |
1069 | ||
1070 | return CMD_SUCCESS; | |
1071 | } | |
1072 | ||
1073 | DEFUN (no_debug_isis_spfstats, | |
1074 | no_debug_isis_spfstats_cmd, | |
1075 | "no debug isis spf-statistics", | |
1076 | NO_STR | |
1077 | UNDEBUG_STR | |
1078 | "IS-IS information\n" | |
1079 | "IS-IS SPF Timing and Statistic Data\n") | |
1080 | { | |
1081 | isis->debugs &= ~DEBUG_SPF_STATS; | |
1082 | print_debug (vty, DEBUG_SPF_STATS, 0); | |
1083 | ||
1084 | return CMD_SUCCESS; | |
1085 | } | |
1086 | ||
1087 | DEFUN (debug_isis_spftrigg, | |
1088 | debug_isis_spftrigg_cmd, | |
1089 | "debug isis spf-triggers", | |
1090 | DEBUG_STR | |
1091 | "IS-IS information\n" | |
1092 | "IS-IS SPF triggering events\n") | |
1093 | { | |
1094 | isis->debugs |= DEBUG_SPF_TRIGGERS; | |
1095 | print_debug (vty, DEBUG_SPF_TRIGGERS, 1); | |
1096 | ||
1097 | return CMD_SUCCESS; | |
1098 | } | |
1099 | ||
1100 | DEFUN (no_debug_isis_spftrigg, | |
1101 | no_debug_isis_spftrigg_cmd, | |
1102 | "no debug isis spf-triggers", | |
1103 | NO_STR | |
1104 | UNDEBUG_STR | |
1105 | "IS-IS information\n" | |
1106 | "IS-IS SPF triggering events\n") | |
1107 | { | |
1108 | isis->debugs &= ~DEBUG_SPF_TRIGGERS; | |
1109 | print_debug (vty, DEBUG_SPF_TRIGGERS, 0); | |
1110 | ||
1111 | return CMD_SUCCESS; | |
1112 | } | |
1113 | ||
1114 | DEFUN (debug_isis_rtevents, | |
1115 | debug_isis_rtevents_cmd, | |
1116 | "debug isis route-events", | |
1117 | DEBUG_STR | |
1118 | "IS-IS information\n" | |
1119 | "IS-IS Route related events\n") | |
1120 | { | |
1121 | isis->debugs |= DEBUG_RTE_EVENTS; | |
1122 | print_debug (vty, DEBUG_RTE_EVENTS, 1); | |
1123 | ||
1124 | return CMD_SUCCESS; | |
1125 | } | |
1126 | ||
1127 | DEFUN (no_debug_isis_rtevents, | |
1128 | no_debug_isis_rtevents_cmd, | |
1129 | "no debug isis route-events", | |
1130 | NO_STR | |
1131 | UNDEBUG_STR | |
1132 | "IS-IS information\n" | |
1133 | "IS-IS Route related events\n") | |
1134 | { | |
1135 | isis->debugs &= ~DEBUG_RTE_EVENTS; | |
1136 | print_debug (vty, DEBUG_RTE_EVENTS, 0); | |
1137 | ||
1138 | return CMD_SUCCESS; | |
1139 | } | |
1140 | ||
1141 | DEFUN (debug_isis_events, | |
1142 | debug_isis_events_cmd, | |
1143 | "debug isis events", | |
1144 | DEBUG_STR | |
1145 | "IS-IS information\n" | |
1146 | "IS-IS Events\n") | |
1147 | { | |
1148 | isis->debugs |= DEBUG_EVENTS; | |
1149 | print_debug (vty, DEBUG_EVENTS, 1); | |
1150 | ||
1151 | return CMD_SUCCESS; | |
1152 | } | |
1153 | ||
1154 | DEFUN (no_debug_isis_events, | |
1155 | no_debug_isis_events_cmd, | |
1156 | "no debug isis events", | |
1157 | NO_STR | |
1158 | UNDEBUG_STR | |
1159 | "IS-IS information\n" | |
1160 | "IS-IS Events\n") | |
1161 | { | |
1162 | isis->debugs &= ~DEBUG_EVENTS; | |
1163 | print_debug (vty, DEBUG_EVENTS, 0); | |
1164 | ||
1165 | return CMD_SUCCESS; | |
1166 | } | |
1167 | ||
1168 | DEFUN (debug_isis_packet_dump, | |
1169 | debug_isis_packet_dump_cmd, | |
1170 | "debug isis packet-dump", | |
1171 | DEBUG_STR | |
1172 | "IS-IS information\n" | |
1173 | "IS-IS packet dump\n") | |
1174 | { | |
1175 | isis->debugs |= DEBUG_PACKET_DUMP; | |
1176 | print_debug (vty, DEBUG_PACKET_DUMP, 1); | |
1177 | ||
1178 | return CMD_SUCCESS; | |
1179 | } | |
1180 | ||
1181 | DEFUN (no_debug_isis_packet_dump, | |
1182 | no_debug_isis_packet_dump_cmd, | |
1183 | "no debug isis packet-dump", | |
1184 | NO_STR | |
1185 | UNDEBUG_STR | |
1186 | "IS-IS information\n" | |
1187 | "IS-IS packet dump\n") | |
1188 | { | |
1189 | isis->debugs &= ~DEBUG_PACKET_DUMP; | |
1190 | print_debug (vty, DEBUG_PACKET_DUMP, 0); | |
1191 | ||
1192 | return CMD_SUCCESS; | |
1193 | } | |
1194 | ||
1195 | DEFUN (debug_isis_lsp_gen, | |
1196 | debug_isis_lsp_gen_cmd, | |
1197 | "debug isis lsp-gen", | |
1198 | DEBUG_STR | |
1199 | "IS-IS information\n" | |
1200 | "IS-IS generation of own LSPs\n") | |
1201 | { | |
1202 | isis->debugs |= DEBUG_LSP_GEN; | |
1203 | print_debug (vty, DEBUG_LSP_GEN, 1); | |
1204 | ||
1205 | return CMD_SUCCESS; | |
1206 | } | |
1207 | ||
1208 | DEFUN (no_debug_isis_lsp_gen, | |
1209 | no_debug_isis_lsp_gen_cmd, | |
1210 | "no debug isis lsp-gen", | |
1211 | NO_STR | |
1212 | UNDEBUG_STR | |
1213 | "IS-IS information\n" | |
1214 | "IS-IS generation of own LSPs\n") | |
1215 | { | |
1216 | isis->debugs &= ~DEBUG_LSP_GEN; | |
1217 | print_debug (vty, DEBUG_LSP_GEN, 0); | |
1218 | ||
1219 | return CMD_SUCCESS; | |
1220 | } | |
1221 | ||
1222 | DEFUN (debug_isis_lsp_sched, | |
1223 | debug_isis_lsp_sched_cmd, | |
1224 | "debug isis lsp-sched", | |
1225 | DEBUG_STR | |
1226 | "IS-IS information\n" | |
1227 | "IS-IS scheduling of LSP generation\n") | |
1228 | { | |
1229 | isis->debugs |= DEBUG_LSP_SCHED; | |
1230 | print_debug (vty, DEBUG_LSP_SCHED, 1); | |
1231 | ||
1232 | return CMD_SUCCESS; | |
1233 | } | |
1234 | ||
1235 | DEFUN (no_debug_isis_lsp_sched, | |
1236 | no_debug_isis_lsp_sched_cmd, | |
1237 | "no debug isis lsp-sched", | |
1238 | NO_STR | |
1239 | UNDEBUG_STR | |
1240 | "IS-IS information\n" | |
1241 | "IS-IS scheduling of LSP generation\n") | |
1242 | { | |
1243 | isis->debugs &= ~DEBUG_LSP_SCHED; | |
1244 | print_debug (vty, DEBUG_LSP_SCHED, 0); | |
1245 | ||
1246 | return CMD_SUCCESS; | |
1247 | } | |
1248 | ||
1249 | DEFUN (show_hostname, | |
1250 | show_hostname_cmd, | |
1251 | "show isis hostname", | |
1252 | SHOW_STR | |
1253 | "IS-IS information\n" | |
1254 | "IS-IS Dynamic hostname mapping\n") | |
1255 | { | |
1256 | dynhn_print_all (vty); | |
1257 | ||
1258 | return CMD_SUCCESS; | |
1259 | } | |
1260 | ||
1261 | static void | |
1262 | vty_out_timestr(struct vty *vty, time_t uptime) | |
1263 | { | |
1264 | struct tm *tm; | |
1265 | time_t difftime = time (NULL); | |
1266 | difftime -= uptime; | |
1267 | tm = gmtime (&difftime); | |
1268 | ||
1269 | #define ONE_DAY_SECOND 60*60*24 | |
1270 | #define ONE_WEEK_SECOND 60*60*24*7 | |
1271 | if (difftime < ONE_DAY_SECOND) | |
1272 | vty_out (vty, "%02d:%02d:%02d", | |
1273 | tm->tm_hour, tm->tm_min, tm->tm_sec); | |
1274 | else if (difftime < ONE_WEEK_SECOND) | |
1275 | vty_out (vty, "%dd%02dh%02dm", | |
1276 | tm->tm_yday, tm->tm_hour, tm->tm_min); | |
1277 | else | |
1278 | vty_out (vty, "%02dw%dd%02dh", | |
1279 | tm->tm_yday/7, | |
1280 | tm->tm_yday - ((tm->tm_yday/7) * 7), tm->tm_hour); | |
1281 | vty_out (vty, " ago"); | |
1282 | } | |
1283 | ||
1284 | DEFUN (show_isis_spf_ietf, | |
1285 | show_isis_spf_ietf_cmd, | |
1286 | "show isis spf-delay-ietf", | |
1287 | SHOW_STR | |
1288 | "IS-IS information\n" | |
1289 | "IS-IS SPF delay IETF information\n") | |
1290 | { | |
1291 | if (!isis) | |
1292 | { | |
1293 | vty_out (vty, "ISIS is not running%s", VTY_NEWLINE); | |
1294 | return CMD_SUCCESS; | |
1295 | } | |
1296 | ||
1297 | struct listnode *node; | |
1298 | struct isis_area *area; | |
1299 | ||
1300 | for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area)) | |
1301 | { | |
1302 | vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null", | |
1303 | VTY_NEWLINE); | |
1304 | ||
1305 | for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) | |
1306 | { | |
1307 | if ((area->is_type & level) == 0) | |
1308 | continue; | |
1309 | ||
1310 | vty_out (vty, " Level-%d:%s", level, VTY_NEWLINE); | |
1311 | vty_out (vty, " SPF delay status: "); | |
1312 | if (area->spf_timer[level -1]) | |
1313 | { | |
1314 | struct timeval remain = thread_timer_remain(area->spf_timer[level - 1]); | |
1315 | vty_out(vty, "Pending, due in %ld msec%s", | |
1316 | remain.tv_sec * 1000 + remain.tv_usec / 1000, | |
1317 | VTY_NEWLINE); | |
1318 | } | |
1319 | else | |
1320 | { | |
1321 | vty_out(vty, "Not scheduled%s", VTY_NEWLINE); | |
1322 | } | |
1323 | ||
1324 | if (area->spf_delay_ietf[level - 1]) { | |
1325 | vty_out(vty, " Using draft-ietf-rtgwg-backoff-algo-04%s", VTY_NEWLINE); | |
1326 | spf_backoff_show(area->spf_delay_ietf[level - 1], vty, " "); | |
1327 | } else { | |
1328 | vty_out(vty, " Using legacy backoff algo%s", VTY_NEWLINE); | |
1329 | } | |
1330 | } | |
1331 | } | |
1332 | return CMD_SUCCESS; | |
1333 | } | |
1334 | ||
1335 | DEFUN (show_isis_summary, | |
1336 | show_isis_summary_cmd, | |
1337 | "show isis summary", | |
1338 | SHOW_STR "IS-IS information\n" "IS-IS summary\n") | |
1339 | { | |
1340 | struct listnode *node, *node2; | |
1341 | struct isis_area *area; | |
1342 | struct isis_spftree *spftree; | |
1343 | int level; | |
1344 | ||
1345 | if (isis == NULL) | |
1346 | { | |
1347 | vty_out (vty, "ISIS is not running%s", VTY_NEWLINE); | |
1348 | return CMD_SUCCESS; | |
1349 | } | |
1350 | ||
1351 | vty_out (vty, "Process Id : %ld%s", isis->process_id, | |
1352 | VTY_NEWLINE); | |
1353 | if (isis->sysid_set) | |
1354 | vty_out (vty, "System Id : %s%s", sysid_print (isis->sysid), | |
1355 | VTY_NEWLINE); | |
1356 | ||
1357 | vty_out (vty, "Up time : "); | |
1358 | vty_out_timestr(vty, isis->uptime); | |
1359 | vty_out (vty, "%s", VTY_NEWLINE); | |
1360 | ||
1361 | if (isis->area_list) | |
1362 | vty_out (vty, "Number of areas : %d%s", isis->area_list->count, | |
1363 | VTY_NEWLINE); | |
1364 | ||
1365 | for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area)) | |
1366 | { | |
1367 | vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null", | |
1368 | VTY_NEWLINE); | |
1369 | ||
1370 | if (listcount (area->area_addrs) > 0) | |
1371 | { | |
1372 | struct area_addr *area_addr; | |
1373 | for (ALL_LIST_ELEMENTS_RO (area->area_addrs, node2, area_addr)) | |
1374 | { | |
1375 | vty_out (vty, " Net: %s%s", | |
1376 | isonet_print (area_addr->area_addr, | |
1377 | area_addr->addr_len + ISIS_SYS_ID_LEN + | |
1378 | 1), VTY_NEWLINE); | |
1379 | } | |
1380 | } | |
1381 | ||
1382 | for (level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) | |
1383 | { | |
1384 | if ((area->is_type & level) == 0) | |
1385 | continue; | |
1386 | ||
1387 | vty_out (vty, " Level-%d:%s", level, VTY_NEWLINE); | |
1388 | spftree = area->spftree[level - 1]; | |
1389 | if (area->spf_timer[level - 1]) | |
1390 | vty_out (vty, " SPF: (pending)%s", VTY_NEWLINE); | |
1391 | else | |
1392 | vty_out (vty, " SPF:%s", VTY_NEWLINE); | |
1393 | ||
1394 | vty_out (vty, " minimum interval : %d", | |
1395 | area->min_spf_interval[level - 1]); | |
1396 | if (area->spf_delay_ietf[level - 1]) | |
1397 | vty_out (vty, " (not used, IETF SPF delay activated)"); | |
1398 | vty_out (vty, VTY_NEWLINE); | |
1399 | ||
1400 | vty_out (vty, " IPv4 route computation:%s", VTY_NEWLINE); | |
1401 | vty_out (vty, " last run elapsed : "); | |
1402 | vty_out_timestr(vty, spftree->last_run_timestamp); | |
1403 | vty_out (vty, "%s", VTY_NEWLINE); | |
1404 | ||
1405 | vty_out (vty, " last run duration : %u usec%s", | |
1406 | (u_int32_t)spftree->last_run_duration, VTY_NEWLINE); | |
1407 | ||
1408 | vty_out (vty, " run count : %d%s", | |
1409 | spftree->runcount, VTY_NEWLINE); | |
1410 | ||
1411 | spftree = area->spftree6[level - 1]; | |
1412 | vty_out (vty, " IPv6 route computation:%s", VTY_NEWLINE); | |
1413 | ||
1414 | vty_out (vty, " last run elapsed : "); | |
1415 | vty_out_timestr(vty, spftree->last_run_timestamp); | |
1416 | vty_out (vty, "%s", VTY_NEWLINE); | |
1417 | ||
1418 | vty_out (vty, " last run duration : %llu msec%s", | |
1419 | (unsigned long long)spftree->last_run_duration, VTY_NEWLINE); | |
1420 | ||
1421 | vty_out (vty, " run count : %d%s", | |
1422 | spftree->runcount, VTY_NEWLINE); | |
1423 | } | |
1424 | } | |
1425 | vty_out (vty, "%s", VTY_NEWLINE); | |
1426 | ||
1427 | return CMD_SUCCESS; | |
1428 | } | |
1429 | ||
1430 | /* | |
1431 | * This function supports following display options: | |
1432 | * [ show isis database [detail] ] | |
1433 | * [ show isis database <sysid> [detail] ] | |
1434 | * [ show isis database <hostname> [detail] ] | |
1435 | * [ show isis database <sysid>.<pseudo-id> [detail] ] | |
1436 | * [ show isis database <hostname>.<pseudo-id> [detail] ] | |
1437 | * [ show isis database <sysid>.<pseudo-id>-<fragment-number> [detail] ] | |
1438 | * [ show isis database <hostname>.<pseudo-id>-<fragment-number> [detail] ] | |
1439 | * [ show isis database detail <sysid> ] | |
1440 | * [ show isis database detail <hostname> ] | |
1441 | * [ show isis database detail <sysid>.<pseudo-id> ] | |
1442 | * [ show isis database detail <hostname>.<pseudo-id> ] | |
1443 | * [ show isis database detail <sysid>.<pseudo-id>-<fragment-number> ] | |
1444 | * [ show isis database detail <hostname>.<pseudo-id>-<fragment-number> ] | |
1445 | */ | |
1446 | static int | |
1447 | show_isis_database (struct vty *vty, const char *argv, int ui_level) | |
1448 | { | |
1449 | struct listnode *node; | |
1450 | struct isis_area *area; | |
1451 | struct isis_lsp *lsp; | |
1452 | struct isis_dynhn *dynhn; | |
1453 | const char *pos = argv; | |
1454 | u_char lspid[ISIS_SYS_ID_LEN+2]; | |
1455 | char sysid[255]; | |
1456 | u_char number[3]; | |
1457 | int level, lsp_count; | |
1458 | ||
1459 | if (isis->area_list->count == 0) | |
1460 | return CMD_SUCCESS; | |
1461 | ||
1462 | memset (&lspid, 0, ISIS_SYS_ID_LEN); | |
1463 | memset (&sysid, 0, 255); | |
1464 | ||
1465 | /* | |
1466 | * extract fragment and pseudo id from the string argv | |
1467 | * in the forms: | |
1468 | * (a) <systemid/hostname>.<pseudo-id>-<framenent> or | |
1469 | * (b) <systemid/hostname>.<pseudo-id> or | |
1470 | * (c) <systemid/hostname> or | |
1471 | * Where systemid is in the form: | |
1472 | * xxxx.xxxx.xxxx | |
1473 | */ | |
1474 | if (argv) | |
1475 | strncpy (sysid, argv, 254); | |
1476 | if (argv && strlen (argv) > 3) | |
1477 | { | |
1478 | pos = argv + strlen (argv) - 3; | |
1479 | if (strncmp (pos, "-", 1) == 0) | |
1480 | { | |
1481 | memcpy (number, ++pos, 2); | |
1482 | lspid[ISIS_SYS_ID_LEN+1] = (u_char) strtol ((char *)number, NULL, 16); | |
1483 | pos -= 4; | |
1484 | if (strncmp (pos, ".", 1) != 0) | |
1485 | return CMD_ERR_AMBIGUOUS; | |
1486 | } | |
1487 | if (strncmp (pos, ".", 1) == 0) | |
1488 | { | |
1489 | memcpy (number, ++pos, 2); | |
1490 | lspid[ISIS_SYS_ID_LEN] = (u_char) strtol ((char *)number, NULL, 16); | |
1491 | sysid[pos - argv - 1] = '\0'; | |
1492 | } | |
1493 | } | |
1494 | ||
1495 | for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area)) | |
1496 | { | |
1497 | vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null", | |
1498 | VTY_NEWLINE); | |
1499 | ||
1500 | for (level = 0; level < ISIS_LEVELS; level++) | |
1501 | { | |
1502 | if (area->lspdb[level] && dict_count (area->lspdb[level]) > 0) | |
1503 | { | |
1504 | lsp = NULL; | |
1505 | if (argv != NULL) | |
1506 | { | |
1507 | /* | |
1508 | * Try to find the lsp-id if the argv string is in | |
1509 | * the form hostname.<pseudo-id>-<fragment> | |
1510 | */ | |
1511 | if (sysid2buff (lspid, sysid)) | |
1512 | { | |
1513 | lsp = lsp_search (lspid, area->lspdb[level]); | |
1514 | } | |
1515 | else if ((dynhn = dynhn_find_by_name (sysid))) | |
1516 | { | |
1517 | memcpy (lspid, dynhn->id, ISIS_SYS_ID_LEN); | |
1518 | lsp = lsp_search (lspid, area->lspdb[level]); | |
1519 | } | |
1520 | else if (strncmp(unix_hostname (), sysid, 15) == 0) | |
1521 | { | |
1522 | memcpy (lspid, isis->sysid, ISIS_SYS_ID_LEN); | |
1523 | lsp = lsp_search (lspid, area->lspdb[level]); | |
1524 | } | |
1525 | } | |
1526 | ||
1527 | if (lsp != NULL || argv == NULL) | |
1528 | { | |
1529 | vty_out (vty, "IS-IS Level-%d link-state database:%s", | |
1530 | level + 1, VTY_NEWLINE); | |
1531 | ||
1532 | /* print the title in all cases */ | |
1533 | vty_out (vty, "LSP ID PduLen " | |
1534 | "SeqNumber Chksum Holdtime ATT/P/OL%s", | |
1535 | VTY_NEWLINE); | |
1536 | } | |
1537 | ||
1538 | if (lsp) | |
1539 | { | |
1540 | if (ui_level == ISIS_UI_LEVEL_DETAIL) | |
1541 | lsp_print_detail (lsp, vty, area->dynhostname); | |
1542 | else | |
1543 | lsp_print (lsp, vty, area->dynhostname); | |
1544 | } | |
1545 | else if (argv == NULL) | |
1546 | { | |
1547 | lsp_count = lsp_print_all (vty, area->lspdb[level], | |
1548 | ui_level, | |
1549 | area->dynhostname); | |
1550 | ||
1551 | vty_out (vty, " %u LSPs%s%s", | |
1552 | lsp_count, VTY_NEWLINE, VTY_NEWLINE); | |
1553 | } | |
1554 | } | |
1555 | } | |
1556 | } | |
1557 | ||
1558 | return CMD_SUCCESS; | |
1559 | } | |
1560 | ||
1561 | DEFUN (show_database, | |
1562 | show_database_cmd, | |
1563 | "show isis database [detail] [WORD]", | |
1564 | SHOW_STR | |
1565 | "IS-IS information\n" | |
1566 | "IS-IS link state database\n" | |
1567 | "Detailed information\n" | |
1568 | "LSP ID\n") | |
1569 | { | |
1570 | int idx = 0; | |
1571 | int uilevel = argv_find (argv, argc, "detail", &idx) ? ISIS_UI_LEVEL_DETAIL : ISIS_UI_LEVEL_BRIEF; | |
1572 | char *id = argv_find (argv, argc, "WORD", &idx) ? argv[idx]->arg : NULL; | |
1573 | return show_isis_database (vty, id, uilevel); | |
1574 | } | |
1575 | ||
1576 | /* | |
1577 | * 'router isis' command | |
1578 | */ | |
1579 | DEFUN_NOSH (router_isis, | |
1580 | router_isis_cmd, | |
1581 | "router isis WORD", | |
1582 | ROUTER_STR | |
1583 | "ISO IS-IS\n" | |
1584 | "ISO Routing area tag") | |
1585 | { | |
1586 | int idx_word = 2; | |
1587 | return isis_area_get (vty, argv[idx_word]->arg); | |
1588 | } | |
1589 | ||
1590 | /* | |
1591 | *'no router isis' command | |
1592 | */ | |
1593 | DEFUN (no_router_isis, | |
1594 | no_router_isis_cmd, | |
1595 | "no router isis WORD", | |
1596 | "no\n" ROUTER_STR "ISO IS-IS\n" "ISO Routing area tag") | |
1597 | { | |
1598 | int idx_word = 3; | |
1599 | return isis_area_destroy (vty, argv[idx_word]->arg); | |
1600 | } | |
1601 | ||
1602 | /* | |
1603 | * 'net' command | |
1604 | */ | |
1605 | DEFUN (net, | |
1606 | net_cmd, | |
1607 | "net WORD", | |
1608 | "A Network Entity Title for this process (OSI only)\n" | |
1609 | "XX.XXXX. ... .XXX.XX Network entity title (NET)\n") | |
1610 | { | |
1611 | int idx_word = 1; | |
1612 | return area_net_title (vty, argv[idx_word]->arg); | |
1613 | } | |
1614 | ||
1615 | /* | |
1616 | * 'no net' command | |
1617 | */ | |
1618 | DEFUN (no_net, | |
1619 | no_net_cmd, | |
1620 | "no net WORD", | |
1621 | NO_STR | |
1622 | "A Network Entity Title for this process (OSI only)\n" | |
1623 | "XX.XXXX. ... .XXX.XX Network entity title (NET)\n") | |
1624 | { | |
1625 | int idx_word = 2; | |
1626 | return area_clear_net_title (vty, argv[idx_word]->arg); | |
1627 | } | |
1628 | ||
1629 | void isis_area_lsp_mtu_set(struct isis_area *area, unsigned int lsp_mtu) | |
1630 | { | |
1631 | area->lsp_mtu = lsp_mtu; | |
1632 | lsp_regenerate_schedule(area, IS_LEVEL_1_AND_2, 1); | |
1633 | } | |
1634 | ||
1635 | static int | |
1636 | isis_area_passwd_set(struct isis_area *area, int level, u_char passwd_type, | |
1637 | const char *passwd, u_char snp_auth) | |
1638 | { | |
1639 | struct isis_passwd *dest; | |
1640 | struct isis_passwd modified; | |
1641 | int len; | |
1642 | ||
1643 | assert((level == IS_LEVEL_1) || (level == IS_LEVEL_2)); | |
1644 | dest = (level == IS_LEVEL_1) ? &area->area_passwd : &area->domain_passwd; | |
1645 | memset(&modified, 0, sizeof(modified)); | |
1646 | ||
1647 | if (passwd_type != ISIS_PASSWD_TYPE_UNUSED) | |
1648 | { | |
1649 | if (!passwd) | |
1650 | return -1; | |
1651 | ||
1652 | len = strlen(passwd); | |
1653 | if (len > 254) | |
1654 | return -1; | |
1655 | ||
1656 | modified.len = len; | |
1657 | strncpy((char*)modified.passwd, passwd, 255); | |
1658 | modified.type = passwd_type; | |
1659 | modified.snp_auth = snp_auth; | |
1660 | } | |
1661 | ||
1662 | if (memcmp(&modified, dest, sizeof(modified))) | |
1663 | { | |
1664 | memcpy(dest, &modified, sizeof(modified)); | |
1665 | lsp_regenerate_schedule(area, IS_LEVEL_1|IS_LEVEL_2, 1); | |
1666 | } | |
1667 | ||
1668 | return 0; | |
1669 | } | |
1670 | ||
1671 | int | |
1672 | isis_area_passwd_unset (struct isis_area *area, int level) | |
1673 | { | |
1674 | return isis_area_passwd_set (area, level, ISIS_PASSWD_TYPE_UNUSED, NULL, 0); | |
1675 | } | |
1676 | ||
1677 | int | |
1678 | isis_area_passwd_cleartext_set (struct isis_area *area, int level, | |
1679 | const char *passwd, u_char snp_auth) | |
1680 | { | |
1681 | return isis_area_passwd_set (area, level, ISIS_PASSWD_TYPE_CLEARTXT, | |
1682 | passwd, snp_auth); | |
1683 | } | |
1684 | ||
1685 | int | |
1686 | isis_area_passwd_hmac_md5_set (struct isis_area *area, int level, | |
1687 | const char *passwd, u_char snp_auth) | |
1688 | { | |
1689 | return isis_area_passwd_set (area, level, ISIS_PASSWD_TYPE_HMAC_MD5, | |
1690 | passwd, snp_auth); | |
1691 | } | |
1692 | ||
1693 | static void | |
1694 | area_resign_level (struct isis_area *area, int level) | |
1695 | { | |
1696 | if (area->lspdb[level - 1]) | |
1697 | { | |
1698 | lsp_db_destroy (area->lspdb[level - 1]); | |
1699 | area->lspdb[level - 1] = NULL; | |
1700 | } | |
1701 | if (area->spftree[level - 1]) | |
1702 | { | |
1703 | isis_spftree_del (area->spftree[level - 1]); | |
1704 | area->spftree[level - 1] = NULL; | |
1705 | } | |
1706 | if (area->spftree6[level - 1]) | |
1707 | { | |
1708 | isis_spftree_del (area->spftree6[level - 1]); | |
1709 | area->spftree6[level - 1] = NULL; | |
1710 | } | |
1711 | THREAD_TIMER_OFF(area->spf_timer[level - 1]); | |
1712 | if (area->route_table[level - 1]) | |
1713 | { | |
1714 | route_table_finish (area->route_table[level - 1]); | |
1715 | area->route_table[level - 1] = NULL; | |
1716 | } | |
1717 | if (area->route_table6[level - 1]) | |
1718 | { | |
1719 | route_table_finish (area->route_table6[level - 1]); | |
1720 | area->route_table6[level - 1] = NULL; | |
1721 | } | |
1722 | ||
1723 | sched_debug("ISIS (%s): Resigned from L%d - canceling LSP regeneration timer.", | |
1724 | area->area_tag, level); | |
1725 | THREAD_TIMER_OFF (area->t_lsp_refresh[level - 1]); | |
1726 | area->lsp_regenerate_pending[level - 1] = 0; | |
1727 | } | |
1728 | ||
1729 | void | |
1730 | isis_area_is_type_set(struct isis_area *area, int is_type) | |
1731 | { | |
1732 | struct listnode *node; | |
1733 | struct isis_circuit *circuit; | |
1734 | ||
1735 | if (isis->debugs & DEBUG_EVENTS) | |
1736 | zlog_debug ("ISIS-Evt (%s) system type change %s -> %s", area->area_tag, | |
1737 | circuit_t2string (area->is_type), circuit_t2string (is_type)); | |
1738 | ||
1739 | if (area->is_type == is_type) | |
1740 | return; /* No change */ | |
1741 | ||
1742 | switch (area->is_type) | |
1743 | { | |
1744 | case IS_LEVEL_1: | |
1745 | if (is_type == IS_LEVEL_2) | |
1746 | area_resign_level (area, IS_LEVEL_1); | |
1747 | ||
1748 | if (area->lspdb[1] == NULL) | |
1749 | area->lspdb[1] = lsp_db_init (); | |
1750 | if (area->route_table[1] == NULL) | |
1751 | area->route_table[1] = route_table_init (); | |
1752 | if (area->route_table6[1] == NULL) | |
1753 | area->route_table6[1] = route_table_init (); | |
1754 | break; | |
1755 | ||
1756 | case IS_LEVEL_1_AND_2: | |
1757 | if (is_type == IS_LEVEL_1) | |
1758 | area_resign_level (area, IS_LEVEL_2); | |
1759 | else | |
1760 | area_resign_level (area, IS_LEVEL_1); | |
1761 | break; | |
1762 | ||
1763 | case IS_LEVEL_2: | |
1764 | if (is_type == IS_LEVEL_1) | |
1765 | area_resign_level (area, IS_LEVEL_2); | |
1766 | ||
1767 | if (area->lspdb[0] == NULL) | |
1768 | area->lspdb[0] = lsp_db_init (); | |
1769 | if (area->route_table[0] == NULL) | |
1770 | area->route_table[0] = route_table_init (); | |
1771 | if (area->route_table6[0] == NULL) | |
1772 | area->route_table6[0] = route_table_init (); | |
1773 | break; | |
1774 | ||
1775 | default: | |
1776 | break; | |
1777 | } | |
1778 | ||
1779 | area->is_type = is_type; | |
1780 | ||
1781 | /* override circuit's is_type */ | |
1782 | if (area->is_type != IS_LEVEL_1_AND_2) | |
1783 | { | |
1784 | for (ALL_LIST_ELEMENTS_RO (area->circuit_list, node, circuit)) | |
1785 | isis_circuit_is_type_set (circuit, is_type); | |
1786 | } | |
1787 | ||
1788 | spftree_area_init (area); | |
1789 | ||
1790 | if (listcount (area->area_addrs) > 0) | |
1791 | { | |
1792 | if (is_type & IS_LEVEL_1) | |
1793 | lsp_generate (area, IS_LEVEL_1); | |
1794 | if (is_type & IS_LEVEL_2) | |
1795 | lsp_generate (area, IS_LEVEL_2); | |
1796 | } | |
1797 | lsp_regenerate_schedule (area, IS_LEVEL_1 | IS_LEVEL_2, 1); | |
1798 | ||
1799 | return; | |
1800 | } | |
1801 | ||
1802 | void isis_area_metricstyle_set(struct isis_area *area, bool old_metric, | |
1803 | bool new_metric) | |
1804 | { | |
1805 | if (area->oldmetric != old_metric | |
1806 | || area->newmetric != new_metric) | |
1807 | { | |
1808 | area->oldmetric = old_metric; | |
1809 | area->newmetric = new_metric; | |
1810 | lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2, 1); | |
1811 | } | |
1812 | } | |
1813 | ||
1814 | void isis_area_overload_bit_set(struct isis_area *area, bool overload_bit) | |
1815 | { | |
1816 | char new_overload_bit = overload_bit ? LSPBIT_OL : 0; | |
1817 | ||
1818 | if (new_overload_bit != area->overload_bit) | |
1819 | { | |
1820 | area->overload_bit = new_overload_bit; | |
1821 | lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2, 1); | |
1822 | } | |
1823 | } | |
1824 | ||
1825 | void isis_area_attached_bit_set(struct isis_area *area, bool attached_bit) | |
1826 | { | |
1827 | char new_attached_bit = attached_bit ? LSPBIT_ATT : 0; | |
1828 | ||
1829 | if (new_attached_bit != area->attached_bit) | |
1830 | { | |
1831 | area->attached_bit = new_attached_bit; | |
1832 | lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2, 1); | |
1833 | } | |
1834 | } | |
1835 | ||
1836 | void isis_area_dynhostname_set(struct isis_area *area, bool dynhostname) | |
1837 | { | |
1838 | if (area->dynhostname != dynhostname) | |
1839 | { | |
1840 | area->dynhostname = dynhostname; | |
1841 | lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2, 0); | |
1842 | } | |
1843 | } | |
1844 | ||
1845 | void | |
1846 | isis_area_max_lsp_lifetime_set(struct isis_area *area, int level, | |
1847 | uint16_t max_lsp_lifetime) | |
1848 | { | |
1849 | assert((level == IS_LEVEL_1) || (level == IS_LEVEL_2)); | |
1850 | ||
1851 | if (area->max_lsp_lifetime[level-1] == max_lsp_lifetime) | |
1852 | return; | |
1853 | ||
1854 | area->max_lsp_lifetime[level-1] = max_lsp_lifetime; | |
1855 | lsp_regenerate_schedule(area, level, 1); | |
1856 | } | |
1857 | ||
1858 | void | |
1859 | isis_area_lsp_refresh_set(struct isis_area *area, int level, | |
1860 | uint16_t lsp_refresh) | |
1861 | { | |
1862 | assert((level == IS_LEVEL_1) || (level == IS_LEVEL_2)); | |
1863 | ||
1864 | if (area->lsp_refresh[level-1] == lsp_refresh) | |
1865 | return; | |
1866 | ||
1867 | area->lsp_refresh[level-1] = lsp_refresh; | |
1868 | lsp_regenerate_schedule(area, level, 1); | |
1869 | } | |
1870 | ||
1871 | DEFUN (log_adj_changes, | |
1872 | log_adj_changes_cmd, | |
1873 | "log-adjacency-changes", | |
1874 | "Log changes in adjacency state\n") | |
1875 | { | |
1876 | VTY_DECLVAR_CONTEXT (isis_area, area); | |
1877 | ||
1878 | area->log_adj_changes = 1; | |
1879 | ||
1880 | return CMD_SUCCESS; | |
1881 | } | |
1882 | ||
1883 | DEFUN (no_log_adj_changes, | |
1884 | no_log_adj_changes_cmd, | |
1885 | "no log-adjacency-changes", | |
1886 | NO_STR | |
1887 | "Stop logging changes in adjacency state\n") | |
1888 | { | |
1889 | VTY_DECLVAR_CONTEXT (isis_area, area); | |
1890 | ||
1891 | area->log_adj_changes = 0; | |
1892 | ||
1893 | return CMD_SUCCESS; | |
1894 | } | |
1895 | ||
1896 | /* IS-IS configuration write function */ | |
1897 | int | |
1898 | isis_config_write (struct vty *vty) | |
1899 | { | |
1900 | int write = 0; | |
1901 | ||
1902 | if (isis != NULL) | |
1903 | { | |
1904 | struct isis_area *area; | |
1905 | struct listnode *node, *node2; | |
1906 | ||
1907 | for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area)) | |
1908 | { | |
1909 | /* ISIS - Area name */ | |
1910 | vty_out (vty, "router isis %s%s", area->area_tag, VTY_NEWLINE); | |
1911 | write++; | |
1912 | /* ISIS - Net */ | |
1913 | if (listcount (area->area_addrs) > 0) | |
1914 | { | |
1915 | struct area_addr *area_addr; | |
1916 | for (ALL_LIST_ELEMENTS_RO (area->area_addrs, node2, area_addr)) | |
1917 | { | |
1918 | vty_out (vty, " net %s%s", | |
1919 | isonet_print (area_addr->area_addr, | |
1920 | area_addr->addr_len + ISIS_SYS_ID_LEN + | |
1921 | 1), VTY_NEWLINE); | |
1922 | write++; | |
1923 | } | |
1924 | } | |
1925 | /* ISIS - Dynamic hostname - Defaults to true so only display if | |
1926 | * false. */ | |
1927 | if (!area->dynhostname) | |
1928 | { | |
1929 | vty_out (vty, " no hostname dynamic%s", VTY_NEWLINE); | |
1930 | write++; | |
1931 | } | |
1932 | /* ISIS - Metric-Style - when true displays wide */ | |
1933 | if (area->newmetric) | |
1934 | { | |
1935 | if (!area->oldmetric) | |
1936 | vty_out (vty, " metric-style wide%s", VTY_NEWLINE); | |
1937 | else | |
1938 | vty_out (vty, " metric-style transition%s", VTY_NEWLINE); | |
1939 | write++; | |
1940 | } | |
1941 | else | |
1942 | { | |
1943 | vty_out (vty, " metric-style narrow%s", VTY_NEWLINE); | |
1944 | write++; | |
1945 | } | |
1946 | /* ISIS - overload-bit */ | |
1947 | if (area->overload_bit) | |
1948 | { | |
1949 | vty_out (vty, " set-overload-bit%s", VTY_NEWLINE); | |
1950 | write++; | |
1951 | } | |
1952 | /* ISIS - Area is-type (level-1-2 is default) */ | |
1953 | if (area->is_type == IS_LEVEL_1) | |
1954 | { | |
1955 | vty_out (vty, " is-type level-1%s", VTY_NEWLINE); | |
1956 | write++; | |
1957 | } | |
1958 | else if (area->is_type == IS_LEVEL_2) | |
1959 | { | |
1960 | vty_out (vty, " is-type level-2-only%s", VTY_NEWLINE); | |
1961 | write++; | |
1962 | } | |
1963 | write += isis_redist_config_write(vty, area, AF_INET); | |
1964 | write += isis_redist_config_write(vty, area, AF_INET6); | |
1965 | /* ISIS - Lsp generation interval */ | |
1966 | if (area->lsp_gen_interval[0] == area->lsp_gen_interval[1]) | |
1967 | { | |
1968 | if (area->lsp_gen_interval[0] != DEFAULT_MIN_LSP_GEN_INTERVAL) | |
1969 | { | |
1970 | vty_out (vty, " lsp-gen-interval %d%s", | |
1971 | area->lsp_gen_interval[0], VTY_NEWLINE); | |
1972 | write++; | |
1973 | } | |
1974 | } | |
1975 | else | |
1976 | { | |
1977 | if (area->lsp_gen_interval[0] != DEFAULT_MIN_LSP_GEN_INTERVAL) | |
1978 | { | |
1979 | vty_out (vty, " lsp-gen-interval level-1 %d%s", | |
1980 | area->lsp_gen_interval[0], VTY_NEWLINE); | |
1981 | write++; | |
1982 | } | |
1983 | if (area->lsp_gen_interval[1] != DEFAULT_MIN_LSP_GEN_INTERVAL) | |
1984 | { | |
1985 | vty_out (vty, " lsp-gen-interval level-2 %d%s", | |
1986 | area->lsp_gen_interval[1], VTY_NEWLINE); | |
1987 | write++; | |
1988 | } | |
1989 | } | |
1990 | /* ISIS - LSP lifetime */ | |
1991 | if (area->max_lsp_lifetime[0] == area->max_lsp_lifetime[1]) | |
1992 | { | |
1993 | if (area->max_lsp_lifetime[0] != DEFAULT_LSP_LIFETIME) | |
1994 | { | |
1995 | vty_out (vty, " max-lsp-lifetime %u%s", area->max_lsp_lifetime[0], | |
1996 | VTY_NEWLINE); | |
1997 | write++; | |
1998 | } | |
1999 | } | |
2000 | else | |
2001 | { | |
2002 | if (area->max_lsp_lifetime[0] != DEFAULT_LSP_LIFETIME) | |
2003 | { | |
2004 | vty_out (vty, " max-lsp-lifetime level-1 %u%s", | |
2005 | area->max_lsp_lifetime[0], VTY_NEWLINE); | |
2006 | write++; | |
2007 | } | |
2008 | if (area->max_lsp_lifetime[1] != DEFAULT_LSP_LIFETIME) | |
2009 | { | |
2010 | vty_out (vty, " max-lsp-lifetime level-2 %u%s", | |
2011 | area->max_lsp_lifetime[1], VTY_NEWLINE); | |
2012 | write++; | |
2013 | } | |
2014 | } | |
2015 | /* ISIS - LSP refresh interval */ | |
2016 | if (area->lsp_refresh[0] == area->lsp_refresh[1]) | |
2017 | { | |
2018 | if (area->lsp_refresh[0] != DEFAULT_MAX_LSP_GEN_INTERVAL) | |
2019 | { | |
2020 | vty_out (vty, " lsp-refresh-interval %u%s", area->lsp_refresh[0], | |
2021 | VTY_NEWLINE); | |
2022 | write++; | |
2023 | } | |
2024 | } | |
2025 | else | |
2026 | { | |
2027 | if (area->lsp_refresh[0] != DEFAULT_MAX_LSP_GEN_INTERVAL) | |
2028 | { | |
2029 | vty_out (vty, " lsp-refresh-interval level-1 %u%s", | |
2030 | area->lsp_refresh[0], VTY_NEWLINE); | |
2031 | write++; | |
2032 | } | |
2033 | if (area->lsp_refresh[1] != DEFAULT_MAX_LSP_GEN_INTERVAL) | |
2034 | { | |
2035 | vty_out (vty, " lsp-refresh-interval level-2 %u%s", | |
2036 | area->lsp_refresh[1], VTY_NEWLINE); | |
2037 | write++; | |
2038 | } | |
2039 | } | |
2040 | if (area->lsp_mtu != DEFAULT_LSP_MTU) | |
2041 | { | |
2042 | vty_out(vty, " lsp-mtu %u%s", area->lsp_mtu, VTY_NEWLINE); | |
2043 | write++; | |
2044 | } | |
2045 | ||
2046 | /* Minimum SPF interval. */ | |
2047 | if (area->min_spf_interval[0] == area->min_spf_interval[1]) | |
2048 | { | |
2049 | if (area->min_spf_interval[0] != MINIMUM_SPF_INTERVAL) | |
2050 | { | |
2051 | vty_out (vty, " spf-interval %d%s", | |
2052 | area->min_spf_interval[0], VTY_NEWLINE); | |
2053 | write++; | |
2054 | } | |
2055 | } | |
2056 | else | |
2057 | { | |
2058 | if (area->min_spf_interval[0] != MINIMUM_SPF_INTERVAL) | |
2059 | { | |
2060 | vty_out (vty, " spf-interval level-1 %d%s", | |
2061 | area->min_spf_interval[0], VTY_NEWLINE); | |
2062 | write++; | |
2063 | } | |
2064 | if (area->min_spf_interval[1] != MINIMUM_SPF_INTERVAL) | |
2065 | { | |
2066 | vty_out (vty, " spf-interval level-2 %d%s", | |
2067 | area->min_spf_interval[1], VTY_NEWLINE); | |
2068 | write++; | |
2069 | } | |
2070 | } | |
2071 | ||
2072 | /* IETF SPF interval */ | |
2073 | if (area->spf_delay_ietf[0]) | |
2074 | { | |
2075 | vty_out (vty, " spf-delay-ietf init-delay %ld short-delay %ld long-delay %ld holddown %ld time-to-learn %ld%s", | |
2076 | spf_backoff_init_delay(area->spf_delay_ietf[0]), | |
2077 | spf_backoff_short_delay(area->spf_delay_ietf[0]), | |
2078 | spf_backoff_long_delay(area->spf_delay_ietf[0]), | |
2079 | spf_backoff_holddown(area->spf_delay_ietf[0]), | |
2080 | spf_backoff_timetolearn(area->spf_delay_ietf[0]), | |
2081 | VTY_NEWLINE); | |
2082 | write++; | |
2083 | } | |
2084 | ||
2085 | /* Authentication passwords. */ | |
2086 | if (area->area_passwd.type == ISIS_PASSWD_TYPE_HMAC_MD5) | |
2087 | { | |
2088 | vty_out(vty, " area-password md5 %s", area->area_passwd.passwd); | |
2089 | if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND)) | |
2090 | { | |
2091 | vty_out(vty, " authenticate snp "); | |
2092 | if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV)) | |
2093 | vty_out(vty, "validate"); | |
2094 | else | |
2095 | vty_out(vty, "send-only"); | |
2096 | } | |
2097 | vty_out(vty, "%s", VTY_NEWLINE); | |
2098 | write++; | |
2099 | } | |
2100 | else if (area->area_passwd.type == ISIS_PASSWD_TYPE_CLEARTXT) | |
2101 | { | |
2102 | vty_out(vty, " area-password clear %s", area->area_passwd.passwd); | |
2103 | if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND)) | |
2104 | { | |
2105 | vty_out(vty, " authenticate snp "); | |
2106 | if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV)) | |
2107 | vty_out(vty, "validate"); | |
2108 | else | |
2109 | vty_out(vty, "send-only"); | |
2110 | } | |
2111 | vty_out(vty, "%s", VTY_NEWLINE); | |
2112 | write++; | |
2113 | } | |
2114 | if (area->domain_passwd.type == ISIS_PASSWD_TYPE_HMAC_MD5) | |
2115 | { | |
2116 | vty_out(vty, " domain-password md5 %s", | |
2117 | area->domain_passwd.passwd); | |
2118 | if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND)) | |
2119 | { | |
2120 | vty_out(vty, " authenticate snp "); | |
2121 | if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV)) | |
2122 | vty_out(vty, "validate"); | |
2123 | else | |
2124 | vty_out(vty, "send-only"); | |
2125 | } | |
2126 | vty_out(vty, "%s", VTY_NEWLINE); | |
2127 | write++; | |
2128 | } | |
2129 | else if (area->domain_passwd.type == ISIS_PASSWD_TYPE_CLEARTXT) | |
2130 | { | |
2131 | vty_out(vty, " domain-password clear %s", | |
2132 | area->domain_passwd.passwd); | |
2133 | if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND)) | |
2134 | { | |
2135 | vty_out(vty, " authenticate snp "); | |
2136 | if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV)) | |
2137 | vty_out(vty, "validate"); | |
2138 | else | |
2139 | vty_out(vty, "send-only"); | |
2140 | } | |
2141 | vty_out(vty, "%s", VTY_NEWLINE); | |
2142 | write++; | |
2143 | } | |
2144 | ||
2145 | if (area->log_adj_changes) | |
2146 | { | |
2147 | vty_out (vty, " log-adjacency-changes%s", VTY_NEWLINE); | |
2148 | write++; | |
2149 | } | |
2150 | ||
2151 | } | |
2152 | isis_mpls_te_config_write_router(vty); | |
2153 | } | |
2154 | ||
2155 | return write; | |
2156 | } | |
2157 | ||
2158 | struct cmd_node isis_node = { | |
2159 | ISIS_NODE, | |
2160 | "%s(config-router)# ", | |
2161 | 1 | |
2162 | }; | |
2163 | ||
2164 | void | |
2165 | isis_init () | |
2166 | { | |
2167 | /* Install IS-IS top node */ | |
2168 | install_node (&isis_node, isis_config_write); | |
2169 | ||
2170 | install_element (VIEW_NODE, &show_isis_summary_cmd); | |
2171 | ||
2172 | install_element (VIEW_NODE, &show_isis_spf_ietf_cmd); | |
2173 | ||
2174 | install_element (VIEW_NODE, &show_isis_interface_cmd); | |
2175 | install_element (VIEW_NODE, &show_isis_interface_detail_cmd); | |
2176 | install_element (VIEW_NODE, &show_isis_interface_arg_cmd); | |
2177 | ||
2178 | install_element (VIEW_NODE, &show_isis_neighbor_cmd); | |
2179 | install_element (VIEW_NODE, &show_isis_neighbor_detail_cmd); | |
2180 | install_element (VIEW_NODE, &show_isis_neighbor_arg_cmd); | |
2181 | install_element (VIEW_NODE, &clear_isis_neighbor_cmd); | |
2182 | install_element (VIEW_NODE, &clear_isis_neighbor_arg_cmd); | |
2183 | ||
2184 | install_element (VIEW_NODE, &show_hostname_cmd); | |
2185 | install_element (VIEW_NODE, &show_database_cmd); | |
2186 | ||
2187 | install_element (ENABLE_NODE, &show_debugging_isis_cmd); | |
2188 | ||
2189 | install_node (&debug_node, config_write_debug); | |
2190 | ||
2191 | install_element (ENABLE_NODE, &debug_isis_adj_cmd); | |
2192 | install_element (ENABLE_NODE, &no_debug_isis_adj_cmd); | |
2193 | install_element (ENABLE_NODE, &debug_isis_csum_cmd); | |
2194 | install_element (ENABLE_NODE, &no_debug_isis_csum_cmd); | |
2195 | install_element (ENABLE_NODE, &debug_isis_lupd_cmd); | |
2196 | install_element (ENABLE_NODE, &no_debug_isis_lupd_cmd); | |
2197 | install_element (ENABLE_NODE, &debug_isis_err_cmd); | |
2198 | install_element (ENABLE_NODE, &no_debug_isis_err_cmd); | |
2199 | install_element (ENABLE_NODE, &debug_isis_snp_cmd); | |
2200 | install_element (ENABLE_NODE, &no_debug_isis_snp_cmd); | |
2201 | install_element (ENABLE_NODE, &debug_isis_upd_cmd); | |
2202 | install_element (ENABLE_NODE, &no_debug_isis_upd_cmd); | |
2203 | install_element (ENABLE_NODE, &debug_isis_spfevents_cmd); | |
2204 | install_element (ENABLE_NODE, &no_debug_isis_spfevents_cmd); | |
2205 | install_element (ENABLE_NODE, &debug_isis_spfstats_cmd); | |
2206 | install_element (ENABLE_NODE, &no_debug_isis_spfstats_cmd); | |
2207 | install_element (ENABLE_NODE, &debug_isis_spftrigg_cmd); | |
2208 | install_element (ENABLE_NODE, &no_debug_isis_spftrigg_cmd); | |
2209 | install_element (ENABLE_NODE, &debug_isis_rtevents_cmd); | |
2210 | install_element (ENABLE_NODE, &no_debug_isis_rtevents_cmd); | |
2211 | install_element (ENABLE_NODE, &debug_isis_events_cmd); | |
2212 | install_element (ENABLE_NODE, &no_debug_isis_events_cmd); | |
2213 | install_element (ENABLE_NODE, &debug_isis_packet_dump_cmd); | |
2214 | install_element (ENABLE_NODE, &no_debug_isis_packet_dump_cmd); | |
2215 | install_element (ENABLE_NODE, &debug_isis_lsp_gen_cmd); | |
2216 | install_element (ENABLE_NODE, &no_debug_isis_lsp_gen_cmd); | |
2217 | install_element (ENABLE_NODE, &debug_isis_lsp_sched_cmd); | |
2218 | install_element (ENABLE_NODE, &no_debug_isis_lsp_sched_cmd); | |
2219 | ||
2220 | install_element (CONFIG_NODE, &debug_isis_adj_cmd); | |
2221 | install_element (CONFIG_NODE, &no_debug_isis_adj_cmd); | |
2222 | install_element (CONFIG_NODE, &debug_isis_csum_cmd); | |
2223 | install_element (CONFIG_NODE, &no_debug_isis_csum_cmd); | |
2224 | install_element (CONFIG_NODE, &debug_isis_lupd_cmd); | |
2225 | install_element (CONFIG_NODE, &no_debug_isis_lupd_cmd); | |
2226 | install_element (CONFIG_NODE, &debug_isis_err_cmd); | |
2227 | install_element (CONFIG_NODE, &no_debug_isis_err_cmd); | |
2228 | install_element (CONFIG_NODE, &debug_isis_snp_cmd); | |
2229 | install_element (CONFIG_NODE, &no_debug_isis_snp_cmd); | |
2230 | install_element (CONFIG_NODE, &debug_isis_upd_cmd); | |
2231 | install_element (CONFIG_NODE, &no_debug_isis_upd_cmd); | |
2232 | install_element (CONFIG_NODE, &debug_isis_spfevents_cmd); | |
2233 | install_element (CONFIG_NODE, &no_debug_isis_spfevents_cmd); | |
2234 | install_element (CONFIG_NODE, &debug_isis_spfstats_cmd); | |
2235 | install_element (CONFIG_NODE, &no_debug_isis_spfstats_cmd); | |
2236 | install_element (CONFIG_NODE, &debug_isis_spftrigg_cmd); | |
2237 | install_element (CONFIG_NODE, &no_debug_isis_spftrigg_cmd); | |
2238 | install_element (CONFIG_NODE, &debug_isis_rtevents_cmd); | |
2239 | install_element (CONFIG_NODE, &no_debug_isis_rtevents_cmd); | |
2240 | install_element (CONFIG_NODE, &debug_isis_events_cmd); | |
2241 | install_element (CONFIG_NODE, &no_debug_isis_events_cmd); | |
2242 | install_element (CONFIG_NODE, &debug_isis_packet_dump_cmd); | |
2243 | install_element (CONFIG_NODE, &no_debug_isis_packet_dump_cmd); | |
2244 | install_element (CONFIG_NODE, &debug_isis_lsp_gen_cmd); | |
2245 | install_element (CONFIG_NODE, &no_debug_isis_lsp_gen_cmd); | |
2246 | install_element (CONFIG_NODE, &debug_isis_lsp_sched_cmd); | |
2247 | install_element (CONFIG_NODE, &no_debug_isis_lsp_sched_cmd); | |
2248 | ||
2249 | install_element (CONFIG_NODE, &router_isis_cmd); | |
2250 | install_element (CONFIG_NODE, &no_router_isis_cmd); | |
2251 | ||
2252 | install_default (ISIS_NODE); | |
2253 | ||
2254 | install_element (ISIS_NODE, &net_cmd); | |
2255 | install_element (ISIS_NODE, &no_net_cmd); | |
2256 | ||
2257 | install_element (ISIS_NODE, &log_adj_changes_cmd); | |
2258 | install_element (ISIS_NODE, &no_log_adj_changes_cmd); | |
2259 | ||
2260 | spf_backoff_cmd_init(); | |
2261 | } |