From eb918dbd25cef3d721c59e65917371806e1019d3 Mon Sep 17 00:00:00 2001 From: Carmine Scarpitta Date: Mon, 5 Dec 2022 17:06:04 +0100 Subject: [PATCH] isisd: Add nb command to show if SRv6 is enabled Add a northbound command to show whether SRv6 is enabled or not. Signed-off-by: Carmine Scarpitta --- isisd/isis_cli.c | 9 +++++++++ isisd/isis_nb.c | 1 + isisd/isis_nb.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c index 6f53ab479f..b455352699 100644 --- a/isisd/isis_cli.c +++ b/isisd/isis_cli.c @@ -2037,6 +2037,15 @@ void cli_show_isis_prefix_sid_algorithm(struct vty *vty, vty_out(vty, "\n"); } +void cli_show_isis_srv6_enabled(struct vty *vty, const struct lyd_node *dnode, + bool show_defaults) +{ + if (!yang_dnode_get_bool(dnode, NULL)) + vty_out(vty, " no"); + + vty_out(vty, " segment-routing srv6\n"); +} + /* * XPath: /frr-isisd:isis/instance/fast-reroute/level-{1,2}/lfa/priority-limit */ diff --git a/isisd/isis_nb.c b/isisd/isis_nb.c index dd0b79b95b..4c42d18eb7 100644 --- a/isisd/isis_nb.c +++ b/isisd/isis_nb.c @@ -864,6 +864,7 @@ const struct frr_yang_module_info frr_isisd_info = { .xpath = "/frr-isisd:isis/instance/segment-routing-srv6/enabled", .cbs = { .modify = isis_instance_segment_routing_srv6_enabled_modify, + .cli_show = cli_show_isis_srv6_enabled, }, }, { diff --git a/isisd/isis_nb.h b/isisd/isis_nb.h index 1cc4a5ddb4..7289677000 100644 --- a/isisd/isis_nb.h +++ b/isisd/isis_nb.h @@ -324,6 +324,8 @@ int isis_instance_flex_algo_affinity_mapping_value_destroy( struct nb_cb_destroy_args *args); int isis_instance_segment_routing_srv6_enabled_modify( struct nb_cb_modify_args *args); +void cli_show_isis_srv6_enabled(struct vty *vty, const struct lyd_node *dnode, + bool show_defaults); int isis_instance_mpls_ldp_sync_destroy(struct nb_cb_destroy_args *args); int isis_instance_mpls_ldp_sync_create(struct nb_cb_create_args *args); int isis_instance_mpls_ldp_sync_holddown_modify(struct nb_cb_modify_args *args); -- 2.39.5