From e6d08a89c7348d1af045b752473ad571020a8de9 Mon Sep 17 00:00:00 2001 From: Dmytro Shytyi Date: Thu, 6 Mar 2025 16:58:24 +0100 Subject: zebra: add rtadv information output in vtysh json Add to "show interface json" output multiple rtadv parameters. if_dump_vty() calls => hook_call(zebra_if_extra_info, vty, ifp); if_dump_vty_json() now do the same call, with additional parameter: hook_call(zebra_if_extra_info, vty, json_if, ifp); Signed-off-by: Dmytro Shytyi --- zebra/interface.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'zebra/interface.c') diff --git a/zebra/interface.c b/zebra/interface.c index 8080ba01de..fd1ea380a5 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -40,8 +40,8 @@ DEFINE_MTYPE_STATIC(ZEBRA, ZINFO, "Zebra Interface Information"); #define ZEBRA_PTM_SUPPORT -DEFINE_HOOK(zebra_if_extra_info, (struct vty * vty, struct interface *ifp), - (vty, ifp)); +DEFINE_HOOK(zebra_if_extra_info, (struct vty * vty, json_object *json_if, struct interface *ifp), + (vty, json_if, ifp)); DEFINE_MTYPE_STATIC(ZEBRA, ZIF_DESC, "Intf desc"); @@ -2846,7 +2846,7 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp) &iflp->rmt_ip, iflp->rmt_as); } - hook_call(zebra_if_extra_info, vty, ifp); + hook_call(zebra_if_extra_info, vty, NULL, ifp); if (listhead(ifp->nbr_connected)) vty_out(vty, " Neighbor address(s):\n"); @@ -3252,6 +3252,8 @@ static void if_dump_vty_json(struct vty *vty, struct interface *ifp, json_object_int_add(json_te, "neighborAsbrAs", iflp->rmt_as); } + hook_call(zebra_if_extra_info, vty, json_if, ifp); + if (listhead(ifp->nbr_connected)) { json_object *json_nbr_addrs; -- cgit v1.2.3