]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/rib.h
*: s/TRUE/true/, s/FALSE/false/
[mirror_frr.git] / zebra / rib.h
index ae25a0e67980acd6593863782c42d039938197fa..9fe42aef3b2e4c9ffcf47c9cf840d0dabadb6ae9 100644 (file)
 #include "mpls.h"
 #include "srcdest_table.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define DISTANCE_INFINITY  255
 #define ZEBRA_KERNEL_TABLE_MAX 252 /* support for no more than this rt tables */
 
@@ -81,12 +85,20 @@ struct route_entry {
        uint32_t flags;
 
        /* RIB internal status */
-       uint8_t status;
+       uint32_t status;
 #define ROUTE_ENTRY_REMOVED          0x1
 /* to simplify NHT logic when NHs change, instead of doing a NH by NH cmp */
 #define ROUTE_ENTRY_NEXTHOPS_CHANGED 0x2
+/* The Route Entry has changed */
 #define ROUTE_ENTRY_CHANGED          0x4
+/* The Label has changed on the Route entry */
 #define ROUTE_ENTRY_LABELS_CHANGED   0x8
+/* Route is queued for Installation into the Data Plane */
+#define ROUTE_ENTRY_QUEUED   0x10
+/* Route is installed into the Data Plane */
+#define ROUTE_ENTRY_INSTALLED        0x20
+/* Route has Failed installation into the Data Plane in some manner */
+#define ROUTE_ENTRY_FAILED           0x40
 
        /* Nexthop information. */
        uint8_t nexthop_num;
@@ -132,6 +144,15 @@ typedef struct rib_dest_t_ {
         */
        uint32_t flags;
 
+       /*
+        * The list of nht prefixes that have ended up
+        * depending on this route node.
+        * After route processing is returned from
+        * the data plane we will run evaluate_rnh
+        * on these prefixes.
+        */
+       struct list *nht;
+
        /*
         * Linkage to put dest on the FPM processing queue.
         */
@@ -160,6 +181,8 @@ typedef struct rib_dest_t_ {
  */
 #define RIB_DEST_UPDATE_FPM    (1 << (ZEBRA_MAX_QINDEX + 2))
 
+#define RIB_DEST_UPDATE_LSPS   (1 << (ZEBRA_MAX_QINDEX + 3))
+
 /*
  * Macro to iterate over each route for a destination (prefix).
  */
@@ -347,6 +370,8 @@ extern struct route_table *rib_tables_iter_next(rib_tables_iter_t *iter);
 
 extern uint8_t route_distance(int type);
 
+extern void zebra_rib_evaluate_rn_nexthops(struct route_node *rn, uint32_t seq);
+
 /*
  * Inline functions.
  */
@@ -418,6 +443,11 @@ static inline struct zebra_vrf *rib_dest_vrf(rib_dest_t *dest)
        return rib_table_info(rib_dest_table(dest))->zvrf;
 }
 
+/*
+ * Create the rib_dest_t and attach it to the specified node
+ */
+extern rib_dest_t *zebra_rib_create_dest(struct route_node *rn);
+
 /*
  * rib_tables_iter_init
  */
@@ -431,7 +461,7 @@ static inline void rib_tables_iter_init(rib_tables_iter_t *iter)
 /*
  * rib_tables_iter_started
  *
- * Returns TRUE if this iterator has started iterating over the set of
+ * Returns true if this iterator has started iterating over the set of
  * tables.
  */
 static inline int rib_tables_iter_started(rib_tables_iter_t *iter)
@@ -456,4 +486,9 @@ extern void zebra_vty_init(void);
 extern pid_t pid;
 
 extern bool v6_rr_semantics;
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /*_ZEBRA_RIB_H */