summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-02-23 20:22:33 +0100
committerDonald Sharp <sharpd@nvidia.com>2023-02-23 20:23:24 +0100
commit0884f1644b19dd6e70a48a6c29fd5d201b264d6d (patch)
treeeff771648f169a737f0a4bc9f176b52c06a6d5ed /lib
parentMerge pull request #12879 from opensourcerouting/pim-ssm-no-rp (diff)
downloadfrr-0884f1644b19dd6e70a48a6c29fd5d201b264d6d.tar.xz
frr-0884f1644b19dd6e70a48a6c29fd5d201b264d6d.zip
lib, bgpd: bmp was not specifying l2vpn afi
The l2vpn afi was not being properly displayed when a show run was being issued. Add a afi2str_lower function and use it. Fixes: #12867 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/prefix.c17
-rw-r--r--lib/prefix.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/prefix.c b/lib/prefix.c
index b3d81aa24..a6aae08a6 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -123,6 +123,23 @@ afi_t family2afi(int family)
return 0;
}
+const char *afi2str_lower(afi_t afi)
+{
+ switch (afi) {
+ case AFI_IP:
+ return "ipv4";
+ case AFI_IP6:
+ return "ipv6";
+ case AFI_L2VPN:
+ return "l2vpn";
+ case AFI_MAX:
+ case AFI_UNSPEC:
+ return "bad-value";
+ }
+
+ assert(!"Reached end of function we should never reach");
+}
+
const char *afi2str(afi_t afi)
{
switch (afi) {
diff --git a/lib/prefix.h b/lib/prefix.h
index a6435be1b..9c5728370 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -383,6 +383,7 @@ extern afi_t family2afi(int);
extern const char *family2str(int family);
extern const char *safi2str(safi_t safi);
extern const char *afi2str(afi_t afi);
+extern const char *afi2str_lower(afi_t afi);
static inline afi_t prefix_afi(union prefixconstptr pu)
{