L2FIB:CLI/API to flush all non-static entries

added CLI l2fib flush-mac all
added API l2fib_flush_all
flushes all non static l2fib entries on all valid BDs

Change-Id: Ic963c88f4bed56308c03ab43106033132a0e87be
Signed-off-by: Eyal Bari <ebari@cisco.com>
diff --git a/src/vnet/l2/l2_fib.h b/src/vnet/l2/l2_fib.h
index 7e49d74..e571a21 100644
--- a/src/vnet/l2/l2_fib.h
+++ b/src/vnet/l2/l2_fib.h
@@ -50,6 +50,20 @@
 
 STATIC_ASSERT_SIZEOF (l2fib_entry_key_t, 8);
 
+
+typedef struct
+{
+  union
+  {
+    struct
+    {
+      u8 swif;
+      u8 bd;
+    };
+    u16 as_u16;
+  };
+} l2fib_seq_num_t;
+
 /*
  * The l2fib entry results
  */
@@ -66,8 +80,7 @@
       u8 filter:1;		/* drop packets to/from this mac */
       u8 unused1:5;
       u8 timestamp;		/* timestamp for aging */
-      u8 int_sn;		/* interface seq num */
-      u8 bd_sn;			/* bridge domain seq num */
+      l2fib_seq_num_t sn;	/* bd/int seq num */
     } fields;
     u64 raw;
   };
@@ -314,7 +327,7 @@
     }
 }
 
-void l2fib_clear_table (uint keep_static);
+void l2fib_clear_table (void);
 
 void
 l2fib_add_entry (u64 mac,
@@ -329,6 +342,8 @@
 
 void l2fib_flush_bd_mac (vlib_main_t * vm, u32 bd_index);
 
+void l2fib_flush_all_mac (vlib_main_t * vm);
+
 void
 l2fib_table_dump (u32 bd_index, l2fib_entry_key_t ** l2fe_key,
 		  l2fib_entry_result_t ** l2fe_res);