]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_ecommunity.h
Merge pull request #9453 from LabNConsulting/chopps/fix-netns-vrfs
[mirror_frr.git] / bgpd / bgp_ecommunity.h
index fe90efe1f7d1d749b48661ae23b8bfd36a28fe97..a9dc2aeaa1f5a3c15e7880d0842dbb992d5fe845 100644 (file)
 #define ECOMMUNITY_EVPN_SUBTYPE_ESI_LABEL    0x01
 #define ECOMMUNITY_EVPN_SUBTYPE_ES_IMPORT_RT 0x02
 #define ECOMMUNITY_EVPN_SUBTYPE_ROUTERMAC    0x03
+#define ECOMMUNITY_EVPN_SUBTYPE_DF_ELECTION 0x06
 #define ECOMMUNITY_EVPN_SUBTYPE_DEF_GW       0x0d
 #define ECOMMUNITY_EVPN_SUBTYPE_ND           0x08
 
 #define ECOMMUNITY_EVPN_SUBTYPE_MACMOBILITY_FLAG_STICKY 0x01
 
+/* DF alg bits - only lower 5 bits are applicable */
+#define ECOMMUNITY_EVPN_SUBTYPE_DF_ALG_BITS 0x1f
+
 #define ECOMMUNITY_EVPN_SUBTYPE_ND_ROUTER_FLAG   0x01
 #define ECOMMUNITY_EVPN_SUBTYPE_ND_OVERRIDE_FLAG 0x02
 #define ECOMMUNITY_EVPN_SUBTYPE_PROXY_FLAG       0x04
 /* Extended Communities type flag.  */
 #define ECOMMUNITY_FLAG_NON_TRANSITIVE      0x40
 
+/* Extended Community readable string length */
+#define ECOMMUNITY_STRLEN 64
+
 /* Extended Communities attribute.  */
 struct ecommunity {
        /* Reference counter.  */
@@ -110,7 +117,7 @@ struct ecommunity {
        uint8_t unit_size;
 
        /* Size of Extended Communities attribute.  */
-       int size;
+       uint32_t size;
 
        /* Extended Communities value.  */
        uint8_t *val;
@@ -144,6 +151,12 @@ struct ecommunity_val_ipv6 {
        char val[IPV6_ECOMMUNITY_SIZE];
 };
 
+enum ecommunity_lb_type {
+       EXPLICIT_BANDWIDTH,
+       CUMULATIVE_BANDWIDTH,
+       COMPUTED_BANDWIDTH
+};
+
 #define ecom_length_size(X, Y)    ((X)->size * (Y))
 
 /*
@@ -223,7 +236,7 @@ extern struct ecommunity *ecommunity_merge(struct ecommunity *,
 extern struct ecommunity *ecommunity_uniq_sort(struct ecommunity *);
 extern struct ecommunity *ecommunity_intern(struct ecommunity *);
 extern bool ecommunity_cmp(const void *arg1, const void *arg2);
-extern void ecommunity_unintern(struct ecommunity **);
+extern void ecommunity_unintern(struct ecommunity **ecommunity);
 extern unsigned int ecommunity_hash_make(const void *);
 extern struct ecommunity *ecommunity_str2com(const char *, int, int);
 extern struct ecommunity *ecommunity_str2com_ipv6(const char *str, int type,