FIB: encode the label stack in the FIB path during table dump
[vpp.git] / src / vnet / mfib / ip4_mfib.h
index 6fc74a3..5b22559 100644 (file)
@@ -38,6 +38,10 @@ extern fib_node_index_t ip4_mfib_table_lookup_exact_match(const ip4_mfib_t *fib,
                                                           const ip4_address_t *grp,
                                                           const ip4_address_t *src,
                                                           u32 len);
+extern fib_node_index_t ip4_mfib_table_get_less_specific (const ip4_mfib_t *mfib,
+                                                          const ip4_address_t *src,
+                                                          const ip4_address_t *grp,
+                                                          u32 len);
 
 extern void ip4_mfib_table_entry_remove(ip4_mfib_t *fib,
                                         const ip4_address_t *grp,
@@ -72,8 +76,9 @@ ip4_mfib_get (u32 index)
  * @returns A pointer to the retrieved or created fib.
  *
  */
-extern u32 ip4_mfib_table_find_or_create_and_lock(u32 table_id);
-extern u32 ip4_mfib_table_create_and_lock(void);
+extern u32 ip4_mfib_table_find_or_create_and_lock(u32 table_id,
+                                                  mfib_source_t src);
+extern u32 ip4_mfib_table_create_and_lock(mfib_source_t src);
 
 static inline
 u32 ip4_mfib_index_from_table_id (u32 table_id)
@@ -90,6 +95,20 @@ u32 ip4_mfib_index_from_table_id (u32 table_id)
 
 extern u32 ip4_mfib_table_get_index_for_sw_if_index(u32 sw_if_index);
 
+/**
+ * @brief Walk the IP4 mfib table.
+ *
+ * @param mfib the table to walk
+ * @param fn The function to invoke on each entry visited
+ * @param ctx A context passed in the visit function
+ */
+extern void ip4_mfib_table_walk(ip4_mfib_t *mfib,
+                                mfib_table_walk_fn_t fn,
+                                void *ctx);
+
+/**
+ * @brief format (display) the memory usage for IP4 mfibs
+ */
+extern u8 * format_ip4_mfib_table_memory(u8 * s, va_list * args);
 
 #endif
-