MPLS Mcast
[vpp.git] / src / vnet / mfib / ip4_mfib.c
index 08001c3..3ed7cba 100644 (file)
@@ -72,6 +72,7 @@ ip4_create_mfib_with_table_id (u32 table_id)
         mfib_table_entry_update(mfib_table->mft_index,
                                 &prefix,
                                 MFIB_SOURCE_DEFAULT_ROUTE,
+                                MFIB_RPF_ID_NONE,
                                 MFIB_ENTRY_FLAG_DROP);
     }
 
@@ -279,6 +280,29 @@ ip4_mfib_table_entry_remove (ip4_mfib_t *mfib,
     mfib->fib_entry_by_dst_address[len] = hash;
 }
 
+void
+ip4_mfib_table_walk (ip4_mfib_t *mfib,
+                     mfib_table_walk_fn_t fn,
+                     void *ctx)
+{
+    int i;
+
+    for (i = 0; i < ARRAY_LEN (mfib->fib_entry_by_dst_address); i++)
+    {
+       uword * hash = mfib->fib_entry_by_dst_address[i];
+
+       if (NULL != hash)
+       {
+           hash_pair_t * p;
+
+           hash_foreach_pair (p, hash,
+           ({
+               fn(p->value[0], ctx);
+           }));
+       }
+    }
+}
+
 static void
 ip4_mfib_table_show_all (ip4_mfib_t *mfib,
                          vlib_main_t * vm)
@@ -457,9 +481,9 @@ ip4_show_mfib (vlib_main_t * vm,
  * @cliexend
  ?*/
 /* *INDENT-OFF* */
-VLIB_CLI_COMMAND (ip4_show_fib_command, static) = {
+VLIB_CLI_COMMAND (ip4_show_mfib_command, static) = {
     .path = "show ip mfib",
-    .short_help = "show ip mfib [summary] [table <table-id>] [index <fib-id>] [<gre-addr>[/<mask>]] [<gre-addr>] [<src-addr> <gre-addr>]",
+    .short_help = "show ip mfib [summary] [table <table-id>] [index <fib-id>] [<grp-addr>[/<mask>]] [<grp-addr>] [<src-addr> <grp-addr>]",
     .function = ip4_show_mfib,
 };
 /* *INDENT-ON* */