diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 4dd148bb4139..fd7b8f445bfe 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -13986,6 +13986,7 @@ DEFUN (no_community_list_standard_all, COMMUNITY_VAL_STR) { char *cl_name_or_number = NULL; + char *str = NULL; int direct = 0; int style = COMMUNITY_LIST_STANDARD; @@ -13998,13 +13999,23 @@ DEFUN (no_community_list_standard_all, zlog_warn("Deprecated option: 'no ip community-list <(1-99)|(100-500)|standard|expanded> |AA:NN' being used"); } + argv_find(argv, argc, "permit", &idx); + argv_find(argv, argc, "deny", &idx); + + if (idx) { + direct = argv_find(argv, argc, "permit", &idx) + ? COMMUNITY_PERMIT + : COMMUNITY_DENY; + + idx = 0; + argv_find(argv, argc, "AA:NN", &idx); + str = argv_concat(argv, argc, idx); + } + + idx = 0; argv_find(argv, argc, "(1-99)", &idx); argv_find(argv, argc, "WORD", &idx); cl_name_or_number = argv[idx]->arg; - direct = argv_find(argv, argc, "permit", &idx) ? COMMUNITY_PERMIT - : COMMUNITY_DENY; - argv_find(argv, argc, "AA:NN", &idx); - char *str = argv_concat(argv, argc, idx); int ret = community_list_unset(bgp_clist, cl_name_or_number, str, direct, style); @@ -14031,6 +14042,20 @@ ALIAS (no_community_list_standard_all, "Specify community to accept\n" COMMUNITY_VAL_STR) +ALIAS(no_community_list_standard_all, no_bgp_community_list_standard_all_list_cmd, + "no bgp community-list <(1-99)|standard WORD>", + NO_STR BGP_STR COMMUNITY_LIST_STR + "Community list number (standard)\n" + "Add an standard community-list entry\n" + "Community list name\n") + +ALIAS(no_community_list_standard_all, no_ip_community_list_standard_all_list_cmd, + "no ip community-list <(1-99)|standard WORD>", + NO_STR BGP_STR COMMUNITY_LIST_STR + "Community list number (standard)\n" + "Add an standard community-list entry\n" + "Community list name\n") + /*community-list expanded */ DEFUN (community_list_expanded_all, bgp_community_list_expanded_all_cmd, @@ -14103,6 +14128,7 @@ DEFUN (no_community_list_expanded_all, COMMUNITY_VAL_STR) { char *cl_name_or_number = NULL; + char *str = NULL; int direct = 0; int style = COMMUNITY_LIST_EXPANDED; @@ -14110,16 +14136,27 @@ DEFUN (no_community_list_expanded_all, if (argv_find(argv, argc, "ip", &idx)) { vty_out(vty, "This config option is deprecated, and is scheduled for removal.\n"); vty_out(vty, "if you are using this please migrate to the below command.\n"); - vty_out(vty, "'no community-list <(1-99)|(100-500)|standard|expanded> AA:NN'\n"); - zlog_warn("Deprecated option: 'no community-list <(1-99)|(100-500)|standard|expanded> AA:NN' being used"); + vty_out(vty, "'no bgp community-list <(1-99)|(100-500)|standard|expanded> AA:NN'\n"); + zlog_warn("Deprecated option: 'no ip community-list <(1-99)|(100-500)|standard|expanded> AA:NN' being used"); + } + + argv_find(argv, argc, "permit", &idx); + argv_find(argv, argc, "deny", &idx); + + if (idx) { + direct = argv_find(argv, argc, "permit", &idx) + ? COMMUNITY_PERMIT + : COMMUNITY_DENY; + + idx = 0; + argv_find(argv, argc, "AA:NN", &idx); + str = argv_concat(argv, argc, idx); } + + idx = 0; argv_find(argv, argc, "(100-500)", &idx); argv_find(argv, argc, "WORD", &idx); cl_name_or_number = argv[idx]->arg; - direct = argv_find(argv, argc, "permit", &idx) ? COMMUNITY_PERMIT - : COMMUNITY_DENY; - argv_find(argv, argc, "AA:NN", &idx); - char *str = argv_concat(argv, argc, idx); int ret = community_list_unset(bgp_clist, cl_name_or_number, str, direct, style); @@ -14147,6 +14184,20 @@ ALIAS (no_community_list_expanded_all, "Specify community to accept\n" COMMUNITY_VAL_STR) +ALIAS(no_community_list_expanded_all, no_bgp_community_list_expanded_all_list_cmd, + "no bgp community-list <(100-500)|expanded WORD>", + NO_STR IP_STR COMMUNITY_LIST_STR + "Community list number (expanded)\n" + "Add an expanded community-list entry\n" + "Community list name\n") + +ALIAS(no_community_list_expanded_all, no_ip_community_list_expanded_all_list_cmd, + "no ip community-list <(100-500)|expanded WORD>", + NO_STR IP_STR COMMUNITY_LIST_STR + "Community list number (expanded)\n" + "Add an expanded community-list entry\n" + "Community list name\n") + /* Return configuration string of community-list entry. */ static const char *community_list_config_str(struct community_entry *entry) { @@ -15227,13 +15278,17 @@ static void community_list_vty(void) install_element(CONFIG_NODE, &bgp_community_list_standard_cmd); install_element(CONFIG_NODE, &bgp_community_list_expanded_all_cmd); install_element(CONFIG_NODE, &no_bgp_community_list_standard_all_cmd); + install_element(CONFIG_NODE, &no_bgp_community_list_standard_all_list_cmd); install_element(CONFIG_NODE, &no_bgp_community_list_expanded_all_cmd); + install_element(CONFIG_NODE, &no_bgp_community_list_expanded_all_list_cmd); install_element(VIEW_NODE, &show_bgp_community_list_cmd); install_element(VIEW_NODE, &show_bgp_community_list_arg_cmd); install_element(CONFIG_NODE, &ip_community_list_standard_cmd); install_element(CONFIG_NODE, &ip_community_list_expanded_all_cmd); install_element(CONFIG_NODE, &no_ip_community_list_standard_all_cmd); + install_element(CONFIG_NODE, &no_ip_community_list_standard_all_list_cmd); install_element(CONFIG_NODE, &no_ip_community_list_expanded_all_cmd); + install_element(CONFIG_NODE, &no_ip_community_list_expanded_all_list_cmd); install_element(VIEW_NODE, &show_ip_community_list_cmd); install_element(VIEW_NODE, &show_ip_community_list_arg_cmd);