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)
extern int str2family(const char *);
extern int afi2family (afi_t);
extern afi_t family2afi (int);
+extern const char *safi2str(safi_t safi);
/* Check bit of the prefix. */
extern unsigned int prefix_bit (const u_char *prefix, const u_char prefixlen);
#define SAFI_MULTICAST 2
#define SAFI_RESERVED_3 3
#define SAFI_MPLS_VPN 4
-#define SAFI_MAX 5
+#define SAFI_ENCAP 7 /* per IANA */
+#define SAFI_MAX 8
/* Filter direction. */
#define FILTER_IN 0