aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/ip4_fib.c
diff options
context:
space:
mode:
authorJon Loeliger <jdl@netgate.com>2024-03-22 12:22:36 -0500
committerMatthew Smith <mgsmith@netgate.com>2024-04-01 18:06:09 +0000
commitd465fd0819853079c78ad3b6b1a86e2e05c3c142 (patch)
tree044d9f07de834f97493bd3039039afe8a134eb87 /src/vnet/fib/ip4_fib.c
parente98031646a1b858c513d339685d23b8f6e3e8671 (diff)
fib: add early config support for IP and IP6 default FIB table names
Type: improvement Change-Id: I8c248d9e224bd069b641a174da57d448371470af Signed-off-by: Jon Loeliger <jdl@netgate.com>
Diffstat (limited to 'src/vnet/fib/ip4_fib.c')
-rw-r--r--src/vnet/fib/ip4_fib.c21
1 files changed, 21 insertions, 0 deletions
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 <table-id>] [index <fib-id>] [<ip4-addr>[/<mask>]] [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");