summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_nexthop.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2021-01-28 02:03:03 +0100
committerDonald Sharp <sharpd@nvidia.com>2021-01-29 13:54:58 +0100
commitdf2a41a9bf6a9c2efb72fab1df57b6654a8d55b4 (patch)
tree4b965befb172b8e0b6eeddc83f495b9ae4404969 /bgpd/bgp_nexthop.c
parentbgpd: Add bgp_nexthop_dump_bnc_flags (diff)
downloadfrr-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.c22
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;
+}