Skip to content

Commit

Permalink
zebra: Expose _route_entry_dump_nh so it can be used.
Browse files Browse the repository at this point in the history
Expose this helper function so it can be used in zebra_nhg.c

Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Sep 12, 2024
1 parent 9fce29c commit aa96bcc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions zebra/rib.h
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,10 @@ extern pid_t pid;

extern uint32_t rt_table_main_id;

void route_entry_dump_nh(const struct route_entry *re, const char *straddr,
const struct vrf *re_vrf,
const struct nexthop *nexthop);

/* Name of hook calls */
#define ZEBRA_ON_RIB_PROCESS_HOOK_CALL "on_rib_process_dplane_results"

Expand Down
9 changes: 4 additions & 5 deletions zebra/zebra_rib.c
Original file line number Diff line number Diff line change
Expand Up @@ -4118,9 +4118,8 @@ void rib_delnode(struct route_node *rn, struct route_entry *re)
/*
* Helper that debugs a single nexthop within a route-entry
*/
static void _route_entry_dump_nh(const struct route_entry *re,
const char *straddr, const struct vrf *re_vrf,
const struct nexthop *nexthop)
void route_entry_dump_nh(const struct route_entry *re, const char *straddr,
const struct vrf *re_vrf, const struct nexthop *nexthop)
{
char nhname[PREFIX_STRLEN];
char backup_str[50];
Expand Down Expand Up @@ -4243,15 +4242,15 @@ void _route_entry_dump(const char *func, union prefixconstptr pp,

/* Dump nexthops */
for (ALL_NEXTHOPS(re->nhe->nhg, nexthop))
_route_entry_dump_nh(re, straddr, vrf, nexthop);
route_entry_dump_nh(re, straddr, vrf, nexthop);

if (zebra_nhg_get_backup_nhg(re->nhe)) {
zlog_debug("%s(%s): backup nexthops:", straddr,
VRF_LOGNAME(vrf));

nhg = zebra_nhg_get_backup_nhg(re->nhe);
for (ALL_NEXTHOPS_PTR(nhg, nexthop))
_route_entry_dump_nh(re, straddr, vrf, nexthop);
route_entry_dump_nh(re, straddr, vrf, nexthop);
}

zlog_debug("%s(%s): dump complete", straddr, VRF_LOGNAME(vrf));
Expand Down

0 comments on commit aa96bcc

Please sign in to comment.