summaryrefslogtreecommitdiffstats
path: root/eigrpd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2021-02-08 17:39:30 +0100
committerDonald Sharp <sharpd@nvidia.com>2021-05-04 22:23:37 +0200
commit5463d7c37440bb6d585f9af04ac6ad11b2028a9c (patch)
treecbac0337f0946af98463c36f055a0aabdb6a1db1 /eigrpd
parentlib, ripd, ripngd, vtysh: Move distribute list to `correct` spot (diff)
downloadfrr-5463d7c37440bb6d585f9af04ac6ad11b2028a9c.tar.xz
frr-5463d7c37440bb6d585f9af04ac6ad11b2028a9c.zip
eigrpd: fix `distribute-list...` command for EIGRP
The distribute-list command was being registered but never setup properly in EIGRP. Put it into place. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'eigrpd')
-rw-r--r--eigrpd/eigrp_main.c2
-rw-r--r--eigrpd/eigrp_routemap.c45
2 files changed, 45 insertions, 2 deletions
diff --git a/eigrpd/eigrp_main.c b/eigrpd/eigrp_main.c
index 0ed7e9496..b775c841f 100644
--- a/eigrpd/eigrp_main.c
+++ b/eigrpd/eigrp_main.c
@@ -227,8 +227,6 @@ int main(int argc, char **argv, char **envp)
route_map_add_hook (eigrp_rmap_update);
route_map_delete_hook (eigrp_rmap_update);*/
/*if_rmap_init (EIGRP_NODE); */
- /* Distribute list install. */
- distribute_list_init(EIGRP_NODE);
frr_config_fork();
frr_run(master);
diff --git a/eigrpd/eigrp_routemap.c b/eigrpd/eigrp_routemap.c
index 5183e645e..90913a5b2 100644
--- a/eigrpd/eigrp_routemap.c
+++ b/eigrpd/eigrp_routemap.c
@@ -1130,6 +1130,48 @@ ALIAS(no_set_tag, no_set_tag_val_cmd, "no set tag (0-65535)", NO_STR SET_STR
"Tag value for routing protocol\n"
"Tag value\n")
+DEFUN (eigrp_distribute_list,
+ eigrp_distribute_list_cmd,
+ "distribute-list [prefix] WORD <in|out> [WORD]",
+ "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[1]->type == WORD_TKN) ? 1 : 0;
+
+ if (argv[argc - 1]->type == VARIABLE_TKN)
+ ifname = argv[argc - 1]->arg;
+
+ return distribute_list_parser(prefix, true, argv[2 + prefix]->text,
+ argv[1 + prefix]->arg, ifname);
+}
+
+DEFUN (eigrp_no_distribute_list,
+ eigrp_no_distribute_list_cmd,
+ "no distribute-list [prefix] WORD <in|out> [WORD]",
+ NO_STR
+ "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_no_parser(vty, prefix, true,
+ argv[3 + prefix]->text,
+ argv[2 + prefix]->arg, ifname);
+}
+
/* Route-map init */
void eigrp_route_map_init()
@@ -1139,6 +1181,9 @@ void eigrp_route_map_init()
route_map_add_hook(eigrp_route_map_update);
route_map_delete_hook(eigrp_route_map_update);
+ install_element(EIGRP_NODE, &eigrp_distribute_list_cmd);
+ install_element(EIGRP_NODE, &eigrp_no_distribute_list_cmd);
+
/*route_map_install_match (&route_match_metric_cmd);
route_map_install_match (&route_match_interface_cmd);*/
/*route_map_install_match (&route_match_ip_next_hop_cmd);