]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_ecommunity.h
Merge pull request #5686 from qlyoung/fix-bgp-fqdn-capability-leak
[mirror_frr.git] / bgpd / bgp_ecommunity.h
index c71f371a9738e2c91171c6cc8c789b4f9acf93ad..ae64f41ca15592b6425857218ac2f0d073e5e69e 100644 (file)
@@ -21,6 +21,9 @@
 #ifndef _QUAGGA_BGP_ECOMMUNITY_H
 #define _QUAGGA_BGP_ECOMMUNITY_H
 
+#include "bgpd/bgp_route.h"
+#include "bgpd/bgpd.h"
+
 /* High-order octet of the Extended Communities type field.  */
 #define ECOMMUNITY_ENCODE_AS                0x00
 #define ECOMMUNITY_ENCODE_IP                0x01
 #define ECOMMUNITY_REDIRECT_VRF             0x08
 #define ECOMMUNITY_TRAFFIC_MARKING          0x09
 #define ECOMMUNITY_REDIRECT_IP_NH           0x00
+/* from IANA: bgp-extended-communities/bgp-extended-communities.xhtml
+ * 0x0c Flow-spec Redirect to IPv4 - draft-ietf-idr-flowspec-redirect
+ */
+#define ECOMMUNITY_FLOWSPEC_REDIRECT_IPV4   0x0c
 
 /* Low-order octet of the Extended Communities type field for EVPN types */
 #define ECOMMUNITY_EVPN_SUBTYPE_MACMOBILITY  0x00
@@ -98,8 +105,6 @@ struct ecommunity_val {
        char val[ECOMMUNITY_SIZE];
 };
 
-#define ecom_length(X)    ((X)->size * ECOMMUNITY_SIZE)
-
 /*
  * Encode BGP Route Target AS:nn.
  */
@@ -154,9 +159,9 @@ extern struct ecommunity *ecommunity_merge(struct ecommunity *,
                                           struct ecommunity *);
 extern struct ecommunity *ecommunity_uniq_sort(struct ecommunity *);
 extern struct ecommunity *ecommunity_intern(struct ecommunity *);
-extern int ecommunity_cmp(const void *, const void *);
+extern bool ecommunity_cmp(const void *arg1, const void *arg2);
 extern void ecommunity_unintern(struct ecommunity **);
-extern unsigned int ecommunity_hash_make(void *);
+extern unsigned int ecommunity_hash_make(const void *);
 extern struct ecommunity *ecommunity_str2com(const char *, int, int);
 extern char *ecommunity_ecom2str(struct ecommunity *, int, int);
 extern void ecommunity_strfree(char **s);
@@ -180,4 +185,21 @@ struct bgp_pbr_entry_action;
 extern int ecommunity_fill_pbr_action(struct ecommunity_val *ecom_eval,
                               struct bgp_pbr_entry_action *api);
 
+extern void bgp_compute_aggregate_ecommunity(
+                                       struct bgp_aggregate *aggregate,
+                                       struct ecommunity *ecommunity);
+
+extern void bgp_compute_aggregate_ecommunity_hash(
+                                       struct bgp_aggregate *aggregate,
+                                       struct ecommunity *ecommunity);
+extern void bgp_compute_aggregate_ecommunity_val(
+                                       struct bgp_aggregate *aggregate);
+extern void bgp_remove_ecommunity_from_aggregate(
+                                       struct bgp_aggregate *aggregate,
+                                       struct ecommunity *ecommunity);
+extern void bgp_remove_ecomm_from_aggregate_hash(
+                                       struct bgp_aggregate *aggregate,
+                                       struct ecommunity *ecommunity);
+extern void bgp_aggr_ecommunity_remove(void *arg);
+
 #endif /* _QUAGGA_BGP_ECOMMUNITY_H */