1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * IS-IS Rout(e)ing protocol - isisd.c
5 * Copyright (C) 2001,2002 Sampo Saaristo
6 * Tampere University of Technology
7 * Institute of Communications Engineering
29 #include "spf_backoff.h"
30 #include "lib/northbound_cli.h"
33 #include "isisd/isis_constants.h"
34 #include "isisd/isis_common.h"
35 #include "isisd/isis_flags.h"
36 #include "isisd/isis_circuit.h"
37 #include "isisd/isis_csm.h"
38 #include "isisd/isisd.h"
39 #include "isisd/isis_dynhn.h"
40 #include "isisd/isis_adjacency.h"
41 #include "isisd/isis_pdu.h"
42 #include "isisd/isis_misc.h"
43 #include "isisd/isis_constants.h"
44 #include "isisd/isis_lsp.h"
45 #include "isisd/isis_spf.h"
46 #include "isisd/isis_route.h"
47 #include "isisd/isis_zebra.h"
48 #include "isisd/isis_events.h"
49 #include "isisd/isis_te.h"
50 #include "isisd/isis_mt.h"
51 #include "isisd/isis_sr.h"
52 #include "isisd/fabricd.h"
53 #include "isisd/isis_nb.h"
55 /* For debug statement. */
56 unsigned long debug_adj_pkt
;
57 unsigned long debug_snp_pkt
;
58 unsigned long debug_update_pkt
;
59 unsigned long debug_spf_events
;
60 unsigned long debug_rte_events
;
61 unsigned long debug_events
;
62 unsigned long debug_pkt_dump
;
63 unsigned long debug_lsp_gen
;
64 unsigned long debug_lsp_sched
;
65 unsigned long debug_flooding
;
66 unsigned long debug_bfd
;
67 unsigned long debug_tx_queue
;
68 unsigned long debug_sr
;
69 unsigned long debug_ldp_sync
;
70 unsigned long debug_lfa
;
71 unsigned long debug_te
;
73 DEFINE_MGROUP(ISISD
, "isisd");
75 DEFINE_MTYPE_STATIC(ISISD
, ISIS
, "ISIS process");
76 DEFINE_MTYPE_STATIC(ISISD
, ISIS_NAME
, "ISIS process name");
77 DEFINE_MTYPE_STATIC(ISISD
, ISIS_AREA
, "ISIS area");
78 DEFINE_MTYPE(ISISD
, ISIS_AREA_ADDR
, "ISIS area address");
79 DEFINE_MTYPE(ISISD
, ISIS_ACL_NAME
, "ISIS access-list name");
80 DEFINE_MTYPE(ISISD
, ISIS_PLIST_NAME
, "ISIS prefix-list name");
82 DEFINE_QOBJ_TYPE(isis_area
);
84 /* ISIS process wide configuration. */
85 static struct isis_master isis_master
;
87 /* ISIS process wide configuration pointer to export. */
88 struct isis_master
*im
;
90 /* ISIS config processing thread */
91 struct event
*t_isis_cfg
;
94 DEFINE_HOOK(isis_hook_db_overload
, (const struct isis_area
*area
), (area
));
95 #endif /* ifndef FABRICD */
100 int isis_area_get(struct vty
*, const char *);
101 int area_net_title(struct vty
*, const char *);
102 int area_clear_net_title(struct vty
*, const char *);
103 int show_isis_interface_common(struct vty
*, struct json_object
*json
,
104 const char *ifname
, char, const char *vrf_name
,
106 int show_isis_interface_common_vty(struct vty
*, const char *ifname
, char,
107 const char *vrf_name
, bool all_vrf
);
108 int show_isis_interface_common_json(struct json_object
*json
,
109 const char *ifname
, char,
110 const char *vrf_name
, bool all_vrf
);
111 int show_isis_neighbor_common(struct vty
*, struct json_object
*json
,
112 const char *id
, char, const char *vrf_name
,
114 int clear_isis_neighbor_common(struct vty
*, const char *id
,
115 const char *vrf_name
, bool all_vrf
);
117 /* Link ISIS instance to VRF. */
118 void isis_vrf_link(struct isis
*isis
, struct vrf
*vrf
)
120 isis
->vrf_id
= vrf
->vrf_id
;
121 if (vrf
->info
!= (void *)isis
)
122 vrf
->info
= (void *)isis
;
125 /* Unlink ISIS instance to VRF. */
126 void isis_vrf_unlink(struct isis
*isis
, struct vrf
*vrf
)
128 if (vrf
->info
== (void *)isis
)
130 isis
->vrf_id
= VRF_UNKNOWN
;
133 struct isis
*isis_lookup_by_vrfid(vrf_id_t vrf_id
)
136 struct listnode
*node
;
138 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
))
139 if (isis
->vrf_id
== vrf_id
)
145 struct isis
*isis_lookup_by_vrfname(const char *vrfname
)
148 struct listnode
*node
;
150 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
))
151 if (isis
->name
&& vrfname
&& strcmp(isis
->name
, vrfname
) == 0)
157 struct isis
*isis_lookup_by_sysid(const uint8_t *sysid
)
160 struct listnode
*node
;
162 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
))
163 if (!memcmp(isis
->sysid
, sysid
, ISIS_SYS_ID_LEN
))
169 void isis_master_init(struct event_loop
*master
)
171 memset(&isis_master
, 0, sizeof(isis_master
));
173 im
->isis
= list_new();
177 struct isis
*isis_new(const char *vrf_name
)
182 isis
= XCALLOC(MTYPE_ISIS
, sizeof(struct isis
));
184 isis
->name
= XSTRDUP(MTYPE_ISIS_NAME
, vrf_name
);
186 vrf
= vrf_lookup_by_name(vrf_name
);
189 isis_vrf_link(isis
, vrf
);
191 isis
->vrf_id
= VRF_UNKNOWN
;
193 isis_zebra_vrf_register(isis
);
197 "%s: Create new isis instance with vrf_name %s vrf_id %u",
198 __func__
, isis
->name
, isis
->vrf_id
);
203 isis
->max_area_addrs
= ISIS_DEFAULT_MAX_AREA_ADDRESSES
;
204 isis
->process_id
= getpid();
206 isis
->area_list
= list_new();
207 isis
->uptime
= time(NULL
);
208 isis
->snmp_notifications
= 1;
209 dyn_cache_init(isis
);
211 listnode_add(im
->isis
, isis
);
216 void isis_finish(struct isis
*isis
)
218 struct isis_area
*area
;
219 struct listnode
*node
, *nnode
;
221 for (ALL_LIST_ELEMENTS(isis
->area_list
, node
, nnode
, area
))
222 isis_area_destroy(area
);
224 struct vrf
*vrf
= NULL
;
226 listnode_delete(im
->isis
, isis
);
228 isis_zebra_vrf_deregister(isis
);
230 vrf
= vrf_lookup_by_name(isis
->name
);
232 isis_vrf_unlink(isis
, vrf
);
233 XFREE(MTYPE_ISIS_NAME
, isis
->name
);
235 isis_redist_free(isis
);
236 list_delete(&isis
->area_list
);
237 dyn_cache_finish(isis
);
238 XFREE(MTYPE_ISIS
, isis
);
241 void isis_area_add_circuit(struct isis_area
*area
, struct isis_circuit
*circuit
)
243 isis_csm_state_change(ISIS_ENABLE
, circuit
, area
);
245 area
->ip_circuits
+= circuit
->ip_router
;
246 area
->ipv6_circuits
+= circuit
->ipv6_router
;
248 area
->lfa_protected_links
[0] += circuit
->lfa_protection
[0];
249 area
->rlfa_protected_links
[0] += circuit
->rlfa_protection
[0];
250 area
->tilfa_protected_links
[0] += circuit
->tilfa_protection
[0];
252 area
->lfa_protected_links
[1] += circuit
->lfa_protection
[1];
253 area
->rlfa_protected_links
[1] += circuit
->rlfa_protection
[1];
254 area
->tilfa_protected_links
[1] += circuit
->tilfa_protection
[1];
257 void isis_area_del_circuit(struct isis_area
*area
, struct isis_circuit
*circuit
)
259 area
->ip_circuits
-= circuit
->ip_router
;
260 area
->ipv6_circuits
-= circuit
->ipv6_router
;
262 area
->lfa_protected_links
[0] -= circuit
->lfa_protection
[0];
263 area
->rlfa_protected_links
[0] -= circuit
->rlfa_protection
[0];
264 area
->tilfa_protected_links
[0] -= circuit
->tilfa_protection
[0];
266 area
->lfa_protected_links
[1] -= circuit
->lfa_protection
[1];
267 area
->rlfa_protected_links
[1] -= circuit
->rlfa_protection
[1];
268 area
->tilfa_protected_links
[1] -= circuit
->tilfa_protection
[1];
270 isis_csm_state_change(ISIS_DISABLE
, circuit
, area
);
273 static void delete_area_addr(void *arg
)
275 struct iso_address
*addr
= (struct iso_address
*)arg
;
277 XFREE(MTYPE_ISIS_AREA_ADDR
, addr
);
280 struct isis_area
*isis_area_create(const char *area_tag
, const char *vrf_name
)
282 struct isis_area
*area
;
283 struct isis
*isis
= NULL
;
284 struct vrf
*vrf
= NULL
;
285 struct interface
*ifp
;
286 struct isis_circuit
*circuit
;
288 area
= XCALLOC(MTYPE_ISIS_AREA
, sizeof(struct isis_area
));
291 vrf_name
= VRF_DEFAULT_NAME
;
293 vrf
= vrf_lookup_by_name(vrf_name
);
294 isis
= isis_lookup_by_vrfname(vrf_name
);
297 isis
= isis_new(vrf_name
);
299 listnode_add(isis
->area_list
, area
);
303 * Fabricd runs only as level-2.
304 * For IS-IS, the default is level-1-2
307 area
->is_type
= IS_LEVEL_2
;
309 area
->is_type
= yang_get_default_enum(
310 "/frr-isisd:isis/instance/is-type");
313 * intialize the databases
315 if (area
->is_type
& IS_LEVEL_1
)
316 lsp_db_init(&area
->lspdb
[0]);
317 if (area
->is_type
& IS_LEVEL_2
)
318 lsp_db_init(&area
->lspdb
[1]);
320 spftree_area_init(area
);
322 area
->circuit_list
= list_new();
323 area
->adjacency_list
= list_new();
324 area
->area_addrs
= list_new();
325 area
->area_addrs
->del
= delete_area_addr
;
327 if (!CHECK_FLAG(im
->options
, F_ISIS_UNIT_TEST
))
328 event_add_timer(master
, lsp_tick
, area
, 1, &area
->t_tick
);
329 flags_initialize(&area
->flags
);
331 isis_sr_area_init(area
);
337 enum isis_metric_style default_style
;
339 area
->max_lsp_lifetime
[0] = yang_get_default_uint16(
340 "/frr-isisd:isis/instance/lsp/timers/level-1/maximum-lifetime");
341 area
->max_lsp_lifetime
[1] = yang_get_default_uint16(
342 "/frr-isisd:isis/instance/lsp/timers/level-2/maximum-lifetime");
343 area
->lsp_refresh
[0] = yang_get_default_uint16(
344 "/frr-isisd:isis/instance/lsp/timers/level-1/refresh-interval");
345 area
->lsp_refresh
[1] = yang_get_default_uint16(
346 "/frr-isisd:isis/instance/lsp/timers/level-2/refresh-interval");
347 area
->lsp_gen_interval
[0] = yang_get_default_uint16(
348 "/frr-isisd:isis/instance/lsp/timers/level-1/generation-interval");
349 area
->lsp_gen_interval
[1] = yang_get_default_uint16(
350 "/frr-isisd:isis/instance/lsp/timers/level-2/generation-interval");
351 area
->min_spf_interval
[0] = yang_get_default_uint16(
352 "/frr-isisd:isis/instance/spf/minimum-interval/level-1");
353 area
->min_spf_interval
[1] = yang_get_default_uint16(
354 "/frr-isisd:isis/instance/spf/minimum-interval/level-1");
355 area
->dynhostname
= yang_get_default_bool(
356 "/frr-isisd:isis/instance/dynamic-hostname");
358 yang_get_default_enum("/frr-isisd:isis/instance/metric-style");
359 area
->oldmetric
= default_style
== ISIS_WIDE_METRIC
? 0 : 1;
360 area
->newmetric
= default_style
== ISIS_NARROW_METRIC
? 0 : 1;
361 area
->lsp_frag_threshold
= 90; /* not currently configurable */
363 yang_get_default_uint16("/frr-isisd:isis/instance/lsp/mtu");
364 area
->lfa_load_sharing
[0] = yang_get_default_bool(
365 "/frr-isisd:isis/instance/fast-reroute/level-1/lfa/load-sharing");
366 area
->lfa_load_sharing
[1] = yang_get_default_bool(
367 "/frr-isisd:isis/instance/fast-reroute/level-2/lfa/load-sharing");
368 area
->attached_bit_send
=
369 yang_get_default_bool("/frr-isisd:isis/instance/attach-send");
370 area
->attached_bit_rcv_ignore
= yang_get_default_bool(
371 "/frr-isisd:isis/instance/attach-receive-ignore");
374 area
->max_lsp_lifetime
[0] = DEFAULT_LSP_LIFETIME
; /* 1200 */
375 area
->max_lsp_lifetime
[1] = DEFAULT_LSP_LIFETIME
; /* 1200 */
376 area
->lsp_refresh
[0] = DEFAULT_MAX_LSP_GEN_INTERVAL
; /* 900 */
377 area
->lsp_refresh
[1] = DEFAULT_MAX_LSP_GEN_INTERVAL
; /* 900 */
378 area
->lsp_gen_interval
[0] = DEFAULT_MIN_LSP_GEN_INTERVAL
;
379 area
->lsp_gen_interval
[1] = DEFAULT_MIN_LSP_GEN_INTERVAL
;
380 area
->min_spf_interval
[0] = MINIMUM_SPF_INTERVAL
;
381 area
->min_spf_interval
[1] = MINIMUM_SPF_INTERVAL
;
382 area
->dynhostname
= 1;
385 area
->lsp_frag_threshold
= 90;
386 area
->lsp_mtu
= DEFAULT_LSP_MTU
;
387 area
->lfa_load_sharing
[0] = true;
388 area
->lfa_load_sharing
[1] = true;
389 area
->attached_bit_send
= true;
390 area
->attached_bit_rcv_ignore
= false;
391 #endif /* ifndef FABRICD */
392 area
->lfa_priority_limit
[0] = SPF_PREFIX_PRIO_LOW
;
393 area
->lfa_priority_limit
[1] = SPF_PREFIX_PRIO_LOW
;
394 isis_lfa_tiebreakers_init(area
, ISIS_LEVEL1
);
395 isis_lfa_tiebreakers_init(area
, ISIS_LEVEL2
);
399 area
->area_tag
= strdup(area_tag
);
402 area
->fabricd
= fabricd_new(area
);
404 area
->lsp_refresh_arg
[0].area
= area
;
405 area
->lsp_refresh_arg
[0].level
= IS_LEVEL_1
;
406 area
->lsp_refresh_arg
[1].area
= area
;
407 area
->lsp_refresh_arg
[1].level
= IS_LEVEL_2
;
409 area
->bfd_signalled_down
= false;
410 area
->bfd_force_spf_refresh
= false;
412 QOBJ_REG(area
, isis_area
);
415 FOR_ALL_INTERFACES (vrf
, ifp
) {
416 if (ifp
->ifindex
== IFINDEX_INTERNAL
)
420 if (circuit
&& strmatch(circuit
->tag
, area
->area_tag
))
421 isis_area_add_circuit(area
, circuit
);
428 struct isis_area
*isis_area_lookup_by_vrf(const char *area_tag
,
429 const char *vrf_name
)
431 struct isis_area
*area
;
432 struct listnode
*node
;
433 struct isis
*isis
= NULL
;
435 isis
= isis_lookup_by_vrfname(vrf_name
);
439 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
))
440 if (strcmp(area
->area_tag
, area_tag
) == 0)
446 struct isis_area
*isis_area_lookup(const char *area_tag
, vrf_id_t vrf_id
)
448 struct isis_area
*area
;
449 struct listnode
*node
;
452 isis
= isis_lookup_by_vrfid(vrf_id
);
456 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
))
457 if ((area
->area_tag
== NULL
&& area_tag
== NULL
)
458 || (area
->area_tag
&& area_tag
459 && strcmp(area
->area_tag
, area_tag
) == 0))
465 int isis_area_get(struct vty
*vty
, const char *area_tag
)
467 struct isis_area
*area
;
469 area
= isis_area_lookup(area_tag
, VRF_DEFAULT
);
472 VTY_PUSH_CONTEXT(ROUTER_NODE
, area
);
476 area
= isis_area_create(area_tag
, VRF_DEFAULT_NAME
);
479 zlog_debug("New IS-IS area instance %s", area
->area_tag
);
481 VTY_PUSH_CONTEXT(ROUTER_NODE
, area
);
486 void isis_area_destroy(struct isis_area
*area
)
488 struct listnode
*node
, *nnode
;
489 struct isis_circuit
*circuit
;
494 fabricd_finish(area
->fabricd
);
496 if (area
->circuit_list
) {
497 for (ALL_LIST_ELEMENTS(area
->circuit_list
, node
, nnode
,
499 isis_area_del_circuit(area
, circuit
);
501 list_delete(&area
->circuit_list
);
503 if (area
->flags
.free_idcs
)
504 list_delete(&area
->flags
.free_idcs
);
506 list_delete(&area
->adjacency_list
);
508 lsp_db_fini(&area
->lspdb
[0]);
509 lsp_db_fini(&area
->lspdb
[1]);
511 /* invalidate and verify to delete all routes from zebra */
512 isis_area_invalidate_routes(area
, area
->is_type
);
513 isis_area_verify_routes(area
);
515 isis_sr_area_term(area
);
517 isis_mpls_te_term(area
);
519 spftree_area_del(area
);
521 if (area
->spf_timer
[0])
522 isis_spf_timer_free(EVENT_ARG(area
->spf_timer
[0]));
523 EVENT_OFF(area
->spf_timer
[0]);
524 if (area
->spf_timer
[1])
525 isis_spf_timer_free(EVENT_ARG(area
->spf_timer
[1]));
526 EVENT_OFF(area
->spf_timer
[1]);
528 spf_backoff_free(area
->spf_delay_ietf
[0]);
529 spf_backoff_free(area
->spf_delay_ietf
[1]);
531 if (!CHECK_FLAG(im
->options
, F_ISIS_UNIT_TEST
))
532 isis_redist_area_finish(area
);
534 list_delete(&area
->area_addrs
);
536 for (int i
= SPF_PREFIX_PRIO_CRITICAL
; i
<= SPF_PREFIX_PRIO_MEDIUM
;
538 struct spf_prefix_priority_acl
*ppa
;
540 ppa
= &area
->spf_prefix_priorities
[i
];
541 XFREE(MTYPE_ISIS_ACL_NAME
, ppa
->name
);
543 isis_lfa_tiebreakers_clear(area
, ISIS_LEVEL1
);
544 isis_lfa_tiebreakers_clear(area
, ISIS_LEVEL2
);
546 EVENT_OFF(area
->t_tick
);
547 EVENT_OFF(area
->t_lsp_refresh
[0]);
548 EVENT_OFF(area
->t_lsp_refresh
[1]);
549 EVENT_OFF(area
->t_rlfa_rib_update
);
551 event_cancel_event(master
, area
);
553 listnode_delete(area
->isis
->area_list
, area
);
555 free(area
->area_tag
);
557 area_mt_finish(area
);
559 if (area
->rlfa_plist_name
[0])
560 XFREE(MTYPE_ISIS_PLIST_NAME
, area
->rlfa_plist_name
[0]);
561 if (area
->rlfa_plist_name
[1])
562 XFREE(MTYPE_ISIS_PLIST_NAME
, area
->rlfa_plist_name
[1]);
564 XFREE(MTYPE_ISIS_AREA
, area
);
568 /* This is hook function for vrf create called as part of vrf_init */
569 static int isis_vrf_new(struct vrf
*vrf
)
572 zlog_debug("%s: VRF Created: %s(%u)", __func__
, vrf
->name
,
578 /* This is hook function for vrf delete call as part of vrf_init */
579 static int isis_vrf_delete(struct vrf
*vrf
)
582 zlog_debug("%s: VRF Deletion: %s(%u)", __func__
, vrf
->name
,
588 static void isis_set_redist_vrf_bitmaps(struct isis
*isis
, bool set
)
590 struct listnode
*node
;
591 struct isis_area
*area
;
596 char do_subscribe
[REDIST_PROTOCOL_COUNT
][ZEBRA_ROUTE_MAX
+ 1];
598 memset(do_subscribe
, 0, sizeof(do_subscribe
));
600 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
))
601 for (protocol
= 0; protocol
< REDIST_PROTOCOL_COUNT
; protocol
++)
602 for (type
= 0; type
< ZEBRA_ROUTE_MAX
+ 1; type
++)
603 for (level
= 0; level
< ISIS_LEVELS
; level
++)
604 if (area
->redist_settings
[protocol
]
608 do_subscribe
[protocol
][type
] =
611 for (protocol
= 0; protocol
< REDIST_PROTOCOL_COUNT
; protocol
++)
612 for (type
= 0; type
< ZEBRA_ROUTE_MAX
+ 1; type
++) {
613 /* This field is actually controlling transmission of
615 * routes to Zebra and has nothing to do with
618 if (type
== PROTO_TYPE
)
621 if (!do_subscribe
[protocol
][type
])
624 afi_t afi
= afi_for_redist_protocol(protocol
);
626 if (type
== DEFAULT_ROUTE
) {
629 zclient
->default_information
634 zclient
->default_information
640 zclient
->redist
[afi
][type
],
644 zclient
->redist
[afi
][type
],
650 static int isis_vrf_enable(struct vrf
*vrf
)
656 zlog_debug("%s: VRF %s id %u enabled", __func__
, vrf
->name
,
659 isis
= isis_lookup_by_vrfname(vrf
->name
);
660 if (isis
&& isis
->vrf_id
!= vrf
->vrf_id
) {
661 old_vrf_id
= isis
->vrf_id
;
662 /* We have instance configured, link to VRF and make it "up". */
663 isis_vrf_link(isis
, vrf
);
666 "%s: isis linked to vrf %s vrf_id %u (old id %u)",
667 __func__
, vrf
->name
, isis
->vrf_id
, old_vrf_id
);
668 /* start zebra redist to us for new vrf */
669 isis_set_redist_vrf_bitmaps(isis
, true);
671 isis_zebra_vrf_register(isis
);
677 static int isis_vrf_disable(struct vrf
*vrf
)
680 vrf_id_t old_vrf_id
= VRF_UNKNOWN
;
682 if (vrf
->vrf_id
== VRF_DEFAULT
)
686 zlog_debug("%s: VRF %s id %d disabled.", __func__
, vrf
->name
,
688 isis
= isis_lookup_by_vrfname(vrf
->name
);
690 old_vrf_id
= isis
->vrf_id
;
692 isis_zebra_vrf_deregister(isis
);
694 isis_set_redist_vrf_bitmaps(isis
, false);
696 /* We have instance configured, unlink
697 * from VRF and make it "down".
699 isis_vrf_unlink(isis
, vrf
);
701 zlog_debug("%s: isis old_vrf_id %d unlinked", __func__
,
708 void isis_vrf_init(void)
710 vrf_init(isis_vrf_new
, isis_vrf_enable
, isis_vrf_disable
,
716 void isis_terminate(void)
719 struct listnode
*node
, *nnode
;
721 bfd_protocol_integration_set_shutdown(true);
723 if (listcount(im
->isis
) == 0)
726 for (ALL_LIST_ELEMENTS(im
->isis
, node
, nnode
, isis
))
730 void isis_filter_update(struct access_list
*access
)
733 struct isis_area
*area
;
734 struct listnode
*node
, *anode
;
736 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
)) {
737 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, anode
, area
)) {
738 for (int i
= SPF_PREFIX_PRIO_CRITICAL
;
739 i
<= SPF_PREFIX_PRIO_MEDIUM
; i
++) {
740 struct spf_prefix_priority_acl
*ppa
;
742 ppa
= &area
->spf_prefix_priorities
[i
];
744 access_list_lookup(AFI_IP
, ppa
->name
);
746 access_list_lookup(AFI_IP6
, ppa
->name
);
748 lsp_regenerate_schedule(area
, area
->is_type
, 0);
753 void isis_prefix_list_update(struct prefix_list
*plist
)
756 struct isis_area
*area
;
757 struct listnode
*node
, *anode
;
759 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
)) {
760 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, anode
, area
)) {
761 for (int level
= ISIS_LEVEL1
; level
<= ISIS_LEVELS
;
763 const char *plist_name
=
764 prefix_list_name(plist
);
766 if (!area
->rlfa_plist_name
[level
- 1])
769 if (!strmatch(area
->rlfa_plist_name
[level
- 1],
773 area
->rlfa_plist
[level
- 1] =
774 prefix_list_lookup(AFI_IP
, plist_name
);
775 lsp_regenerate_schedule(area
, area
->is_type
, 0);
782 static void area_set_mt_enabled(struct isis_area
*area
, uint16_t mtid
,
785 struct isis_area_mt_setting
*setting
;
787 setting
= area_get_mt_setting(area
, mtid
);
788 if (setting
->enabled
!= enabled
) {
789 setting
->enabled
= enabled
;
790 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 0);
794 static void area_set_mt_overload(struct isis_area
*area
, uint16_t mtid
,
797 struct isis_area_mt_setting
*setting
;
799 setting
= area_get_mt_setting(area
, mtid
);
800 if (setting
->overload
!= overload
) {
801 setting
->overload
= overload
;
802 if (setting
->enabled
)
803 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
,
807 #endif /* ifdef FABRICD */
809 int area_net_title(struct vty
*vty
, const char *net_title
)
811 VTY_DECLVAR_CONTEXT(isis_area
, area
);
812 struct iso_address
*addr
;
813 struct iso_address
*addrp
;
814 struct listnode
*node
;
818 /* We check that we are not over the maximal number of addresses */
819 if (listcount(area
->area_addrs
) >= area
->isis
->max_area_addrs
) {
821 "Maximum of area addresses (%d) already reached \n",
822 area
->isis
->max_area_addrs
);
823 return CMD_ERR_NOTHING_TODO
;
826 addr
= XMALLOC(MTYPE_ISIS_AREA_ADDR
, sizeof(struct iso_address
));
827 addr
->addr_len
= dotformat2buff(buff
, net_title
);
828 memcpy(addr
->area_addr
, buff
, addr
->addr_len
);
830 zlog_debug("added area address %s for area %s (address length %d)",
831 net_title
, area
->area_tag
, addr
->addr_len
);
832 #endif /* EXTREME_DEBUG */
833 if (addr
->addr_len
< ISO_ADDR_MIN
|| addr
->addr_len
> ISO_ADDR_SIZE
) {
835 "area address must be at least 8..20 octets long (%d)\n",
837 XFREE(MTYPE_ISIS_AREA_ADDR
, addr
);
838 return CMD_WARNING_CONFIG_FAILED
;
841 if (addr
->area_addr
[addr
->addr_len
- 1] != 0) {
843 "nsel byte (last byte) in area address must be 0\n");
844 XFREE(MTYPE_ISIS_AREA_ADDR
, addr
);
845 return CMD_WARNING_CONFIG_FAILED
;
848 if (area
->isis
->sysid_set
== 0) {
850 * First area address - get the SystemID for this router
852 memcpy(area
->isis
->sysid
, GETSYSID(addr
), ISIS_SYS_ID_LEN
);
853 area
->isis
->sysid_set
= 1;
855 zlog_debug("Router has SystemID %pSY",
859 * Check that the SystemID portions match
861 if (memcmp(area
->isis
->sysid
, GETSYSID(addr
),
864 "System ID must not change when defining additional area addresses\n");
865 XFREE(MTYPE_ISIS_AREA_ADDR
, addr
);
866 return CMD_WARNING_CONFIG_FAILED
;
869 /* now we see that we don't already have this address */
870 for (ALL_LIST_ELEMENTS_RO(area
->area_addrs
, node
, addrp
)) {
871 if ((addrp
->addr_len
+ ISIS_SYS_ID_LEN
+ ISIS_NSEL_LEN
)
874 if (!memcmp(addrp
->area_addr
, addr
->area_addr
,
876 XFREE(MTYPE_ISIS_AREA_ADDR
, addr
);
877 return CMD_SUCCESS
; /* silent fail */
883 * Forget the systemID part of the address
885 addr
->addr_len
-= (ISIS_SYS_ID_LEN
+ ISIS_NSEL_LEN
);
886 listnode_add(area
->area_addrs
, addr
);
888 /* only now we can safely generate our LSPs for this area */
889 if (listcount(area
->area_addrs
) > 0) {
890 if (area
->is_type
& IS_LEVEL_1
)
891 lsp_generate(area
, IS_LEVEL_1
);
892 if (area
->is_type
& IS_LEVEL_2
)
893 lsp_generate(area
, IS_LEVEL_2
);
899 int area_clear_net_title(struct vty
*vty
, const char *net_title
)
901 VTY_DECLVAR_CONTEXT(isis_area
, area
);
902 struct iso_address addr
, *addrp
= NULL
;
903 struct listnode
*node
;
906 addr
.addr_len
= dotformat2buff(buff
, net_title
);
907 if (addr
.addr_len
< ISO_ADDR_MIN
|| addr
.addr_len
> ISO_ADDR_SIZE
) {
909 "Unsupported area address length %d, should be 8...20 \n",
911 return CMD_WARNING_CONFIG_FAILED
;
914 memcpy(addr
.area_addr
, buff
, (int)addr
.addr_len
);
916 for (ALL_LIST_ELEMENTS_RO(area
->area_addrs
, node
, addrp
))
917 if ((addrp
->addr_len
+ ISIS_SYS_ID_LEN
+ 1) == addr
.addr_len
918 && !memcmp(addrp
->area_addr
, addr
.area_addr
, addr
.addr_len
))
922 vty_out(vty
, "No area address %s for area %s \n", net_title
,
924 return CMD_ERR_NO_MATCH
;
927 listnode_delete(area
->area_addrs
, addrp
);
928 XFREE(MTYPE_ISIS_AREA_ADDR
, addrp
);
931 * Last area address - reset the SystemID for this router
933 if (listcount(area
->area_addrs
) == 0) {
934 memset(area
->isis
->sysid
, 0, ISIS_SYS_ID_LEN
);
935 area
->isis
->sysid_set
= 0;
937 zlog_debug("Router has no SystemID");
944 * 'show isis interface' command
946 int show_isis_interface_common(struct vty
*vty
, struct json_object
*json
,
947 const char *ifname
, char detail
,
948 const char *vrf_name
, bool all_vrf
)
951 return show_isis_interface_common_json(json
, ifname
, detail
,
954 return show_isis_interface_common_vty(vty
, ifname
, detail
,
959 int show_isis_interface_common_json(struct json_object
*json
,
960 const char *ifname
, char detail
,
961 const char *vrf_name
, bool all_vrf
)
963 struct listnode
*anode
, *cnode
, *inode
;
964 struct isis_area
*area
;
965 struct isis_circuit
*circuit
;
967 struct json_object
*areas_json
, *area_json
;
968 struct json_object
*circuits_json
, *circuit_json
;
970 // IS-IS Routing Process not enabled
971 json_object_string_add(json
, "is-is-routing-process-enabled",
977 for (ALL_LIST_ELEMENTS_RO(im
->isis
, inode
, isis
)) {
978 areas_json
= json_object_new_array();
979 json_object_object_add(json
, "areas",
981 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
,
983 area_json
= json_object_new_object();
984 json_object_string_add(
986 area
->area_tag
? area
->area_tag
988 circuits_json
= json_object_new_array();
989 json_object_object_add(area_json
,
992 for (ALL_LIST_ELEMENTS_RO(
993 area
->circuit_list
, cnode
,
996 json_object_new_object();
998 circuit_json
, "circuit",
999 circuit
->circuit_id
);
1001 isis_circuit_print_json(
1005 else if (strcmp(circuit
->interface
->name
, ifname
) == 0)
1006 isis_circuit_print_json(
1010 json_object_array_add(
1014 json_object_array_add(areas_json
,
1020 isis
= isis_lookup_by_vrfname(vrf_name
);
1022 areas_json
= json_object_new_array();
1023 json_object_object_add(json
, "areas", areas_json
);
1024 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, anode
,
1026 area_json
= json_object_new_object();
1027 json_object_string_add(area_json
, "area",
1032 circuits_json
= json_object_new_array();
1033 json_object_object_add(area_json
, "circuits",
1035 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
,
1037 circuit_json
= json_object_new_object();
1038 json_object_int_add(
1039 circuit_json
, "circuit",
1040 circuit
->circuit_id
);
1042 isis_circuit_print_json(
1043 circuit
, circuit_json
,
1046 strcmp(circuit
->interface
->name
,
1048 isis_circuit_print_json(
1049 circuit
, circuit_json
,
1051 json_object_array_add(circuits_json
,
1054 json_object_array_add(areas_json
, area_json
);
1061 int show_isis_interface_common_vty(struct vty
*vty
, const char *ifname
,
1062 char detail
, const char *vrf_name
,
1065 struct listnode
*anode
, *cnode
, *inode
;
1066 struct isis_area
*area
;
1067 struct isis_circuit
*circuit
;
1071 vty_out(vty
, "IS-IS Routing Process not enabled\n");
1076 for (ALL_LIST_ELEMENTS_RO(im
->isis
, inode
, isis
)) {
1077 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
,
1079 vty_out(vty
, "Area %s:\n",
1082 if (detail
== ISIS_UI_LEVEL_BRIEF
)
1084 " Interface CircId State Type Level\n");
1086 for (ALL_LIST_ELEMENTS_RO(
1087 area
->circuit_list
, cnode
,
1090 isis_circuit_print_vty(
1093 else if (strcmp(circuit
->interface
->name
, ifname
) == 0)
1094 isis_circuit_print_vty(
1101 isis
= isis_lookup_by_vrfname(vrf_name
);
1103 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, anode
,
1105 vty_out(vty
, "Area %s:\n", area
->area_tag
);
1107 if (detail
== ISIS_UI_LEVEL_BRIEF
)
1109 " Interface CircId State Type Level\n");
1111 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
,
1114 isis_circuit_print_vty(
1115 circuit
, vty
, detail
);
1117 strcmp(circuit
->interface
->name
,
1119 isis_circuit_print_vty(
1120 circuit
, vty
, detail
);
1128 DEFUN(show_isis_interface
,
1129 show_isis_interface_cmd
,
1130 "show " PROTO_NAME
" [vrf <NAME|all>] interface [json]",
1136 "IS-IS interface\n")
1138 int res
= CMD_SUCCESS
;
1139 const char *vrf_name
= VRF_DEFAULT_NAME
;
1140 bool all_vrf
= false;
1142 bool uj
= use_json(argc
, argv
);
1143 json_object
*json
= NULL
;
1145 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
1147 json
= json_object_new_object();
1148 res
= show_isis_interface_common(vty
, json
, NULL
, ISIS_UI_LEVEL_BRIEF
,
1151 vty_json(vty
, json
);
1155 DEFUN(show_isis_interface_detail
,
1156 show_isis_interface_detail_cmd
,
1157 "show " PROTO_NAME
" [vrf <NAME|all>] interface detail [json]",
1163 "show detailed information\n"
1166 int res
= CMD_SUCCESS
;
1167 const char *vrf_name
= VRF_DEFAULT_NAME
;
1168 bool all_vrf
= false;
1170 bool uj
= use_json(argc
, argv
);
1171 json_object
*json
= NULL
;
1173 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
1175 json
= json_object_new_object();
1176 res
= show_isis_interface_common(vty
, json
, NULL
, ISIS_UI_LEVEL_DETAIL
,
1179 vty_json(vty
, json
);
1183 DEFUN(show_isis_interface_arg
,
1184 show_isis_interface_arg_cmd
,
1185 "show " PROTO_NAME
" [vrf <NAME|all>] interface WORD [json]",
1191 "IS-IS interface name\n"
1194 int res
= CMD_SUCCESS
;
1196 const char *vrf_name
= VRF_DEFAULT_NAME
;
1197 bool all_vrf
= false;
1199 bool uj
= use_json(argc
, argv
);
1200 json_object
*json
= NULL
;
1202 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
1204 json
= json_object_new_object();
1206 char *ifname
= argv_find(argv
, argc
, "WORD", &idx_word
)
1207 ? argv
[idx_word
]->arg
1209 res
= show_isis_interface_common(
1210 vty
, json
, ifname
, ISIS_UI_LEVEL_DETAIL
, vrf_name
, all_vrf
);
1212 vty_json(vty
, json
);
1216 static int id_to_sysid(struct isis
*isis
, const char *id
, uint8_t *sysid
)
1218 struct isis_dynhn
*dynhn
;
1220 memset(sysid
, 0, ISIS_SYS_ID_LEN
);
1222 if (sysid2buff(sysid
, id
) == 0) {
1223 dynhn
= dynhn_find_by_name(isis
, id
);
1226 memcpy(sysid
, dynhn
->id
, ISIS_SYS_ID_LEN
);
1233 static void isis_neighbor_common_json(struct json_object
*json
, const char *id
,
1234 char detail
, struct isis
*isis
,
1237 struct listnode
*anode
, *cnode
, *node
;
1238 struct isis_area
*area
;
1239 struct isis_circuit
*circuit
;
1241 struct isis_adjacency
*adj
;
1242 struct json_object
*areas_json
, *area_json
;
1243 struct json_object
*circuits_json
, *circuit_json
;
1246 areas_json
= json_object_new_array();
1247 json_object_object_add(json
, "areas", areas_json
);
1248 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, anode
, area
)) {
1249 area_json
= json_object_new_object();
1250 json_object_string_add(area_json
, "area",
1251 area
->area_tag
? area
->area_tag
1253 circuits_json
= json_object_new_array();
1254 json_object_object_add(area_json
, "circuits", circuits_json
);
1255 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
, cnode
, circuit
)) {
1256 circuit_json
= json_object_new_object();
1257 json_object_int_add(circuit_json
, "circuit",
1258 circuit
->circuit_id
);
1259 if (circuit
->circ_type
== CIRCUIT_T_BROADCAST
) {
1260 for (i
= 0; i
< 2; i
++) {
1261 adjdb
= circuit
->u
.bc
.adjdb
[i
];
1262 if (adjdb
&& adjdb
->count
) {
1263 for (ALL_LIST_ELEMENTS_RO(
1269 isis_adj_print_json(
1275 } else if (circuit
->circ_type
== CIRCUIT_T_P2P
&&
1276 circuit
->u
.p2p
.neighbor
) {
1277 adj
= circuit
->u
.p2p
.neighbor
;
1279 !memcmp(adj
->sysid
, sysid
, ISIS_SYS_ID_LEN
))
1280 isis_adj_print_json(adj
, circuit_json
,
1283 json_object_array_add(circuits_json
, circuit_json
);
1285 json_object_array_add(areas_json
, area_json
);
1289 static void isis_neighbor_common_vty(struct vty
*vty
, const char *id
,
1290 char detail
, struct isis
*isis
,
1293 struct listnode
*anode
, *cnode
, *node
;
1294 struct isis_area
*area
;
1295 struct isis_circuit
*circuit
;
1297 struct isis_adjacency
*adj
;
1300 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, anode
, area
)) {
1301 vty_out(vty
, "Area %s:\n", area
->area_tag
);
1303 if (detail
== ISIS_UI_LEVEL_BRIEF
)
1305 " System Id Interface L State Holdtime SNPA\n");
1307 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
, cnode
, circuit
)) {
1308 if (circuit
->circ_type
== CIRCUIT_T_BROADCAST
) {
1309 for (i
= 0; i
< 2; i
++) {
1310 adjdb
= circuit
->u
.bc
.adjdb
[i
];
1311 if (adjdb
&& adjdb
->count
) {
1312 for (ALL_LIST_ELEMENTS_RO(
1324 } else if (circuit
->circ_type
== CIRCUIT_T_P2P
&&
1325 circuit
->u
.p2p
.neighbor
) {
1326 adj
= circuit
->u
.p2p
.neighbor
;
1328 !memcmp(adj
->sysid
, sysid
, ISIS_SYS_ID_LEN
))
1329 isis_adj_print_vty(adj
, vty
, detail
);
1335 static void isis_neighbor_common(struct vty
*vty
, struct json_object
*json
,
1336 const char *id
, char detail
, struct isis
*isis
,
1340 isis_neighbor_common_json(json
, id
, detail
,isis
,sysid
);
1342 isis_neighbor_common_vty(vty
, id
, detail
,isis
,sysid
);
1347 * 'show isis neighbor' command
1350 int show_isis_neighbor_common(struct vty
*vty
, struct json_object
*json
,
1351 const char *id
, char detail
, const char *vrf_name
,
1354 struct listnode
*node
;
1355 uint8_t sysid
[ISIS_SYS_ID_LEN
];
1359 vty_out(vty
, "IS-IS Routing Process not enabled\n");
1365 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
)) {
1366 if (id_to_sysid(isis
, id
, sysid
)) {
1367 vty_out(vty
, "Invalid system id %s\n",
1371 isis_neighbor_common(vty
, json
, id
, detail
,
1376 isis
= isis_lookup_by_vrfname(vrf_name
);
1378 if (id_to_sysid(isis
, id
, sysid
)) {
1379 vty_out(vty
, "Invalid system id %s\n", id
);
1382 isis_neighbor_common(vty
, json
, id
, detail
, isis
,
1390 static void isis_neighbor_common_clear(struct vty
*vty
, const char *id
,
1391 uint8_t *sysid
, struct isis
*isis
)
1393 struct listnode
*anode
, *cnode
, *node
, *nnode
;
1394 struct isis_area
*area
;
1395 struct isis_circuit
*circuit
;
1397 struct isis_adjacency
*adj
;
1400 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, anode
, area
)) {
1401 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
, cnode
, circuit
)) {
1402 if (circuit
->circ_type
== CIRCUIT_T_BROADCAST
) {
1403 for (i
= 0; i
< 2; i
++) {
1404 adjdb
= circuit
->u
.bc
.adjdb
[i
];
1405 if (adjdb
&& adjdb
->count
) {
1406 for (ALL_LIST_ELEMENTS(
1414 isis_adj_state_change(
1417 "clear user request");
1420 } else if (circuit
->circ_type
== CIRCUIT_T_P2P
1421 && circuit
->u
.p2p
.neighbor
) {
1422 adj
= circuit
->u
.p2p
.neighbor
;
1424 || !memcmp(adj
->sysid
, sysid
,
1426 isis_adj_state_change(
1427 &adj
, ISIS_ADJ_DOWN
,
1428 "clear user request");
1434 * 'clear isis neighbor' command
1436 int clear_isis_neighbor_common(struct vty
*vty
, const char *id
, const char *vrf_name
,
1439 struct listnode
*node
;
1440 uint8_t sysid
[ISIS_SYS_ID_LEN
];
1444 vty_out(vty
, "IS-IS Routing Process not enabled\n");
1450 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
)) {
1451 if (id_to_sysid(isis
, id
, sysid
)) {
1452 vty_out(vty
, "Invalid system id %s\n",
1456 isis_neighbor_common_clear(vty
, id
, sysid
,
1461 isis
= isis_lookup_by_vrfname(vrf_name
);
1463 if (id_to_sysid(isis
, id
, sysid
)) {
1464 vty_out(vty
, "Invalid system id %s\n", id
);
1467 isis_neighbor_common_clear(vty
, id
, sysid
, isis
);
1474 DEFUN(show_isis_neighbor
,
1475 show_isis_neighbor_cmd
,
1476 "show " PROTO_NAME
" [vrf <NAME|all>] neighbor [json]",
1481 "IS-IS neighbor adjacencies\n"
1484 int res
= CMD_SUCCESS
;
1485 const char *vrf_name
= VRF_DEFAULT_NAME
;
1486 bool all_vrf
= false;
1488 bool uj
= use_json(argc
, argv
);
1489 json_object
*json
= NULL
;
1491 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
1493 json
= json_object_new_object();
1494 res
= show_isis_neighbor_common(vty
, json
, NULL
, ISIS_UI_LEVEL_BRIEF
,
1497 vty_json(vty
, json
);
1501 DEFUN(show_isis_neighbor_detail
,
1502 show_isis_neighbor_detail_cmd
,
1503 "show " PROTO_NAME
" [vrf <NAME|all>] neighbor detail [json]",
1508 "IS-IS neighbor adjacencies\n"
1509 "show detailed information\n"
1512 int res
= CMD_SUCCESS
;
1513 const char *vrf_name
= VRF_DEFAULT_NAME
;
1514 bool all_vrf
= false;
1516 bool uj
= use_json(argc
, argv
);
1517 json_object
*json
= NULL
;
1519 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
1521 json
= json_object_new_object();
1523 res
= show_isis_neighbor_common(vty
, json
, NULL
, ISIS_UI_LEVEL_DETAIL
,
1526 vty_json(vty
, json
);
1530 DEFUN(show_isis_neighbor_arg
,
1531 show_isis_neighbor_arg_cmd
,
1532 "show " PROTO_NAME
" [vrf <NAME|all>] neighbor WORD [json]",
1537 "IS-IS neighbor adjacencies\n"
1541 int res
= CMD_SUCCESS
;
1543 const char *vrf_name
= VRF_DEFAULT_NAME
;
1544 bool all_vrf
= false;
1546 bool uj
= use_json(argc
, argv
);
1547 json_object
*json
= NULL
;
1549 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
1551 json
= json_object_new_object();
1552 char *id
= argv_find(argv
, argc
, "WORD", &idx_word
)
1553 ? argv
[idx_word
]->arg
1556 res
= show_isis_neighbor_common(vty
, json
, id
, ISIS_UI_LEVEL_DETAIL
,
1559 vty_json(vty
, json
);
1563 DEFUN(clear_isis_neighbor
,
1564 clear_isis_neighbor_cmd
,
1565 "clear " PROTO_NAME
" [vrf <NAME|all>] neighbor",
1570 "IS-IS neighbor adjacencies\n")
1572 const char *vrf_name
= VRF_DEFAULT_NAME
;
1573 bool all_vrf
= false;
1576 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
1577 return clear_isis_neighbor_common(vty
, NULL
, vrf_name
, all_vrf
);
1580 DEFUN(clear_isis_neighbor_arg
,
1581 clear_isis_neighbor_arg_cmd
,
1582 "clear " PROTO_NAME
" [vrf <NAME|all>] neighbor WORD",
1587 "IS-IS neighbor adjacencies\n"
1591 const char *vrf_name
= VRF_DEFAULT_NAME
;
1592 bool all_vrf
= false;
1595 char *id
= argv_find(argv
, argc
, "WORD", &idx_word
)
1596 ? argv
[idx_word
]->arg
1598 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
1599 return clear_isis_neighbor_common(vty
, id
, vrf_name
, all_vrf
);
1603 * 'isis debug', 'show debugging'
1605 void print_debug(struct vty
*vty
, int flags
, int onoff
)
1607 const char *onoffs
= onoff
? "on" : "off";
1609 if (flags
& DEBUG_ADJ_PACKETS
)
1611 "IS-IS Adjacency related packets debugging is %s\n",
1613 if (flags
& DEBUG_TX_QUEUE
)
1614 vty_out(vty
, "IS-IS TX queue debugging is %s\n",
1616 if (flags
& DEBUG_SNP_PACKETS
)
1617 vty_out(vty
, "IS-IS CSNP/PSNP packets debugging is %s\n",
1619 if (flags
& DEBUG_SPF_EVENTS
)
1620 vty_out(vty
, "IS-IS SPF events debugging is %s\n", onoffs
);
1621 if (flags
& DEBUG_SR
)
1622 vty_out(vty
, "IS-IS Segment Routing events debugging is %s\n",
1624 if (flags
& DEBUG_TE
)
1626 "IS-IS Traffic Engineering events debugging is %s\n",
1628 if (flags
& DEBUG_LFA
)
1629 vty_out(vty
, "IS-IS LFA events debugging is %s\n", onoffs
);
1630 if (flags
& DEBUG_UPDATE_PACKETS
)
1631 vty_out(vty
, "IS-IS Update related packet debugging is %s\n",
1633 if (flags
& DEBUG_RTE_EVENTS
)
1634 vty_out(vty
, "IS-IS Route related debugging is %s\n", onoffs
);
1635 if (flags
& DEBUG_EVENTS
)
1636 vty_out(vty
, "IS-IS Event debugging is %s\n", onoffs
);
1637 if (flags
& DEBUG_PACKET_DUMP
)
1638 vty_out(vty
, "IS-IS Packet dump debugging is %s\n", onoffs
);
1639 if (flags
& DEBUG_LSP_GEN
)
1640 vty_out(vty
, "IS-IS LSP generation debugging is %s\n", onoffs
);
1641 if (flags
& DEBUG_LSP_SCHED
)
1642 vty_out(vty
, "IS-IS LSP scheduling debugging is %s\n", onoffs
);
1643 if (flags
& DEBUG_FLOODING
)
1644 vty_out(vty
, "IS-IS Flooding debugging is %s\n", onoffs
);
1645 if (flags
& DEBUG_BFD
)
1646 vty_out(vty
, "IS-IS BFD debugging is %s\n", onoffs
);
1647 if (flags
& DEBUG_LDP_SYNC
)
1648 vty_out(vty
, "IS-IS ldp-sync debugging is %s\n", onoffs
);
1651 DEFUN_NOSH (show_debugging
,
1652 show_debugging_isis_cmd
,
1653 "show debugging [" PROTO_NAME
"]",
1655 "State of each debugging option\n"
1658 vty_out(vty
, PROTO_NAME
" debugging status:\n");
1660 if (IS_DEBUG_ADJ_PACKETS
)
1661 print_debug(vty
, DEBUG_ADJ_PACKETS
, 1);
1662 if (IS_DEBUG_TX_QUEUE
)
1663 print_debug(vty
, DEBUG_TX_QUEUE
, 1);
1664 if (IS_DEBUG_SNP_PACKETS
)
1665 print_debug(vty
, DEBUG_SNP_PACKETS
, 1);
1666 if (IS_DEBUG_SPF_EVENTS
)
1667 print_debug(vty
, DEBUG_SPF_EVENTS
, 1);
1669 print_debug(vty
, DEBUG_SR
, 1);
1671 print_debug(vty
, DEBUG_TE
, 1);
1672 if (IS_DEBUG_UPDATE_PACKETS
)
1673 print_debug(vty
, DEBUG_UPDATE_PACKETS
, 1);
1674 if (IS_DEBUG_RTE_EVENTS
)
1675 print_debug(vty
, DEBUG_RTE_EVENTS
, 1);
1676 if (IS_DEBUG_EVENTS
)
1677 print_debug(vty
, DEBUG_EVENTS
, 1);
1678 if (IS_DEBUG_PACKET_DUMP
)
1679 print_debug(vty
, DEBUG_PACKET_DUMP
, 1);
1680 if (IS_DEBUG_LSP_GEN
)
1681 print_debug(vty
, DEBUG_LSP_GEN
, 1);
1682 if (IS_DEBUG_LSP_SCHED
)
1683 print_debug(vty
, DEBUG_LSP_SCHED
, 1);
1684 if (IS_DEBUG_FLOODING
)
1685 print_debug(vty
, DEBUG_FLOODING
, 1);
1687 print_debug(vty
, DEBUG_BFD
, 1);
1688 if (IS_DEBUG_LDP_SYNC
)
1689 print_debug(vty
, DEBUG_LDP_SYNC
, 1);
1691 print_debug(vty
, DEBUG_LFA
, 1);
1693 cmd_show_lib_debugs(vty
);
1698 static int config_write_debug(struct vty
*vty
);
1700 static struct cmd_node debug_node
= {
1704 .config_write
= config_write_debug
,
1707 static int config_write_debug(struct vty
*vty
)
1711 if (IS_DEBUG_ADJ_PACKETS
) {
1712 vty_out(vty
, "debug " PROTO_NAME
" adj-packets\n");
1715 if (IS_DEBUG_TX_QUEUE
) {
1716 vty_out(vty
, "debug " PROTO_NAME
" tx-queue\n");
1719 if (IS_DEBUG_SNP_PACKETS
) {
1720 vty_out(vty
, "debug " PROTO_NAME
" snp-packets\n");
1723 if (IS_DEBUG_SPF_EVENTS
) {
1724 vty_out(vty
, "debug " PROTO_NAME
" spf-events\n");
1728 vty_out(vty
, "debug " PROTO_NAME
" sr-events\n");
1732 vty_out(vty
, "debug " PROTO_NAME
" te-events\n");
1736 vty_out(vty
, "debug " PROTO_NAME
" lfa\n");
1739 if (IS_DEBUG_UPDATE_PACKETS
) {
1740 vty_out(vty
, "debug " PROTO_NAME
" update-packets\n");
1743 if (IS_DEBUG_RTE_EVENTS
) {
1744 vty_out(vty
, "debug " PROTO_NAME
" route-events\n");
1747 if (IS_DEBUG_EVENTS
) {
1748 vty_out(vty
, "debug " PROTO_NAME
" events\n");
1751 if (IS_DEBUG_PACKET_DUMP
) {
1752 vty_out(vty
, "debug " PROTO_NAME
" packet-dump\n");
1755 if (IS_DEBUG_LSP_GEN
) {
1756 vty_out(vty
, "debug " PROTO_NAME
" lsp-gen\n");
1759 if (IS_DEBUG_LSP_SCHED
) {
1760 vty_out(vty
, "debug " PROTO_NAME
" lsp-sched\n");
1763 if (IS_DEBUG_FLOODING
) {
1764 vty_out(vty
, "debug " PROTO_NAME
" flooding\n");
1768 vty_out(vty
, "debug " PROTO_NAME
" bfd\n");
1771 if (IS_DEBUG_LDP_SYNC
) {
1772 vty_out(vty
, "debug " PROTO_NAME
" ldp-sync\n");
1775 write
+= spf_backoff_write_config(vty
);
1780 DEFUN (debug_isis_adj
,
1782 "debug " PROTO_NAME
" adj-packets",
1785 "IS-IS Adjacency related packets\n")
1787 debug_adj_pkt
|= DEBUG_ADJ_PACKETS
;
1788 print_debug(vty
, DEBUG_ADJ_PACKETS
, 1);
1793 DEFUN (no_debug_isis_adj
,
1794 no_debug_isis_adj_cmd
,
1795 "no debug " PROTO_NAME
" adj-packets",
1799 "IS-IS Adjacency related packets\n")
1801 debug_adj_pkt
&= ~DEBUG_ADJ_PACKETS
;
1802 print_debug(vty
, DEBUG_ADJ_PACKETS
, 0);
1807 DEFUN (debug_isis_tx_queue
,
1808 debug_isis_tx_queue_cmd
,
1809 "debug " PROTO_NAME
" tx-queue",
1812 "IS-IS TX queues\n")
1814 debug_tx_queue
|= DEBUG_TX_QUEUE
;
1815 print_debug(vty
, DEBUG_TX_QUEUE
, 1);
1820 DEFUN (no_debug_isis_tx_queue
,
1821 no_debug_isis_tx_queue_cmd
,
1822 "no debug " PROTO_NAME
" tx-queue",
1826 "IS-IS TX queues\n")
1828 debug_tx_queue
&= ~DEBUG_TX_QUEUE
;
1829 print_debug(vty
, DEBUG_TX_QUEUE
, 0);
1834 DEFUN (debug_isis_flooding
,
1835 debug_isis_flooding_cmd
,
1836 "debug " PROTO_NAME
" flooding",
1839 "Flooding algorithm\n")
1841 debug_flooding
|= DEBUG_FLOODING
;
1842 print_debug(vty
, DEBUG_FLOODING
, 1);
1847 DEFUN (no_debug_isis_flooding
,
1848 no_debug_isis_flooding_cmd
,
1849 "no debug " PROTO_NAME
" flooding",
1853 "Flooding algorithm\n")
1855 debug_flooding
&= ~DEBUG_FLOODING
;
1856 print_debug(vty
, DEBUG_FLOODING
, 0);
1861 DEFUN (debug_isis_snp
,
1863 "debug " PROTO_NAME
" snp-packets",
1866 "IS-IS CSNP/PSNP packets\n")
1868 debug_snp_pkt
|= DEBUG_SNP_PACKETS
;
1869 print_debug(vty
, DEBUG_SNP_PACKETS
, 1);
1874 DEFUN (no_debug_isis_snp
,
1875 no_debug_isis_snp_cmd
,
1876 "no debug " PROTO_NAME
" snp-packets",
1880 "IS-IS CSNP/PSNP packets\n")
1882 debug_snp_pkt
&= ~DEBUG_SNP_PACKETS
;
1883 print_debug(vty
, DEBUG_SNP_PACKETS
, 0);
1888 DEFUN (debug_isis_upd
,
1890 "debug " PROTO_NAME
" update-packets",
1893 "IS-IS Update related packets\n")
1895 debug_update_pkt
|= DEBUG_UPDATE_PACKETS
;
1896 print_debug(vty
, DEBUG_UPDATE_PACKETS
, 1);
1901 DEFUN (no_debug_isis_upd
,
1902 no_debug_isis_upd_cmd
,
1903 "no debug " PROTO_NAME
" update-packets",
1907 "IS-IS Update related packets\n")
1909 debug_update_pkt
&= ~DEBUG_UPDATE_PACKETS
;
1910 print_debug(vty
, DEBUG_UPDATE_PACKETS
, 0);
1915 DEFUN (debug_isis_spfevents
,
1916 debug_isis_spfevents_cmd
,
1917 "debug " PROTO_NAME
" spf-events",
1920 "IS-IS Shortest Path First Events\n")
1922 debug_spf_events
|= DEBUG_SPF_EVENTS
;
1923 print_debug(vty
, DEBUG_SPF_EVENTS
, 1);
1928 DEFUN (no_debug_isis_spfevents
,
1929 no_debug_isis_spfevents_cmd
,
1930 "no debug " PROTO_NAME
" spf-events",
1934 "IS-IS Shortest Path First Events\n")
1936 debug_spf_events
&= ~DEBUG_SPF_EVENTS
;
1937 print_debug(vty
, DEBUG_SPF_EVENTS
, 0);
1942 DEFUN (debug_isis_srevents
,
1943 debug_isis_srevents_cmd
,
1944 "debug " PROTO_NAME
" sr-events",
1947 "IS-IS Segment Routing Events\n")
1949 debug_sr
|= DEBUG_SR
;
1950 print_debug(vty
, DEBUG_SR
, 1);
1955 DEFUN (no_debug_isis_srevents
,
1956 no_debug_isis_srevents_cmd
,
1957 "no debug " PROTO_NAME
" sr-events",
1961 "IS-IS Segment Routing Events\n")
1963 debug_sr
&= ~DEBUG_SR
;
1964 print_debug(vty
, DEBUG_SR
, 0);
1969 DEFUN (debug_isis_teevents
,
1970 debug_isis_teevents_cmd
,
1971 "debug " PROTO_NAME
" te-events",
1974 "IS-IS Traffic Engineering Events\n")
1976 debug_te
|= DEBUG_TE
;
1977 print_debug(vty
, DEBUG_TE
, 1);
1982 DEFUN (no_debug_isis_teevents
,
1983 no_debug_isis_teevents_cmd
,
1984 "no debug " PROTO_NAME
" te-events",
1988 "IS-IS Traffic Engineering Events\n")
1990 debug_te
&= ~DEBUG_TE
;
1991 print_debug(vty
, DEBUG_TE
, 0);
1996 DEFUN (debug_isis_lfa
,
1998 "debug " PROTO_NAME
" lfa",
2001 "IS-IS LFA Events\n")
2003 debug_lfa
|= DEBUG_LFA
;
2004 print_debug(vty
, DEBUG_LFA
, 1);
2009 DEFUN (no_debug_isis_lfa
,
2010 no_debug_isis_lfa_cmd
,
2011 "no debug " PROTO_NAME
" lfa",
2015 "IS-IS LFA Events\n")
2017 debug_lfa
&= ~DEBUG_LFA
;
2018 print_debug(vty
, DEBUG_LFA
, 0);
2023 DEFUN (debug_isis_rtevents
,
2024 debug_isis_rtevents_cmd
,
2025 "debug " PROTO_NAME
" route-events",
2028 "IS-IS Route related events\n")
2030 debug_rte_events
|= DEBUG_RTE_EVENTS
;
2031 print_debug(vty
, DEBUG_RTE_EVENTS
, 1);
2036 DEFUN (no_debug_isis_rtevents
,
2037 no_debug_isis_rtevents_cmd
,
2038 "no debug " PROTO_NAME
" route-events",
2042 "IS-IS Route related events\n")
2044 debug_rte_events
&= ~DEBUG_RTE_EVENTS
;
2045 print_debug(vty
, DEBUG_RTE_EVENTS
, 0);
2050 DEFUN (debug_isis_events
,
2051 debug_isis_events_cmd
,
2052 "debug " PROTO_NAME
" events",
2057 debug_events
|= DEBUG_EVENTS
;
2058 print_debug(vty
, DEBUG_EVENTS
, 1);
2063 DEFUN (no_debug_isis_events
,
2064 no_debug_isis_events_cmd
,
2065 "no debug " PROTO_NAME
" events",
2071 debug_events
&= ~DEBUG_EVENTS
;
2072 print_debug(vty
, DEBUG_EVENTS
, 0);
2077 DEFUN (debug_isis_packet_dump
,
2078 debug_isis_packet_dump_cmd
,
2079 "debug " PROTO_NAME
" packet-dump",
2082 "IS-IS packet dump\n")
2084 debug_pkt_dump
|= DEBUG_PACKET_DUMP
;
2085 print_debug(vty
, DEBUG_PACKET_DUMP
, 1);
2090 DEFUN (no_debug_isis_packet_dump
,
2091 no_debug_isis_packet_dump_cmd
,
2092 "no debug " PROTO_NAME
" packet-dump",
2096 "IS-IS packet dump\n")
2098 debug_pkt_dump
&= ~DEBUG_PACKET_DUMP
;
2099 print_debug(vty
, DEBUG_PACKET_DUMP
, 0);
2104 DEFUN (debug_isis_lsp_gen
,
2105 debug_isis_lsp_gen_cmd
,
2106 "debug " PROTO_NAME
" lsp-gen",
2109 "IS-IS generation of own LSPs\n")
2111 debug_lsp_gen
|= DEBUG_LSP_GEN
;
2112 print_debug(vty
, DEBUG_LSP_GEN
, 1);
2117 DEFUN (no_debug_isis_lsp_gen
,
2118 no_debug_isis_lsp_gen_cmd
,
2119 "no debug " PROTO_NAME
" lsp-gen",
2123 "IS-IS generation of own LSPs\n")
2125 debug_lsp_gen
&= ~DEBUG_LSP_GEN
;
2126 print_debug(vty
, DEBUG_LSP_GEN
, 0);
2131 DEFUN (debug_isis_lsp_sched
,
2132 debug_isis_lsp_sched_cmd
,
2133 "debug " PROTO_NAME
" lsp-sched",
2136 "IS-IS scheduling of LSP generation\n")
2138 debug_lsp_sched
|= DEBUG_LSP_SCHED
;
2139 print_debug(vty
, DEBUG_LSP_SCHED
, 1);
2144 DEFUN (no_debug_isis_lsp_sched
,
2145 no_debug_isis_lsp_sched_cmd
,
2146 "no debug " PROTO_NAME
" lsp-sched",
2150 "IS-IS scheduling of LSP generation\n")
2152 debug_lsp_sched
&= ~DEBUG_LSP_SCHED
;
2153 print_debug(vty
, DEBUG_LSP_SCHED
, 0);
2158 DEFUN (debug_isis_bfd
,
2160 "debug " PROTO_NAME
" bfd",
2163 PROTO_NAME
" interaction with BFD\n")
2165 debug_bfd
|= DEBUG_BFD
;
2166 bfd_protocol_integration_set_debug(true);
2167 print_debug(vty
, DEBUG_BFD
, 1);
2172 DEFUN (no_debug_isis_bfd
,
2173 no_debug_isis_bfd_cmd
,
2174 "no debug " PROTO_NAME
" bfd",
2178 PROTO_NAME
" interaction with BFD\n")
2180 debug_bfd
&= ~DEBUG_BFD
;
2181 bfd_protocol_integration_set_debug(false);
2182 print_debug(vty
, DEBUG_BFD
, 0);
2187 DEFUN(debug_isis_ldp_sync
, debug_isis_ldp_sync_cmd
,
2188 "debug " PROTO_NAME
" ldp-sync",
2189 DEBUG_STR PROTO_HELP PROTO_NAME
" interaction with LDP-Sync\n")
2191 debug_ldp_sync
|= DEBUG_LDP_SYNC
;
2192 print_debug(vty
, DEBUG_LDP_SYNC
, 1);
2197 DEFUN(no_debug_isis_ldp_sync
, no_debug_isis_ldp_sync_cmd
,
2198 "no debug " PROTO_NAME
" ldp-sync",
2199 NO_STR UNDEBUG_STR PROTO_HELP PROTO_NAME
" interaction with LDP-Sync\n")
2201 debug_ldp_sync
&= ~DEBUG_LDP_SYNC
;
2202 print_debug(vty
, DEBUG_LDP_SYNC
, 0);
2207 DEFUN (show_hostname
,
2209 "show " PROTO_NAME
" [vrf <NAME|all>] hostname",
2210 SHOW_STR PROTO_HELP VRF_CMD_HELP_STR
2212 "IS-IS Dynamic hostname mapping\n")
2214 struct listnode
*node
;
2215 const char *vrf_name
= VRF_DEFAULT_NAME
;
2216 bool all_vrf
= false;
2220 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
2223 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
))
2224 dynhn_print_all(vty
, isis
);
2228 isis
= isis_lookup_by_vrfname(vrf_name
);
2230 dynhn_print_all(vty
, isis
);
2236 static void isis_spf_ietf_common(struct vty
*vty
, struct isis
*isis
)
2238 struct listnode
*node
;
2239 struct isis_area
*area
;
2240 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
)) {
2242 vty_out(vty
, "vrf : %s\n", isis
->name
);
2243 vty_out(vty
, "Area %s:\n",
2244 area
->area_tag
? area
->area_tag
: "null");
2246 for (int level
= ISIS_LEVEL1
; level
<= ISIS_LEVELS
; level
++) {
2247 if ((area
->is_type
& level
) == 0)
2250 vty_out(vty
, " Level-%d:\n", level
);
2251 vty_out(vty
, " SPF delay status: ");
2252 if (area
->spf_timer
[level
- 1]) {
2253 struct timeval remain
= event_timer_remain(
2254 area
->spf_timer
[level
- 1]);
2255 vty_out(vty
, "Pending, due in %lld msec\n",
2256 (long long)remain
.tv_sec
* 1000
2257 + remain
.tv_usec
/ 1000);
2259 vty_out(vty
, "Not scheduled\n");
2262 if (area
->spf_delay_ietf
[level
- 1]) {
2264 " Using draft-ietf-rtgwg-backoff-algo-04\n");
2266 area
->spf_delay_ietf
[level
- 1], vty
,
2269 vty_out(vty
, " Using legacy backoff algo\n");
2275 DEFUN(show_isis_spf_ietf
, show_isis_spf_ietf_cmd
,
2276 "show " PROTO_NAME
" [vrf <NAME|all>] spf-delay-ietf",
2277 SHOW_STR PROTO_HELP VRF_CMD_HELP_STR
2279 "SPF delay IETF information\n")
2281 struct listnode
*node
;
2284 const char *vrf_name
= VRF_DEFAULT_NAME
;
2285 bool all_vrf
= false;
2287 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
)
2290 vty_out(vty
, "ISIS is not running\n");
2296 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
))
2297 isis_spf_ietf_common(vty
, isis
);
2301 isis
= isis_lookup_by_vrfname(vrf_name
);
2303 isis_spf_ietf_common(vty
, isis
);
2310 static const char *pdu_counter_index_to_name_json(enum pdu_counter_index index
)
2313 case L1_LAN_HELLO_INDEX
:
2315 case L2_LAN_HELLO_INDEX
:
2317 case P2P_HELLO_INDEX
:
2319 case L1_LINK_STATE_INDEX
:
2321 case L2_LINK_STATE_INDEX
:
2323 case FS_LINK_STATE_INDEX
:
2325 case L1_COMPLETE_SEQ_NUM_INDEX
:
2327 case L2_COMPLETE_SEQ_NUM_INDEX
:
2329 case L1_PARTIAL_SEQ_NUM_INDEX
:
2331 case L2_PARTIAL_SEQ_NUM_INDEX
:
2333 case PDU_COUNTER_SIZE
:
2337 assert(!"Reached end of function where we are not expecting to");
2340 static void common_isis_summary_json(struct json_object
*json
,
2344 json_object
*areas_json
, *area_json
, *tx_pdu_json
, *rx_pdu_json
,
2345 *levels_json
, *level_json
;
2346 struct listnode
*node
, *node2
;
2347 struct isis_area
*area
;
2349 char uptime
[MONOTIME_STRLEN
];
2352 json_object_string_add(json
, "vrf", isis
->name
);
2353 json_object_int_add(json
, "process-id", isis
->process_id
);
2354 if (isis
->sysid_set
)
2355 json_object_string_addf(json
, "system-id", "%pSY", isis
->sysid
);
2358 cur
-= isis
->uptime
;
2359 frrtime_to_interval(cur
, uptime
, sizeof(uptime
));
2360 json_object_string_add(json
, "up-time", uptime
);
2361 if (isis
->area_list
)
2362 json_object_int_add(json
, "number-areas",
2363 isis
->area_list
->count
);
2364 areas_json
= json_object_new_array();
2365 json_object_object_add(json
, "areas", areas_json
);
2366 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
)) {
2367 area_json
= json_object_new_object();
2368 json_object_string_add(area_json
, "area",
2369 area
->area_tag
? area
->area_tag
2374 uint8_t tier
= fabricd_tier(area
);
2375 snprintfrr(stier
, sizeof(stier
), "%s", &tier
);
2376 json_object_string_add(area_json
, "tier",
2377 tier
== ISIS_TIER_UNDEFINED
2382 if (listcount(area
->area_addrs
) > 0) {
2383 struct iso_address
*area_addr
;
2384 for (ALL_LIST_ELEMENTS_RO(area
->area_addrs
, node2
,
2386 json_object_string_addf(area_json
, "net",
2387 "%pISl", area_addr
);
2390 tx_pdu_json
= json_object_new_object();
2391 json_object_object_add(area_json
, "tx-pdu-type", tx_pdu_json
);
2392 for (int i
= 0; i
< PDU_COUNTER_SIZE
; i
++) {
2393 if (!area
->pdu_tx_counters
[i
])
2395 json_object_int_add(tx_pdu_json
,
2396 pdu_counter_index_to_name_json(i
),
2397 area
->pdu_tx_counters
[i
]);
2399 json_object_int_add(tx_pdu_json
, "lsp-rxmt",
2400 area
->lsp_rxmt_count
);
2402 rx_pdu_json
= json_object_new_object();
2403 json_object_object_add(area_json
, "rx-pdu-type", rx_pdu_json
);
2404 for (int i
= 0; i
< PDU_COUNTER_SIZE
; i
++) {
2405 if (!area
->pdu_rx_counters
[i
])
2407 json_object_int_add(rx_pdu_json
,
2408 pdu_counter_index_to_name_json(i
),
2409 area
->pdu_rx_counters
[i
]);
2412 levels_json
= json_object_new_array();
2413 json_object_object_add(area_json
, "levels", levels_json
);
2414 for (level
= ISIS_LEVEL1
; level
<= ISIS_LEVELS
; level
++) {
2415 if ((area
->is_type
& level
) == 0)
2417 level_json
= json_object_new_object();
2418 json_object_int_add(level_json
, "id", level
);
2419 json_object_int_add(level_json
, "lsp0-regenerated",
2420 area
->lsp_gen_count
[level
- 1]);
2421 json_object_int_add(level_json
, "lsp-purged",
2422 area
->lsp_purge_count
[level
- 1]);
2423 if (area
->spf_timer
[level
- 1])
2424 json_object_string_add(level_json
, "spf",
2427 json_object_string_add(level_json
, "spf",
2429 json_object_int_add(level_json
, "minimum-interval",
2430 area
->min_spf_interval
[level
- 1]);
2431 if (area
->spf_delay_ietf
[level
- 1])
2432 json_object_string_add(
2433 level_json
, "ietf-spf-delay-activated",
2435 if (area
->ip_circuits
) {
2436 isis_spf_print_json(
2437 area
->spftree
[SPFTREE_IPV4
][level
- 1],
2440 if (area
->ipv6_circuits
) {
2441 isis_spf_print_json(
2442 area
->spftree
[SPFTREE_IPV6
][level
- 1],
2445 json_object_array_add(levels_json
, level_json
);
2447 json_object_array_add(areas_json
, area_json
);
2451 static void common_isis_summary_vty(struct vty
*vty
, struct isis
*isis
)
2453 struct listnode
*node
, *node2
;
2454 struct isis_area
*area
;
2457 vty_out(vty
, "vrf : %s\n", isis
->name
);
2458 vty_out(vty
, "Process Id : %ld\n", isis
->process_id
);
2459 if (isis
->sysid_set
)
2460 vty_out(vty
, "System Id : %pSY\n", isis
->sysid
);
2462 vty_out(vty
, "Up time : ");
2463 vty_out_timestr(vty
, isis
->uptime
);
2466 if (isis
->area_list
)
2467 vty_out(vty
, "Number of areas : %d\n", isis
->area_list
->count
);
2469 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
)) {
2470 vty_out(vty
, "Area %s:\n",
2471 area
->area_tag
? area
->area_tag
: "null");
2474 uint8_t tier
= fabricd_tier(area
);
2475 if (tier
== ISIS_TIER_UNDEFINED
)
2476 vty_out(vty
, " Tier: undefined\n");
2478 vty_out(vty
, " Tier: %hhu\n", tier
);
2481 if (listcount(area
->area_addrs
) > 0) {
2482 struct iso_address
*area_addr
;
2483 for (ALL_LIST_ELEMENTS_RO(area
->area_addrs
, node2
,
2485 vty_out(vty
, " Net: %pISl\n", area_addr
);
2488 vty_out(vty
, " TX counters per PDU type:\n");
2489 pdu_counter_print(vty
, " ", area
->pdu_tx_counters
);
2490 vty_out(vty
, " LSP RXMT: %" PRIu64
"\n",
2491 area
->lsp_rxmt_count
);
2492 vty_out(vty
, " RX counters per PDU type:\n");
2493 pdu_counter_print(vty
, " ", area
->pdu_rx_counters
);
2495 vty_out(vty
, " Drop counters per PDU type:\n");
2496 pdu_counter_print(vty
, " ", area
->pdu_drop_counters
);
2498 vty_out(vty
, " Advertise high metrics: %s\n",
2499 area
->advertise_high_metrics
? "Enabled" : "Disabled");
2501 for (level
= ISIS_LEVEL1
; level
<= ISIS_LEVELS
; level
++) {
2502 if ((area
->is_type
& level
) == 0)
2505 vty_out(vty
, " Level-%d:\n", level
);
2507 vty_out(vty
, " LSP0 regenerated: %" PRIu64
"\n",
2508 area
->lsp_gen_count
[level
- 1]);
2510 vty_out(vty
, " LSPs purged: %" PRIu64
"\n",
2511 area
->lsp_purge_count
[level
- 1]);
2513 if (area
->spf_timer
[level
- 1])
2514 vty_out(vty
, " SPF: (pending)\n");
2516 vty_out(vty
, " SPF:\n");
2518 vty_out(vty
, " minimum interval : %d",
2519 area
->min_spf_interval
[level
- 1]);
2520 if (area
->spf_delay_ietf
[level
- 1])
2522 " (not used, IETF SPF delay activated)");
2525 if (area
->ip_circuits
) {
2526 vty_out(vty
, " IPv4 route computation:\n");
2528 area
->spftree
[SPFTREE_IPV4
][level
- 1],
2532 if (area
->ipv6_circuits
) {
2533 vty_out(vty
, " IPv6 route computation:\n");
2535 area
->spftree
[SPFTREE_IPV6
][level
- 1],
2539 if (area
->ipv6_circuits
2540 && isis_area_ipv6_dstsrc_enabled(area
)) {
2542 " IPv6 dst-src route computation:\n");
2543 isis_spf_print(area
->spftree
[SPFTREE_DSTSRC
]
2551 static void common_isis_summary(struct vty
*vty
, struct json_object
*json
,
2555 common_isis_summary_json(json
, isis
);
2557 common_isis_summary_vty(vty
, isis
);
2561 DEFUN(show_isis_summary
, show_isis_summary_cmd
,
2562 "show " PROTO_NAME
" [vrf <NAME|all>] summary [json]",
2563 SHOW_STR PROTO_HELP VRF_CMD_HELP_STR
2568 struct listnode
*node
;
2571 const char *vrf_name
= VRF_DEFAULT_NAME
;
2572 bool all_vrf
= false;
2573 bool uj
= use_json(argc
, argv
);
2574 json_object
*json
= NULL
;
2576 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
)
2578 vty_out(vty
, PROTO_NAME
" is not running\n");
2582 json
= json_object_new_object();
2585 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
))
2586 common_isis_summary(vty
, json
, isis
);
2590 isis
= isis_lookup_by_vrfname(vrf_name
);
2592 common_isis_summary(vty
, json
, isis
);
2596 vty_json(vty
, json
);
2601 struct isis_lsp
*lsp_for_sysid(struct lspdb_head
*head
, const char *sysid_str
,
2604 char sysid
[255] = {0};
2605 uint8_t number
[3] = {0};
2607 uint8_t lspid
[ISIS_SYS_ID_LEN
+ 2] = {0};
2608 struct isis_dynhn
*dynhn
;
2609 struct isis_lsp
*lsp
= NULL
;
2615 * extract fragment and pseudo id from the string sysid_str
2617 * (a) <systemid/hostname>.<pseudo-id>-<framenent> or
2618 * (b) <systemid/hostname>.<pseudo-id> or
2619 * (c) <systemid/hostname> or
2620 * Where systemid is in the form:
2623 strlcpy(sysid
, sysid_str
, sizeof(sysid
));
2625 if (strlen(sysid_str
) > 3) {
2626 pos
= sysid_str
+ strlen(sysid_str
) - 3;
2627 if (strncmp(pos
, "-", 1) == 0) {
2628 memcpy(number
, ++pos
, 2);
2629 lspid
[ISIS_SYS_ID_LEN
+ 1] =
2630 (uint8_t)strtol((char *)number
, NULL
, 16);
2632 if (strncmp(pos
, ".", 1) != 0)
2635 if (strncmp(pos
, ".", 1) == 0) {
2636 memcpy(number
, ++pos
, 2);
2637 lspid
[ISIS_SYS_ID_LEN
] =
2638 (uint8_t)strtol((char *)number
, NULL
, 16);
2639 sysid
[pos
- sysid_str
- 1] = '\0';
2644 * Try to find the lsp-id if the sysid_str
2646 * hostname.<pseudo-id>-<fragment>
2648 if (sysid2buff(lspid
, sysid
)) {
2649 lsp
= lsp_search(head
, lspid
);
2650 } else if ((dynhn
= dynhn_find_by_name(isis
, sysid
))) {
2651 memcpy(lspid
, dynhn
->id
, ISIS_SYS_ID_LEN
);
2652 lsp
= lsp_search(head
, lspid
);
2653 } else if (strncmp(cmd_hostname_get(), sysid
, 15) == 0) {
2654 memcpy(lspid
, isis
->sysid
, ISIS_SYS_ID_LEN
);
2655 lsp
= lsp_search(head
, lspid
);
2661 void show_isis_database_lspdb_json(struct json_object
*json
,
2662 struct isis_area
*area
, int level
,
2663 struct lspdb_head
*lspdb
,
2664 const char *sysid_str
, int ui_level
)
2666 struct isis_lsp
*lsp
;
2669 if (lspdb_count(lspdb
) > 0) {
2670 lsp
= lsp_for_sysid(lspdb
, sysid_str
, area
->isis
);
2672 if (lsp
!= NULL
|| sysid_str
== NULL
) {
2673 json_object_int_add(json
, "id", level
+ 1);
2677 if (ui_level
== ISIS_UI_LEVEL_DETAIL
)
2678 lsp_print_detail(lsp
, NULL
, json
,
2679 area
->dynhostname
, area
->isis
);
2681 lsp_print_json(lsp
, json
, area
->dynhostname
,
2683 } else if (sysid_str
== NULL
) {
2685 lsp_print_all(NULL
, json
, lspdb
, ui_level
,
2686 area
->dynhostname
, area
->isis
);
2688 json_object_int_add(json
, "count", lsp_count
);
2692 void show_isis_database_lspdb_vty(struct vty
*vty
, struct isis_area
*area
,
2693 int level
, struct lspdb_head
*lspdb
,
2694 const char *sysid_str
, int ui_level
)
2696 struct isis_lsp
*lsp
;
2699 if (lspdb_count(lspdb
) > 0) {
2700 lsp
= lsp_for_sysid(lspdb
, sysid_str
, area
->isis
);
2702 if (lsp
!= NULL
|| sysid_str
== NULL
) {
2703 vty_out(vty
, "IS-IS Level-%d link-state database:\n",
2706 /* print the title in all cases */
2708 "LSP ID PduLen SeqNumber Chksum Holdtime ATT/P/OL\n");
2712 if (ui_level
== ISIS_UI_LEVEL_DETAIL
)
2713 lsp_print_detail(lsp
, vty
, NULL
,
2714 area
->dynhostname
, area
->isis
);
2716 lsp_print_vty(lsp
, vty
, area
->dynhostname
,
2718 } else if (sysid_str
== NULL
) {
2720 lsp_print_all(vty
, NULL
, lspdb
, ui_level
,
2721 area
->dynhostname
, area
->isis
);
2723 vty_out(vty
, " %u LSPs\n\n", lsp_count
);
2728 static void show_isis_database_json(struct json_object
*json
, const char *sysid_str
,
2729 int ui_level
, struct isis
*isis
)
2731 struct listnode
*node
;
2732 struct isis_area
*area
;
2734 struct json_object
*tag_area_json
,*area_json
, *lsp_json
, *area_arr_json
, *arr_json
;
2736 if (isis
->area_list
->count
== 0)
2739 area_arr_json
= json_object_new_array();
2740 json_object_object_add(json
, "areas", area_arr_json
);
2741 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
)) {
2742 area_json
= json_object_new_object();
2743 tag_area_json
= json_object_new_object();
2744 json_object_string_add(tag_area_json
, "name",
2745 area
->area_tag
? area
->area_tag
2748 arr_json
= json_object_new_array();
2749 json_object_object_add(area_json
,"area",tag_area_json
);
2750 json_object_object_add(area_json
,"levels",arr_json
);
2751 for (level
= 0; level
< ISIS_LEVELS
; level
++) {
2752 lsp_json
= json_object_new_object();
2753 show_isis_database_lspdb_json(lsp_json
, area
, level
,
2754 &area
->lspdb
[level
],
2755 sysid_str
, ui_level
);
2756 json_object_array_add(arr_json
, lsp_json
);
2758 json_object_array_add(area_arr_json
, area_json
);
2762 static void show_isis_database_vty(struct vty
*vty
, const char *sysid_str
,
2763 int ui_level
, struct isis
*isis
)
2765 struct listnode
*node
;
2766 struct isis_area
*area
;
2769 if (isis
->area_list
->count
== 0)
2772 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
)) {
2773 vty_out(vty
, "Area %s:\n",
2774 area
->area_tag
? area
->area_tag
: "null");
2776 for (level
= 0; level
< ISIS_LEVELS
; level
++)
2777 show_isis_database_lspdb_vty(vty
, area
, level
,
2778 &area
->lspdb
[level
], sysid_str
,
2783 static void show_isis_database_common(struct vty
*vty
, struct json_object
*json
, const char *sysid_str
,
2784 int ui_level
, struct isis
*isis
)
2787 show_isis_database_json(json
, sysid_str
, ui_level
, isis
);
2789 show_isis_database_vty(vty
, sysid_str
, ui_level
, isis
);
2794 * This function supports following display options:
2795 * [ show isis database [detail] ]
2796 * [ show isis database <sysid> [detail] ]
2797 * [ show isis database <hostname> [detail] ]
2798 * [ show isis database <sysid>.<pseudo-id> [detail] ]
2799 * [ show isis database <hostname>.<pseudo-id> [detail] ]
2800 * [ show isis database <sysid>.<pseudo-id>-<fragment-number> [detail] ]
2801 * [ show isis database <hostname>.<pseudo-id>-<fragment-number> [detail] ]
2802 * [ show isis database detail <sysid> ]
2803 * [ show isis database detail <hostname> ]
2804 * [ show isis database detail <sysid>.<pseudo-id> ]
2805 * [ show isis database detail <hostname>.<pseudo-id> ]
2806 * [ show isis database detail <sysid>.<pseudo-id>-<fragment-number> ]
2807 * [ show isis database detail <hostname>.<pseudo-id>-<fragment-number> ]
2809 static int show_isis_database(struct vty
*vty
, struct json_object
*json
, const char *sysid_str
,
2810 int ui_level
, const char *vrf_name
, bool all_vrf
)
2812 struct listnode
*node
;
2817 for (ALL_LIST_ELEMENTS_RO(im
->isis
, node
, isis
))
2818 show_isis_database_common(vty
, json
, sysid_str
,
2823 isis
= isis_lookup_by_vrfname(vrf_name
);
2825 show_isis_database_common(vty
, json
, sysid_str
,
2832 DEFUN(show_database
, show_database_cmd
,
2833 "show " PROTO_NAME
" [vrf <NAME|all>] database [detail] [WORD] [json]",
2834 SHOW_STR PROTO_HELP VRF_CMD_HELP_STR
2836 "Link state database\n"
2837 "Detailed information\n"
2841 int res
= CMD_SUCCESS
;
2844 const char *vrf_name
= VRF_DEFAULT_NAME
;
2845 bool all_vrf
= false;
2846 int uilevel
= argv_find(argv
, argc
, "detail", &idx
)
2847 ? ISIS_UI_LEVEL_DETAIL
2848 : ISIS_UI_LEVEL_BRIEF
;
2849 char *id
= argv_find(argv
, argc
, "WORD", &idx
) ? argv
[idx
]->arg
: NULL
;
2850 bool uj
= use_json(argc
, argv
);
2851 json_object
*json
= NULL
;
2853 ISIS_FIND_VRF_ARGS(argv
, argc
, idx_vrf
, vrf_name
, all_vrf
);
2855 json
= json_object_new_object();
2857 res
= show_isis_database(vty
, json
, id
, uilevel
, vrf_name
, all_vrf
);
2859 vty_json(vty
, json
);
2865 * 'router openfabric' command
2867 DEFUN_NOSH (router_openfabric
,
2868 router_openfabric_cmd
,
2869 "router openfabric WORD",
2872 "ISO Routing area tag\n")
2875 return isis_area_get(vty
, argv
[idx_word
]->arg
);
2879 *'no router openfabric' command
2881 DEFUN (no_router_openfabric
,
2882 no_router_openfabric_cmd
,
2883 "no router openfabric WORD",
2887 "ISO Routing area tag\n")
2889 struct isis_area
*area
;
2890 const char *area_tag
;
2893 area_tag
= argv
[idx_word
]->arg
;
2894 area
= isis_area_lookup(area_tag
, VRF_DEFAULT
);
2896 zlog_warn("%s: could not find area with area-tag %s",
2897 __func__
, area_tag
);
2898 return CMD_ERR_NO_MATCH
;
2901 isis_area_destroy(area
);
2904 #endif /* ifdef FABRICD */
2912 "A Network Entity Title for this process (OSI only)\n"
2913 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
2916 return area_net_title(vty
, argv
[idx_word
]->arg
);
2926 "A Network Entity Title for this process (OSI only)\n"
2927 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
2930 return area_clear_net_title(vty
, argv
[idx_word
]->arg
);
2932 #endif /* ifdef FABRICD */
2934 DEFUN (isis_topology
,
2936 "topology " ISIS_MT_NAMES
" [overload]",
2937 "Configure IS-IS topologies\n"
2938 ISIS_MT_DESCRIPTIONS
2939 "Set overload bit for topology\n")
2941 VTY_DECLVAR_CONTEXT(isis_area
, area
);
2943 const char *arg
= argv
[1]->arg
;
2944 uint16_t mtid
= isis_str2mtid(arg
);
2946 if (area
->oldmetric
) {
2948 "Multi topology IS-IS can only be used with wide metrics\n");
2949 return CMD_WARNING_CONFIG_FAILED
;
2952 if (mtid
== (uint16_t)-1) {
2953 vty_out(vty
, "Don't know topology '%s'\n", arg
);
2954 return CMD_WARNING_CONFIG_FAILED
;
2956 if (mtid
== ISIS_MT_IPV4_UNICAST
) {
2957 vty_out(vty
, "Cannot configure IPv4 unicast topology\n");
2958 return CMD_WARNING_CONFIG_FAILED
;
2961 area_set_mt_enabled(area
, mtid
, true);
2962 area_set_mt_overload(area
, mtid
, (argc
== 3));
2966 DEFUN (no_isis_topology
,
2967 no_isis_topology_cmd
,
2968 "no topology " ISIS_MT_NAMES
" [overload]",
2970 "Configure IS-IS topologies\n"
2971 ISIS_MT_DESCRIPTIONS
2972 "Set overload bit for topology\n")
2974 VTY_DECLVAR_CONTEXT(isis_area
, area
);
2976 const char *arg
= argv
[2]->arg
;
2977 uint16_t mtid
= isis_str2mtid(arg
);
2979 if (area
->oldmetric
) {
2981 "Multi topology IS-IS can only be used with wide metrics\n");
2982 return CMD_WARNING_CONFIG_FAILED
;
2985 if (mtid
== (uint16_t)-1) {
2986 vty_out(vty
, "Don't know topology '%s'\n", arg
);
2987 return CMD_WARNING_CONFIG_FAILED
;
2989 if (mtid
== ISIS_MT_IPV4_UNICAST
) {
2990 vty_out(vty
, "Cannot configure IPv4 unicast topology\n");
2991 return CMD_WARNING_CONFIG_FAILED
;
2994 area_set_mt_enabled(area
, mtid
, false);
2995 area_set_mt_overload(area
, mtid
, false);
2998 #endif /* ifdef FABRICD */
3000 void isis_area_lsp_mtu_set(struct isis_area
*area
, unsigned int lsp_mtu
)
3002 area
->lsp_mtu
= lsp_mtu
;
3003 lsp_regenerate_schedule(area
, IS_LEVEL_1_AND_2
, 1);
3006 static int isis_area_passwd_set(struct isis_area
*area
, int level
,
3007 uint8_t passwd_type
, const char *passwd
,
3010 struct isis_passwd
*dest
;
3011 struct isis_passwd modified
;
3014 assert((level
== IS_LEVEL_1
) || (level
== IS_LEVEL_2
));
3015 dest
= (level
== IS_LEVEL_1
) ? &area
->area_passwd
3016 : &area
->domain_passwd
;
3017 memset(&modified
, 0, sizeof(modified
));
3019 if (passwd_type
!= ISIS_PASSWD_TYPE_UNUSED
) {
3023 len
= strlen(passwd
);
3028 strlcpy((char *)modified
.passwd
, passwd
,
3029 sizeof(modified
.passwd
));
3030 modified
.type
= passwd_type
;
3031 modified
.snp_auth
= snp_auth
;
3034 if (memcmp(&modified
, dest
, sizeof(modified
))) {
3035 memcpy(dest
, &modified
, sizeof(modified
));
3036 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
3042 int isis_area_passwd_unset(struct isis_area
*area
, int level
)
3044 return isis_area_passwd_set(area
, level
, ISIS_PASSWD_TYPE_UNUSED
, NULL
,
3048 int isis_area_passwd_cleartext_set(struct isis_area
*area
, int level
,
3049 const char *passwd
, uint8_t snp_auth
)
3051 return isis_area_passwd_set(area
, level
, ISIS_PASSWD_TYPE_CLEARTXT
,
3055 int isis_area_passwd_hmac_md5_set(struct isis_area
*area
, int level
,
3056 const char *passwd
, uint8_t snp_auth
)
3058 return isis_area_passwd_set(area
, level
, ISIS_PASSWD_TYPE_HMAC_MD5
,
3062 void isis_area_invalidate_routes(struct isis_area
*area
, int levels
)
3064 for (int level
= ISIS_LEVEL1
; level
<= ISIS_LEVEL2
; level
++) {
3065 if (!(level
& levels
))
3067 for (int tree
= SPFTREE_IPV4
; tree
< SPFTREE_COUNT
; tree
++) {
3068 isis_spf_invalidate_routes(
3069 area
->spftree
[tree
][level
- 1]);
3074 void isis_area_verify_routes(struct isis_area
*area
)
3076 for (int tree
= SPFTREE_IPV4
; tree
< SPFTREE_COUNT
; tree
++)
3077 isis_spf_verify_routes(area
, area
->spftree
[tree
]);
3080 void isis_area_switchover_routes(struct isis_area
*area
, int family
,
3081 union g_addr
*nexthop_ip
, ifindex_t ifindex
,
3086 /* TODO SPFTREE_DSTSRC */
3087 if (family
== AF_INET
)
3088 tree
= SPFTREE_IPV4
;
3089 else if (family
== AF_INET6
)
3090 tree
= SPFTREE_IPV6
;
3094 isis_spf_switchover_routes(area
, area
->spftree
[tree
], family
,
3095 nexthop_ip
, ifindex
, level
);
3099 static void area_resign_level(struct isis_area
*area
, int level
)
3101 isis_area_invalidate_routes(area
, level
);
3102 isis_area_verify_routes(area
);
3104 lsp_db_fini(&area
->lspdb
[level
- 1]);
3106 for (int tree
= SPFTREE_IPV4
; tree
< SPFTREE_COUNT
; tree
++) {
3107 if (area
->spftree
[tree
][level
- 1]) {
3108 isis_spftree_del(area
->spftree
[tree
][level
- 1]);
3109 area
->spftree
[tree
][level
- 1] = NULL
;
3113 if (area
->spf_timer
[level
- 1])
3114 isis_spf_timer_free(EVENT_ARG(area
->spf_timer
[level
- 1]));
3116 EVENT_OFF(area
->spf_timer
[level
- 1]);
3119 "ISIS (%s): Resigned from L%d - canceling LSP regeneration timer.",
3120 area
->area_tag
, level
);
3121 EVENT_OFF(area
->t_lsp_refresh
[level
- 1]);
3122 area
->lsp_regenerate_pending
[level
- 1] = 0;
3125 void isis_area_is_type_set(struct isis_area
*area
, int is_type
)
3127 struct listnode
*node
;
3128 struct isis_circuit
*circuit
;
3130 if (IS_DEBUG_EVENTS
)
3131 zlog_debug("ISIS-Evt (%s) system type change %s -> %s",
3132 area
->area_tag
, circuit_t2string(area
->is_type
),
3133 circuit_t2string(is_type
));
3135 if (area
->is_type
== is_type
)
3136 return; /* No change */
3138 switch (area
->is_type
) {
3140 if (is_type
== IS_LEVEL_2
)
3141 area_resign_level(area
, IS_LEVEL_1
);
3143 lsp_db_init(&area
->lspdb
[1]);
3146 case IS_LEVEL_1_AND_2
:
3147 if (is_type
== IS_LEVEL_1
)
3148 area_resign_level(area
, IS_LEVEL_2
);
3150 area_resign_level(area
, IS_LEVEL_1
);
3154 if (is_type
== IS_LEVEL_1
)
3155 area_resign_level(area
, IS_LEVEL_2
);
3157 lsp_db_init(&area
->lspdb
[0]);
3164 area
->is_type
= is_type
;
3167 * If area's IS type is strict Level-1 or Level-2, override circuit's
3168 * IS type. Otherwise use circuit's configured IS type.
3170 if (area
->is_type
!= IS_LEVEL_1_AND_2
) {
3171 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
, node
, circuit
))
3172 isis_circuit_is_type_set(circuit
, is_type
);
3174 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
, node
, circuit
))
3175 isis_circuit_is_type_set(circuit
, circuit
->is_type_config
);
3178 spftree_area_init(area
);
3180 if (listcount(area
->area_addrs
) > 0) {
3181 if (is_type
& IS_LEVEL_1
)
3182 lsp_generate(area
, IS_LEVEL_1
);
3183 if (is_type
& IS_LEVEL_2
)
3184 lsp_generate(area
, IS_LEVEL_2
);
3186 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
3191 void isis_area_metricstyle_set(struct isis_area
*area
, bool old_metric
,
3194 area
->oldmetric
= old_metric
;
3195 area
->newmetric
= new_metric
;
3196 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
3199 void isis_area_overload_bit_set(struct isis_area
*area
, bool overload_bit
)
3201 char new_overload_bit
= overload_bit
? LSPBIT_OL
: 0;
3203 if (new_overload_bit
!= area
->overload_bit
) {
3204 area
->overload_bit
= new_overload_bit
;
3205 if (new_overload_bit
) {
3206 area
->overload_counter
++;
3208 /* Cancel overload on startup timer if it's running */
3209 if (area
->t_overload_on_startup_timer
) {
3210 EVENT_OFF(area
->t_overload_on_startup_timer
);
3211 area
->t_overload_on_startup_timer
= NULL
;
3216 hook_call(isis_hook_db_overload
, area
);
3217 #endif /* ifndef FABRICD */
3219 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
3222 isis_notif_db_overload(area
, overload_bit
);
3223 #endif /* ifndef FABRICD */
3226 void isis_area_overload_on_startup_set(struct isis_area
*area
,
3227 uint32_t startup_time
)
3229 if (area
->overload_on_startup_time
!= startup_time
) {
3230 area
->overload_on_startup_time
= startup_time
;
3231 isis_restart_write_overload_time(area
, startup_time
);
3235 void config_end_lsp_generate(struct isis_area
*area
)
3237 if (listcount(area
->area_addrs
) > 0) {
3238 if (CHECK_FLAG(area
->is_type
, IS_LEVEL_1
))
3239 lsp_generate(area
, IS_LEVEL_1
);
3240 if (CHECK_FLAG(area
->is_type
, IS_LEVEL_2
))
3241 lsp_generate(area
, IS_LEVEL_2
);
3245 void isis_area_advertise_high_metrics_set(struct isis_area
*area
,
3246 bool advertise_high_metrics
)
3248 struct listnode
*node
;
3249 struct isis_circuit
*circuit
;
3251 char xpath
[XPATH_MAXLEN
];
3252 struct lyd_node
*dnode
;
3253 int configured_metric_l1
;
3254 int configured_metric_l2
;
3256 if (area
->advertise_high_metrics
== advertise_high_metrics
)
3259 if (advertise_high_metrics
) {
3260 if (area
->oldmetric
&& area
->newmetric
)
3261 max_metric
= ISIS_NARROW_METRIC_INFINITY
;
3262 else if (area
->newmetric
)
3263 max_metric
= MAX_WIDE_LINK_METRIC
;
3265 max_metric
= MAX_NARROW_LINK_METRIC
;
3267 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
, node
, circuit
)) {
3268 isis_circuit_metric_set(circuit
, IS_LEVEL_1
,
3270 isis_circuit_metric_set(circuit
, IS_LEVEL_2
,
3274 area
->advertise_high_metrics
= true;
3276 area
->advertise_high_metrics
= false;
3277 for (ALL_LIST_ELEMENTS_RO(area
->circuit_list
, node
, circuit
)) {
3278 /* Get configured metric */
3279 snprintf(xpath
, XPATH_MAXLEN
,
3280 "/frr-interface:lib/interface[name='%s']",
3281 circuit
->interface
->name
);
3282 dnode
= yang_dnode_get(running_config
->dnode
, xpath
);
3284 configured_metric_l1
= yang_dnode_get_uint32(
3285 dnode
, "./frr-isisd:isis/metric/level-1");
3286 configured_metric_l2
= yang_dnode_get_uint32(
3287 dnode
, "./frr-isisd:isis/metric/level-2");
3289 isis_circuit_metric_set(circuit
, IS_LEVEL_1
,
3290 configured_metric_l1
);
3291 isis_circuit_metric_set(circuit
, IS_LEVEL_2
,
3292 configured_metric_l2
);
3298 * Returns the path of the file (non-volatile memory) that contains restart
3301 char *isis_restart_filepath(void)
3303 static char filepath
[MAXPATHLEN
];
3304 snprintf(filepath
, sizeof(filepath
), ISISD_RESTART
, "");
3309 * Record in non-volatile memory the overload on startup time.
3311 void isis_restart_write_overload_time(struct isis_area
*isis_area
,
3312 uint32_t overload_time
)
3315 const char *area_name
;
3317 json_object
*json_areas
;
3318 json_object
*json_area
;
3320 filepath
= isis_restart_filepath();
3321 area_name
= isis_area
->area_tag
;
3323 json
= json_object_from_file(filepath
);
3325 json
= json_object_new_object();
3327 json_object_object_get_ex(json
, "areas", &json_areas
);
3329 json_areas
= json_object_new_object();
3330 json_object_object_add(json
, "areas", json_areas
);
3333 json_object_object_get_ex(json_areas
, area_name
, &json_area
);
3335 json_area
= json_object_new_object();
3336 json_object_object_add(json_areas
, area_name
, json_area
);
3339 json_object_int_add(json_area
, "overload_time",
3340 isis_area
->overload_on_startup_time
);
3341 json_object_to_file_ext(filepath
, json
, JSON_C_TO_STRING_PRETTY
);
3342 json_object_free(json
);
3346 * Fetch from non-volatile memory the overload on startup time.
3348 uint32_t isis_restart_read_overload_time(struct isis_area
*isis_area
)
3351 const char *area_name
;
3353 json_object
*json_areas
;
3354 json_object
*json_area
;
3355 json_object
*json_overload_time
;
3356 uint32_t overload_time
= 0;
3358 filepath
= isis_restart_filepath();
3359 area_name
= isis_area
->area_tag
;
3361 json
= json_object_from_file(filepath
);
3363 json
= json_object_new_object();
3365 json_object_object_get_ex(json
, "areas", &json_areas
);
3367 json_areas
= json_object_new_object();
3368 json_object_object_add(json
, "areas", json_areas
);
3371 json_object_object_get_ex(json_areas
, area_name
, &json_area
);
3373 json_area
= json_object_new_object();
3374 json_object_object_add(json_areas
, area_name
, json_area
);
3377 json_object_object_get_ex(json_area
, "overload_time",
3378 &json_overload_time
);
3379 if (json_overload_time
) {
3380 overload_time
= json_object_get_int(json_overload_time
);
3383 json_object_object_del(json_areas
, area_name
);
3385 json_object_to_file_ext(filepath
, json
, JSON_C_TO_STRING_PRETTY
);
3386 json_object_free(json
);
3388 return overload_time
;
3391 void isis_area_attached_bit_send_set(struct isis_area
*area
, bool attached_bit
)
3394 if (attached_bit
!= area
->attached_bit_send
) {
3395 area
->attached_bit_send
= attached_bit
;
3396 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
3400 void isis_area_attached_bit_receive_set(struct isis_area
*area
,
3404 if (attached_bit
!= area
->attached_bit_rcv_ignore
) {
3405 area
->attached_bit_rcv_ignore
= attached_bit
;
3406 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 1);
3410 void isis_area_dynhostname_set(struct isis_area
*area
, bool dynhostname
)
3412 if (area
->dynhostname
!= dynhostname
) {
3413 area
->dynhostname
= dynhostname
;
3414 lsp_regenerate_schedule(area
, IS_LEVEL_1
| IS_LEVEL_2
, 0);
3418 void isis_area_max_lsp_lifetime_set(struct isis_area
*area
, int level
,
3419 uint16_t max_lsp_lifetime
)
3421 assert((level
== IS_LEVEL_1
) || (level
== IS_LEVEL_2
));
3423 if (area
->max_lsp_lifetime
[level
- 1] == max_lsp_lifetime
)
3426 area
->max_lsp_lifetime
[level
- 1] = max_lsp_lifetime
;
3427 lsp_regenerate_schedule(area
, level
, 1);
3430 void isis_area_lsp_refresh_set(struct isis_area
*area
, int level
,
3431 uint16_t lsp_refresh
)
3433 assert((level
== IS_LEVEL_1
) || (level
== IS_LEVEL_2
));
3435 if (area
->lsp_refresh
[level
- 1] == lsp_refresh
)
3438 area
->lsp_refresh
[level
- 1] = lsp_refresh
;
3439 lsp_regenerate_schedule(area
, level
, 1);
3443 DEFUN (log_adj_changes
,
3444 log_adj_changes_cmd
,
3445 "log-adjacency-changes",
3446 "Log changes in adjacency state\n")
3448 VTY_DECLVAR_CONTEXT(isis_area
, area
);
3450 area
->log_adj_changes
= 1;
3455 DEFUN (no_log_adj_changes
,
3456 no_log_adj_changes_cmd
,
3457 "no log-adjacency-changes",
3459 "Stop logging changes in adjacency state\n")
3461 VTY_DECLVAR_CONTEXT(isis_area
, area
);
3463 area
->log_adj_changes
= 0;
3467 #endif /* ifdef FABRICD */
3469 /* IS-IS configuration write function */
3470 static int isis_config_write(struct vty
*vty
)
3473 struct isis_area
*area
;
3474 struct listnode
*node
, *node2
, *inode
;
3478 vty_out(vty
, "IS-IS Routing Process not enabled\n");
3482 for (ALL_LIST_ELEMENTS_RO(im
->isis
, inode
, isis
)) {
3483 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
)) {
3484 /* ISIS - Area name */
3485 vty_out(vty
, "router " PROTO_NAME
" %s\n", area
->area_tag
);
3488 if (listcount(area
->area_addrs
) > 0) {
3489 struct iso_address
*area_addr
;
3490 for (ALL_LIST_ELEMENTS_RO(area
->area_addrs
,
3491 node2
, area_addr
)) {
3492 vty_out(vty
, " net %pISl\n", area_addr
);
3496 /* ISIS - Dynamic hostname - Defaults to true so only
3499 if (!area
->dynhostname
) {
3500 vty_out(vty
, " no hostname dynamic\n");
3503 /* ISIS - Metric-Style - when true displays wide */
3505 if (area
->newmetric
) {
3506 if (!area
->oldmetric
)
3507 vty_out(vty
, " metric-style wide\n");
3510 " metric-style transition\n");
3513 vty_out(vty
, " metric-style narrow\n");
3517 /* ISIS - overload-bit */
3518 if (area
->overload_bit
) {
3519 vty_out(vty
, " set-overload-bit\n");
3522 /* ISIS - Area is-type (level-1-2 is default) */
3524 if (area
->is_type
== IS_LEVEL_1
) {
3525 vty_out(vty
, " is-type level-1\n");
3527 } else if (area
->is_type
== IS_LEVEL_2
) {
3528 vty_out(vty
, " is-type level-2-only\n");
3532 write
+= isis_redist_config_write(vty
, area
, AF_INET
);
3533 write
+= isis_redist_config_write(vty
, area
, AF_INET6
);
3534 /* ISIS - Lsp generation interval */
3535 if (area
->lsp_gen_interval
[0]
3536 == area
->lsp_gen_interval
[1]) {
3537 if (area
->lsp_gen_interval
[0]
3538 != DEFAULT_MIN_LSP_GEN_INTERVAL
) {
3539 vty_out(vty
, " lsp-gen-interval %d\n",
3540 area
->lsp_gen_interval
[0]);
3544 if (area
->lsp_gen_interval
[0]
3545 != DEFAULT_MIN_LSP_GEN_INTERVAL
) {
3547 " lsp-gen-interval level-1 %d\n",
3548 area
->lsp_gen_interval
[0]);
3551 if (area
->lsp_gen_interval
[1]
3552 != DEFAULT_MIN_LSP_GEN_INTERVAL
) {
3554 " lsp-gen-interval level-2 %d\n",
3555 area
->lsp_gen_interval
[1]);
3559 /* ISIS - LSP lifetime */
3560 if (area
->max_lsp_lifetime
[0]
3561 == area
->max_lsp_lifetime
[1]) {
3562 if (area
->max_lsp_lifetime
[0]
3563 != DEFAULT_LSP_LIFETIME
) {
3564 vty_out(vty
, " max-lsp-lifetime %u\n",
3565 area
->max_lsp_lifetime
[0]);
3569 if (area
->max_lsp_lifetime
[0]
3570 != DEFAULT_LSP_LIFETIME
) {
3572 " max-lsp-lifetime level-1 %u\n",
3573 area
->max_lsp_lifetime
[0]);
3576 if (area
->max_lsp_lifetime
[1]
3577 != DEFAULT_LSP_LIFETIME
) {
3579 " max-lsp-lifetime level-2 %u\n",
3580 area
->max_lsp_lifetime
[1]);
3584 /* ISIS - LSP refresh interval */
3585 if (area
->lsp_refresh
[0] == area
->lsp_refresh
[1]) {
3586 if (area
->lsp_refresh
[0]
3587 != DEFAULT_MAX_LSP_GEN_INTERVAL
) {
3589 " lsp-refresh-interval %u\n",
3590 area
->lsp_refresh
[0]);
3594 if (area
->lsp_refresh
[0]
3595 != DEFAULT_MAX_LSP_GEN_INTERVAL
) {
3597 " lsp-refresh-interval level-1 %u\n",
3598 area
->lsp_refresh
[0]);
3601 if (area
->lsp_refresh
[1]
3602 != DEFAULT_MAX_LSP_GEN_INTERVAL
) {
3604 " lsp-refresh-interval level-2 %u\n",
3605 area
->lsp_refresh
[1]);
3609 if (area
->lsp_mtu
!= DEFAULT_LSP_MTU
) {
3610 vty_out(vty
, " lsp-mtu %u\n", area
->lsp_mtu
);
3613 if (area
->purge_originator
) {
3614 vty_out(vty
, " purge-originator\n");
3618 /* Minimum SPF interval. */
3619 if (area
->min_spf_interval
[0]
3620 == area
->min_spf_interval
[1]) {
3621 if (area
->min_spf_interval
[0]
3622 != MINIMUM_SPF_INTERVAL
) {
3623 vty_out(vty
, " spf-interval %d\n",
3624 area
->min_spf_interval
[0]);
3628 if (area
->min_spf_interval
[0]
3629 != MINIMUM_SPF_INTERVAL
) {
3631 " spf-interval level-1 %d\n",
3632 area
->min_spf_interval
[0]);
3635 if (area
->min_spf_interval
[1]
3636 != MINIMUM_SPF_INTERVAL
) {
3638 " spf-interval level-2 %d\n",
3639 area
->min_spf_interval
[1]);
3644 /* IETF SPF interval */
3645 if (area
->spf_delay_ietf
[0]) {
3647 " spf-delay-ietf init-delay %ld short-delay %ld long-delay %ld holddown %ld time-to-learn %ld\n",
3648 spf_backoff_init_delay(
3649 area
->spf_delay_ietf
[0]),
3650 spf_backoff_short_delay(
3651 area
->spf_delay_ietf
[0]),
3652 spf_backoff_long_delay(
3653 area
->spf_delay_ietf
[0]),
3654 spf_backoff_holddown(
3655 area
->spf_delay_ietf
[0]),
3656 spf_backoff_timetolearn(
3657 area
->spf_delay_ietf
[0]));
3661 /* Authentication passwords. */
3662 if (area
->area_passwd
.type
3663 == ISIS_PASSWD_TYPE_HMAC_MD5
) {
3664 vty_out(vty
, " area-password md5 %s",
3665 area
->area_passwd
.passwd
);
3666 if (CHECK_FLAG(area
->area_passwd
.snp_auth
,
3668 vty_out(vty
, " authenticate snp ");
3670 area
->area_passwd
.snp_auth
,
3672 vty_out(vty
, "validate");
3674 vty_out(vty
, "send-only");
3678 } else if (area
->area_passwd
.type
3679 == ISIS_PASSWD_TYPE_CLEARTXT
) {
3680 vty_out(vty
, " area-password clear %s",
3681 area
->area_passwd
.passwd
);
3682 if (CHECK_FLAG(area
->area_passwd
.snp_auth
,
3684 vty_out(vty
, " authenticate snp ");
3686 area
->area_passwd
.snp_auth
,
3688 vty_out(vty
, "validate");
3690 vty_out(vty
, "send-only");
3695 if (area
->domain_passwd
.type
3696 == ISIS_PASSWD_TYPE_HMAC_MD5
) {
3697 vty_out(vty
, " domain-password md5 %s",
3698 area
->domain_passwd
.passwd
);
3699 if (CHECK_FLAG(area
->domain_passwd
.snp_auth
,
3701 vty_out(vty
, " authenticate snp ");
3702 if (CHECK_FLAG(area
->domain_passwd
3705 vty_out(vty
, "validate");
3707 vty_out(vty
, "send-only");
3711 } else if (area
->domain_passwd
.type
3712 == ISIS_PASSWD_TYPE_CLEARTXT
) {
3713 vty_out(vty
, " domain-password clear %s",
3714 area
->domain_passwd
.passwd
);
3715 if (CHECK_FLAG(area
->domain_passwd
.snp_auth
,
3717 vty_out(vty
, " authenticate snp ");
3718 if (CHECK_FLAG(area
->domain_passwd
3721 vty_out(vty
, "validate");
3723 vty_out(vty
, "send-only");
3729 if (area
->log_adj_changes
) {
3730 vty_out(vty
, " log-adjacency-changes\n");
3734 write
+= area_write_mt_settings(area
, vty
);
3735 write
+= fabricd_write_settings(area
, vty
);
3737 vty_out(vty
, "exit\n");
3744 struct cmd_node router_node
= {
3745 .name
= "openfabric",
3746 .node
= OPENFABRIC_NODE
,
3747 .parent_node
= CONFIG_NODE
,
3748 .prompt
= "%s(config-router)# ",
3749 .config_write
= isis_config_write
,
3752 /* IS-IS configuration write function */
3753 static int isis_config_write(struct vty
*vty
)
3756 struct lyd_node
*dnode
;
3758 dnode
= yang_dnode_get(running_config
->dnode
, "/frr-isisd:isis");
3760 nb_cli_show_dnode_cmds(vty
, dnode
, false);
3767 struct cmd_node router_node
= {
3770 .parent_node
= CONFIG_NODE
,
3771 .prompt
= "%s(config-router)# ",
3772 .config_write
= isis_config_write
,
3774 #endif /* ifdef FABRICD */
3776 void isis_init(void)
3778 /* Install IS-IS top node */
3779 install_node(&router_node
);
3781 install_element(VIEW_NODE
, &show_isis_summary_cmd
);
3783 install_element(VIEW_NODE
, &show_isis_spf_ietf_cmd
);
3785 install_element(VIEW_NODE
, &show_isis_interface_cmd
);
3786 install_element(VIEW_NODE
, &show_isis_interface_detail_cmd
);
3787 install_element(VIEW_NODE
, &show_isis_interface_arg_cmd
);
3789 install_element(VIEW_NODE
, &show_isis_neighbor_cmd
);
3790 install_element(VIEW_NODE
, &show_isis_neighbor_detail_cmd
);
3791 install_element(VIEW_NODE
, &show_isis_neighbor_arg_cmd
);
3792 install_element(ENABLE_NODE
, &clear_isis_neighbor_cmd
);
3793 install_element(ENABLE_NODE
, &clear_isis_neighbor_arg_cmd
);
3795 install_element(VIEW_NODE
, &show_hostname_cmd
);
3796 install_element(VIEW_NODE
, &show_database_cmd
);
3798 install_element(ENABLE_NODE
, &show_debugging_isis_cmd
);
3800 install_node(&debug_node
);
3802 install_element(ENABLE_NODE
, &debug_isis_adj_cmd
);
3803 install_element(ENABLE_NODE
, &no_debug_isis_adj_cmd
);
3804 install_element(ENABLE_NODE
, &debug_isis_tx_queue_cmd
);
3805 install_element(ENABLE_NODE
, &no_debug_isis_tx_queue_cmd
);
3806 install_element(ENABLE_NODE
, &debug_isis_flooding_cmd
);
3807 install_element(ENABLE_NODE
, &no_debug_isis_flooding_cmd
);
3808 install_element(ENABLE_NODE
, &debug_isis_snp_cmd
);
3809 install_element(ENABLE_NODE
, &no_debug_isis_snp_cmd
);
3810 install_element(ENABLE_NODE
, &debug_isis_upd_cmd
);
3811 install_element(ENABLE_NODE
, &no_debug_isis_upd_cmd
);
3812 install_element(ENABLE_NODE
, &debug_isis_spfevents_cmd
);
3813 install_element(ENABLE_NODE
, &no_debug_isis_spfevents_cmd
);
3814 install_element(ENABLE_NODE
, &debug_isis_srevents_cmd
);
3815 install_element(ENABLE_NODE
, &no_debug_isis_srevents_cmd
);
3816 install_element(ENABLE_NODE
, &debug_isis_teevents_cmd
);
3817 install_element(ENABLE_NODE
, &no_debug_isis_teevents_cmd
);
3818 install_element(ENABLE_NODE
, &debug_isis_lfa_cmd
);
3819 install_element(ENABLE_NODE
, &no_debug_isis_lfa_cmd
);
3820 install_element(ENABLE_NODE
, &debug_isis_rtevents_cmd
);
3821 install_element(ENABLE_NODE
, &no_debug_isis_rtevents_cmd
);
3822 install_element(ENABLE_NODE
, &debug_isis_events_cmd
);
3823 install_element(ENABLE_NODE
, &no_debug_isis_events_cmd
);
3824 install_element(ENABLE_NODE
, &debug_isis_packet_dump_cmd
);
3825 install_element(ENABLE_NODE
, &no_debug_isis_packet_dump_cmd
);
3826 install_element(ENABLE_NODE
, &debug_isis_lsp_gen_cmd
);
3827 install_element(ENABLE_NODE
, &no_debug_isis_lsp_gen_cmd
);
3828 install_element(ENABLE_NODE
, &debug_isis_lsp_sched_cmd
);
3829 install_element(ENABLE_NODE
, &no_debug_isis_lsp_sched_cmd
);
3830 install_element(ENABLE_NODE
, &debug_isis_bfd_cmd
);
3831 install_element(ENABLE_NODE
, &no_debug_isis_bfd_cmd
);
3832 install_element(ENABLE_NODE
, &debug_isis_ldp_sync_cmd
);
3833 install_element(ENABLE_NODE
, &no_debug_isis_ldp_sync_cmd
);
3835 install_element(CONFIG_NODE
, &debug_isis_adj_cmd
);
3836 install_element(CONFIG_NODE
, &no_debug_isis_adj_cmd
);
3837 install_element(CONFIG_NODE
, &debug_isis_tx_queue_cmd
);
3838 install_element(CONFIG_NODE
, &no_debug_isis_tx_queue_cmd
);
3839 install_element(CONFIG_NODE
, &debug_isis_flooding_cmd
);
3840 install_element(CONFIG_NODE
, &no_debug_isis_flooding_cmd
);
3841 install_element(CONFIG_NODE
, &debug_isis_snp_cmd
);
3842 install_element(CONFIG_NODE
, &no_debug_isis_snp_cmd
);
3843 install_element(CONFIG_NODE
, &debug_isis_upd_cmd
);
3844 install_element(CONFIG_NODE
, &no_debug_isis_upd_cmd
);
3845 install_element(CONFIG_NODE
, &debug_isis_spfevents_cmd
);
3846 install_element(CONFIG_NODE
, &no_debug_isis_spfevents_cmd
);
3847 install_element(CONFIG_NODE
, &debug_isis_srevents_cmd
);
3848 install_element(CONFIG_NODE
, &no_debug_isis_srevents_cmd
);
3849 install_element(CONFIG_NODE
, &debug_isis_teevents_cmd
);
3850 install_element(CONFIG_NODE
, &no_debug_isis_teevents_cmd
);
3851 install_element(CONFIG_NODE
, &debug_isis_lfa_cmd
);
3852 install_element(CONFIG_NODE
, &no_debug_isis_lfa_cmd
);
3853 install_element(CONFIG_NODE
, &debug_isis_rtevents_cmd
);
3854 install_element(CONFIG_NODE
, &no_debug_isis_rtevents_cmd
);
3855 install_element(CONFIG_NODE
, &debug_isis_events_cmd
);
3856 install_element(CONFIG_NODE
, &no_debug_isis_events_cmd
);
3857 install_element(CONFIG_NODE
, &debug_isis_packet_dump_cmd
);
3858 install_element(CONFIG_NODE
, &no_debug_isis_packet_dump_cmd
);
3859 install_element(CONFIG_NODE
, &debug_isis_lsp_gen_cmd
);
3860 install_element(CONFIG_NODE
, &no_debug_isis_lsp_gen_cmd
);
3861 install_element(CONFIG_NODE
, &debug_isis_lsp_sched_cmd
);
3862 install_element(CONFIG_NODE
, &no_debug_isis_lsp_sched_cmd
);
3863 install_element(CONFIG_NODE
, &debug_isis_bfd_cmd
);
3864 install_element(CONFIG_NODE
, &no_debug_isis_bfd_cmd
);
3865 install_element(CONFIG_NODE
, &debug_isis_ldp_sync_cmd
);
3866 install_element(CONFIG_NODE
, &no_debug_isis_ldp_sync_cmd
);
3868 install_default(ROUTER_NODE
);
3871 install_element(CONFIG_NODE
, &router_openfabric_cmd
);
3872 install_element(CONFIG_NODE
, &no_router_openfabric_cmd
);
3874 install_element(ROUTER_NODE
, &net_cmd
);
3875 install_element(ROUTER_NODE
, &no_net_cmd
);
3877 install_element(ROUTER_NODE
, &isis_topology_cmd
);
3878 install_element(ROUTER_NODE
, &no_isis_topology_cmd
);
3880 install_element(ROUTER_NODE
, &log_adj_changes_cmd
);
3881 install_element(ROUTER_NODE
, &no_log_adj_changes_cmd
);
3882 #endif /* ifdef FABRICD */
3884 spf_backoff_cmd_init();