vxlan-gbp: Add support for vxlan gbp
[vpp.git] / src / vnet / fib / fib_node.h
index 3ad8ee9..3a4ba84 100644 (file)
@@ -31,6 +31,7 @@ typedef enum fib_node_type_t_ {
      */
     FIB_NODE_TYPE_WALK,
     FIB_NODE_TYPE_ENTRY,
+    FIB_NODE_TYPE_MFIB_ENTRY,
     FIB_NODE_TYPE_PATH_LIST,
     FIB_NODE_TYPE_PATH,
     FIB_NODE_TYPE_ADJ,
@@ -40,27 +41,41 @@ typedef enum fib_node_type_t_ {
     FIB_NODE_TYPE_LISP_ADJ,
     FIB_NODE_TYPE_GRE_TUNNEL,
     FIB_NODE_TYPE_VXLAN_TUNNEL,
+    FIB_NODE_TYPE_MAP_E,
+    FIB_NODE_TYPE_VXLAN_GPE_TUNNEL,
+    FIB_NODE_TYPE_GENEVE_TUNNEL,
+    FIB_NODE_TYPE_UDP_ENCAP,
+    FIB_NODE_TYPE_BIER_FMASK,
+    FIB_NODE_TYPE_BIER_ENTRY,
+    FIB_NODE_TYPE_VXLAN_GBP_TUNNEL,
     /**
      * Marker. New types before this one. leave the test last.
      */
     FIB_NODE_TYPE_TEST,
     FIB_NODE_TYPE_LAST = FIB_NODE_TYPE_TEST,
-} fib_node_type_t;
+} __attribute__ ((packed)) fib_node_type_t;
 
 #define FIB_NODE_TYPE_MAX (FIB_NODE_TYPE_LAST + 1)
 
-#define FIB_NODE_TYPES {                          \
-    [FIB_NODE_TYPE_ENTRY]     = "entry",          \
-    [FIB_NODE_TYPE_WALK]      = "walk",           \
-    [FIB_NODE_TYPE_PATH_LIST] = "path-list",      \
-    [FIB_NODE_TYPE_PATH]      = "path",           \
-    [FIB_NODE_TYPE_MPLS_ENTRY] = "mpls-entry",    \
-    [FIB_NODE_TYPE_MPLS_TUNNEL] = "mpls-tunnel",  \
-    [FIB_NODE_TYPE_ADJ] = "adj",                  \
-    [FIB_NODE_TYPE_LISP_GPE_FWD_ENTRY] = "lisp-gpe-fwd-entry", \
-    [FIB_NODE_TYPE_LISP_ADJ] = "lisp-adj", \
-    [FIB_NODE_TYPE_GRE_TUNNEL] = "gre-tunnel", \
-    [FIB_NODE_TYPE_VXLAN_TUNNEL] = "vxlan-tunnel", \
+#define FIB_NODE_TYPES {                                       \
+    [FIB_NODE_TYPE_ENTRY]     = "entry",                       \
+    [FIB_NODE_TYPE_MFIB_ENTRY] = "mfib-entry",                 \
+    [FIB_NODE_TYPE_WALK]      = "walk",                                \
+    [FIB_NODE_TYPE_PATH_LIST] = "path-list",                   \
+    [FIB_NODE_TYPE_PATH]      = "path",                                \
+    [FIB_NODE_TYPE_MPLS_ENTRY] = "mpls-entry",                 \
+    [FIB_NODE_TYPE_MPLS_TUNNEL] = "mpls-tunnel",               \
+    [FIB_NODE_TYPE_ADJ] = "adj",                               \
+    [FIB_NODE_TYPE_LISP_GPE_FWD_ENTRY] = "lisp-gpe-fwd-entry", \
+    [FIB_NODE_TYPE_LISP_ADJ] = "lisp-adj",                     \
+    [FIB_NODE_TYPE_GRE_TUNNEL] = "gre-tunnel",                 \
+    [FIB_NODE_TYPE_VXLAN_TUNNEL] = "vxlan-tunnel",             \
+    [FIB_NODE_TYPE_MAP_E] = "map-e",                           \
+    [FIB_NODE_TYPE_VXLAN_GPE_TUNNEL] = "vxlan-gpe-tunnel",     \
+    [FIB_NODE_TYPE_UDP_ENCAP] = "udp-encap",                   \
+    [FIB_NODE_TYPE_BIER_FMASK] = "bier-fmask",                 \
+    [FIB_NODE_TYPE_BIER_ENTRY] = "bier-entry",                 \
+    [FIB_NODE_TYPE_VXLAN_GBP_TUNNEL] = "vxlan-gbp-tunnel"      \
 }
 
 /**
@@ -146,6 +161,7 @@ STATIC_ASSERT(sizeof(fib_node_bw_reason_flag_t) < 2,
  */
 typedef enum fib_node_bw_flags_t_
 {
+    FIB_NODE_BW_FLAG_NONE = 0,
     /**
      * Force the walk to be synchronous
      */
@@ -268,21 +284,18 @@ typedef struct fib_node_vft_t_ {
 /**
  * An node in the FIB graph
  *
- * Objects in the FIB form a graph. 
+ * Objects in the FIB form a graph.
  */
 typedef struct fib_node_t_ {
-#if CLIB_DEBUG > 0
     /**
      * The node's type. make sure we are dynamic/down casting correctly
      */
     fib_node_type_t fn_type;
-#endif
+
     /**
-     * The node's VFT.
-     * we could store the type here instead, and lookup the VFT using that. But
-     * I like this better,
+     * Some pad space the concrete/derived type is free to use
      */
-    const fib_node_vft_t *fn_vft;
+    u16 fn_pad;
 
     /**
      * Vector of nodes that depend upon/use/share this node
@@ -296,6 +309,8 @@ typedef struct fib_node_t_ {
     u32 fn_locks;
 } fib_node_t;
 
+STATIC_ASSERT(sizeof(fib_node_t) == 12, "FIB node type is growing");
+
 /**
  * @brief
  *  Register the function table for a given type