From 943224a13afd27891d65e67c5044b969cc4f6a91 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 21 Oct 2021 22:38:31 +0300 Subject: [PATCH] lib: Add autocomplete for prefix-list under route-maps ``` exit1-debian-9(config-route-map)# match ip route-source prefix-list ? PREFIXLIST_NAME IP prefix-list name p1 p2 ``` Signed-off-by: Donatas Abraitis --- bgpd/bgp_routemap.c | 4 ++-- eigrpd/eigrp_routemap.c | 8 ++++---- lib/plist.c | 2 ++ lib/routemap_cli.c | 12 ++++++------ 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index d7c56dd83a..3fc478bc97 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -4616,7 +4616,7 @@ DEFUN_YANG (no_match_ip_route_source, DEFUN_YANG (match_ip_route_source_prefix_list, match_ip_route_source_prefix_list_cmd, - "match ip route-source prefix-list WORD", + "match ip route-source prefix-list PREFIXLIST_NAME", MATCH_STR IP_STR "Match advertising source address of route\n" @@ -4640,7 +4640,7 @@ DEFUN_YANG (match_ip_route_source_prefix_list, DEFUN_YANG (no_match_ip_route_source_prefix_list, no_match_ip_route_source_prefix_list_cmd, - "no match ip route-source prefix-list [WORD]", + "no match ip route-source prefix-list [PREFIXLIST_NAME]", NO_STR MATCH_STR IP_STR diff --git a/eigrpd/eigrp_routemap.c b/eigrpd/eigrp_routemap.c index 67fab89271..65fa95b652 100644 --- a/eigrpd/eigrp_routemap.c +++ b/eigrpd/eigrp_routemap.c @@ -890,7 +890,7 @@ ALIAS(no_match_ip_next_hop, no_match_ip_next_hop_val_cmd, DEFUN (match_ip_next_hop_prefix_list, match_ip_next_hop_prefix_list_cmd, - "match ip next-hop prefix-list WORD", + "match ip next-hop prefix-list PREFIXLIST_NAME", MATCH_STR IP_STR "Match next-hop address of route\n" @@ -920,7 +920,7 @@ DEFUN (no_match_ip_next_hop_prefix_list, ALIAS(no_match_ip_next_hop_prefix_list, no_match_ip_next_hop_prefix_list_val_cmd, - "no match ip next-hop prefix-list WORD", NO_STR MATCH_STR IP_STR + "no match ip next-hop prefix-list PREFIXLIST_NAME", NO_STR MATCH_STR IP_STR "Match next-hop address of route\n" "Match entries of prefix-lists\n" "IP prefix-list name\n") @@ -958,7 +958,7 @@ ALIAS(no_match_ip_address, no_match_ip_address_val_cmd, DEFUN (match_ip_address_prefix_list, match_ip_address_prefix_list_cmd, - "match ip address prefix-list WORD", + "match ip address prefix-list PREFIXLIST_NAME", MATCH_STR IP_STR "Match address of route\n" @@ -987,7 +987,7 @@ DEFUN (no_match_ip_address_prefix_list, } ALIAS(no_match_ip_address_prefix_list, no_match_ip_address_prefix_list_val_cmd, - "no match ip address prefix-list WORD", NO_STR MATCH_STR IP_STR + "no match ip address prefix-list PREFIXLIST_NAME", NO_STR MATCH_STR IP_STR "Match address of route\n" "Match entries of prefix-lists\n" "IP prefix-list name\n") diff --git a/lib/plist.c b/lib/plist.c index 2f9f06f43b..a53b087a46 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -1668,6 +1668,8 @@ static const struct cmd_variable_handler plist_var_handlers[] = { {/* "prefix-list WORD" */ .varname = "prefix_list", .completions = plist_autocomplete}, + {.tokenname = "PREFIXLIST_NAME", + .completions = plist_autocomplete}, {.completions = NULL}}; diff --git a/lib/routemap_cli.c b/lib/routemap_cli.c index 9360c7f529..918a2ebdcb 100644 --- a/lib/routemap_cli.c +++ b/lib/routemap_cli.c @@ -204,7 +204,7 @@ DEFPY_YANG( DEFPY_YANG( match_ip_address_prefix_list, match_ip_address_prefix_list_cmd, - "match ip address prefix-list WORD$name", + "match ip address prefix-list PREFIXLIST_NAME$name", MATCH_STR IP_STR "Match address of route\n" @@ -225,7 +225,7 @@ DEFPY_YANG( DEFPY_YANG( no_match_ip_address_prefix_list, no_match_ip_address_prefix_list_cmd, - "no match ip address prefix-list [WORD]", + "no match ip address prefix-list [PREFIXLIST_NAME]", NO_STR MATCH_STR IP_STR @@ -281,7 +281,7 @@ DEFPY_YANG( DEFPY_YANG( match_ip_next_hop_prefix_list, match_ip_next_hop_prefix_list_cmd, - "match ip next-hop prefix-list WORD$name", + "match ip next-hop prefix-list PREFIXLIST_NAME$name", MATCH_STR IP_STR "Match next-hop address of route\n" @@ -303,7 +303,7 @@ DEFPY_YANG( DEFPY_YANG( no_match_ip_next_hop_prefix_list, no_match_ip_next_hop_prefix_list_cmd, - "no match ip next-hop prefix-list [WORD]", + "no match ip next-hop prefix-list [PREFIXLIST_NAME]", NO_STR MATCH_STR IP_STR @@ -395,7 +395,7 @@ DEFPY_YANG( DEFPY_YANG( match_ipv6_address_prefix_list, match_ipv6_address_prefix_list_cmd, - "match ipv6 address prefix-list WORD$name", + "match ipv6 address prefix-list PREFIXLIST_NAME$name", MATCH_STR IPV6_STR "Match address of route\n" @@ -417,7 +417,7 @@ DEFPY_YANG( DEFPY_YANG( no_match_ipv6_address_prefix_list, no_match_ipv6_address_prefix_list_cmd, - "no match ipv6 address prefix-list [WORD]", + "no match ipv6 address prefix-list [PREFIXLIST_NAME]", NO_STR MATCH_STR IPV6_STR -- 2.39.5