summaryrefslogtreecommitdiffstats
path: root/ripngd/ripng_cli.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2021-02-08 17:36:05 +0100
committerDonald Sharp <sharpd@nvidia.com>2021-05-04 22:23:37 +0200
commit458133dbc5fa60f6b5c30e850d0232df37049240 (patch)
tree8f86f26338f4023b3bf038b447e2dd705b3d2c50 /ripngd/ripng_cli.c
parentlib: Abstract parsing of distribute lists (diff)
downloadfrr-458133dbc5fa60f6b5c30e850d0232df37049240.tar.xz
frr-458133dbc5fa60f6b5c30e850d0232df37049240.zip
lib, ripd, ripngd, vtysh: Move distribute list to `correct` spot
Allow the `distribute-list...` command in ripd and ripngd to work correctly. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'ripngd/ripng_cli.c')
-rw-r--r--ripngd/ripng_cli.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/ripngd/ripng_cli.c b/ripngd/ripng_cli.c
index 365082f80..7e0d01408 100644
--- a/ripngd/ripng_cli.c
+++ b/ripngd/ripng_cli.c
@@ -503,11 +503,58 @@ DEFPY_YANG (clear_ipv6_rip,
return ret;
}
+DEFUN (ripng_ipv6_distribute_list,
+ ripng_ipv6_distribute_list_cmd,
+ "ipv6 distribute-list [prefix] WORD <in|out> [WORD]",
+ "IPv6\n"
+ "Filter networks in routing updates\n"
+ "Specify a prefix\n"
+ "Access-list name\n"
+ "Filter incoming routing updates\n"
+ "Filter outgoing routing updates\n"
+ "Interface name\n")
+{
+ const char *ifname = NULL;
+ int prefix = (argv[2]->type == WORD_TKN) ? 1 : 0;
+
+ if (argv[argc - 1]->type == VARIABLE_TKN)
+ ifname = argv[argc - 1]->arg;
+
+ return distribute_list_parser(prefix, false, argv[3 + prefix]->text,
+ argv[2 + prefix]->arg, ifname);
+}
+
+DEFUN (ripng_no_ipv6_distribute_list,
+ ripng_no_ipv6_distribute_list_cmd,
+ "no ipv6 distribute-list [prefix] WORD <in|out> [WORD]",
+ NO_STR
+ "IPv6\n"
+ "Filter networks in routing updates\n"
+ "Specify a prefix\n"
+ "Access-list name\n"
+ "Filter incoming routing updates\n"
+ "Filter outgoing routing updates\n"
+ "Interface name\n")
+{
+ const char *ifname = NULL;
+ int prefix = (argv[3]->type == WORD_TKN) ? 1 : 0;
+
+ if (argv[argc - 1]->type == VARIABLE_TKN)
+ ifname = argv[argc - 1]->arg;
+
+ return distribute_list_no_parser(vty, prefix, false,
+ argv[4 + prefix]->text,
+ argv[3 + prefix]->arg, ifname);
+}
+
void ripng_cli_init(void)
{
install_element(CONFIG_NODE, &router_ripng_cmd);
install_element(CONFIG_NODE, &no_router_ripng_cmd);
+ install_element(RIPNG_NODE, &ripng_ipv6_distribute_list_cmd);
+ install_element(RIPNG_NODE, &ripng_no_ipv6_distribute_list_cmd);
+
install_element(RIPNG_NODE, &ripng_allow_ecmp_cmd);
install_element(RIPNG_NODE, &ripng_default_information_originate_cmd);
install_element(RIPNG_NODE, &ripng_default_metric_cmd);