summaryrefslogtreecommitdiff
path: root/zebra/zebra_vty.c
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2021-10-08 13:49:54 -0400
committerGitHub <noreply@github.com>2021-10-08 13:49:54 -0400
commit99497bc4ee5c8324444998310cd211425d9bb10c (patch)
tree075e382f49c3c152ae7c739bade133d824f58856 /zebra/zebra_vty.c
parent144908dc528c1cc89d576888dbacb1c4b1661457 (diff)
parent42d4b30e00131923691ef260ed8b1ff11bf3f33c (diff)
Merge pull request #9471 from pguibert6WIND/table_manager_alloc2
zebra: extend table manager per vrf, add vty configuration
Diffstat (limited to 'zebra/zebra_vty.c')
-rw-r--r--zebra/zebra_vty.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 4b06e84788..c6b3eb48a0 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -59,6 +59,7 @@
#include "northbound_cli.h"
#include "zebra/zebra_nb.h"
#include "zebra/kernel_netlink.h"
+#include "zebra/table_manager.h"
extern int allow_delete;
@@ -4291,6 +4292,31 @@ DEFUN_HIDDEN(no_zebra_kernel_netlink_batch_tx_buf,
#endif /* HAVE_NETLINK */
+DEFUN(ip_table_range, ip_table_range_cmd,
+ "[no] ip table range (1-4294967295) (1-4294967295)",
+ NO_STR IP_STR
+ "table configuration\n"
+ "Configure table range\n"
+ "Start Routing Table\n"
+ "End Routing Table\n")
+{
+ ZEBRA_DECLVAR_CONTEXT(vrf, zvrf);
+
+ if (!zvrf)
+ return CMD_WARNING;
+
+ if (zvrf_id(zvrf) != VRF_DEFAULT && !vrf_is_backend_netns()) {
+ vty_out(vty,
+ "VRF subcommand does not make any sense in l3mdev based vrf's\n");
+ return CMD_WARNING;
+ }
+
+ if (strmatch(argv[0]->text, "no"))
+ return table_manager_range(vty, false, zvrf, NULL, NULL);
+
+ return table_manager_range(vty, true, zvrf, argv[3]->arg, argv[4]->arg);
+}
+
/* IP node for static routes. */
static int zebra_ip_config(struct vty *vty);
static struct cmd_node ip_node = {
@@ -4439,6 +4465,9 @@ void zebra_vty_init(void)
install_element(CONFIG_NODE, &zebra_dplane_queue_limit_cmd);
install_element(CONFIG_NODE, &no_zebra_dplane_queue_limit_cmd);
+ install_element(CONFIG_NODE, &ip_table_range_cmd);
+ install_element(VRF_NODE, &ip_table_range_cmd);
+
#ifdef HAVE_NETLINK
install_element(CONFIG_NODE, &zebra_kernel_netlink_batch_tx_buf_cmd);
install_element(CONFIG_NODE, &no_zebra_kernel_netlink_batch_tx_buf_cmd);