zebra: Setup structure for opaque data to be displayed

Setup the output mechanism for opaque data to be displayed
to the end operator.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2020-12-05 07:06:38 -05:00
parent a29a60016e
commit 80a6ee90c3

View File

@ -419,6 +419,18 @@ static void show_nexthop_detail_helper(struct vty *vty,
}
}
static void zebra_show_ip_route_opaque(struct vty *vty, struct route_entry *re,
struct json_object *json)
{
if (!re->opaque)
return;
switch (re->type) {
default:
break;
}
}
/* New RIB. Detailed information for IPv4 route. */
static void vty_show_ip_route_detail(struct vty *vty, struct route_node *rn,
int mcast, bool use_fib, bool show_ng)
@ -495,6 +507,8 @@ static void vty_show_ip_route_detail(struct vty *vty, struct route_node *rn,
if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_HAS_BACKUP))
show_nh_backup_helper(vty, re, nexthop);
}
zebra_show_ip_route_opaque(vty, re, NULL);
vty_out(vty, "\n");
}
}
@ -927,6 +941,7 @@ static void vty_show_ip_route(struct vty *vty, struct route_node *rn,
json_object_object_add(json_route, "backupNexthops",
json_nexthops);
}
zebra_show_ip_route_opaque(NULL, re, json_route);
json_object_array_add(json, json_route);
return;