Skip to content

Commit

Permalink
pimd, pim6d: Added pimEnabled field in "show ip pim nexthop json" cli #…
Browse files Browse the repository at this point in the history
  • Loading branch information
mobash-rasool committed Jun 28, 2023
1 parent f3dca82 commit f0061c9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pimd/pim_cmd_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit f0061c9

Please sign in to comment.