mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 16:57:44 +00:00
bgpd: Remove extcommunity-list by name without typing full rule
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
This commit is contained in:
parent
fef6daf4da
commit
d4455c8975
@ -14984,6 +14984,7 @@ DEFUN (no_extcommunity_list_standard_all,
|
||||
int style = EXTCOMMUNITY_LIST_STANDARD;
|
||||
int direct = 0;
|
||||
char *cl_number_or_name = NULL;
|
||||
char *str = NULL;
|
||||
|
||||
int idx = 0;
|
||||
if (argv_find(argv, argc, "ip", &idx)) {
|
||||
@ -14992,13 +14993,25 @@ DEFUN (no_extcommunity_list_standard_all,
|
||||
vty_out(vty, "'no bgp extcommunity-list <(1-99)|(100-500)|standard|expanded> <deny|permit> <LINE|AA:NN>'\n");
|
||||
zlog_warn("Deprecated option: ‘no ip extcommunity-list <(1-99)|(100-500)|standard|expanded> <deny|permit> <LINE|AA:NN>' being used");
|
||||
}
|
||||
|
||||
idx = 0;
|
||||
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_number_or_name = 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 = extcommunity_list_unset(bgp_clist, cl_number_or_name, str,
|
||||
direct, style);
|
||||
@ -15026,6 +15039,22 @@ ALIAS (no_extcommunity_list_standard_all,
|
||||
"Specify community to accept\n"
|
||||
EXTCOMMUNITY_VAL_STR)
|
||||
|
||||
ALIAS(no_extcommunity_list_standard_all,
|
||||
no_bgp_extcommunity_list_standard_all_list_cmd,
|
||||
"no bgp extcommunity-list <(1-99)|standard WORD>",
|
||||
NO_STR IP_STR EXTCOMMUNITY_LIST_STR
|
||||
"Extended Community list number (standard)\n"
|
||||
"Specify standard extcommunity-list\n"
|
||||
"Community list name\n")
|
||||
|
||||
ALIAS(no_extcommunity_list_standard_all,
|
||||
no_ip_extcommunity_list_standard_all_list_cmd,
|
||||
"no ip extcommunity-list <(1-99)|standard WORD>",
|
||||
NO_STR IP_STR EXTCOMMUNITY_LIST_STR
|
||||
"Extended Community list number (standard)\n"
|
||||
"Specify standard extcommunity-list\n"
|
||||
"Community list name\n")
|
||||
|
||||
DEFUN (no_extcommunity_list_expanded_all,
|
||||
no_bgp_extcommunity_list_expanded_all_cmd,
|
||||
"no bgp extcommunity-list <(100-500)|expanded WORD> <deny|permit> LINE...",
|
||||
@ -15042,6 +15071,7 @@ DEFUN (no_extcommunity_list_expanded_all,
|
||||
int style = EXTCOMMUNITY_LIST_EXPANDED;
|
||||
int direct = 0;
|
||||
char *cl_number_or_name = NULL;
|
||||
char *str = NULL;
|
||||
|
||||
int idx = 0;
|
||||
if (argv_find(argv, argc, "ip", &idx)) {
|
||||
@ -15050,13 +15080,25 @@ DEFUN (no_extcommunity_list_expanded_all,
|
||||
vty_out(vty, "'no bgp extcommunity-list <(1-99)|(100-500)|standard|expanded> <deny|permit> <LINE|AA:NN>'\n");
|
||||
zlog_warn("Deprecated option: ‘no ip extcommunity-list <(1-99)|(100-500)|standard|expanded> <deny|permit> <LINE|AA:NN>' being used");
|
||||
}
|
||||
|
||||
idx = 0;
|
||||
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, "LINE", &idx);
|
||||
str = argv_concat(argv, argc, idx);
|
||||
}
|
||||
|
||||
idx = 0;
|
||||
argv_find(argv, argc, "(100-500)", &idx);
|
||||
argv_find(argv, argc, "WORD", &idx);
|
||||
cl_number_or_name = argv[idx]->arg;
|
||||
direct = argv_find(argv, argc, "permit", &idx) ? COMMUNITY_PERMIT
|
||||
: COMMUNITY_DENY;
|
||||
argv_find(argv, argc, "LINE", &idx);
|
||||
char *str = argv_concat(argv, argc, idx);
|
||||
|
||||
int ret = extcommunity_list_unset(bgp_clist, cl_number_or_name, str,
|
||||
direct, style);
|
||||
@ -15084,6 +15126,22 @@ ALIAS (no_extcommunity_list_expanded_all,
|
||||
"Specify community to accept\n"
|
||||
"An ordered list as a regular-expression\n")
|
||||
|
||||
ALIAS(no_extcommunity_list_expanded_all,
|
||||
no_ip_extcommunity_list_expanded_all_list_cmd,
|
||||
"no ip extcommunity-list <(100-500)|expanded WORD>",
|
||||
NO_STR IP_STR EXTCOMMUNITY_LIST_STR
|
||||
"Extended Community list number (expanded)\n"
|
||||
"Specify expanded extcommunity-list\n"
|
||||
"Extended Community list name\n")
|
||||
|
||||
ALIAS(no_extcommunity_list_expanded_all,
|
||||
no_bgp_extcommunity_list_expanded_all_list_cmd,
|
||||
"no bgp extcommunity-list <(100-500)|expanded WORD>",
|
||||
NO_STR IP_STR EXTCOMMUNITY_LIST_STR
|
||||
"Extended Community list number (expanded)\n"
|
||||
"Specify expanded extcommunity-list\n"
|
||||
"Extended Community list name\n")
|
||||
|
||||
static void extcommunity_list_show(struct vty *vty, struct community_list *list)
|
||||
{
|
||||
struct community_entry *entry;
|
||||
@ -15297,13 +15355,19 @@ static void community_list_vty(void)
|
||||
install_element(CONFIG_NODE, &bgp_extcommunity_list_standard_cmd);
|
||||
install_element(CONFIG_NODE, &bgp_extcommunity_list_name_expanded_cmd);
|
||||
install_element(CONFIG_NODE, &no_bgp_extcommunity_list_standard_all_cmd);
|
||||
install_element(CONFIG_NODE,
|
||||
&no_bgp_extcommunity_list_standard_all_list_cmd);
|
||||
install_element(CONFIG_NODE, &no_bgp_extcommunity_list_expanded_all_cmd);
|
||||
install_element(CONFIG_NODE,
|
||||
&no_bgp_extcommunity_list_expanded_all_list_cmd);
|
||||
install_element(VIEW_NODE, &show_bgp_extcommunity_list_cmd);
|
||||
install_element(VIEW_NODE, &show_bgp_extcommunity_list_arg_cmd);
|
||||
install_element(CONFIG_NODE, &ip_extcommunity_list_standard_cmd);
|
||||
install_element(CONFIG_NODE, &ip_extcommunity_list_name_expanded_cmd);
|
||||
install_element(CONFIG_NODE, &no_ip_extcommunity_list_standard_all_cmd);
|
||||
install_element(CONFIG_NODE, &no_ip_extcommunity_list_standard_all_list_cmd);
|
||||
install_element(CONFIG_NODE, &no_ip_extcommunity_list_expanded_all_cmd);
|
||||
install_element(CONFIG_NODE, &no_ip_extcommunity_list_expanded_all_list_cmd);
|
||||
install_element(VIEW_NODE, &show_ip_extcommunity_list_cmd);
|
||||
install_element(VIEW_NODE, &show_ip_extcommunity_list_arg_cmd);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user