]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/prefix.h
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / lib / prefix.h
index ab3c05ae744a740ee19ed9fc3c0d54466f519a47..4247569137dd4a4b5a3e3e917e9e6c0190d670ad 100644 (file)
@@ -39,6 +39,9 @@
 #define ETH_ALEN 6
 #endif
 
+#define ESI_BYTES 10
+#define ESI_STR_LEN (3 * ESI_BYTES)
+
 #define ETHER_ADDR_STRLEN (3*ETH_ALEN)
 /*
  * there isn't a portable ethernet address type. We define our
@@ -213,6 +216,8 @@ static inline int is_evpn_prefix_ipaddr_none(const struct prefix_evpn *evp)
                return IS_IPADDR_NONE(&(evp)->prefix.macip_addr.ip);
        if (evp->prefix.route_type == 3)
                return IS_IPADDR_NONE(&(evp)->prefix.imet_addr.ip);
+       if (evp->prefix.route_type == 4)
+               return IS_IPADDR_NONE(&(evp)->prefix.es_addr.ip);
        if (evp->prefix.route_type == 5)
                return IS_IPADDR_NONE(&(evp)->prefix.prefix_addr.ip);
        return 0;
@@ -224,6 +229,8 @@ static inline int is_evpn_prefix_ipaddr_v4(const struct prefix_evpn *evp)
                return IS_IPADDR_V4(&(evp)->prefix.macip_addr.ip);
        if (evp->prefix.route_type == 3)
                return IS_IPADDR_V4(&(evp)->prefix.imet_addr.ip);
+       if (evp->prefix.route_type == 4)
+               return IS_IPADDR_V4(&(evp)->prefix.es_addr.ip);
        if (evp->prefix.route_type == 5)
                return IS_IPADDR_V4(&(evp)->prefix.prefix_addr.ip);
        return 0;
@@ -235,6 +242,8 @@ static inline int is_evpn_prefix_ipaddr_v6(const struct prefix_evpn *evp)
                return IS_IPADDR_V6(&(evp)->prefix.macip_addr.ip);
        if (evp->prefix.route_type == 3)
                return IS_IPADDR_V6(&(evp)->prefix.imet_addr.ip);
+       if (evp->prefix.route_type == 4)
+               return IS_IPADDR_V6(&(evp)->prefix.es_addr.ip);
        if (evp->prefix.route_type == 5)
                return IS_IPADDR_V6(&(evp)->prefix.prefix_addr.ip);
        return 0;
@@ -432,6 +441,11 @@ extern char *prefix_mac2str(const struct ethaddr *mac, char *buf, int size);
 
 extern unsigned prefix_hash_key(void *pp);
 
+extern int str_to_esi(const char *str, esi_t *esi);
+extern char *esi_to_str(const esi_t *esi, char *buf, int size);
+extern void prefix_hexdump(const struct prefix *p);
+extern void prefix_evpn_hexdump(const struct prefix_evpn *p);
+
 static inline int ipv6_martian(struct in6_addr *addr)
 {
        struct in6_addr localhost_addr;
@@ -444,7 +458,6 @@ static inline int ipv6_martian(struct in6_addr *addr)
        return 0;
 }
 
-extern int all_digit(const char *);
 extern int macstr2prefix_evpn(const char *str, struct prefix_evpn *p);
 
 /* NOTE: This routine expects the address argument in network byte order. */
@@ -482,5 +495,4 @@ static inline int is_host_route(struct prefix *p)
                return (p->prefixlen == IPV6_MAX_BITLEN);
        return 0;
 }
-
 #endif /* _ZEBRA_PREFIX_H */