]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_route.h
Merge pull request #7809 from donaldsharp/m_coverity
[mirror_frr.git] / bgpd / bgp_route.h
index 3281ae32b0e91d4cf707a013edd7fc4770314cef..17ca3f8b38470df209dd7255ed78457969ec09cf 100644 (file)
@@ -102,6 +102,19 @@ enum bgp_show_adj_route_type {
 #define BGP_NLRI_PARSE_ERROR_EVPN_TYPE1_SIZE -15
 #define BGP_NLRI_PARSE_ERROR -32
 
+/* MAC-IP/type-2 path_info in the global routing table is linked to the
+ * destination ES
+ */
+struct bgp_path_es_info {
+       /* back pointer to the route */
+       struct bgp_path_info *pi;
+       vni_t vni;
+       /* destination ES */
+       struct bgp_evpn_es *es;
+       /* memory used for linking the path to the destination ES */
+       struct listnode es_listnode;
+};
+
 /* Ancillary information to struct bgp_path_info,
  * used for uncommonly used data (aggregation, MPLS, etc.)
  * and lazily allocated to save memory.
@@ -188,6 +201,8 @@ struct bgp_path_info_extra {
        struct list *bgp_fs_pbr;
        /* presence of FS pbr iprule based entry */
        struct list *bgp_fs_iprule;
+       /* Destination Ethernet Segment links for EVPN MH */
+       struct bgp_path_es_info *es_info;
 };
 
 struct bgp_path_info {
@@ -454,6 +469,14 @@ struct bgp_aggregate {
 #define UNSUPPRESS_MAP_NAME(F)  ((F)->usmap.name)
 #define UNSUPPRESS_MAP(F)       ((F)->usmap.map)
 
+#define ADVERTISE_MAP_NAME(F)  ((F)->advmap.aname)
+#define ADVERTISE_MAP(F)       ((F)->advmap.amap)
+
+#define ADVERTISE_CONDITION(F) ((F)->advmap.condition)
+
+#define CONDITION_MAP_NAME(F)  ((F)->advmap.cname)
+#define CONDITION_MAP(F)       ((F)->advmap.cmap)
+
 /* path PREFIX (addpath rxid NUMBER) */
 #define PATH_ADDPATH_STR_BUFFER PREFIX2STR_BUFFER + 32
 
@@ -516,6 +539,13 @@ static inline void prep_for_rmap_apply(struct bgp_path_info *dst_pi,
        }
 }
 
+static inline bool bgp_check_advertise(struct bgp *bgp, struct bgp_dest *dest)
+{
+       return (!(BGP_SUPPRESS_FIB_ENABLED(bgp) &&
+                 CHECK_FLAG(dest->flags, BGP_NODE_FIB_INSTALL_PENDING) &&
+                (!bgp_option_check(BGP_OPT_NO_FIB))));
+}
+
 /* called before bgp_process() */
 DECLARE_HOOK(bgp_process,
             (struct bgp * bgp, afi_t afi, safi_t safi, struct bgp_dest *bn,
@@ -663,6 +693,8 @@ extern void route_vty_out_overlay(struct vty *vty, const struct prefix *p,
                                  struct bgp_path_info *path, int display,
                                  json_object *json);
 
+extern void bgp_notify_conditional_adv_scanner(struct update_subgroup *subgrp);
+
 extern void subgroup_process_announce_selected(struct update_subgroup *subgrp,
                                               struct bgp_path_info *selected,
                                               struct bgp_dest *dest,
@@ -671,7 +703,8 @@ extern void subgroup_process_announce_selected(struct update_subgroup *subgrp,
 extern bool subgroup_announce_check(struct bgp_dest *dest,
                                    struct bgp_path_info *pi,
                                    struct update_subgroup *subgrp,
-                                   const struct prefix *p, struct attr *attr);
+                                   const struct prefix *p, struct attr *attr,
+                                   bool skip_rmap_check);
 
 extern void bgp_peer_clear_node_queue_drain_immediate(struct peer *peer);
 extern void bgp_process_queues_drain_immediate(void);
@@ -746,5 +779,5 @@ extern int bgp_distance_set(uint8_t distance, const char *ip_str,
 extern int bgp_distance_unset(uint8_t distance, const char *ip_str,
                              const char *access_list_str, afi_t afi,
                              safi_t safi, char *errmsg, size_t errmsg_len);
-
+extern void subgroup_announce_reset_nhop(uint8_t family, struct attr *attr);
 #endif /* _QUAGGA_BGP_ROUTE_H */