summaryrefslogtreecommitdiff
path: root/lib/prefix.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/prefix.h')
-rw-r--r--lib/prefix.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/prefix.h b/lib/prefix.h
index 0732cf1290..7e947ea48a 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -348,6 +348,7 @@ extern void masklen2ip6(const int, struct in6_addr *);
extern const char *inet6_ntoa(struct in6_addr);
+extern int is_zero_mac(struct ethaddr *mac);
extern int prefix_str2mac(const char *str, struct ethaddr *mac);
extern char *prefix_mac2str(const struct ethaddr *mac, char *buf, int size);
@@ -398,4 +399,13 @@ static inline int is_default_prefix(const struct prefix *p)
return 0;
}
+static inline int is_host_route(struct prefix *p)
+{
+ if (p->family == AF_INET)
+ return (p->prefixlen == IPV4_MAX_BITLEN);
+ else if (p->family == AF_INET6)
+ return (p->prefixlen == IPV6_MAX_BITLEN);
+ return 0;
+}
+
#endif /* _ZEBRA_PREFIX_H */