2 * IS-IS Rout(e)ing protocol - isisd.c
4 * Copyright (C) 2001,2002 Sampo Saaristo
5 * Tampere University of Technology
6 * Institute of Communications Engineering
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)
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
18 * You should have received a copy of the GNU General Public License along
19 * with this program; see the file COPYING; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
42 #include "spf_backoff.h"
43 #include "lib/northbound_cli.h"
46 #include "isisd/isis_constants.h"
47 #include "isisd/isis_common.h"
48 #include "isisd/isis_flags.h"
49 #include "isisd/isis_circuit.h"
50 #include "isisd/isis_csm.h"
51 #include "isisd/isisd.h"
52 #include "isisd/isis_dynhn.h"
53 #include "isisd/isis_adjacency.h"
54 #include "isisd/isis_pdu.h"
55 #include "isisd/isis_misc.h"
56 #include "isisd/isis_constants.h"
57 #include "isisd/isis_lsp.h"
58 #include "isisd/isis_spf.h"
59 #include "isisd/isis_route.h"
60 #include "isisd/isis_zebra.h"
61 #include "isisd/isis_events.h"
62 #include "isisd/isis_te.h"
63 #include "isisd/isis_mt.h"
64 #include "isisd/isis_sr.h"
65 #include "isisd/fabricd.h"
66 #include "isisd/isis_nb.h"
68 /* For debug statement. */
69 unsigned long debug_adj_pkt
;
70 unsigned long debug_snp_pkt
;
71 unsigned long debug_update_pkt
;
72 unsigned long debug_spf_events
;
73 unsigned long debug_rte_events
;
74 unsigned long debug_events
;
75 unsigned long debug_pkt_dump
;
76 unsigned long debug_lsp_gen
;
77 unsigned long debug_lsp_sched
;
78 unsigned long debug_flooding
;
79 unsigned long debug_bfd
;
80 unsigned long debug_tx_queue
;
81 unsigned long debug_sr
;
82 unsigned long debug_ldp_sync
;
83 unsigned long debug_lfa
;
85 DEFINE_MGROUP(ISISD
, "isisd");
87 DEFINE_MTYPE_STATIC(ISISD
, ISIS
, "ISIS process");
88 DEFINE_MTYPE_STATIC(ISISD
, ISIS_NAME
, "ISIS process name");
89 DEFINE_MTYPE_STATIC(ISISD
, ISIS_AREA
, "ISIS area");
90 DEFINE_MTYPE(ISISD
, ISIS_AREA_ADDR
, "ISIS area address");
91 DEFINE_MTYPE(ISISD
, ISIS_ACL_NAME
, "ISIS access-list name");
93 DEFINE_QOBJ_TYPE(isis_area
);
95 /* ISIS process wide configuration. */
96 static struct isis_master isis_master
;
98 /* ISIS process wide configuration pointer to export. */
99 struct isis_master
*im
;
102 DEFINE_HOOK(isis_hook_db_overload
, (const struct isis_area
*area
), (area
));
103 #endif /* ifndef FABRICD */
108 int isis_area_get(struct vty
*, const char *);
109 int area_net_title(struct vty
*, const char *);
110 int area_clear_net_title(struct vty
*, const char *);
111 int show_isis_interface_common(struct vty
*, const char *ifname
, char,
112 const char *vrf_name
, bool all_vrf
);
113 int show_isis_neighbor_common(struct vty
*, const char *id
, char,
114 const char *vrf_name
, bool all_vrf
);
115 int clear_isis_neighbor_common(struct vty
*, const char *id
, const char *vrf_name
,
118 /* Link ISIS instance to VRF. */
119 void isis_vrf_link(struct isis
*isis
, struct vrf
*vrf
)
121 isis
->vrf_id
= vrf
->vrf_id
;
122 if (vrf
->info
!= (void *)isis
)
123 vrf
->info
= (void *)isis
;
126 /* Unlink ISIS instance to VRF. */
127 void isis_vrf_unlink(struct isis
*isis
, struct vrf
*vrf
)
129 if (vrf
->info
== (void *)isis
)
131 isis
->vrf_id
= VRF_UNKNOWN
;
134 struct isis
*isis_lookup_by_vrfid(vrf_id_t vrf_id
)
137 struct listnode
*node
;
139 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
))
140 if (isis
->vrf_id
== vrf_id
)
146 struct isis
*isis_lookup_by_vrfname(const char *vrfname
)
149 struct listnode
*node
;
151 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
))
152 if (isis
->name
&& vrfname
&& strcmp(isis
->name
, vrfname
) == 0)
158 struct isis
*isis_lookup_by_sysid(const uint8_t *sysid
)
161 struct listnode
*node
;
163 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
))
164 if (!memcmp(isis
->sysid
, sysid
, ISIS_SYS_ID_LEN
))
170 void isis_master_init(struct thread_master
*master
)
172 memset(&isis_master
, 0, sizeof(struct isis_master
));
174 im
->isis
= list_new();
178 struct isis
*isis_new(const char *vrf_name
)
183 isis
= XCALLOC(MTYPE_ISIS
, sizeof(struct isis
));
185 isis
->name
= XSTRDUP(MTYPE_ISIS_NAME
, vrf_name
);
187 vrf
= vrf_lookup_by_name(vrf_name
);
190 isis_vrf_link(isis
, vrf
);
192 isis
->vrf_id
= VRF_UNKNOWN
;
194 isis_zebra_vrf_register(isis
);
198 "%s: Create new isis instance with vrf_name %s vrf_id %u",
199 __func__
, isis
->name
, isis
->vrf_id
);
204 isis
->max_area_addrs
= 3;
205 isis
->process_id
= getpid();
207 isis
->area_list
= list_new();
208 isis
->uptime
= time(NULL
);
209 isis
->snmp_notifications
= 1;
210 dyn_cache_init(isis
);
212 listnode_add(im
->isis
, isis
);
217 void isis_finish(struct isis
*isis
)
219 struct vrf
*vrf
= NULL
;
221 listnode_delete(im
->isis
, isis
);
223 isis_zebra_vrf_deregister(isis
);
225 vrf
= vrf_lookup_by_name(isis
->name
);
227 isis_vrf_unlink(isis
, vrf
);
228 XFREE(MTYPE_ISIS_NAME
, isis
->name
);
230 isis_redist_free(isis
);
231 list_delete(&isis
->area_list
);
232 dyn_cache_finish(isis
);
233 XFREE(MTYPE_ISIS
, isis
);
236 void isis_area_add_circuit(struct isis_area
*area
, struct isis_circuit
*circuit
)
238 isis_csm_state_change(ISIS_ENABLE
, circuit
, area
);
240 area
->ip_circuits
+= circuit
->ip_router
;
241 area
->ipv6_circuits
+= circuit
->ipv6_router
;
243 area
->lfa_protected_links
[0] += circuit
->lfa_protection
[0];
244 area
->rlfa_protected_links
[0] += circuit
->rlfa_protection
[0];
245 area
->tilfa_protected_links
[0] += circuit
->tilfa_protection
[0];
247 area
->lfa_protected_links
[1] += circuit
->lfa_protection
[1];
248 area
->rlfa_protected_links
[1] += circuit
->rlfa_protection
[1];
249 area
->tilfa_protected_links
[1] += circuit
->tilfa_protection
[1];
252 void isis_area_del_circuit(struct isis_area
*area
, struct isis_circuit
*circuit
)
254 area
->ip_circuits
-= circuit
->ip_router
;
255 area
->ipv6_circuits
-= circuit
->ipv6_router
;
257 area
->lfa_protected_links
[0] -= circuit
->lfa_protection
[0];
258 area
->rlfa_protected_links
[0] -= circuit
->rlfa_protection
[0];
259 area
->tilfa_protected_links
[0] -= circuit
->tilfa_protection
[0];
261 area
->lfa_protected_links
[1] -= circuit
->lfa_protection
[1];
262 area
->rlfa_protected_links
[1] -= circuit
->rlfa_protection
[1];
263 area
->tilfa_protected_links
[1] -= circuit
->tilfa_protection
[1];
265 isis_csm_state_change(ISIS_DISABLE
, circuit
, area
);
268 struct isis_area
*isis_area_create(const char *area_tag
, const char *vrf_name
)
270 struct isis_area
*area
;
271 struct isis
*isis
= NULL
;
272 struct vrf
*vrf
= NULL
;
273 struct interface
*ifp
;
274 struct isis_circuit
*circuit
;
276 area
= XCALLOC(MTYPE_ISIS_AREA
, sizeof(struct isis_area
));
279 vrf_name
= VRF_DEFAULT_NAME
;
281 vrf
= vrf_lookup_by_name(vrf_name
);
282 isis
= isis_lookup_by_vrfname(vrf_name
);
285 isis
= isis_new(vrf_name
);
287 listnode_add(isis
->area_list
, area
);
291 * Fabricd runs only as level-2.
292 * For IS-IS, the default is level-1-2
295 area
->is_type
= IS_LEVEL_2
;
297 area
->is_type
= yang_get_default_enum(
298 "/frr-isisd:isis/instance/is-type");
301 * intialize the databases
303 if (area
->is_type
& IS_LEVEL_1
)
304 lsp_db_init(&area
->lspdb
[0]);
305 if (area
->is_type
& IS_LEVEL_2
)
306 lsp_db_init(&area
->lspdb
[1]);
308 spftree_area_init(area
);
310 area
->circuit_list
= list_new();
311 area
->adjacency_list
= list_new();
312 area
->area_addrs
= list_new();
313 if (!CHECK_FLAG(im
->options
, F_ISIS_UNIT_TEST
))
314 thread_add_timer(master
, lsp_tick
, area
, 1, &area
->t_tick
);
315 flags_initialize(&area
->flags
);
317 isis_sr_area_init(area
);
323 enum isis_metric_style default_style
;
325 area
->max_lsp_lifetime
[0] = yang_get_default_uint16(
326 "/frr-isisd:isis/instance/lsp/timers/level-1/maximum-lifetime");
327 area
->max_lsp_lifetime
[1] = yang_get_default_uint16(
328 "/frr-isisd:isis/instance/lsp/timers/level-2/maximum-lifetime");
329 area
->lsp_refresh
[0] = yang_get_default_uint16(
330 "/frr-isisd:isis/instance/lsp/timers/level-1/refresh-interval");
331 area
->lsp_refresh
[1] = yang_get_default_uint16(
332 "/frr-isisd:isis/instance/lsp/timers/level-2/refresh-interval");
333 area
->lsp_gen_interval
[0] = yang_get_default_uint16(
334 "/frr-isisd:isis/instance/lsp/timers/level-1/generation-interval");
335 area
->lsp_gen_interval
[1] = yang_get_default_uint16(
336 "/frr-isisd:isis/instance/lsp/timers/level-2/generation-interval");
337 area
->min_spf_interval
[0] = yang_get_default_uint16(
338 "/frr-isisd:isis/instance/spf/minimum-interval/level-1");
339 area
->min_spf_interval
[1] = yang_get_default_uint16(
340 "/frr-isisd:isis/instance/spf/minimum-interval/level-1");
341 area
->dynhostname
= yang_get_default_bool(
342 "/frr-isisd:isis/instance/dynamic-hostname");
344 yang_get_default_enum("/frr-isisd:isis/instance/metric-style");
345 area
->oldmetric
= default_style
== ISIS_WIDE_METRIC
? 0 : 1;
346 area
->newmetric
= default_style
== ISIS_NARROW_METRIC
? 0 : 1;
347 area
->lsp_frag_threshold
= 90; /* not currently configurable */
349 yang_get_default_uint16("/frr-isisd:isis/instance/lsp/mtu");
350 area
->lfa_load_sharing
[0] = yang_get_default_bool(
351 "/frr-isisd:isis/instance/fast-reroute/level-1/lfa/load-sharing");
352 area
->lfa_load_sharing
[1] = yang_get_default_bool(
353 "/frr-isisd:isis/instance/fast-reroute/level-2/lfa/load-sharing");
354 area
->attached_bit_send
=
355 yang_get_default_bool("/frr-isisd:isis/instance/attach-send");
356 area
->attached_bit_rcv_ignore
= yang_get_default_bool(
357 "/frr-isisd:isis/instance/attach-receive-ignore");
360 area
->max_lsp_lifetime
[0] = DEFAULT_LSP_LIFETIME
; /* 1200 */
361 area
->max_lsp_lifetime
[1] = DEFAULT_LSP_LIFETIME
; /* 1200 */
362 area
->lsp_refresh
[0] = DEFAULT_MAX_LSP_GEN_INTERVAL
; /* 900 */
363 area
->lsp_refresh
[1] = DEFAULT_MAX_LSP_GEN_INTERVAL
; /* 900 */
364 area
->lsp_gen_interval
[0] = DEFAULT_MIN_LSP_GEN_INTERVAL
;
365 area
->lsp_gen_interval
[1] = DEFAULT_MIN_LSP_GEN_INTERVAL
;
366 area
->min_spf_interval
[0] = MINIMUM_SPF_INTERVAL
;
367 area
->min_spf_interval
[1] = MINIMUM_SPF_INTERVAL
;
368 area
->dynhostname
= 1;
371 area
->lsp_frag_threshold
= 90;
372 area
->lsp_mtu
= DEFAULT_LSP_MTU
;
373 area
->lfa_load_sharing
[0] = true;
374 area
->lfa_load_sharing
[1] = true;
375 area
->attached_bit_send
= true;
376 area
->attached_bit_rcv_ignore
= false;
377 #endif /* ifndef FABRICD */
378 area
->lfa_priority_limit
[0] = SPF_PREFIX_PRIO_LOW
;
379 area
->lfa_priority_limit
[1] = SPF_PREFIX_PRIO_LOW
;
380 isis_lfa_tiebreakers_init(area
, ISIS_LEVEL1
);
381 isis_lfa_tiebreakers_init(area
, ISIS_LEVEL2
);
385 area
->area_tag
= strdup(area_tag
);
388 area
->fabricd
= fabricd_new(area
);
390 area
->lsp_refresh_arg
[0].area
= area
;
391 area
->lsp_refresh_arg
[0].level
= IS_LEVEL_1
;
392 area
->lsp_refresh_arg
[1].area
= area
;
393 area
->lsp_refresh_arg
[1].level
= IS_LEVEL_2
;
395 area
->bfd_signalled_down
= false;
396 area
->bfd_force_spf_refresh
= false;
398 QOBJ_REG(area
, isis_area
);
401 FOR_ALL_INTERFACES (vrf
, ifp
) {
402 if (ifp
->ifindex
== IFINDEX_INTERNAL
)
406 if (circuit
&& strmatch(circuit
->tag
, area
->area_tag
))
407 isis_area_add_circuit(area
, circuit
);
414 struct isis_area
*isis_area_lookup_by_vrf(const char *area_tag
,
415 const char *vrf_name
)
417 struct isis_area
*area
;
418 struct listnode
*node
;
419 struct isis
*isis
= NULL
;
421 isis
= isis_lookup_by_vrfname(vrf_name
);
425 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
))
426 if (strcmp(area
->area_tag
, area_tag
) == 0)
432 struct isis_area
*isis_area_lookup(const char *area_tag
, vrf_id_t vrf_id
)
434 struct isis_area
*area
;
435 struct listnode
*node
;
438 isis
= isis_lookup_by_vrfid(vrf_id
);
442 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
))
443 if ((area
->area_tag
== NULL
&& area_tag
== NULL
)
444 || (area
->area_tag
&& area_tag
445 && strcmp(area
->area_tag
, area_tag
) == 0))
451 int isis_area_get(struct vty
*vty
, const char *area_tag
)
453 struct isis_area
*area
;
455 area
= isis_area_lookup(area_tag
, VRF_DEFAULT
);
458 VTY_PUSH_CONTEXT(ROUTER_NODE
, area
);
462 area
= isis_area_create(area_tag
, VRF_DEFAULT_NAME
);
465 zlog_debug("New IS-IS area instance %s", area
->area_tag
);
467 VTY_PUSH_CONTEXT(ROUTER_NODE
, area
);
472 /* return the number of Level1 and level-1-2 routers or
473 * the number of Level2 and level-1-2 routers configured
475 int isis_area_count(const struct isis
*isis
, int levels
)
477 struct isis_area
*area
;
478 struct listnode
*node
;
481 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
))
482 if (area
->is_type
& levels
)
488 void isis_area_destroy(struct isis_area
*area
)
490 struct listnode
*node
, *nnode
;
491 struct isis_circuit
*circuit
;
492 struct area_addr
*addr
;
497 fabricd_finish(area
->fabricd
);
499 /* Disable MPLS if necessary before flooding LSP */
500 if (IS_MPLS_TE(area
->mta
))
501 area
->mta
->status
= disable
;
503 if (area
->circuit_list
) {
504 for (ALL_LIST_ELEMENTS(area
->circuit_list
, node
, nnode
,
506 isis_area_del_circuit(area
, circuit
);
508 list_delete(&area
->circuit_list
);
510 list_delete(&area
->adjacency_list
);
512 lsp_db_fini(&area
->lspdb
[0]);
513 lsp_db_fini(&area
->lspdb
[1]);
515 /* invalidate and verify to delete all routes from zebra */
516 isis_area_invalidate_routes(area
, area
->is_type
);
517 isis_area_verify_routes(area
);
519 isis_sr_area_term(area
);
521 spftree_area_del(area
);
523 if (area
->spf_timer
[0])
524 isis_spf_timer_free(THREAD_ARG(area
->spf_timer
[0]));
525 thread_cancel(&area
->spf_timer
[0]);
526 if (area
->spf_timer
[1])
527 isis_spf_timer_free(THREAD_ARG(area
->spf_timer
[1]));
528 thread_cancel(&area
->spf_timer
[1]);
530 spf_backoff_free(area
->spf_delay_ietf
[0]);
531 spf_backoff_free(area
->spf_delay_ietf
[1]);
533 if (!CHECK_FLAG(im
->options
, F_ISIS_UNIT_TEST
))
534 isis_redist_area_finish(area
);
536 for (ALL_LIST_ELEMENTS(area
->area_addrs
, node
, nnode
, addr
)) {
537 list_delete_node(area
->area_addrs
, node
);
538 XFREE(MTYPE_ISIS_AREA_ADDR
, addr
);
540 area
->area_addrs
= NULL
;
542 for (int i
= SPF_PREFIX_PRIO_CRITICAL
; i
<= SPF_PREFIX_PRIO_MEDIUM
;
544 struct spf_prefix_priority_acl
*ppa
;
546 ppa
= &area
->spf_prefix_priorities
[i
];
547 XFREE(MTYPE_ISIS_ACL_NAME
, ppa
->name
);
549 isis_lfa_tiebreakers_clear(area
, ISIS_LEVEL1
);
550 isis_lfa_tiebreakers_clear(area
, ISIS_LEVEL2
);
552 thread_cancel(&area
->t_tick
);
553 thread_cancel(&area
->t_lsp_refresh
[0]);
554 thread_cancel(&area
->t_lsp_refresh
[1]);
555 thread_cancel(&area
->t_rlfa_rib_update
);
557 thread_cancel_event(master
, area
);
559 listnode_delete(area
->isis
->area_list
, area
);
561 free(area
->area_tag
);
563 area_mt_finish(area
);
565 if (listcount(area
->isis
->area_list
) == 0) {
566 isis_finish(area
->isis
);
569 XFREE(MTYPE_ISIS_AREA
, area
);
573 /* This is hook function for vrf create called as part of vrf_init */
574 static int isis_vrf_new(struct vrf
*vrf
)
577 zlog_debug("%s: VRF Created: %s(%u)", __func__
, vrf
->name
,
583 /* This is hook function for vrf delete call as part of vrf_init */
584 static int isis_vrf_delete(struct vrf
*vrf
)
587 zlog_debug("%s: VRF Deletion: %s(%u)", __func__
, vrf
->name
,
593 static void isis_set_redist_vrf_bitmaps(struct isis
*isis
, bool set
)
595 struct listnode
*node
;
596 struct isis_area
*area
;
601 char do_subscribe
[REDIST_PROTOCOL_COUNT
][ZEBRA_ROUTE_MAX
+ 1];
603 memset(do_subscribe
, 0, sizeof(do_subscribe
));
605 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
))
606 for (protocol
= 0; protocol
< REDIST_PROTOCOL_COUNT
; protocol
++)
607 for (type
= 0; type
< ZEBRA_ROUTE_MAX
+ 1; type
++)
608 for (level
= 0; level
< ISIS_LEVELS
; level
++)
609 if (area
->redist_settings
[protocol
]
613 do_subscribe
[protocol
][type
] =
616 for (protocol
= 0; protocol
< REDIST_PROTOCOL_COUNT
; protocol
++)
617 for (type
= 0; type
< ZEBRA_ROUTE_MAX
+ 1; type
++) {
618 /* This field is actually controlling transmission of
620 * routes to Zebra and has nothing to do with
623 if (type
== PROTO_TYPE
)
626 if (!do_subscribe
[protocol
][type
])
629 afi_t afi
= afi_for_redist_protocol(protocol
);
631 if (type
== DEFAULT_ROUTE
) {
634 zclient
->default_information
639 zclient
->default_information
645 zclient
->redist
[afi
][type
],
649 zclient
->redist
[afi
][type
],
655 static int isis_vrf_enable(struct vrf
*vrf
)
661 zlog_debug("%s: VRF %s id %u enabled", __func__
, vrf
->name
,
664 isis
= isis_lookup_by_vrfname(vrf
->name
);
666 old_vrf_id
= isis
->vrf_id
;
667 /* We have instance configured, link to VRF and make it "up". */
668 isis_vrf_link(isis
, vrf
);
671 "%s: isis linked to vrf %s vrf_id %u (old id %u)",
672 __func__
, vrf
->name
, isis
->vrf_id
, old_vrf_id
);
673 if (old_vrf_id
!= isis
->vrf_id
) {
674 /* start zebra redist to us for new vrf */
675 isis_set_redist_vrf_bitmaps(isis
, true);
677 isis_zebra_vrf_register(isis
);
684 static int isis_vrf_disable(struct vrf
*vrf
)
687 vrf_id_t old_vrf_id
= VRF_UNKNOWN
;
689 if (vrf
->vrf_id
== VRF_DEFAULT
)
693 zlog_debug("%s: VRF %s id %d disabled.", __func__
, vrf
->name
,
695 isis
= isis_lookup_by_vrfname(vrf
->name
);
697 old_vrf_id
= isis
->vrf_id
;
699 isis_zebra_vrf_deregister(isis
);
701 isis_set_redist_vrf_bitmaps(isis
, false);
703 /* We have instance configured, unlink
704 * from VRF and make it "down".
706 isis_vrf_unlink(isis
, vrf
);
708 zlog_debug("%s: isis old_vrf_id %d unlinked", __func__
,
715 void isis_vrf_init(void)
717 vrf_init(isis_vrf_new
, isis_vrf_enable
, isis_vrf_disable
,
718 isis_vrf_delete
, isis_vrf_enable
);
720 vrf_cmd_init(NULL
, &isisd_privs
);
723 void isis_terminate()
726 struct listnode
*node
, *nnode
;
728 bfd_protocol_integration_set_shutdown(true);
730 if (listcount(im
->isis
) == 0)
733 for (ALL_LIST_ELEMENTS(im
->isis
, node
, nnode
, isis
))
737 void isis_filter_update(struct access_list
*access
)
740 struct isis_area
*area
;
741 struct listnode
*node
, *anode
;
743 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
)) {
744 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, anode
, area
)) {
745 for (int i
= SPF_PREFIX_PRIO_CRITICAL
;
746 i
<= SPF_PREFIX_PRIO_MEDIUM
; i
++) {
747 struct spf_prefix_priority_acl
*ppa
;
749 ppa
= &area
->spf_prefix_priorities
[i
];
751 access_list_lookup(AFI_IP
, ppa
->name
);
753 access_list_lookup(AFI_IP6
, ppa
->name
);
755 lsp_regenerate_schedule(area
, area
->is_type
, 0);
760 void isis_prefix_list_update(struct prefix_list
*plist
)
763 struct isis_area
*area
;
764 struct listnode
*node
, *anode
;
766 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
)) {
767 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, anode
, area
)) {
768 for (int level
= ISIS_LEVEL1
; level
<= ISIS_LEVELS
;
770 const char *plist_name
=
771 prefix_list_name(plist
);
773 if (!area
->rlfa_plist_name
[level
- 1])
776 if (!strmatch(area
->rlfa_plist_name
[level
- 1],
780 area
->rlfa_plist
[level
- 1] =
781 prefix_list_lookup(AFI_IP
, plist_name
);
782 lsp_regenerate_schedule(area
, area
->is_type
, 0);
789 static void area_set_mt_enabled(struct isis_area
*area
, uint16_t mtid
,
792 struct isis_area_mt_setting
*setting
;
794 setting
= area_get_mt_setting(area
, mtid
);
795 if (setting
->enabled
!= enabled
) {
796 setting
->enabled
= enabled
;
797 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 0);
801 static void area_set_mt_overload(struct isis_area
*area
, uint16_t mtid
,
804 struct isis_area_mt_setting
*setting
;
806 setting
= area_get_mt_setting(area
, mtid
);
807 if (setting
->overload
!= overload
) {
808 setting
->overload
= overload
;
809 if (setting
->enabled
)
810 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
,
814 #endif /* ifdef FABRICD */
816 int area_net_title(struct vty
*vty
, const char *net_title
)
818 VTY_DECLVAR_CONTEXT(isis_area
, area
);
819 struct area_addr
*addr
;
820 struct area_addr
*addrp
;
821 struct listnode
*node
;
825 /* We check that we are not over the maximal number of addresses */
826 if (listcount(area
->area_addrs
) >= area
->isis
->max_area_addrs
) {
828 "Maximum of area addresses (%d) already reached \n",
829 area
->isis
->max_area_addrs
);
830 return CMD_ERR_NOTHING_TODO
;
833 addr
= XMALLOC(MTYPE_ISIS_AREA_ADDR
, sizeof(struct area_addr
));
834 addr
->addr_len
= dotformat2buff(buff
, net_title
);
835 memcpy(addr
->area_addr
, buff
, addr
->addr_len
);
837 zlog_debug("added area address %s for area %s (address length %d)",
838 net_title
, area
->area_tag
, addr
->addr_len
);
839 #endif /* EXTREME_DEBUG */
840 if (addr
->addr_len
< 8 || addr
->addr_len
> 20) {
842 "area address must be at least 8..20 octets long (%d)\n",
844 XFREE(MTYPE_ISIS_AREA_ADDR
, addr
);
845 return CMD_WARNING_CONFIG_FAILED
;
848 if (addr
->area_addr
[addr
->addr_len
- 1] != 0) {
850 "nsel byte (last byte) in area address must be 0\n");
851 XFREE(MTYPE_ISIS_AREA_ADDR
, addr
);
852 return CMD_WARNING_CONFIG_FAILED
;
855 if (area
->isis
->sysid_set
== 0) {
857 * First area address - get the SystemID for this router
859 memcpy(area
->isis
->sysid
, GETSYSID(addr
), ISIS_SYS_ID_LEN
);
860 area
->isis
->sysid_set
= 1;
862 zlog_debug("Router has SystemID %s",
863 sysid_print(area
->isis
->sysid
));
866 * Check that the SystemID portions match
868 if (memcmp(area
->isis
->sysid
, GETSYSID(addr
),
871 "System ID must not change when defining additional area addresses\n");
872 XFREE(MTYPE_ISIS_AREA_ADDR
, addr
);
873 return CMD_WARNING_CONFIG_FAILED
;
876 /* now we see that we don't already have this address */
877 for (ALL_LIST_ELEMENTS_RO(area
->area_addrs
, node
, addrp
)) {
878 if ((addrp
->addr_len
+ ISIS_SYS_ID_LEN
+ ISIS_NSEL_LEN
)
881 if (!memcmp(addrp
->area_addr
, addr
->area_addr
,
883 XFREE(MTYPE_ISIS_AREA_ADDR
, addr
);
884 return CMD_SUCCESS
; /* silent fail */
890 * Forget the systemID part of the address
892 addr
->addr_len
-= (ISIS_SYS_ID_LEN
+ ISIS_NSEL_LEN
);
893 listnode_add(area
->area_addrs
, addr
);
895 /* only now we can safely generate our LSPs for this area */
896 if (listcount(area
->area_addrs
) > 0) {
897 if (area
->is_type
& IS_LEVEL_1
)
898 lsp_generate(area
, IS_LEVEL_1
);
899 if (area
->is_type
& IS_LEVEL_2
)
900 lsp_generate(area
, IS_LEVEL_2
);
906 int area_clear_net_title(struct vty
*vty
, const char *net_title
)
908 VTY_DECLVAR_CONTEXT(isis_area
, area
);
909 struct area_addr addr
, *addrp
= NULL
;
910 struct listnode
*node
;
913 addr
.addr_len
= dotformat2buff(buff
, net_title
);
914 if (addr
.addr_len
< 8 || addr
.addr_len
> 20) {
916 "Unsupported area address length %d, should be 8...20 \n",
918 return CMD_WARNING_CONFIG_FAILED
;
921 memcpy(addr
.area_addr
, buff
, (int)addr
.addr_len
);
923 for (ALL_LIST_ELEMENTS_RO(area
->area_addrs
, node
, addrp
))
924 if ((addrp
->addr_len
+ ISIS_SYS_ID_LEN
+ 1) == addr
.addr_len
925 && !memcmp(addrp
->area_addr
, addr
.area_addr
, addr
.addr_len
))
929 vty_out(vty
, "No area address %s for area %s \n", net_title
,
931 return CMD_ERR_NO_MATCH
;
934 listnode_delete(area
->area_addrs
, addrp
);
935 XFREE(MTYPE_ISIS_AREA_ADDR
, addrp
);
938 * Last area address - reset the SystemID for this router
940 if (listcount(area
->area_addrs
) == 0) {
941 memset(area
->isis
->sysid
, 0, ISIS_SYS_ID_LEN
);
942 area
->isis
->sysid_set
= 0;
944 zlog_debug("Router has no SystemID");
951 * 'show isis interface' command
954 int show_isis_interface_common(struct vty
*vty
, const char *ifname
, char detail
,
955 const char *vrf_name
, bool all_vrf
)
957 struct listnode
*anode
, *cnode
, *inode
;
958 struct isis_area
*area
;
959 struct isis_circuit
*circuit
;
963 vty_out(vty
, "IS-IS Routing Process not enabled\n");
968 for (ALL_LIST_ELEMENTS_RO(im
->isis
, inode
, isis
)) {
969 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
,
971 vty_out(vty
, "Area %s:\n",
974 if (detail
== ISIS_UI_LEVEL_BRIEF
)
976 " Interface CircId State Type Level\n");
978 for (ALL_LIST_ELEMENTS_RO(
979 area
->circuit_list
, cnode
,
982 isis_circuit_print_vty(
985 else if (strcmp(circuit
->interface
->name
, ifname
) == 0)
986 isis_circuit_print_vty(
993 isis
= isis_lookup_by_vrfname(vrf_name
);
995 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, anode
,
997 vty_out(vty
, "Area %s:\n", area
->area_tag
);
999 if (detail
== ISIS_UI_LEVEL_BRIEF
)
1001 " Interface CircId State Type Level\n");
1003 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
,
1006 isis_circuit_print_vty(
1007 circuit
, vty
, detail
);
1009 strcmp(circuit
->interface
->name
,
1012 isis_circuit_print_vty(
1013 circuit
, vty
, detail
);
1021 DEFUN(show_isis_interface
,
1022 show_isis_interface_cmd
,
1023 "show " PROTO_NAME
" [vrf <NAME|all>] interface",
1028 "IS-IS interface\n")
1030 const char *vrf_name
= VRF_DEFAULT_NAME
;
1031 bool all_vrf
= false;
1034 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
1035 return show_isis_interface_common(vty
, NULL
, ISIS_UI_LEVEL_BRIEF
,
1039 DEFUN(show_isis_interface_detail
,
1040 show_isis_interface_detail_cmd
,
1041 "show " PROTO_NAME
" [vrf <NAME|all>] interface detail",
1047 "show detailed information\n")
1049 const char *vrf_name
= VRF_DEFAULT_NAME
;
1050 bool all_vrf
= false;
1053 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
1054 return show_isis_interface_common(vty
, NULL
, ISIS_UI_LEVEL_DETAIL
,
1058 DEFUN(show_isis_interface_arg
,
1059 show_isis_interface_arg_cmd
,
1060 "show " PROTO_NAME
" [vrf <NAME|all>] interface WORD",
1066 "IS-IS interface name\n")
1069 const char *vrf_name
= VRF_DEFAULT_NAME
;
1070 bool all_vrf
= false;
1073 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
1075 char *ifname
= argv_find(argv
, argc
, "WORD", &idx_word
)
1076 ? argv
[idx_word
]->arg
1078 return show_isis_interface_common(vty
, ifname
, ISIS_UI_LEVEL_DETAIL
,
1082 static int id_to_sysid(struct isis
*isis
, const char *id
, uint8_t *sysid
)
1084 struct isis_dynhn
*dynhn
;
1086 memset(sysid
, 0, ISIS_SYS_ID_LEN
);
1088 if (sysid2buff(sysid
, id
) == 0) {
1089 dynhn
= dynhn_find_by_name(isis
, id
);
1092 memcpy(sysid
, dynhn
->id
, ISIS_SYS_ID_LEN
);
1099 static void isis_neighbor_common(struct vty
*vty
, const char *id
, char detail
,
1100 struct isis
*isis
, uint8_t *sysid
)
1102 struct listnode
*anode
, *cnode
, *node
;
1103 struct isis_area
*area
;
1104 struct isis_circuit
*circuit
;
1106 struct isis_adjacency
*adj
;
1109 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, anode
, area
)) {
1110 vty_out(vty
, "Area %s:\n", area
->area_tag
);
1112 if (detail
== ISIS_UI_LEVEL_BRIEF
)
1114 " System Id Interface L State Holdtime SNPA\n");
1116 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
, cnode
, circuit
)) {
1117 if (circuit
->circ_type
== CIRCUIT_T_BROADCAST
) {
1118 for (i
= 0; i
< 2; i
++) {
1119 adjdb
= circuit
->u
.bc
.adjdb
[i
];
1120 if (adjdb
&& adjdb
->count
) {
1121 for (ALL_LIST_ELEMENTS_RO(
1134 } else if (circuit
->circ_type
== CIRCUIT_T_P2P
1135 && circuit
->u
.p2p
.neighbor
) {
1136 adj
= circuit
->u
.p2p
.neighbor
;
1138 || !memcmp(adj
->sysid
, sysid
,
1140 isis_adj_print_vty(adj
, vty
, detail
);
1147 * 'show isis neighbor' command
1150 int show_isis_neighbor_common(struct vty
*vty
, const char *id
, char detail
,
1151 const char *vrf_name
, bool all_vrf
)
1153 struct listnode
*node
;
1154 uint8_t sysid
[ISIS_SYS_ID_LEN
];
1158 vty_out(vty
, "IS-IS Routing Process not enabled\n");
1164 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
)) {
1165 if (id_to_sysid(isis
, id
, sysid
)) {
1166 vty_out(vty
, "Invalid system id %s\n",
1170 isis_neighbor_common(vty
, id
, detail
, isis
,
1175 isis
= isis_lookup_by_vrfname(vrf_name
);
1177 if (id_to_sysid(isis
, id
, sysid
)) {
1178 vty_out(vty
, "Invalid system id %s\n", id
);
1181 isis_neighbor_common(vty
, id
, detail
, isis
, sysid
);
1188 static void isis_neighbor_common_clear(struct vty
*vty
, const char *id
,
1189 uint8_t *sysid
, struct isis
*isis
)
1191 struct listnode
*anode
, *cnode
, *node
, *nnode
;
1192 struct isis_area
*area
;
1193 struct isis_circuit
*circuit
;
1195 struct isis_adjacency
*adj
;
1198 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, anode
, area
)) {
1199 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
, cnode
, circuit
)) {
1200 if (circuit
->circ_type
== CIRCUIT_T_BROADCAST
) {
1201 for (i
= 0; i
< 2; i
++) {
1202 adjdb
= circuit
->u
.bc
.adjdb
[i
];
1203 if (adjdb
&& adjdb
->count
) {
1204 for (ALL_LIST_ELEMENTS(
1212 isis_adj_state_change(
1215 "clear user request");
1218 } else if (circuit
->circ_type
== CIRCUIT_T_P2P
1219 && circuit
->u
.p2p
.neighbor
) {
1220 adj
= circuit
->u
.p2p
.neighbor
;
1222 || !memcmp(adj
->sysid
, sysid
,
1224 isis_adj_state_change(
1225 &adj
, ISIS_ADJ_DOWN
,
1226 "clear user request");
1232 * 'clear isis neighbor' command
1234 int clear_isis_neighbor_common(struct vty
*vty
, const char *id
, const char *vrf_name
,
1237 struct listnode
*node
;
1238 uint8_t sysid
[ISIS_SYS_ID_LEN
];
1242 vty_out(vty
, "IS-IS Routing Process not enabled\n");
1248 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
)) {
1249 if (id_to_sysid(isis
, id
, sysid
)) {
1250 vty_out(vty
, "Invalid system id %s\n",
1254 isis_neighbor_common_clear(vty
, id
, sysid
,
1259 isis
= isis_lookup_by_vrfname(vrf_name
);
1261 if (id_to_sysid(isis
, id
, sysid
)) {
1262 vty_out(vty
, "Invalid system id %s\n", id
);
1265 isis_neighbor_common_clear(vty
, id
, sysid
, isis
);
1272 DEFUN(show_isis_neighbor
,
1273 show_isis_neighbor_cmd
,
1274 "show " PROTO_NAME
" [vrf <NAME|all>] neighbor",
1279 "IS-IS neighbor adjacencies\n")
1281 const char *vrf_name
= VRF_DEFAULT_NAME
;
1282 bool all_vrf
= false;
1285 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
1286 return show_isis_neighbor_common(vty
, NULL
, ISIS_UI_LEVEL_BRIEF
,
1290 DEFUN(show_isis_neighbor_detail
,
1291 show_isis_neighbor_detail_cmd
,
1292 "show " PROTO_NAME
" [vrf <NAME|all>] neighbor detail",
1297 "IS-IS neighbor adjacencies\n"
1298 "show detailed information\n")
1300 const char *vrf_name
= VRF_DEFAULT_NAME
;
1301 bool all_vrf
= false;
1304 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
1306 return show_isis_neighbor_common(vty
, NULL
, ISIS_UI_LEVEL_DETAIL
,
1310 DEFUN(show_isis_neighbor_arg
,
1311 show_isis_neighbor_arg_cmd
,
1312 "show " PROTO_NAME
" [vrf <NAME|all>] neighbor WORD",
1317 "IS-IS neighbor adjacencies\n"
1321 const char *vrf_name
= VRF_DEFAULT_NAME
;
1322 bool all_vrf
= false;
1325 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
1326 char *id
= argv_find(argv
, argc
, "WORD", &idx_word
)
1327 ? argv
[idx_word
]->arg
1330 return show_isis_neighbor_common(vty
, id
, ISIS_UI_LEVEL_DETAIL
,
1334 DEFUN(clear_isis_neighbor
,
1335 clear_isis_neighbor_cmd
,
1336 "clear " PROTO_NAME
" [vrf <NAME|all>] neighbor",
1341 "IS-IS neighbor adjacencies\n")
1343 const char *vrf_name
= VRF_DEFAULT_NAME
;
1344 bool all_vrf
= false;
1347 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
1348 return clear_isis_neighbor_common(vty
, NULL
, vrf_name
, all_vrf
);
1351 DEFUN(clear_isis_neighbor_arg
,
1352 clear_isis_neighbor_arg_cmd
,
1353 "clear " PROTO_NAME
" [vrf <NAME|all>] neighbor WORD",
1358 "IS-IS neighbor adjacencies\n"
1362 const char *vrf_name
= VRF_DEFAULT_NAME
;
1363 bool all_vrf
= false;
1366 char *id
= argv_find(argv
, argc
, "WORD", &idx_word
)
1367 ? argv
[idx_word
]->arg
1369 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
1370 return clear_isis_neighbor_common(vty
, id
, vrf_name
, all_vrf
);
1374 * 'isis debug', 'show debugging'
1376 void print_debug(struct vty
*vty
, int flags
, int onoff
)
1378 const char *onoffs
= onoff
? "on" : "off";
1380 if (flags
& DEBUG_ADJ_PACKETS
)
1382 "IS-IS Adjacency related packets debugging is %s\n",
1384 if (flags
& DEBUG_TX_QUEUE
)
1385 vty_out(vty
, "IS-IS TX queue debugging is %s\n",
1387 if (flags
& DEBUG_SNP_PACKETS
)
1388 vty_out(vty
, "IS-IS CSNP/PSNP packets debugging is %s\n",
1390 if (flags
& DEBUG_SPF_EVENTS
)
1391 vty_out(vty
, "IS-IS SPF events debugging is %s\n", onoffs
);
1392 if (flags
& DEBUG_SR
)
1393 vty_out(vty
, "IS-IS Segment Routing events debugging is %s\n",
1395 if (flags
& DEBUG_LFA
)
1396 vty_out(vty
, "IS-IS LFA events debugging is %s\n", onoffs
);
1397 if (flags
& DEBUG_UPDATE_PACKETS
)
1398 vty_out(vty
, "IS-IS Update related packet debugging is %s\n",
1400 if (flags
& DEBUG_RTE_EVENTS
)
1401 vty_out(vty
, "IS-IS Route related debuggin is %s\n", onoffs
);
1402 if (flags
& DEBUG_EVENTS
)
1403 vty_out(vty
, "IS-IS Event debugging is %s\n", onoffs
);
1404 if (flags
& DEBUG_PACKET_DUMP
)
1405 vty_out(vty
, "IS-IS Packet dump debugging is %s\n", onoffs
);
1406 if (flags
& DEBUG_LSP_GEN
)
1407 vty_out(vty
, "IS-IS LSP generation debugging is %s\n", onoffs
);
1408 if (flags
& DEBUG_LSP_SCHED
)
1409 vty_out(vty
, "IS-IS LSP scheduling debugging is %s\n", onoffs
);
1410 if (flags
& DEBUG_FLOODING
)
1411 vty_out(vty
, "IS-IS Flooding debugging is %s\n", onoffs
);
1412 if (flags
& DEBUG_BFD
)
1413 vty_out(vty
, "IS-IS BFD debugging is %s\n", onoffs
);
1414 if (flags
& DEBUG_LDP_SYNC
)
1415 vty_out(vty
, "IS-IS ldp-sync debugging is %s\n", onoffs
);
1418 DEFUN_NOSH (show_debugging
,
1419 show_debugging_isis_cmd
,
1420 "show debugging [" PROTO_NAME
"]",
1422 "State of each debugging option\n"
1425 vty_out(vty
, PROTO_NAME
" debugging status:\n");
1427 if (IS_DEBUG_ADJ_PACKETS
)
1428 print_debug(vty
, DEBUG_ADJ_PACKETS
, 1);
1429 if (IS_DEBUG_TX_QUEUE
)
1430 print_debug(vty
, DEBUG_TX_QUEUE
, 1);
1431 if (IS_DEBUG_SNP_PACKETS
)
1432 print_debug(vty
, DEBUG_SNP_PACKETS
, 1);
1433 if (IS_DEBUG_SPF_EVENTS
)
1434 print_debug(vty
, DEBUG_SPF_EVENTS
, 1);
1436 print_debug(vty
, DEBUG_SR
, 1);
1437 if (IS_DEBUG_UPDATE_PACKETS
)
1438 print_debug(vty
, DEBUG_UPDATE_PACKETS
, 1);
1439 if (IS_DEBUG_RTE_EVENTS
)
1440 print_debug(vty
, DEBUG_RTE_EVENTS
, 1);
1441 if (IS_DEBUG_EVENTS
)
1442 print_debug(vty
, DEBUG_EVENTS
, 1);
1443 if (IS_DEBUG_PACKET_DUMP
)
1444 print_debug(vty
, DEBUG_PACKET_DUMP
, 1);
1445 if (IS_DEBUG_LSP_GEN
)
1446 print_debug(vty
, DEBUG_LSP_GEN
, 1);
1447 if (IS_DEBUG_LSP_SCHED
)
1448 print_debug(vty
, DEBUG_LSP_SCHED
, 1);
1449 if (IS_DEBUG_FLOODING
)
1450 print_debug(vty
, DEBUG_FLOODING
, 1);
1452 print_debug(vty
, DEBUG_BFD
, 1);
1453 if (IS_DEBUG_LDP_SYNC
)
1454 print_debug(vty
, DEBUG_LDP_SYNC
, 1);
1456 print_debug(vty
, DEBUG_LFA
, 1);
1461 static int config_write_debug(struct vty
*vty
);
1463 static struct cmd_node debug_node
= {
1467 .config_write
= config_write_debug
,
1470 static int config_write_debug(struct vty
*vty
)
1474 if (IS_DEBUG_ADJ_PACKETS
) {
1475 vty_out(vty
, "debug " PROTO_NAME
" adj-packets\n");
1478 if (IS_DEBUG_TX_QUEUE
) {
1479 vty_out(vty
, "debug " PROTO_NAME
" tx-queue\n");
1482 if (IS_DEBUG_SNP_PACKETS
) {
1483 vty_out(vty
, "debug " PROTO_NAME
" snp-packets\n");
1486 if (IS_DEBUG_SPF_EVENTS
) {
1487 vty_out(vty
, "debug " PROTO_NAME
" spf-events\n");
1491 vty_out(vty
, "debug " PROTO_NAME
" sr-events\n");
1495 vty_out(vty
, "debug " PROTO_NAME
" lfa\n");
1498 if (IS_DEBUG_UPDATE_PACKETS
) {
1499 vty_out(vty
, "debug " PROTO_NAME
" update-packets\n");
1502 if (IS_DEBUG_RTE_EVENTS
) {
1503 vty_out(vty
, "debug " PROTO_NAME
" route-events\n");
1506 if (IS_DEBUG_EVENTS
) {
1507 vty_out(vty
, "debug " PROTO_NAME
" events\n");
1510 if (IS_DEBUG_PACKET_DUMP
) {
1511 vty_out(vty
, "debug " PROTO_NAME
" packet-dump\n");
1514 if (IS_DEBUG_LSP_GEN
) {
1515 vty_out(vty
, "debug " PROTO_NAME
" lsp-gen\n");
1518 if (IS_DEBUG_LSP_SCHED
) {
1519 vty_out(vty
, "debug " PROTO_NAME
" lsp-sched\n");
1522 if (IS_DEBUG_FLOODING
) {
1523 vty_out(vty
, "debug " PROTO_NAME
" flooding\n");
1527 vty_out(vty
, "debug " PROTO_NAME
" bfd\n");
1530 if (IS_DEBUG_LDP_SYNC
) {
1531 vty_out(vty
, "debug " PROTO_NAME
" ldp-sync\n");
1534 write
+= spf_backoff_write_config(vty
);
1539 DEFUN (debug_isis_adj
,
1541 "debug " PROTO_NAME
" adj-packets",
1544 "IS-IS Adjacency related packets\n")
1546 debug_adj_pkt
|= DEBUG_ADJ_PACKETS
;
1547 print_debug(vty
, DEBUG_ADJ_PACKETS
, 1);
1552 DEFUN (no_debug_isis_adj
,
1553 no_debug_isis_adj_cmd
,
1554 "no debug " PROTO_NAME
" adj-packets",
1558 "IS-IS Adjacency related packets\n")
1560 debug_adj_pkt
&= ~DEBUG_ADJ_PACKETS
;
1561 print_debug(vty
, DEBUG_ADJ_PACKETS
, 0);
1566 DEFUN (debug_isis_tx_queue
,
1567 debug_isis_tx_queue_cmd
,
1568 "debug " PROTO_NAME
" tx-queue",
1571 "IS-IS TX queues\n")
1573 debug_tx_queue
|= DEBUG_TX_QUEUE
;
1574 print_debug(vty
, DEBUG_TX_QUEUE
, 1);
1579 DEFUN (no_debug_isis_tx_queue
,
1580 no_debug_isis_tx_queue_cmd
,
1581 "no debug " PROTO_NAME
" tx-queue",
1585 "IS-IS TX queues\n")
1587 debug_tx_queue
&= ~DEBUG_TX_QUEUE
;
1588 print_debug(vty
, DEBUG_TX_QUEUE
, 0);
1593 DEFUN (debug_isis_flooding
,
1594 debug_isis_flooding_cmd
,
1595 "debug " PROTO_NAME
" flooding",
1598 "Flooding algorithm\n")
1600 debug_flooding
|= DEBUG_FLOODING
;
1601 print_debug(vty
, DEBUG_FLOODING
, 1);
1606 DEFUN (no_debug_isis_flooding
,
1607 no_debug_isis_flooding_cmd
,
1608 "no debug " PROTO_NAME
" flooding",
1612 "Flooding algorithm\n")
1614 debug_flooding
&= ~DEBUG_FLOODING
;
1615 print_debug(vty
, DEBUG_FLOODING
, 0);
1620 DEFUN (debug_isis_snp
,
1622 "debug " PROTO_NAME
" snp-packets",
1625 "IS-IS CSNP/PSNP packets\n")
1627 debug_snp_pkt
|= DEBUG_SNP_PACKETS
;
1628 print_debug(vty
, DEBUG_SNP_PACKETS
, 1);
1633 DEFUN (no_debug_isis_snp
,
1634 no_debug_isis_snp_cmd
,
1635 "no debug " PROTO_NAME
" snp-packets",
1639 "IS-IS CSNP/PSNP packets\n")
1641 debug_snp_pkt
&= ~DEBUG_SNP_PACKETS
;
1642 print_debug(vty
, DEBUG_SNP_PACKETS
, 0);
1647 DEFUN (debug_isis_upd
,
1649 "debug " PROTO_NAME
" update-packets",
1652 "IS-IS Update related packets\n")
1654 debug_update_pkt
|= DEBUG_UPDATE_PACKETS
;
1655 print_debug(vty
, DEBUG_UPDATE_PACKETS
, 1);
1660 DEFUN (no_debug_isis_upd
,
1661 no_debug_isis_upd_cmd
,
1662 "no debug " PROTO_NAME
" update-packets",
1666 "IS-IS Update related packets\n")
1668 debug_update_pkt
&= ~DEBUG_UPDATE_PACKETS
;
1669 print_debug(vty
, DEBUG_UPDATE_PACKETS
, 0);
1674 DEFUN (debug_isis_spfevents
,
1675 debug_isis_spfevents_cmd
,
1676 "debug " PROTO_NAME
" spf-events",
1679 "IS-IS Shortest Path First Events\n")
1681 debug_spf_events
|= DEBUG_SPF_EVENTS
;
1682 print_debug(vty
, DEBUG_SPF_EVENTS
, 1);
1687 DEFUN (no_debug_isis_spfevents
,
1688 no_debug_isis_spfevents_cmd
,
1689 "no debug " PROTO_NAME
" spf-events",
1693 "IS-IS Shortest Path First Events\n")
1695 debug_spf_events
&= ~DEBUG_SPF_EVENTS
;
1696 print_debug(vty
, DEBUG_SPF_EVENTS
, 0);
1701 DEFUN (debug_isis_srevents
,
1702 debug_isis_srevents_cmd
,
1703 "debug " PROTO_NAME
" sr-events",
1706 "IS-IS Segment Routing Events\n")
1708 debug_sr
|= DEBUG_SR
;
1709 print_debug(vty
, DEBUG_SR
, 1);
1714 DEFUN (no_debug_isis_srevents
,
1715 no_debug_isis_srevents_cmd
,
1716 "no debug " PROTO_NAME
" sr-events",
1720 "IS-IS Segment Routing Events\n")
1722 debug_sr
&= ~DEBUG_SR
;
1723 print_debug(vty
, DEBUG_SR
, 0);
1728 DEFUN (debug_isis_lfa
,
1730 "debug " PROTO_NAME
" lfa",
1733 "IS-IS LFA Events\n")
1735 debug_lfa
|= DEBUG_LFA
;
1736 print_debug(vty
, DEBUG_LFA
, 1);
1741 DEFUN (no_debug_isis_lfa
,
1742 no_debug_isis_lfa_cmd
,
1743 "no debug " PROTO_NAME
" lfa",
1747 "IS-IS LFA Events\n")
1749 debug_lfa
&= ~DEBUG_LFA
;
1750 print_debug(vty
, DEBUG_LFA
, 0);
1755 DEFUN (debug_isis_rtevents
,
1756 debug_isis_rtevents_cmd
,
1757 "debug " PROTO_NAME
" route-events",
1760 "IS-IS Route related events\n")
1762 debug_rte_events
|= DEBUG_RTE_EVENTS
;
1763 print_debug(vty
, DEBUG_RTE_EVENTS
, 1);
1768 DEFUN (no_debug_isis_rtevents
,
1769 no_debug_isis_rtevents_cmd
,
1770 "no debug " PROTO_NAME
" route-events",
1774 "IS-IS Route related events\n")
1776 debug_rte_events
&= ~DEBUG_RTE_EVENTS
;
1777 print_debug(vty
, DEBUG_RTE_EVENTS
, 0);
1782 DEFUN (debug_isis_events
,
1783 debug_isis_events_cmd
,
1784 "debug " PROTO_NAME
" events",
1789 debug_events
|= DEBUG_EVENTS
;
1790 print_debug(vty
, DEBUG_EVENTS
, 1);
1795 DEFUN (no_debug_isis_events
,
1796 no_debug_isis_events_cmd
,
1797 "no debug " PROTO_NAME
" events",
1803 debug_events
&= ~DEBUG_EVENTS
;
1804 print_debug(vty
, DEBUG_EVENTS
, 0);
1809 DEFUN (debug_isis_packet_dump
,
1810 debug_isis_packet_dump_cmd
,
1811 "debug " PROTO_NAME
" packet-dump",
1814 "IS-IS packet dump\n")
1816 debug_pkt_dump
|= DEBUG_PACKET_DUMP
;
1817 print_debug(vty
, DEBUG_PACKET_DUMP
, 1);
1822 DEFUN (no_debug_isis_packet_dump
,
1823 no_debug_isis_packet_dump_cmd
,
1824 "no debug " PROTO_NAME
" packet-dump",
1828 "IS-IS packet dump\n")
1830 debug_pkt_dump
&= ~DEBUG_PACKET_DUMP
;
1831 print_debug(vty
, DEBUG_PACKET_DUMP
, 0);
1836 DEFUN (debug_isis_lsp_gen
,
1837 debug_isis_lsp_gen_cmd
,
1838 "debug " PROTO_NAME
" lsp-gen",
1841 "IS-IS generation of own LSPs\n")
1843 debug_lsp_gen
|= DEBUG_LSP_GEN
;
1844 print_debug(vty
, DEBUG_LSP_GEN
, 1);
1849 DEFUN (no_debug_isis_lsp_gen
,
1850 no_debug_isis_lsp_gen_cmd
,
1851 "no debug " PROTO_NAME
" lsp-gen",
1855 "IS-IS generation of own LSPs\n")
1857 debug_lsp_gen
&= ~DEBUG_LSP_GEN
;
1858 print_debug(vty
, DEBUG_LSP_GEN
, 0);
1863 DEFUN (debug_isis_lsp_sched
,
1864 debug_isis_lsp_sched_cmd
,
1865 "debug " PROTO_NAME
" lsp-sched",
1868 "IS-IS scheduling of LSP generation\n")
1870 debug_lsp_sched
|= DEBUG_LSP_SCHED
;
1871 print_debug(vty
, DEBUG_LSP_SCHED
, 1);
1876 DEFUN (no_debug_isis_lsp_sched
,
1877 no_debug_isis_lsp_sched_cmd
,
1878 "no debug " PROTO_NAME
" lsp-sched",
1882 "IS-IS scheduling of LSP generation\n")
1884 debug_lsp_sched
&= ~DEBUG_LSP_SCHED
;
1885 print_debug(vty
, DEBUG_LSP_SCHED
, 0);
1890 DEFUN (debug_isis_bfd
,
1892 "debug " PROTO_NAME
" bfd",
1895 PROTO_NAME
" interaction with BFD\n")
1897 debug_bfd
|= DEBUG_BFD
;
1898 print_debug(vty
, DEBUG_BFD
, 1);
1903 DEFUN (no_debug_isis_bfd
,
1904 no_debug_isis_bfd_cmd
,
1905 "no debug " PROTO_NAME
" bfd",
1909 PROTO_NAME
" interaction with BFD\n")
1911 debug_bfd
&= ~DEBUG_BFD
;
1912 print_debug(vty
, DEBUG_BFD
, 0);
1917 DEFUN(debug_isis_ldp_sync
, debug_isis_ldp_sync_cmd
,
1918 "debug " PROTO_NAME
" ldp-sync",
1919 DEBUG_STR PROTO_HELP PROTO_NAME
" interaction with LDP-Sync\n")
1921 debug_ldp_sync
|= DEBUG_LDP_SYNC
;
1922 print_debug(vty
, DEBUG_LDP_SYNC
, 1);
1927 DEFUN(no_debug_isis_ldp_sync
, no_debug_isis_ldp_sync_cmd
,
1928 "no debug " PROTO_NAME
" ldp-sync",
1929 NO_STR UNDEBUG_STR PROTO_HELP PROTO_NAME
" interaction with LDP-Sync\n")
1931 debug_ldp_sync
&= ~DEBUG_LDP_SYNC
;
1932 print_debug(vty
, DEBUG_LDP_SYNC
, 0);
1937 DEFUN (show_hostname
,
1939 "show " PROTO_NAME
" [vrf <NAME|all>] hostname",
1940 SHOW_STR PROTO_HELP VRF_CMD_HELP_STR
1942 "IS-IS Dynamic hostname mapping\n")
1944 struct listnode
*node
;
1945 const char *vrf_name
= VRF_DEFAULT_NAME
;
1946 bool all_vrf
= false;
1950 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
1953 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
))
1954 dynhn_print_all(vty
, isis
);
1958 isis
= isis_lookup_by_vrfname(vrf_name
);
1960 dynhn_print_all(vty
, isis
);
1966 static void isis_spf_ietf_common(struct vty
*vty
, struct isis
*isis
)
1968 struct listnode
*node
;
1969 struct isis_area
*area
;
1970 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
)) {
1972 vty_out(vty
, "vrf : %s\n", isis
->name
);
1973 vty_out(vty
, "Area %s:\n",
1974 area
->area_tag
? area
->area_tag
: "null");
1976 for (int level
= ISIS_LEVEL1
; level
<= ISIS_LEVELS
; level
++) {
1977 if ((area
->is_type
& level
) == 0)
1980 vty_out(vty
, " Level-%d:\n", level
);
1981 vty_out(vty
, " SPF delay status: ");
1982 if (area
->spf_timer
[level
- 1]) {
1983 struct timeval remain
= thread_timer_remain(
1984 area
->spf_timer
[level
- 1]);
1985 vty_out(vty
, "Pending, due in %lld msec\n",
1986 (long long)remain
.tv_sec
* 1000
1987 + remain
.tv_usec
/ 1000);
1989 vty_out(vty
, "Not scheduled\n");
1992 if (area
->spf_delay_ietf
[level
- 1]) {
1994 " Using draft-ietf-rtgwg-backoff-algo-04\n");
1996 area
->spf_delay_ietf
[level
- 1], vty
,
1999 vty_out(vty
, " Using legacy backoff algo\n");
2005 DEFUN(show_isis_spf_ietf
, show_isis_spf_ietf_cmd
,
2006 "show " PROTO_NAME
" [vrf <NAME|all>] spf-delay-ietf",
2007 SHOW_STR PROTO_HELP VRF_CMD_HELP_STR
2009 "SPF delay IETF information\n")
2011 struct listnode
*node
;
2014 const char *vrf_name
= VRF_DEFAULT_NAME
;
2015 bool all_vrf
= false;
2017 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
)
2020 vty_out(vty
, "ISIS is not running\n");
2026 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
))
2027 isis_spf_ietf_common(vty
, isis
);
2031 isis
= isis_lookup_by_vrfname(vrf_name
);
2033 isis_spf_ietf_common(vty
, isis
);
2039 static void common_isis_summary(struct vty
*vty
, struct isis
*isis
)
2041 struct listnode
*node
, *node2
;
2042 struct isis_area
*area
;
2045 vty_out(vty
, "vrf : %s\n", isis
->name
);
2046 vty_out(vty
, "Process Id : %ld\n", isis
->process_id
);
2047 if (isis
->sysid_set
)
2048 vty_out(vty
, "System Id : %s\n",
2049 sysid_print(isis
->sysid
));
2051 vty_out(vty
, "Up time : ");
2052 vty_out_timestr(vty
, isis
->uptime
);
2055 if (isis
->area_list
)
2056 vty_out(vty
, "Number of areas : %d\n", isis
->area_list
->count
);
2058 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
)) {
2059 vty_out(vty
, "Area %s:\n",
2060 area
->area_tag
? area
->area_tag
: "null");
2063 uint8_t tier
= fabricd_tier(area
);
2064 if (tier
== ISIS_TIER_UNDEFINED
)
2065 vty_out(vty
, " Tier: undefined\n");
2067 vty_out(vty
, " Tier: %hhu\n", tier
);
2070 if (listcount(area
->area_addrs
) > 0) {
2071 struct area_addr
*area_addr
;
2072 for (ALL_LIST_ELEMENTS_RO(area
->area_addrs
, node2
,
2074 vty_out(vty
, " Net: %s\n",
2075 isonet_print(area_addr
->area_addr
,
2082 vty_out(vty
, " TX counters per PDU type:\n");
2083 pdu_counter_print(vty
, " ", area
->pdu_tx_counters
);
2084 vty_out(vty
, " LSP RXMT: %" PRIu64
"\n",
2085 area
->lsp_rxmt_count
);
2086 vty_out(vty
, " RX counters per PDU type:\n");
2087 pdu_counter_print(vty
, " ", area
->pdu_rx_counters
);
2089 for (level
= ISIS_LEVEL1
; level
<= ISIS_LEVELS
; level
++) {
2090 if ((area
->is_type
& level
) == 0)
2093 vty_out(vty
, " Level-%d:\n", level
);
2095 vty_out(vty
, " LSP0 regenerated: %" PRIu64
"\n",
2096 area
->lsp_gen_count
[level
- 1]);
2098 vty_out(vty
, " LSPs purged: %" PRIu64
"\n",
2099 area
->lsp_purge_count
[level
- 1]);
2101 if (area
->spf_timer
[level
- 1])
2102 vty_out(vty
, " SPF: (pending)\n");
2104 vty_out(vty
, " SPF:\n");
2106 vty_out(vty
, " minimum interval : %d",
2107 area
->min_spf_interval
[level
- 1]);
2108 if (area
->spf_delay_ietf
[level
- 1])
2110 " (not used, IETF SPF delay activated)");
2113 if (area
->ip_circuits
) {
2114 vty_out(vty
, " IPv4 route computation:\n");
2116 area
->spftree
[SPFTREE_IPV4
][level
- 1],
2120 if (area
->ipv6_circuits
) {
2121 vty_out(vty
, " IPv6 route computation:\n");
2123 area
->spftree
[SPFTREE_IPV6
][level
- 1],
2127 if (area
->ipv6_circuits
2128 && isis_area_ipv6_dstsrc_enabled(area
)) {
2130 " IPv6 dst-src route computation:\n");
2131 isis_spf_print(area
->spftree
[SPFTREE_DSTSRC
]
2139 DEFUN(show_isis_summary
, show_isis_summary_cmd
,
2140 "show " PROTO_NAME
" [vrf <NAME|all>] summary",
2141 SHOW_STR PROTO_HELP VRF_CMD_HELP_STR
2145 struct listnode
*node
;
2148 const char *vrf_name
= VRF_DEFAULT_NAME
;
2149 bool all_vrf
= false;
2151 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
)
2153 vty_out(vty
, PROTO_NAME
" is not running\n");
2158 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
))
2159 common_isis_summary(vty
, isis
);
2163 isis
= isis_lookup_by_vrfname(vrf_name
);
2165 common_isis_summary(vty
, isis
);
2173 struct isis_lsp
*lsp_for_sysid(struct lspdb_head
*head
, const char *sysid_str
,
2176 char sysid
[255] = {0};
2177 uint8_t number
[3] = {0};
2179 uint8_t lspid
[ISIS_SYS_ID_LEN
+ 2] = {0};
2180 struct isis_dynhn
*dynhn
;
2181 struct isis_lsp
*lsp
= NULL
;
2187 * extract fragment and pseudo id from the string sysid_str
2189 * (a) <systemid/hostname>.<pseudo-id>-<framenent> or
2190 * (b) <systemid/hostname>.<pseudo-id> or
2191 * (c) <systemid/hostname> or
2192 * Where systemid is in the form:
2195 strlcpy(sysid
, sysid_str
, sizeof(sysid
));
2197 if (strlen(sysid_str
) > 3) {
2198 pos
= sysid_str
+ strlen(sysid_str
) - 3;
2199 if (strncmp(pos
, "-", 1) == 0) {
2200 memcpy(number
, ++pos
, 2);
2201 lspid
[ISIS_SYS_ID_LEN
+ 1] =
2202 (uint8_t)strtol((char *)number
, NULL
, 16);
2204 if (strncmp(pos
, ".", 1) != 0)
2207 if (strncmp(pos
, ".", 1) == 0) {
2208 memcpy(number
, ++pos
, 2);
2209 lspid
[ISIS_SYS_ID_LEN
] =
2210 (uint8_t)strtol((char *)number
, NULL
, 16);
2211 sysid
[pos
- sysid_str
- 1] = '\0';
2216 * Try to find the lsp-id if the sysid_str
2218 * hostname.<pseudo-id>-<fragment>
2220 if (sysid2buff(lspid
, sysid
)) {
2221 lsp
= lsp_search(head
, lspid
);
2222 } else if ((dynhn
= dynhn_find_by_name(isis
, sysid
))) {
2223 memcpy(lspid
, dynhn
->id
, ISIS_SYS_ID_LEN
);
2224 lsp
= lsp_search(head
, lspid
);
2225 } else if (strncmp(cmd_hostname_get(), sysid
, 15) == 0) {
2226 memcpy(lspid
, isis
->sysid
, ISIS_SYS_ID_LEN
);
2227 lsp
= lsp_search(head
, lspid
);
2233 void show_isis_database_lspdb(struct vty
*vty
, struct isis_area
*area
,
2234 int level
, struct lspdb_head
*lspdb
,
2235 const char *sysid_str
, int ui_level
)
2237 struct isis_lsp
*lsp
;
2240 if (lspdb_count(lspdb
) > 0) {
2241 lsp
= lsp_for_sysid(lspdb
, sysid_str
, area
->isis
);
2243 if (lsp
!= NULL
|| sysid_str
== NULL
) {
2244 vty_out(vty
, "IS-IS Level-%d link-state database:\n",
2247 /* print the title in all cases */
2249 "LSP ID PduLen SeqNumber Chksum Holdtime ATT/P/OL\n");
2253 if (ui_level
== ISIS_UI_LEVEL_DETAIL
)
2254 lsp_print_detail(lsp
, vty
, area
->dynhostname
,
2257 lsp_print(lsp
, vty
, area
->dynhostname
,
2259 } else if (sysid_str
== NULL
) {
2261 lsp_print_all(vty
, lspdb
, ui_level
,
2262 area
->dynhostname
, area
->isis
);
2264 vty_out(vty
, " %u LSPs\n\n", lsp_count
);
2269 static void show_isis_database_common(struct vty
*vty
, const char *sysid_str
,
2270 int ui_level
, struct isis
*isis
)
2272 struct listnode
*node
;
2273 struct isis_area
*area
;
2276 if (isis
->area_list
->count
== 0)
2279 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
)) {
2280 vty_out(vty
, "Area %s:\n",
2281 area
->area_tag
? area
->area_tag
: "null");
2283 for (level
= 0; level
< ISIS_LEVELS
; level
++)
2284 show_isis_database_lspdb(vty
, area
, level
,
2285 &area
->lspdb
[level
], sysid_str
,
2290 * This function supports following display options:
2291 * [ show isis database [detail] ]
2292 * [ show isis database <sysid> [detail] ]
2293 * [ show isis database <hostname> [detail] ]
2294 * [ show isis database <sysid>.<pseudo-id> [detail] ]
2295 * [ show isis database <hostname>.<pseudo-id> [detail] ]
2296 * [ show isis database <sysid>.<pseudo-id>-<fragment-number> [detail] ]
2297 * [ show isis database <hostname>.<pseudo-id>-<fragment-number> [detail] ]
2298 * [ show isis database detail <sysid> ]
2299 * [ show isis database detail <hostname> ]
2300 * [ show isis database detail <sysid>.<pseudo-id> ]
2301 * [ show isis database detail <hostname>.<pseudo-id> ]
2302 * [ show isis database detail <sysid>.<pseudo-id>-<fragment-number> ]
2303 * [ show isis database detail <hostname>.<pseudo-id>-<fragment-number> ]
2305 static int show_isis_database(struct vty
*vty
, const char *sysid_str
,
2306 int ui_level
, const char *vrf_name
, bool all_vrf
)
2308 struct listnode
*node
;
2313 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
))
2314 show_isis_database_common(vty
, sysid_str
,
2319 isis
= isis_lookup_by_vrfname(vrf_name
);
2321 show_isis_database_common(vty
, sysid_str
, ui_level
,
2328 DEFUN(show_database
, show_database_cmd
,
2329 "show " PROTO_NAME
" [vrf <NAME|all>] database [detail] [WORD]",
2330 SHOW_STR PROTO_HELP VRF_CMD_HELP_STR
2332 "Link state database\n"
2333 "Detailed information\n"
2338 const char *vrf_name
= VRF_DEFAULT_NAME
;
2339 bool all_vrf
= false;
2340 int uilevel
= argv_find(argv
, argc
, "detail", &idx
)
2341 ? ISIS_UI_LEVEL_DETAIL
2342 : ISIS_UI_LEVEL_BRIEF
;
2343 char *id
= argv_find(argv
, argc
, "WORD", &idx
) ? argv
[idx
]->arg
: NULL
;
2344 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
2345 return show_isis_database(vty
, id
, uilevel
, vrf_name
, all_vrf
);
2350 * 'router openfabric' command
2352 DEFUN_NOSH (router_openfabric
,
2353 router_openfabric_cmd
,
2354 "router openfabric WORD",
2357 "ISO Routing area tag\n")
2360 return isis_area_get(vty
, argv
[idx_word
]->arg
);
2364 *'no router openfabric' command
2366 DEFUN (no_router_openfabric
,
2367 no_router_openfabric_cmd
,
2368 "no router openfabric WORD",
2372 "ISO Routing area tag\n")
2374 struct isis_area
*area
;
2375 const char *area_tag
;
2378 area_tag
= argv
[idx_word
]->arg
;
2379 area
= isis_area_lookup(area_tag
, VRF_DEFAULT
);
2381 zlog_warn("%s: could not find area with area-tag %s",
2382 __func__
, area_tag
);
2383 return CMD_ERR_NO_MATCH
;
2386 isis_area_destroy(area
);
2389 #endif /* ifdef FABRICD */
2397 "A Network Entity Title for this process (OSI only)\n"
2398 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
2401 return area_net_title(vty
, argv
[idx_word
]->arg
);
2411 "A Network Entity Title for this process (OSI only)\n"
2412 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
2415 return area_clear_net_title(vty
, argv
[idx_word
]->arg
);
2417 #endif /* ifdef FABRICD */
2419 DEFUN (isis_topology
,
2421 "topology " ISIS_MT_NAMES
" [overload]",
2422 "Configure IS-IS topologies\n"
2423 ISIS_MT_DESCRIPTIONS
2424 "Set overload bit for topology\n")
2426 VTY_DECLVAR_CONTEXT(isis_area
, area
);
2428 const char *arg
= argv
[1]->arg
;
2429 uint16_t mtid
= isis_str2mtid(arg
);
2431 if (area
->oldmetric
) {
2433 "Multi topology IS-IS can only be used with wide metrics\n");
2434 return CMD_WARNING_CONFIG_FAILED
;
2437 if (mtid
== (uint16_t)-1) {
2438 vty_out(vty
, "Don't know topology '%s'\n", arg
);
2439 return CMD_WARNING_CONFIG_FAILED
;
2441 if (mtid
== ISIS_MT_IPV4_UNICAST
) {
2442 vty_out(vty
, "Cannot configure IPv4 unicast topology\n");
2443 return CMD_WARNING_CONFIG_FAILED
;
2446 area_set_mt_enabled(area
, mtid
, true);
2447 area_set_mt_overload(area
, mtid
, (argc
== 3));
2451 DEFUN (no_isis_topology
,
2452 no_isis_topology_cmd
,
2453 "no topology " ISIS_MT_NAMES
" [overload]",
2455 "Configure IS-IS topologies\n"
2456 ISIS_MT_DESCRIPTIONS
2457 "Set overload bit for topology\n")
2459 VTY_DECLVAR_CONTEXT(isis_area
, area
);
2461 const char *arg
= argv
[2]->arg
;
2462 uint16_t mtid
= isis_str2mtid(arg
);
2464 if (area
->oldmetric
) {
2466 "Multi topology IS-IS can only be used with wide metrics\n");
2467 return CMD_WARNING_CONFIG_FAILED
;
2470 if (mtid
== (uint16_t)-1) {
2471 vty_out(vty
, "Don't know topology '%s'\n", arg
);
2472 return CMD_WARNING_CONFIG_FAILED
;
2474 if (mtid
== ISIS_MT_IPV4_UNICAST
) {
2475 vty_out(vty
, "Cannot configure IPv4 unicast topology\n");
2476 return CMD_WARNING_CONFIG_FAILED
;
2479 area_set_mt_enabled(area
, mtid
, false);
2480 area_set_mt_overload(area
, mtid
, false);
2483 #endif /* ifdef FABRICD */
2485 void isis_area_lsp_mtu_set(struct isis_area
*area
, unsigned int lsp_mtu
)
2487 area
->lsp_mtu
= lsp_mtu
;
2488 lsp_regenerate_schedule(area
, IS_LEVEL_1_AND_2
, 1);
2491 static int isis_area_passwd_set(struct isis_area
*area
, int level
,
2492 uint8_t passwd_type
, const char *passwd
,
2495 struct isis_passwd
*dest
;
2496 struct isis_passwd modified
;
2499 assert((level
== IS_LEVEL_1
) || (level
== IS_LEVEL_2
));
2500 dest
= (level
== IS_LEVEL_1
) ? &area
->area_passwd
2501 : &area
->domain_passwd
;
2502 memset(&modified
, 0, sizeof(modified
));
2504 if (passwd_type
!= ISIS_PASSWD_TYPE_UNUSED
) {
2508 len
= strlen(passwd
);
2513 strlcpy((char *)modified
.passwd
, passwd
,
2514 sizeof(modified
.passwd
));
2515 modified
.type
= passwd_type
;
2516 modified
.snp_auth
= snp_auth
;
2519 if (memcmp(&modified
, dest
, sizeof(modified
))) {
2520 memcpy(dest
, &modified
, sizeof(modified
));
2521 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
2527 int isis_area_passwd_unset(struct isis_area
*area
, int level
)
2529 return isis_area_passwd_set(area
, level
, ISIS_PASSWD_TYPE_UNUSED
, NULL
,
2533 int isis_area_passwd_cleartext_set(struct isis_area
*area
, int level
,
2534 const char *passwd
, uint8_t snp_auth
)
2536 return isis_area_passwd_set(area
, level
, ISIS_PASSWD_TYPE_CLEARTXT
,
2540 int isis_area_passwd_hmac_md5_set(struct isis_area
*area
, int level
,
2541 const char *passwd
, uint8_t snp_auth
)
2543 return isis_area_passwd_set(area
, level
, ISIS_PASSWD_TYPE_HMAC_MD5
,
2547 void isis_area_invalidate_routes(struct isis_area
*area
, int levels
)
2549 for (int level
= ISIS_LEVEL1
; level
<= ISIS_LEVEL2
; level
++) {
2550 if (!(level
& levels
))
2552 for (int tree
= SPFTREE_IPV4
; tree
< SPFTREE_COUNT
; tree
++) {
2553 isis_spf_invalidate_routes(
2554 area
->spftree
[tree
][level
- 1]);
2559 void isis_area_verify_routes(struct isis_area
*area
)
2561 for (int tree
= SPFTREE_IPV4
; tree
< SPFTREE_COUNT
; tree
++)
2562 isis_spf_verify_routes(area
, area
->spftree
[tree
]);
2565 static void area_resign_level(struct isis_area
*area
, int level
)
2567 isis_area_invalidate_routes(area
, level
);
2568 isis_area_verify_routes(area
);
2570 lsp_db_fini(&area
->lspdb
[level
- 1]);
2572 for (int tree
= SPFTREE_IPV4
; tree
< SPFTREE_COUNT
; tree
++) {
2573 if (area
->spftree
[tree
][level
- 1]) {
2574 isis_spftree_del(area
->spftree
[tree
][level
- 1]);
2575 area
->spftree
[tree
][level
- 1] = NULL
;
2579 if (area
->spf_timer
[level
- 1])
2580 isis_spf_timer_free(THREAD_ARG(area
->spf_timer
[level
- 1]));
2582 thread_cancel(&area
->spf_timer
[level
- 1]);
2585 "ISIS (%s): Resigned from L%d - canceling LSP regeneration timer.",
2586 area
->area_tag
, level
);
2587 thread_cancel(&area
->t_lsp_refresh
[level
- 1]);
2588 area
->lsp_regenerate_pending
[level
- 1] = 0;
2591 void isis_area_is_type_set(struct isis_area
*area
, int is_type
)
2593 struct listnode
*node
;
2594 struct isis_circuit
*circuit
;
2596 if (IS_DEBUG_EVENTS
)
2597 zlog_debug("ISIS-Evt (%s) system type change %s -> %s",
2598 area
->area_tag
, circuit_t2string(area
->is_type
),
2599 circuit_t2string(is_type
));
2601 if (area
->is_type
== is_type
)
2602 return; /* No change */
2604 switch (area
->is_type
) {
2606 if (is_type
== IS_LEVEL_2
)
2607 area_resign_level(area
, IS_LEVEL_1
);
2609 lsp_db_init(&area
->lspdb
[1]);
2612 case IS_LEVEL_1_AND_2
:
2613 if (is_type
== IS_LEVEL_1
)
2614 area_resign_level(area
, IS_LEVEL_2
);
2616 area_resign_level(area
, IS_LEVEL_1
);
2620 if (is_type
== IS_LEVEL_1
)
2621 area_resign_level(area
, IS_LEVEL_2
);
2623 lsp_db_init(&area
->lspdb
[0]);
2630 area
->is_type
= is_type
;
2632 /* override circuit's is_type */
2633 if (area
->is_type
!= IS_LEVEL_1_AND_2
) {
2634 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
, node
, circuit
))
2635 isis_circuit_is_type_set(circuit
, is_type
);
2638 spftree_area_init(area
);
2640 if (listcount(area
->area_addrs
) > 0) {
2641 if (is_type
& IS_LEVEL_1
)
2642 lsp_generate(area
, IS_LEVEL_1
);
2643 if (is_type
& IS_LEVEL_2
)
2644 lsp_generate(area
, IS_LEVEL_2
);
2646 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
2651 void isis_area_metricstyle_set(struct isis_area
*area
, bool old_metric
,
2654 area
->oldmetric
= old_metric
;
2655 area
->newmetric
= new_metric
;
2656 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
2659 void isis_area_overload_bit_set(struct isis_area
*area
, bool overload_bit
)
2661 char new_overload_bit
= overload_bit
? LSPBIT_OL
: 0;
2663 if (new_overload_bit
!= area
->overload_bit
) {
2664 area
->overload_bit
= new_overload_bit
;
2666 if (new_overload_bit
)
2667 area
->overload_counter
++;
2670 hook_call(isis_hook_db_overload
, area
);
2671 #endif /* ifndef FABRICD */
2673 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
2676 isis_notif_db_overload(area
, overload_bit
);
2677 #endif /* ifndef FABRICD */
2680 void isis_area_attached_bit_send_set(struct isis_area
*area
, bool attached_bit
)
2683 if (attached_bit
!= area
->attached_bit_send
) {
2684 area
->attached_bit_send
= attached_bit
;
2685 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
2689 void isis_area_attached_bit_receive_set(struct isis_area
*area
,
2693 if (attached_bit
!= area
->attached_bit_rcv_ignore
) {
2694 area
->attached_bit_rcv_ignore
= attached_bit
;
2695 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
2699 void isis_area_dynhostname_set(struct isis_area
*area
, bool dynhostname
)
2701 if (area
->dynhostname
!= dynhostname
) {
2702 area
->dynhostname
= dynhostname
;
2703 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 0);
2707 void isis_area_max_lsp_lifetime_set(struct isis_area
*area
, int level
,
2708 uint16_t max_lsp_lifetime
)
2710 assert((level
== IS_LEVEL_1
) || (level
== IS_LEVEL_2
));
2712 if (area
->max_lsp_lifetime
[level
- 1] == max_lsp_lifetime
)
2715 area
->max_lsp_lifetime
[level
- 1] = max_lsp_lifetime
;
2716 lsp_regenerate_schedule(area
, level
, 1);
2719 void isis_area_lsp_refresh_set(struct isis_area
*area
, int level
,
2720 uint16_t lsp_refresh
)
2722 assert((level
== IS_LEVEL_1
) || (level
== IS_LEVEL_2
));
2724 if (area
->lsp_refresh
[level
- 1] == lsp_refresh
)
2727 area
->lsp_refresh
[level
- 1] = lsp_refresh
;
2728 lsp_regenerate_schedule(area
, level
, 1);
2732 DEFUN (log_adj_changes
,
2733 log_adj_changes_cmd
,
2734 "log-adjacency-changes",
2735 "Log changes in adjacency state\n")
2737 VTY_DECLVAR_CONTEXT(isis_area
, area
);
2739 area
->log_adj_changes
= 1;
2744 DEFUN (no_log_adj_changes
,
2745 no_log_adj_changes_cmd
,
2746 "no log-adjacency-changes",
2748 "Stop logging changes in adjacency state\n")
2750 VTY_DECLVAR_CONTEXT(isis_area
, area
);
2752 area
->log_adj_changes
= 0;
2756 #endif /* ifdef FABRICD */
2758 /* IS-IS configuration write function */
2759 static int isis_config_write(struct vty
*vty
)
2762 struct isis_area
*area
;
2763 struct listnode
*node
, *node2
, *inode
;
2767 vty_out(vty
, "IS-IS Routing Process not enabled\n");
2771 for (ALL_LIST_ELEMENTS_RO(im
->isis
, inode
, isis
)) {
2772 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
)) {
2773 /* ISIS - Area name */
2774 vty_out(vty
, "router " PROTO_NAME
" %s\n", area
->area_tag
);
2777 if (listcount(area
->area_addrs
) > 0) {
2778 struct area_addr
*area_addr
;
2779 for (ALL_LIST_ELEMENTS_RO(area
->area_addrs
,
2780 node2
, area_addr
)) {
2781 vty_out(vty
, " net %s\n",
2783 area_addr
->area_addr
,
2790 /* ISIS - Dynamic hostname - Defaults to true so only
2793 if (!area
->dynhostname
) {
2794 vty_out(vty
, " no hostname dynamic\n");
2797 /* ISIS - Metric-Style - when true displays wide */
2799 if (area
->newmetric
) {
2800 if (!area
->oldmetric
)
2801 vty_out(vty
, " metric-style wide\n");
2804 " metric-style transition\n");
2807 vty_out(vty
, " metric-style narrow\n");
2811 /* ISIS - overload-bit */
2812 if (area
->overload_bit
) {
2813 vty_out(vty
, " set-overload-bit\n");
2816 /* ISIS - Area is-type (level-1-2 is default) */
2818 if (area
->is_type
== IS_LEVEL_1
) {
2819 vty_out(vty
, " is-type level-1\n");
2821 } else if (area
->is_type
== IS_LEVEL_2
) {
2822 vty_out(vty
, " is-type level-2-only\n");
2826 write
+= isis_redist_config_write(vty
, area
, AF_INET
);
2827 write
+= isis_redist_config_write(vty
, area
, AF_INET6
);
2828 /* ISIS - Lsp generation interval */
2829 if (area
->lsp_gen_interval
[0]
2830 == area
->lsp_gen_interval
[1]) {
2831 if (area
->lsp_gen_interval
[0]
2832 != DEFAULT_MIN_LSP_GEN_INTERVAL
) {
2833 vty_out(vty
, " lsp-gen-interval %d\n",
2834 area
->lsp_gen_interval
[0]);
2838 if (area
->lsp_gen_interval
[0]
2839 != DEFAULT_MIN_LSP_GEN_INTERVAL
) {
2841 " lsp-gen-interval level-1 %d\n",
2842 area
->lsp_gen_interval
[0]);
2845 if (area
->lsp_gen_interval
[1]
2846 != DEFAULT_MIN_LSP_GEN_INTERVAL
) {
2848 " lsp-gen-interval level-2 %d\n",
2849 area
->lsp_gen_interval
[1]);
2853 /* ISIS - LSP lifetime */
2854 if (area
->max_lsp_lifetime
[0]
2855 == area
->max_lsp_lifetime
[1]) {
2856 if (area
->max_lsp_lifetime
[0]
2857 != DEFAULT_LSP_LIFETIME
) {
2858 vty_out(vty
, " max-lsp-lifetime %u\n",
2859 area
->max_lsp_lifetime
[0]);
2863 if (area
->max_lsp_lifetime
[0]
2864 != DEFAULT_LSP_LIFETIME
) {
2866 " max-lsp-lifetime level-1 %u\n",
2867 area
->max_lsp_lifetime
[0]);
2870 if (area
->max_lsp_lifetime
[1]
2871 != DEFAULT_LSP_LIFETIME
) {
2873 " max-lsp-lifetime level-2 %u\n",
2874 area
->max_lsp_lifetime
[1]);
2878 /* ISIS - LSP refresh interval */
2879 if (area
->lsp_refresh
[0] == area
->lsp_refresh
[1]) {
2880 if (area
->lsp_refresh
[0]
2881 != DEFAULT_MAX_LSP_GEN_INTERVAL
) {
2883 " lsp-refresh-interval %u\n",
2884 area
->lsp_refresh
[0]);
2888 if (area
->lsp_refresh
[0]
2889 != DEFAULT_MAX_LSP_GEN_INTERVAL
) {
2891 " lsp-refresh-interval level-1 %u\n",
2892 area
->lsp_refresh
[0]);
2895 if (area
->lsp_refresh
[1]
2896 != DEFAULT_MAX_LSP_GEN_INTERVAL
) {
2898 " lsp-refresh-interval level-2 %u\n",
2899 area
->lsp_refresh
[1]);
2903 if (area
->lsp_mtu
!= DEFAULT_LSP_MTU
) {
2904 vty_out(vty
, " lsp-mtu %u\n", area
->lsp_mtu
);
2907 if (area
->purge_originator
) {
2908 vty_out(vty
, " purge-originator\n");
2912 /* Minimum SPF interval. */
2913 if (area
->min_spf_interval
[0]
2914 == area
->min_spf_interval
[1]) {
2915 if (area
->min_spf_interval
[0]
2916 != MINIMUM_SPF_INTERVAL
) {
2917 vty_out(vty
, " spf-interval %d\n",
2918 area
->min_spf_interval
[0]);
2922 if (area
->min_spf_interval
[0]
2923 != MINIMUM_SPF_INTERVAL
) {
2925 " spf-interval level-1 %d\n",
2926 area
->min_spf_interval
[0]);
2929 if (area
->min_spf_interval
[1]
2930 != MINIMUM_SPF_INTERVAL
) {
2932 " spf-interval level-2 %d\n",
2933 area
->min_spf_interval
[1]);
2938 /* IETF SPF interval */
2939 if (area
->spf_delay_ietf
[0]) {
2941 " spf-delay-ietf init-delay %ld short-delay %ld long-delay %ld holddown %ld time-to-learn %ld\n",
2942 spf_backoff_init_delay(
2943 area
->spf_delay_ietf
[0]),
2944 spf_backoff_short_delay(
2945 area
->spf_delay_ietf
[0]),
2946 spf_backoff_long_delay(
2947 area
->spf_delay_ietf
[0]),
2948 spf_backoff_holddown(
2949 area
->spf_delay_ietf
[0]),
2950 spf_backoff_timetolearn(
2951 area
->spf_delay_ietf
[0]));
2955 /* Authentication passwords. */
2956 if (area
->area_passwd
.type
2957 == ISIS_PASSWD_TYPE_HMAC_MD5
) {
2958 vty_out(vty
, " area-password md5 %s",
2959 area
->area_passwd
.passwd
);
2960 if (CHECK_FLAG(area
->area_passwd
.snp_auth
,
2962 vty_out(vty
, " authenticate snp ");
2964 area
->area_passwd
.snp_auth
,
2966 vty_out(vty
, "validate");
2968 vty_out(vty
, "send-only");
2972 } else if (area
->area_passwd
.type
2973 == ISIS_PASSWD_TYPE_CLEARTXT
) {
2974 vty_out(vty
, " area-password clear %s",
2975 area
->area_passwd
.passwd
);
2976 if (CHECK_FLAG(area
->area_passwd
.snp_auth
,
2978 vty_out(vty
, " authenticate snp ");
2980 area
->area_passwd
.snp_auth
,
2982 vty_out(vty
, "validate");
2984 vty_out(vty
, "send-only");
2989 if (area
->domain_passwd
.type
2990 == ISIS_PASSWD_TYPE_HMAC_MD5
) {
2991 vty_out(vty
, " domain-password md5 %s",
2992 area
->domain_passwd
.passwd
);
2993 if (CHECK_FLAG(area
->domain_passwd
.snp_auth
,
2995 vty_out(vty
, " authenticate snp ");
2996 if (CHECK_FLAG(area
->domain_passwd
2999 vty_out(vty
, "validate");
3001 vty_out(vty
, "send-only");
3005 } else if (area
->domain_passwd
.type
3006 == ISIS_PASSWD_TYPE_CLEARTXT
) {
3007 vty_out(vty
, " domain-password clear %s",
3008 area
->domain_passwd
.passwd
);
3009 if (CHECK_FLAG(area
->domain_passwd
.snp_auth
,
3011 vty_out(vty
, " authenticate snp ");
3012 if (CHECK_FLAG(area
->domain_passwd
3015 vty_out(vty
, "validate");
3017 vty_out(vty
, "send-only");
3023 if (area
->log_adj_changes
) {
3024 vty_out(vty
, " log-adjacency-changes\n");
3028 write
+= area_write_mt_settings(area
, vty
);
3029 write
+= fabricd_write_settings(area
, vty
);
3036 struct cmd_node router_node
= {
3037 .name
= "openfabric",
3038 .node
= OPENFABRIC_NODE
,
3039 .parent_node
= CONFIG_NODE
,
3040 .prompt
= "%s(config-router)# ",
3041 .config_write
= isis_config_write
,
3044 /* IS-IS configuration write function */
3045 static int isis_config_write(struct vty
*vty
)
3048 struct lyd_node
*dnode
;
3050 dnode
= yang_dnode_get(running_config
->dnode
, "/frr-isisd:isis");
3052 nb_cli_show_dnode_cmds(vty
, dnode
, false);
3059 struct cmd_node router_node
= {
3062 .parent_node
= CONFIG_NODE
,
3063 .prompt
= "%s(config-router)# ",
3064 .config_write
= isis_config_write
,
3066 #endif /* ifdef FABRICD */
3068 void isis_init(void)
3070 /* Install IS-IS top node */
3071 install_node(&router_node
);
3073 install_element(VIEW_NODE
, &show_isis_summary_cmd
);
3075 install_element(VIEW_NODE
, &show_isis_spf_ietf_cmd
);
3077 install_element(VIEW_NODE
, &show_isis_interface_cmd
);
3078 install_element(VIEW_NODE
, &show_isis_interface_detail_cmd
);
3079 install_element(VIEW_NODE
, &show_isis_interface_arg_cmd
);
3081 install_element(VIEW_NODE
, &show_isis_neighbor_cmd
);
3082 install_element(VIEW_NODE
, &show_isis_neighbor_detail_cmd
);
3083 install_element(VIEW_NODE
, &show_isis_neighbor_arg_cmd
);
3084 install_element(ENABLE_NODE
, &clear_isis_neighbor_cmd
);
3085 install_element(ENABLE_NODE
, &clear_isis_neighbor_arg_cmd
);
3087 install_element(VIEW_NODE
, &show_hostname_cmd
);
3088 install_element(VIEW_NODE
, &show_database_cmd
);
3090 install_element(ENABLE_NODE
, &show_debugging_isis_cmd
);
3092 install_node(&debug_node
);
3094 install_element(ENABLE_NODE
, &debug_isis_adj_cmd
);
3095 install_element(ENABLE_NODE
, &no_debug_isis_adj_cmd
);
3096 install_element(ENABLE_NODE
, &debug_isis_tx_queue_cmd
);
3097 install_element(ENABLE_NODE
, &no_debug_isis_tx_queue_cmd
);
3098 install_element(ENABLE_NODE
, &debug_isis_flooding_cmd
);
3099 install_element(ENABLE_NODE
, &no_debug_isis_flooding_cmd
);
3100 install_element(ENABLE_NODE
, &debug_isis_snp_cmd
);
3101 install_element(ENABLE_NODE
, &no_debug_isis_snp_cmd
);
3102 install_element(ENABLE_NODE
, &debug_isis_upd_cmd
);
3103 install_element(ENABLE_NODE
, &no_debug_isis_upd_cmd
);
3104 install_element(ENABLE_NODE
, &debug_isis_spfevents_cmd
);
3105 install_element(ENABLE_NODE
, &no_debug_isis_spfevents_cmd
);
3106 install_element(ENABLE_NODE
, &debug_isis_srevents_cmd
);
3107 install_element(ENABLE_NODE
, &no_debug_isis_srevents_cmd
);
3108 install_element(ENABLE_NODE
, &debug_isis_lfa_cmd
);
3109 install_element(ENABLE_NODE
, &no_debug_isis_lfa_cmd
);
3110 install_element(ENABLE_NODE
, &debug_isis_rtevents_cmd
);
3111 install_element(ENABLE_NODE
, &no_debug_isis_rtevents_cmd
);
3112 install_element(ENABLE_NODE
, &debug_isis_events_cmd
);
3113 install_element(ENABLE_NODE
, &no_debug_isis_events_cmd
);
3114 install_element(ENABLE_NODE
, &debug_isis_packet_dump_cmd
);
3115 install_element(ENABLE_NODE
, &no_debug_isis_packet_dump_cmd
);
3116 install_element(ENABLE_NODE
, &debug_isis_lsp_gen_cmd
);
3117 install_element(ENABLE_NODE
, &no_debug_isis_lsp_gen_cmd
);
3118 install_element(ENABLE_NODE
, &debug_isis_lsp_sched_cmd
);
3119 install_element(ENABLE_NODE
, &no_debug_isis_lsp_sched_cmd
);
3120 install_element(ENABLE_NODE
, &debug_isis_bfd_cmd
);
3121 install_element(ENABLE_NODE
, &no_debug_isis_bfd_cmd
);
3122 install_element(ENABLE_NODE
, &debug_isis_ldp_sync_cmd
);
3123 install_element(ENABLE_NODE
, &no_debug_isis_ldp_sync_cmd
);
3125 install_element(CONFIG_NODE
, &debug_isis_adj_cmd
);
3126 install_element(CONFIG_NODE
, &no_debug_isis_adj_cmd
);
3127 install_element(CONFIG_NODE
, &debug_isis_tx_queue_cmd
);
3128 install_element(CONFIG_NODE
, &no_debug_isis_tx_queue_cmd
);
3129 install_element(CONFIG_NODE
, &debug_isis_flooding_cmd
);
3130 install_element(CONFIG_NODE
, &no_debug_isis_flooding_cmd
);
3131 install_element(CONFIG_NODE
, &debug_isis_snp_cmd
);
3132 install_element(CONFIG_NODE
, &no_debug_isis_snp_cmd
);
3133 install_element(CONFIG_NODE
, &debug_isis_upd_cmd
);
3134 install_element(CONFIG_NODE
, &no_debug_isis_upd_cmd
);
3135 install_element(CONFIG_NODE
, &debug_isis_spfevents_cmd
);
3136 install_element(CONFIG_NODE
, &no_debug_isis_spfevents_cmd
);
3137 install_element(CONFIG_NODE
, &debug_isis_srevents_cmd
);
3138 install_element(CONFIG_NODE
, &no_debug_isis_srevents_cmd
);
3139 install_element(CONFIG_NODE
, &debug_isis_lfa_cmd
);
3140 install_element(CONFIG_NODE
, &no_debug_isis_lfa_cmd
);
3141 install_element(CONFIG_NODE
, &debug_isis_rtevents_cmd
);
3142 install_element(CONFIG_NODE
, &no_debug_isis_rtevents_cmd
);
3143 install_element(CONFIG_NODE
, &debug_isis_events_cmd
);
3144 install_element(CONFIG_NODE
, &no_debug_isis_events_cmd
);
3145 install_element(CONFIG_NODE
, &debug_isis_packet_dump_cmd
);
3146 install_element(CONFIG_NODE
, &no_debug_isis_packet_dump_cmd
);
3147 install_element(CONFIG_NODE
, &debug_isis_lsp_gen_cmd
);
3148 install_element(CONFIG_NODE
, &no_debug_isis_lsp_gen_cmd
);
3149 install_element(CONFIG_NODE
, &debug_isis_lsp_sched_cmd
);
3150 install_element(CONFIG_NODE
, &no_debug_isis_lsp_sched_cmd
);
3151 install_element(CONFIG_NODE
, &debug_isis_bfd_cmd
);
3152 install_element(CONFIG_NODE
, &no_debug_isis_bfd_cmd
);
3153 install_element(CONFIG_NODE
, &debug_isis_ldp_sync_cmd
);
3154 install_element(CONFIG_NODE
, &no_debug_isis_ldp_sync_cmd
);
3156 install_default(ROUTER_NODE
);
3159 install_element(CONFIG_NODE
, &router_openfabric_cmd
);
3160 install_element(CONFIG_NODE
, &no_router_openfabric_cmd
);
3162 install_element(ROUTER_NODE
, &net_cmd
);
3163 install_element(ROUTER_NODE
, &no_net_cmd
);
3165 install_element(ROUTER_NODE
, &isis_topology_cmd
);
3166 install_element(ROUTER_NODE
, &no_isis_topology_cmd
);
3168 install_element(ROUTER_NODE
, &log_adj_changes_cmd
);
3169 install_element(ROUTER_NODE
, &no_log_adj_changes_cmd
);
3170 #endif /* ifdef FABRICD */
3172 spf_backoff_cmd_init();