diff options
author | Donald Sharp <sharpd@nvidia.com> | 2021-01-28 02:03:03 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2021-01-29 13:54:58 +0100 |
commit | df2a41a9bf6a9c2efb72fab1df57b6654a8d55b4 (patch) | |
tree | 4b965befb172b8e0b6eeddc83f495b9ae4404969 /bgpd/bgp_nexthop.c | |
parent | bgpd: Add bgp_nexthop_dump_bnc_flags (diff) | |
download | frr-df2a41a9bf6a9c2efb72fab1df57b6654a8d55b4.tar.xz frr-df2a41a9bf6a9c2efb72fab1df57b6654a8d55b4.zip |
bgpd: Add `bgp_nexthop_dump_bnc_change_flags` function
Allow us to read what the change flags are instead of having
to look them up.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_nexthop.c')
-rw-r--r-- | bgpd/bgp_nexthop.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index dcada0468..b7f62ec0a 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -1046,3 +1046,25 @@ char *bgp_nexthop_dump_bnc_flags(struct bgp_nexthop_cache *bnc, char *buf, return buf; } + +char *bgp_nexthop_dump_bnc_change_flags(struct bgp_nexthop_cache *bnc, + char *buf, size_t len) +{ + if (bnc->flags == 0) { + snprintfrr(buf, len, "None "); + return buf; + } + + snprintfrr(buf, len, "%s%s%s", + CHECK_FLAG(bnc->change_flags, BGP_NEXTHOP_CHANGED) + ? "Changed " + : "", + CHECK_FLAG(bnc->change_flags, BGP_NEXTHOP_METRIC_CHANGED) + ? "Metric " + : "", + CHECK_FLAG(bnc->change_flags, BGP_NEXTHOP_CONNECTED_CHANGED) + ? "Connected " + : ""); + + return buf; +} |