summaryrefslogtreecommitdiffstats
path: root/lib/prefix.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/prefix.c')
-rw-r--r--lib/prefix.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/prefix.c b/lib/prefix.c
index 936e9fcb..3e4ca167 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -223,6 +223,22 @@ family2afi (int family)
return 0;
}
+const char *
+safi2str(safi_t safi)
+{
+ switch (safi) {
+ case SAFI_UNICAST:
+ return "unicast";
+ case SAFI_MULTICAST:
+ return "multicast";
+ case SAFI_ENCAP:
+ return "encap";
+ case SAFI_MPLS_VPN:
+ return "vpn";
+ }
+ return NULL;
+}
+
/* If n includes p prefix then return 1 else return 0. */
int
prefix_match (const struct prefix *n, const struct prefix *p)