From d465fd0819853079c78ad3b6b1a86e2e05c3c142 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Fri, 22 Mar 2024 12:22:36 -0500 Subject: fib: add early config support for IP and IP6 default FIB table names Type: improvement Change-Id: I8c248d9e224bd069b641a174da57d448371470af Signed-off-by: Jon Loeliger --- src/vnet/fib/ip4_fib.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/vnet/fib/ip4_fib.c') diff --git a/src/vnet/fib/ip4_fib.c b/src/vnet/fib/ip4_fib.c index 4211f8785ca..0eff8d0d485 100644 --- a/src/vnet/fib/ip4_fib.c +++ b/src/vnet/fib/ip4_fib.c @@ -626,3 +626,24 @@ VLIB_CLI_COMMAND (ip4_show_fib_command, static) = { .short_help = "show ip fib [summary] [table ] [index ] [[/]] [mtrie] [detail]", .function = ip4_show_fib, }; + +static clib_error_t * +ip_config (vlib_main_t * vm, unformat_input_t * input) +{ + char *default_name = 0; + + while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) + { + if (unformat (input, "default-table-name %s", &default_name)) + ; + else + return clib_error_return (0, "unknown input '%U'", + format_unformat_error, input); + } + + fib_table_default_names[FIB_PROTOCOL_IP4] = default_name; + + return 0; +} + +VLIB_EARLY_CONFIG_FUNCTION (ip_config, "ip"); -- cgit 1.2.3-korg