From f0061c9c3f1f64ebe8794959154bcc03ee167e6c Mon Sep 17 00:00:00 2001 From: Mobashshera Rasool Date: Wed, 28 Jun 2023 03:21:35 -0700 Subject: [PATCH] pimd, pim6d: Added pimEnabled field in "show ip pim nexthop json" cli #13715 --- pimd/pim_cmd_common.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c index 5b905a9536f9..84744669f111 100644 --- a/pimd/pim_cmd_common.c +++ b/pimd/pim_cmd_common.c @@ -2832,6 +2832,8 @@ static int pim_print_json_pnc_cache_walkcb(struct hash_bucket *backet, json_object *json_row = NULL; json_object *json_ifp = NULL; json_object *json_arr = NULL; + struct pim_interface *pim_ifp = NULL; + bool pim_enable = false; for (nh_node = pnc->nexthop; nh_node; nh_node = nh_node->next) { first_ifindex = nh_node->ifindex; @@ -2851,6 +2853,14 @@ static int pim_print_json_pnc_cache_walkcb(struct hash_bucket *backet, json_ifp = json_object_new_object(); json_object_string_add(json_ifp, "interface", ifp ? ifp->name : "NULL"); + + if (ifp) + pim_ifp = ifp->info; + + if (pim_ifp && pim_ifp->pim_enable) + pim_enable = true; + + json_object_boolean_add(json_ifp, "pimEnabled", pim_enable); #if PIM_IPV == 4 json_object_string_addf(json_ifp, "nexthop", "%pI4", &nh_node->gate.ipv4);