devices: fix the l2 hdr offset in af_packet transmit side
[vpp.git] / src / vnet / fib / fib_node.h
index bd8bee0..6639c39 100644 (file)
@@ -53,8 +53,7 @@ typedef enum fib_node_type_t_ {
     /**
      * 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_LAST = FIB_NODE_TYPE_ENTRY_TRACK,
 } __attribute__ ((packed)) fib_node_type_t;
 
 #define FIB_NODE_TYPE_MAX (FIB_NODE_TYPE_LAST + 1)
@@ -109,6 +108,10 @@ typedef enum fib_node_back_walk_reason_t_ {
      * A resolving interface has gone down
      */
     FIB_NODE_BW_REASON_INTERFACE_DOWN,
+    /**
+     * A resolving interface has been bound to another table
+     */
+    FIB_NODE_BW_REASON_INTERFACE_BIND,
     /**
      * A resolving interface has been deleted.
      */
@@ -118,6 +121,10 @@ typedef enum fib_node_back_walk_reason_t_ {
      * a unipath adjacency changes
      */
     FIB_NODE_BW_REASON_ADJ_UPDATE,
+    /**
+     * Walk update the adjacency MTU
+     */
+    FIB_NODE_BW_REASON_ADJ_MTU,
     /**
      * Walk to update children to inform them the adjacency is now down.
      */
@@ -134,7 +141,9 @@ typedef enum fib_node_back_walk_reason_t_ {
     [FIB_NODE_BW_REASON_INTERFACE_UP] = "if-up",            \
     [FIB_NODE_BW_REASON_INTERFACE_DOWN] = "if-down",        \
     [FIB_NODE_BW_REASON_INTERFACE_DELETE] = "if-delete",    \
+    [FIB_NODE_BW_REASON_INTERFACE_BIND] = "if-bind",        \
     [FIB_NODE_BW_REASON_ADJ_UPDATE] = "adj-update",         \
+    [FIB_NODE_BW_REASON_ADJ_MTU] = "adj-mtu",               \
     [FIB_NODE_BW_REASON_ADJ_DOWN] = "adj-down",             \
 }
 
@@ -152,13 +161,15 @@ typedef enum fib_node_bw_reason_flag_t_ {
     FIB_NODE_BW_REASON_FLAG_EVALUATE = (1 << FIB_NODE_BW_REASON_EVALUATE),
     FIB_NODE_BW_REASON_FLAG_INTERFACE_UP = (1 << FIB_NODE_BW_REASON_INTERFACE_UP),
     FIB_NODE_BW_REASON_FLAG_INTERFACE_DOWN = (1 << FIB_NODE_BW_REASON_INTERFACE_DOWN),
+    FIB_NODE_BW_REASON_FLAG_INTERFACE_BIND = (1 << FIB_NODE_BW_REASON_INTERFACE_BIND),
     FIB_NODE_BW_REASON_FLAG_INTERFACE_DELETE = (1 << FIB_NODE_BW_REASON_INTERFACE_DELETE),
     FIB_NODE_BW_REASON_FLAG_ADJ_UPDATE = (1 << FIB_NODE_BW_REASON_ADJ_UPDATE),
+    FIB_NODE_BW_REASON_FLAG_ADJ_MTU = (1 << FIB_NODE_BW_REASON_ADJ_MTU),
     FIB_NODE_BW_REASON_FLAG_ADJ_DOWN = (1 << FIB_NODE_BW_REASON_ADJ_DOWN),
 } __attribute__ ((packed)) fib_node_bw_reason_flag_t;
 
-STATIC_ASSERT(sizeof(fib_node_bw_reason_flag_t) < 2,
-             "BW Reason enum < 2 byte. Consequences for cover_upd_res_t");
+STATIC_ASSERT(sizeof(fib_node_bw_reason_flag_t) < 3,
+             "BW Reason enum < 2 byte. Consequences for fib_entry_src_cover_res_t");
 
 extern u8 *format_fib_node_bw_reason(u8 *s, va_list *args);
 
@@ -175,7 +186,7 @@ typedef enum fib_node_bw_flags_t_
 } fib_node_bw_flags_t;
 
 /**
- * Forward eclarations
+ * Forward declarations
  */
 struct fib_node_t_;
 
@@ -223,6 +234,17 @@ typedef struct fib_node_back_walk_ctx_t_ {
      * in the graph.
      */
     u32 fnbw_depth;
+
+    /**
+     * Additional data associated with the reason the walk is occuring
+     */
+    union
+    {
+        struct {
+            u32 fnbw_from_fib_index;
+            u32 fnbw_to_fib_index;
+        } interface_bind;
+    };
 } fib_node_back_walk_ctx_t;
 
 /**
@@ -283,7 +305,6 @@ typedef struct fib_node_vft_t_ {
     fib_node_get_t fnv_get;
     fib_node_last_lock_gone_t fnv_last_lock;
     fib_node_back_walk_t fnv_back_walk;
-    format_function_t *fnv_format;
     fib_node_memory_show_t fnv_mem_show;
 } fib_node_vft_t;
 
@@ -334,12 +355,13 @@ extern void fib_node_register_type (fib_node_type_t ft,
  * @brief
  *  Create a new FIB node type and Register the function table for it.
  *
- * @param vft
- * virtual function table
+ * @param name Name of the type (as display when printing children)
+ * @param vft virtual function table
  *
  * @return new FIB node type
  */
-extern fib_node_type_t fib_node_register_new_type (const fib_node_vft_t *vft);
+extern fib_node_type_t fib_node_register_new_type (const char *name,
+                                                   const fib_node_vft_t *vft);
 
 /**
  * @brief Show the memory usage for a type