+static clib_error_t *
+lfib_config (vlib_main_t * vm, unformat_input_t * input)
+{
+ l2fib_main_t *lm = &l2fib_main;
+ uword table_size = ~0;
+ u32 n_buckets = ~0;
+
+ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (input, "table-size %U", unformat_memory_size,
+ &table_size))
+ ;
+ else if (unformat (input, "num-buckets %u", &n_buckets))
+ ;
+ else
+ return clib_error_return (0, "unknown input `%U'",
+ format_unformat_error, input);
+ }
+
+ if (n_buckets != ~0)
+ {
+ if (!is_pow2 (n_buckets))
+ return clib_error_return (0, "num-buckets must be power of 2");
+ lm->mac_table_n_buckets = n_buckets;
+ }
+
+ if (table_size != ~0)
+ lm->mac_table_memory_size = table_size;
+ return 0;
+}
+
+VLIB_CONFIG_FUNCTION (lfib_config, "l2fib");
+