From: Donatas Abraitis Date: Tue, 19 Oct 2021 12:14:19 +0000 (+0300) Subject: bgpd: Add autocomplete for community/large/extcommunity stuff X-Git-Tag: base_8.2~316^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=a2099c1d640e33597e5d9a17691e741ba0ba6201;p=matthieu%2Ffrr.git bgpd: Add autocomplete for community/large/extcommunity stuff ``` exit1-debian-9(config)# route-map test1 permit 10 exit1-debian-9(config-route-map)# match community ? (1-99) Community-list number (standard) (100-500) Community-list number (expanded) COMMUNITY_LIST_NAME Community-list name testas exit1-debian-9(config-route-map)# match large-community ? (1-99) Large Community-list number (standard) (100-500) Large Community-list number (expanded) LCOMMUNITY_LIST_NAME Large Community-list name LCL-ORIGINATED-ALL exit1-debian-9(config-route-map)# ``` Signed-off-by: Donatas Abraitis --- diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 2f37367a8f..ffeaa3466e 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -4761,7 +4761,7 @@ DEFUN_YANG(no_match_alias, no_match_alias_cmd, "no match alias [ALIAS_NAME]", DEFPY_YANG (match_community, match_community_cmd, - "match community <(1-99)|(100-500)|WORD> [exact-match]", + "match community <(1-99)|(100-500)|COMMUNITY_LIST_NAME> [exact-match]", MATCH_STR "Match BGP community list\n" "Community-list number (standard)\n" @@ -4804,7 +4804,7 @@ DEFPY_YANG (match_community, DEFUN_YANG (no_match_community, no_match_community_cmd, - "no match community [<(1-99)|(100-500)|WORD> [exact-match]]", + "no match community [<(1-99)|(100-500)|COMMUNITY_LIST_NAME> [exact-match]]", NO_STR MATCH_STR "Match BGP community list\n" @@ -4822,7 +4822,7 @@ DEFUN_YANG (no_match_community, DEFPY_YANG (match_lcommunity, match_lcommunity_cmd, - "match large-community <(1-99)|(100-500)|WORD> [exact-match]", + "match large-community <(1-99)|(100-500)|LCOMMUNITY_LIST_NAME> [exact-match]", MATCH_STR "Match BGP large community list\n" "Large Community-list number (standard)\n" @@ -4865,7 +4865,7 @@ DEFPY_YANG (match_lcommunity, DEFUN_YANG (no_match_lcommunity, no_match_lcommunity_cmd, - "no match large-community [<(1-99)|(100-500)|WORD> [exact-match]]", + "no match large-community [<(1-99)|(100-500)|LCOMMUNITY_LIST_NAME> [exact-match]]", NO_STR MATCH_STR "Match BGP large community list\n" @@ -4883,7 +4883,7 @@ DEFUN_YANG (no_match_lcommunity, DEFPY_YANG (match_ecommunity, match_ecommunity_cmd, - "match extcommunity <(1-99)|(100-500)|WORD>", + "match extcommunity <(1-99)|(100-500)|EXTCOMMUNITY_LIST_NAME>", MATCH_STR "Match BGP/VPN extended community list\n" "Extended community-list number (standard)\n" @@ -4909,7 +4909,7 @@ DEFPY_YANG (match_ecommunity, DEFUN_YANG (no_match_ecommunity, no_match_ecommunity_cmd, - "no match extcommunity [<(1-99)|(100-500)|WORD>]", + "no match extcommunity [<(1-99)|(100-500)|EXTCOMMUNITY_LIST_NAME>]", NO_STR MATCH_STR "Match BGP/VPN extended community list\n" @@ -5522,7 +5522,7 @@ ALIAS_YANG (no_set_community, DEFPY_YANG (set_community_delete, set_community_delete_cmd, - "set comm-list <(1-99)|(100-500)|WORD> delete", + "set comm-list <(1-99)|(100-500)|COMMUNITY_LIST_NAME> delete", SET_STR "set BGP community list (for deletion)\n" "Community-list number (standard)\n" @@ -5549,7 +5549,7 @@ DEFPY_YANG (set_community_delete, DEFUN_YANG (no_set_community_delete, no_set_community_delete_cmd, - "no set comm-list [<(1-99)|(100-500)|WORD> delete]", + "no set comm-list [<(1-99)|(100-500)|COMMUNITY_LIST_NAME> delete]", NO_STR SET_STR "set BGP community list (for deletion)\n" @@ -5649,7 +5649,7 @@ ALIAS_YANG (no_set_lcommunity1, DEFPY_YANG (set_lcommunity_delete, set_lcommunity_delete_cmd, - "set large-comm-list <(1-99)|(100-500)|WORD> delete", + "set large-comm-list <(1-99)|(100-500)|LCOMMUNITY_LIST_NAME> delete", SET_STR "set BGP large community list (for deletion)\n" "Large Community-list number (standard)\n" @@ -5675,7 +5675,7 @@ DEFPY_YANG (set_lcommunity_delete, DEFUN_YANG (no_set_lcommunity_delete, no_set_lcommunity_delete_cmd, - "no set large-comm-list <(1-99)|(100-500)|WORD> [delete]", + "no set large-comm-list <(1-99)|(100-500)|LCOMMUNITY_LIST_NAME> [delete]", NO_STR SET_STR "set BGP large community list (for deletion)\n" diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 26da38bd7a..4d972c0642 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -19061,7 +19061,7 @@ static void community_list_perror(struct vty *vty, int ret) /*community-list standard */ DEFUN (community_list_standard, bgp_community_list_standard_cmd, - "bgp community-list <(1-99)|standard WORD> [seq (0-4294967295)] AA:NN...", + "bgp community-list <(1-99)|standard COMMUNITY_LIST_NAME> [seq (0-4294967295)] AA:NN...", BGP_STR COMMUNITY_LIST_STR "Community list number (standard)\n" @@ -19085,7 +19085,7 @@ DEFUN (community_list_standard, idx = 0; argv_find(argv, argc, "(1-99)", &idx); - argv_find(argv, argc, "WORD", &idx); + argv_find(argv, argc, "COMMUNITY_LIST_NAME", &idx); cl_name_or_number = argv[idx]->arg; direct = argv_find(argv, argc, "permit", &idx) ? COMMUNITY_PERMIT : COMMUNITY_DENY; @@ -19108,7 +19108,7 @@ DEFUN (community_list_standard, DEFUN (no_community_list_standard_all, no_bgp_community_list_standard_all_cmd, - "no bgp community-list <(1-99)|standard WORD> [seq (0-4294967295)] AA:NN...", + "no bgp community-list <(1-99)|standard COMMUNITY_LIST_NAME> [seq (0-4294967295)] AA:NN...", NO_STR BGP_STR COMMUNITY_LIST_STR @@ -19148,7 +19148,7 @@ DEFUN (no_community_list_standard_all, idx = 0; argv_find(argv, argc, "(1-99)", &idx); - argv_find(argv, argc, "WORD", &idx); + argv_find(argv, argc, "COMMUNITY_LIST_NAME", &idx); cl_name_or_number = argv[idx]->arg; int ret = community_list_unset(bgp_clist, cl_name_or_number, str, seq, @@ -19165,7 +19165,7 @@ DEFUN (no_community_list_standard_all, } ALIAS(no_community_list_standard_all, no_bgp_community_list_standard_all_list_cmd, - "no bgp community-list <(1-99)|standard WORD>", + "no bgp community-list <(1-99)|standard COMMUNITY_LIST_NAME>", NO_STR BGP_STR COMMUNITY_LIST_STR "Community list number (standard)\n" "Add an standard community-list entry\n" @@ -19174,7 +19174,7 @@ ALIAS(no_community_list_standard_all, no_bgp_community_list_standard_all_list_cm /*community-list expanded */ DEFUN (community_list_expanded_all, bgp_community_list_expanded_all_cmd, - "bgp community-list <(100-500)|expanded WORD> [seq (0-4294967295)] AA:NN...", + "bgp community-list <(100-500)|expanded COMMUNITY_LIST_NAME> [seq (0-4294967295)] AA:NN...", BGP_STR COMMUNITY_LIST_STR "Community list number (expanded)\n" @@ -19199,7 +19199,7 @@ DEFUN (community_list_expanded_all, idx = 0; argv_find(argv, argc, "(100-500)", &idx); - argv_find(argv, argc, "WORD", &idx); + argv_find(argv, argc, "COMMUNITY_LIST_NAME", &idx); cl_name_or_number = argv[idx]->arg; direct = argv_find(argv, argc, "permit", &idx) ? COMMUNITY_PERMIT : COMMUNITY_DENY; @@ -19222,7 +19222,7 @@ DEFUN (community_list_expanded_all, DEFUN (no_community_list_expanded_all, no_bgp_community_list_expanded_all_cmd, - "no bgp community-list <(100-500)|expanded WORD> [seq (0-4294967295)] AA:NN...", + "no bgp community-list <(100-500)|expanded COMMUNITY_LIST_NAME> [seq (0-4294967295)] AA:NN...", NO_STR BGP_STR COMMUNITY_LIST_STR @@ -19262,7 +19262,7 @@ DEFUN (no_community_list_expanded_all, idx = 0; argv_find(argv, argc, "(100-500)", &idx); - argv_find(argv, argc, "WORD", &idx); + argv_find(argv, argc, "COMMUNITY_LIST_NAME", &idx); cl_name_or_number = argv[idx]->arg; int ret = community_list_unset(bgp_clist, cl_name_or_number, str, seq, @@ -19280,7 +19280,7 @@ DEFUN (no_community_list_expanded_all, ALIAS(no_community_list_expanded_all, no_bgp_community_list_expanded_all_list_cmd, - "no bgp community-list <(100-500)|expanded WORD>", + "no bgp community-list <(100-500)|expanded COMMUNITY_LIST_NAME>", NO_STR BGP_STR COMMUNITY_LIST_STR "Community list number (expanded)\n" "Add an expanded community-list entry\n" @@ -19358,7 +19358,7 @@ DEFUN (show_community_list, DEFUN (show_community_list_arg, show_bgp_community_list_arg_cmd, - "show bgp community-list <(1-500)|WORD> detail", + "show bgp community-list <(1-500)|COMMUNITY_LIST_NAME> detail", SHOW_STR BGP_STR "List community-list\n" @@ -19404,7 +19404,7 @@ static int lcommunity_list_set_vty(struct vty *vty, int argc, /* All digit name check. */ idx = 0; - argv_find(argv, argc, "WORD", &idx); + argv_find(argv, argc, "LCOMMUNITY_LIST_NAME", &idx); argv_find(argv, argc, "(1-99)", &idx); argv_find(argv, argc, "(100-500)", &idx); cl_name = argv[idx]->arg; @@ -19468,7 +19468,7 @@ static int lcommunity_list_unset_vty(struct vty *vty, int argc, idx = 0; argv_find(argv, argc, "(1-99)", &idx); argv_find(argv, argc, "(100-500)", &idx); - argv_find(argv, argc, "WORD", &idx); + argv_find(argv, argc, "LCOMMUNITY_LIST_NAME", &idx); /* Unset community list. */ ret = lcommunity_list_unset(bgp_clist, argv[idx]->arg, str, seq, direct, @@ -19524,7 +19524,7 @@ DEFUN (lcommunity_list_expanded, DEFUN (lcommunity_list_name_standard, bgp_lcommunity_list_name_standard_cmd, - "bgp large-community-list standard WORD [seq (0-4294967295)] AA:BB:CC...", + "bgp large-community-list standard LCOMMUNITY_LIST_NAME [seq (0-4294967295)] AA:BB:CC...", BGP_STR LCOMMUNITY_LIST_STR "Specify standard large-community-list\n" @@ -19541,7 +19541,7 @@ DEFUN (lcommunity_list_name_standard, DEFUN (lcommunity_list_name_expanded, bgp_lcommunity_list_name_expanded_cmd, - "bgp large-community-list expanded WORD [seq (0-4294967295)] LINE...", + "bgp large-community-list expanded LCOMMUNITY_LIST_NAME [seq (0-4294967295)] LINE...", BGP_STR LCOMMUNITY_LIST_STR "Specify expanded large-community-list\n" @@ -19558,7 +19558,7 @@ DEFUN (lcommunity_list_name_expanded, DEFUN (no_lcommunity_list_all, no_bgp_lcommunity_list_all_cmd, - "no bgp large-community-list <(1-99)|(100-500)|WORD>", + "no bgp large-community-list <(1-99)|(100-500)|LCOMMUNITY_LIST_NAME>", NO_STR BGP_STR LCOMMUNITY_LIST_STR @@ -19572,7 +19572,7 @@ DEFUN (no_lcommunity_list_all, DEFUN (no_lcommunity_list_name_standard_all, no_bgp_lcommunity_list_name_standard_all_cmd, - "no bgp large-community-list standard WORD", + "no bgp large-community-list standard LCOMMUNITY_LIST_NAME", NO_STR BGP_STR LCOMMUNITY_LIST_STR @@ -19585,7 +19585,7 @@ DEFUN (no_lcommunity_list_name_standard_all, DEFUN (no_lcommunity_list_name_expanded_all, no_bgp_lcommunity_list_name_expanded_all_cmd, - "no bgp large-community-list expanded WORD", + "no bgp large-community-list expanded LCOMMUNITY_LIST_NAME", NO_STR BGP_STR LCOMMUNITY_LIST_STR @@ -19632,7 +19632,7 @@ DEFUN (no_lcommunity_list_expanded, DEFUN (no_lcommunity_list_name_standard, no_bgp_lcommunity_list_name_standard_cmd, - "no bgp large-community-list standard WORD [seq (0-4294967295)] AA:AA:NN...", + "no bgp large-community-list standard LCOMMUNITY_LIST_NAME [seq (0-4294967295)] AA:AA:NN...", NO_STR BGP_STR LCOMMUNITY_LIST_STR @@ -19650,7 +19650,7 @@ DEFUN (no_lcommunity_list_name_standard, DEFUN (no_lcommunity_list_name_expanded, no_bgp_lcommunity_list_name_expanded_cmd, - "no bgp large-community-list expanded WORD [seq (0-4294967295)] LINE...", + "no bgp large-community-list expanded LCOMMUNITY_LIST_NAME [seq (0-4294967295)] LINE...", NO_STR BGP_STR LCOMMUNITY_LIST_STR @@ -19724,7 +19724,7 @@ DEFUN (show_lcommunity_list, DEFUN (show_lcommunity_list_arg, show_bgp_lcommunity_list_arg_cmd, - "show bgp large-community-list <(1-500)|WORD> detail", + "show bgp large-community-list <(1-500)|LCOMMUNITY_LIST_NAME> detail", SHOW_STR BGP_STR "List large-community list\n" @@ -19752,7 +19752,7 @@ DEFUN (show_lcommunity_list_arg, DEFUN (extcommunity_list_standard, bgp_extcommunity_list_standard_cmd, - "bgp extcommunity-list <(1-99)|standard WORD> [seq (0-4294967295)] AA:NN...", + "bgp extcommunity-list <(1-99)|standard EXTCOMMUNITY_LIST_NAME> [seq (0-4294967295)] AA:NN...", BGP_STR EXTCOMMUNITY_LIST_STR "Extended Community list number (standard)\n" @@ -19772,7 +19772,7 @@ DEFUN (extcommunity_list_standard, int idx = 0; argv_find(argv, argc, "(1-99)", &idx); - argv_find(argv, argc, "WORD", &idx); + argv_find(argv, argc, "EXTCOMMUNITY_LIST_NAME", &idx); cl_number_or_name = argv[idx]->arg; if (argv_find(argv, argc, "(0-4294967295)", &idx)) @@ -19798,7 +19798,7 @@ DEFUN (extcommunity_list_standard, DEFUN (extcommunity_list_name_expanded, bgp_extcommunity_list_name_expanded_cmd, - "bgp extcommunity-list <(100-500)|expanded WORD> [seq (0-4294967295)] LINE...", + "bgp extcommunity-list <(100-500)|expanded EXTCOMMUNITY_LIST_NAME> [seq (0-4294967295)] LINE...", BGP_STR EXTCOMMUNITY_LIST_STR "Extended Community list number (expanded)\n" @@ -19817,7 +19817,7 @@ DEFUN (extcommunity_list_name_expanded, int idx = 0; argv_find(argv, argc, "(100-500)", &idx); - argv_find(argv, argc, "WORD", &idx); + argv_find(argv, argc, "EXTCOMMUNITY_LIST_NAME", &idx); cl_number_or_name = argv[idx]->arg; if (argv_find(argv, argc, "(0-4294967295)", &idx)) @@ -19843,7 +19843,7 @@ DEFUN (extcommunity_list_name_expanded, DEFUN (no_extcommunity_list_standard_all, no_bgp_extcommunity_list_standard_all_cmd, - "no bgp extcommunity-list <(1-99)|standard WORD> [seq (0-4294967295)] AA:NN...", + "no bgp extcommunity-list <(1-99)|standard EXTCOMMUNITY_LIST_NAME> [seq (0-4294967295)] AA:NN...", NO_STR BGP_STR EXTCOMMUNITY_LIST_STR @@ -19881,7 +19881,7 @@ DEFUN (no_extcommunity_list_standard_all, idx = 0; argv_find(argv, argc, "(1-99)", &idx); - argv_find(argv, argc, "WORD", &idx); + argv_find(argv, argc, "EXTCOMMUNITY_LIST_NAME", &idx); cl_number_or_name = argv[idx]->arg; int ret = extcommunity_list_unset(bgp_clist, cl_number_or_name, str, @@ -19899,7 +19899,7 @@ DEFUN (no_extcommunity_list_standard_all, ALIAS(no_extcommunity_list_standard_all, no_bgp_extcommunity_list_standard_all_list_cmd, - "no bgp extcommunity-list <(1-99)|standard WORD>", + "no bgp extcommunity-list <(1-99)|standard EXTCOMMUNITY_LIST_NAME>", NO_STR BGP_STR EXTCOMMUNITY_LIST_STR "Extended Community list number (standard)\n" "Specify standard extcommunity-list\n" @@ -19907,7 +19907,7 @@ ALIAS(no_extcommunity_list_standard_all, DEFUN (no_extcommunity_list_expanded_all, no_bgp_extcommunity_list_expanded_all_cmd, - "no bgp extcommunity-list <(100-500)|expanded WORD> [seq (0-4294967295)] LINE...", + "no bgp extcommunity-list <(100-500)|expanded EXTCOMMUNITY_LIST_NAME> [seq (0-4294967295)] LINE...", NO_STR BGP_STR EXTCOMMUNITY_LIST_STR @@ -19946,7 +19946,7 @@ DEFUN (no_extcommunity_list_expanded_all, idx = 0; argv_find(argv, argc, "(100-500)", &idx); - argv_find(argv, argc, "WORD", &idx); + argv_find(argv, argc, "EXTCOMMUNITY_LIST_NAME", &idx); cl_number_or_name = argv[idx]->arg; int ret = extcommunity_list_unset(bgp_clist, cl_number_or_name, str, @@ -19964,7 +19964,7 @@ DEFUN (no_extcommunity_list_expanded_all, ALIAS(no_extcommunity_list_expanded_all, no_bgp_extcommunity_list_expanded_all_list_cmd, - "no bgp extcommunity-list <(100-500)|expanded WORD>", + "no bgp extcommunity-list <(100-500)|expanded EXTCOMMUNITY_LIST_NAME>", NO_STR BGP_STR EXTCOMMUNITY_LIST_STR "Extended Community list number (expanded)\n" "Specify expanded extcommunity-list\n" @@ -20025,7 +20025,7 @@ DEFUN (show_extcommunity_list, DEFUN (show_extcommunity_list_arg, show_bgp_extcommunity_list_arg_cmd, - "show bgp extcommunity-list <(1-500)|WORD> detail", + "show bgp extcommunity-list <(1-500)|EXTCOMMUNITY_LIST_NAME> detail", SHOW_STR BGP_STR "List extended-community list\n"