]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_table.h
Merge pull request #3370 from pguibert6WIND/default_vrf_initialization
[mirror_frr.git] / bgpd / bgp_table.h
index 9afc2adbb06e2f9596a9ca67a3f425d14b4fae5e..c267b4fe8ae42ceb69f65d87399280967e45b54a 100644 (file)
 #include "mpls.h"
 #include "table.h"
 #include "queue.h"
+#include "linklist.h"
+#include "bgpd.h"
 
 struct bgp_table {
+       /* table belongs to this instance */
+       struct bgp *bgp;
+
        /* afi/safi of this table */
        afi_t afi;
        safi_t safi;
@@ -63,6 +68,8 @@ struct bgp_node {
 #define BGP_NODE_USER_CLEAR             (1 << 1)
 #define BGP_NODE_LABEL_CHANGED          (1 << 2)
 #define BGP_NODE_REGISTERED_FOR_LABEL   (1 << 3)
+
+       struct bgp_addpath_node_data tx_addpath;
 };
 
 /*
@@ -75,7 +82,7 @@ typedef struct bgp_table_iter_t_ {
        route_table_iter_t rt_iter;
 } bgp_table_iter_t;
 
-extern struct bgp_table *bgp_table_init(afi_t, safi_t);
+extern struct bgp_table *bgp_table_init(struct bgp *bgp, afi_t, safi_t);
 extern void bgp_table_lock(struct bgp_table *);
 extern void bgp_table_unlock(struct bgp_table *);
 extern void bgp_table_finish(struct bgp_table **);
@@ -108,7 +115,7 @@ static inline struct route_node *bgp_node_to_rnode(struct bgp_node *node)
  */
 static inline struct bgp_table *bgp_node_table(struct bgp_node *node)
 {
-       return bgp_node_to_rnode(node)->table->info;
+       return route_table_get_info(bgp_node_to_rnode(node)->table);
 }
 
 /*
@@ -306,4 +313,66 @@ static inline uint64_t bgp_table_version(struct bgp_table *table)
        return table->version;
 }
 
+void bgp_table_range_lookup(const struct bgp_table *table, struct prefix *p,
+                           uint8_t maxlen, struct list *matches);
+
+
+static inline struct bgp_aggregate *
+bgp_aggregate_get_node_info(struct bgp_node *node)
+{
+       return node->info;
+}
+
+static inline void bgp_aggregate_set_node_info(struct bgp_node *node,
+                                              struct bgp_aggregate *aggregate)
+{
+       node->info = aggregate;
+}
+
+static inline struct bgp_distance *bgp_distance_get_node(struct bgp_node *node)
+{
+       return node->info;
+}
+
+static inline void bgp_distance_set_node_info(struct bgp_node *node,
+                                             struct bgp_distance *distance)
+{
+       node->info = distance;
+}
+
+static inline struct bgp_static *bgp_static_get_node_info(struct bgp_node *node)
+{
+       return node->info;
+}
+
+static inline void bgp_static_set_node_info(struct bgp_node *node,
+                                           struct bgp_static *bgp_static)
+{
+       node->info = bgp_static;
+}
+
+static inline struct bgp_connected_ref *
+bgp_connected_get_node_info(struct bgp_node *node)
+{
+       return node->info;
+}
+
+static inline void bgp_connected_set_node_info(struct bgp_node *node,
+                                              struct bgp_connected_ref *bc)
+{
+       node->info = bc;
+}
+
+static inline struct bgp_nexthop_cache *
+bgp_nexthop_get_node_info(struct bgp_node *node)
+{
+       return node->info;
+}
+
+static inline void bgp_nexthop_set_node_info(struct bgp_node *node,
+                                            struct bgp_nexthop_cache *bnc)
+{
+       node->info = bnc;
+}
+
 #endif /* _QUAGGA_BGP_TABLE_H */