bgpd: List all groups dynamically for commands with peer-group

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
This commit is contained in:
Donatas Abraitis 2019-06-11 23:29:32 +03:00
parent afbdfbb69b
commit d7b9898c7f
3 changed files with 18 additions and 18 deletions

View File

@ -2577,7 +2577,7 @@ static struct peer_group *listen_range_exists(struct bgp *bgp,
DEFUN (bgp_listen_range, DEFUN (bgp_listen_range,
bgp_listen_range_cmd, bgp_listen_range_cmd,
"bgp listen range <A.B.C.D/M|X:X::X:X/M> peer-group WORD", "bgp listen range <A.B.C.D/M|X:X::X:X/M> peer-group PGNAME",
"BGP specific commands\n" "BGP specific commands\n"
"Configure BGP dynamic neighbors listen range\n" "Configure BGP dynamic neighbors listen range\n"
"Configure BGP dynamic neighbors listen range\n" "Configure BGP dynamic neighbors listen range\n"
@ -2595,7 +2595,7 @@ DEFUN (bgp_listen_range,
argv_find(argv, argc, "A.B.C.D/M", &idx); argv_find(argv, argc, "A.B.C.D/M", &idx);
argv_find(argv, argc, "X:X::X:X/M", &idx); argv_find(argv, argc, "X:X::X:X/M", &idx);
char *prefix = argv[idx]->arg; char *prefix = argv[idx]->arg;
argv_find(argv, argc, "WORD", &idx); argv_find(argv, argc, "PGNAME", &idx);
char *peergroup = argv[idx]->arg; char *peergroup = argv[idx]->arg;
/* Convert IP prefix string to struct prefix. */ /* Convert IP prefix string to struct prefix. */
@ -2647,7 +2647,7 @@ DEFUN (bgp_listen_range,
DEFUN (no_bgp_listen_range, DEFUN (no_bgp_listen_range,
no_bgp_listen_range_cmd, no_bgp_listen_range_cmd,
"no bgp listen range <A.B.C.D/M|X:X::X:X/M> peer-group WORD", "no bgp listen range <A.B.C.D/M|X:X::X:X/M> peer-group PGNAME",
NO_STR NO_STR
"BGP specific commands\n" "BGP specific commands\n"
"Unconfigure BGP dynamic neighbors listen range\n" "Unconfigure BGP dynamic neighbors listen range\n"
@ -2947,7 +2947,7 @@ static int peer_conf_interface_get(struct vty *vty, const char *conf_if,
DEFUN (neighbor_interface_config, DEFUN (neighbor_interface_config,
neighbor_interface_config_cmd, neighbor_interface_config_cmd,
"neighbor WORD interface [peer-group WORD]", "neighbor WORD interface [peer-group PGNAME]",
NEIGHBOR_STR NEIGHBOR_STR
"Interface name or neighbor tag\n" "Interface name or neighbor tag\n"
"Enable BGP on interface\n" "Enable BGP on interface\n"
@ -2968,7 +2968,7 @@ DEFUN (neighbor_interface_config,
DEFUN (neighbor_interface_config_v6only, DEFUN (neighbor_interface_config_v6only,
neighbor_interface_config_v6only_cmd, neighbor_interface_config_v6only_cmd,
"neighbor WORD interface v6only [peer-group WORD]", "neighbor WORD interface v6only [peer-group PGNAME]",
NEIGHBOR_STR NEIGHBOR_STR
"Interface name or neighbor tag\n" "Interface name or neighbor tag\n"
"Enable BGP on interface\n" "Enable BGP on interface\n"
@ -3113,7 +3113,7 @@ DEFUN (no_neighbor,
DEFUN (no_neighbor_interface_config, DEFUN (no_neighbor_interface_config,
no_neighbor_interface_config_cmd, no_neighbor_interface_config_cmd,
"no neighbor WORD interface [v6only] [peer-group WORD] [remote-as <(1-4294967295)|internal|external>]", "no neighbor WORD interface [v6only] [peer-group PGNAME] [remote-as <(1-4294967295)|internal|external>]",
NO_STR NO_STR
NEIGHBOR_STR NEIGHBOR_STR
"Interface name\n" "Interface name\n"
@ -3428,7 +3428,7 @@ ALIAS_HIDDEN(no_neighbor_activate, no_neighbor_activate_hidden_cmd,
DEFUN (neighbor_set_peer_group, DEFUN (neighbor_set_peer_group,
neighbor_set_peer_group_cmd, neighbor_set_peer_group_cmd,
"neighbor <A.B.C.D|X:X::X:X|WORD> peer-group WORD", "neighbor <A.B.C.D|X:X::X:X|WORD> peer-group PGNAME",
NEIGHBOR_STR NEIGHBOR_STR
NEIGHBOR_ADDR_STR2 NEIGHBOR_ADDR_STR2
"Member of the peer-group\n" "Member of the peer-group\n"
@ -3486,14 +3486,14 @@ DEFUN (neighbor_set_peer_group,
} }
ALIAS_HIDDEN(neighbor_set_peer_group, neighbor_set_peer_group_hidden_cmd, ALIAS_HIDDEN(neighbor_set_peer_group, neighbor_set_peer_group_hidden_cmd,
"neighbor <A.B.C.D|X:X::X:X|WORD> peer-group WORD", "neighbor <A.B.C.D|X:X::X:X|WORD> peer-group PGNAME",
NEIGHBOR_STR NEIGHBOR_ADDR_STR2 NEIGHBOR_STR NEIGHBOR_ADDR_STR2
"Member of the peer-group\n" "Member of the peer-group\n"
"Peer-group name\n") "Peer-group name\n")
DEFUN (no_neighbor_set_peer_group, DEFUN (no_neighbor_set_peer_group,
no_neighbor_set_peer_group_cmd, no_neighbor_set_peer_group_cmd,
"no neighbor <A.B.C.D|X:X::X:X|WORD> peer-group WORD", "no neighbor <A.B.C.D|X:X::X:X|WORD> peer-group PGNAME",
NO_STR NO_STR
NEIGHBOR_STR NEIGHBOR_STR
NEIGHBOR_ADDR_STR2 NEIGHBOR_ADDR_STR2
@ -3523,7 +3523,7 @@ DEFUN (no_neighbor_set_peer_group,
} }
ALIAS_HIDDEN(no_neighbor_set_peer_group, no_neighbor_set_peer_group_hidden_cmd, ALIAS_HIDDEN(no_neighbor_set_peer_group, no_neighbor_set_peer_group_hidden_cmd,
"no neighbor <A.B.C.D|X:X::X:X|WORD> peer-group WORD", "no neighbor <A.B.C.D|X:X::X:X|WORD> peer-group PGNAME",
NO_STR NEIGHBOR_STR NEIGHBOR_ADDR_STR2 NO_STR NEIGHBOR_STR NEIGHBOR_ADDR_STR2
"Member of the peer-group\n" "Member of the peer-group\n"
"Peer-group name\n") "Peer-group name\n")
@ -7216,7 +7216,7 @@ static int bgp_clear_prefix(struct vty *vty, const char *view_name,
/* one clear bgp command to rule them all */ /* one clear bgp command to rule them all */
DEFUN (clear_ip_bgp_all, DEFUN (clear_ip_bgp_all,
clear_ip_bgp_all_cmd, clear_ip_bgp_all_cmd,
"clear [ip] bgp [<view|vrf> VIEWVRFNAME] [<ipv4|ipv6|l2vpn> [<unicast|multicast|vpn|labeled-unicast|flowspec|evpn>]] <*|A.B.C.D|X:X::X:X|WORD|(1-4294967295)|external|peer-group WORD> [<soft [<in|out>]|in [prefix-filter]|out>]", "clear [ip] bgp [<view|vrf> VIEWVRFNAME] [<ipv4|ipv6|l2vpn> [<unicast|multicast|vpn|labeled-unicast|flowspec|evpn>]] <*|A.B.C.D|X:X::X:X|WORD|(1-4294967295)|external|peer-group PGNAME> [<soft [<in|out>]|in [prefix-filter]|out>]",
CLEAR_STR CLEAR_STR
IP_STR IP_STR
BGP_STR BGP_STR
@ -7269,7 +7269,7 @@ DEFUN (clear_ip_bgp_all,
if (argv_find_and_parse_afi(argv, argc, &idx, &afi)) if (argv_find_and_parse_afi(argv, argc, &idx, &afi))
argv_find_and_parse_safi(argv, argc, &idx, &safi); argv_find_and_parse_safi(argv, argc, &idx, &safi);
/* <*|A.B.C.D|X:X::X:X|WORD|(1-4294967295)|external|peer-group WORD> */ /* <*|A.B.C.D|X:X::X:X|WORD|(1-4294967295)|external|peer-group PGNAME> */
if (argv_find(argv, argc, "*", &idx)) { if (argv_find(argv, argc, "*", &idx)) {
clr_sort = clear_all; clr_sort = clear_all;
} else if (argv_find(argv, argc, "A.B.C.D", &idx)) { } else if (argv_find(argv, argc, "A.B.C.D", &idx)) {
@ -7282,7 +7282,7 @@ DEFUN (clear_ip_bgp_all,
clr_sort = clear_group; clr_sort = clear_group;
idx++; idx++;
clr_arg = argv[idx]->arg; clr_arg = argv[idx]->arg;
} else if (argv_find(argv, argc, "WORD", &idx)) { } else if (argv_find(argv, argc, "PGNAME", &idx)) {
clr_sort = clear_peer; clr_sort = clear_peer;
clr_arg = argv[idx]->arg; clr_arg = argv[idx]->arg;
} else if (argv_find(argv, argc, "(1-4294967295)", &idx)) { } else if (argv_find(argv, argc, "(1-4294967295)", &idx)) {

View File

@ -6974,7 +6974,7 @@ static void bgp_config_write_peer_global(struct vty *vty, struct bgp *bgp,
} }
/* For swpX peers we displayed the peer-group /* For swpX peers we displayed the peer-group
* via 'neighbor swpX interface peer-group WORD' */ * via 'neighbor swpX interface peer-group PGNAME' */
if (!if_pg_printed) if (!if_pg_printed)
vty_out(vty, " neighbor %s peer-group %s\n", addr, vty_out(vty, " neighbor %s peer-group %s\n", addr,
peer->group->name); peer->group->name);

View File

@ -826,8 +826,8 @@ Defining Peers
peers ASN is the same as mine as specified under the :clicmd:`router bgp ASN` peers ASN is the same as mine as specified under the :clicmd:`router bgp ASN`
command the connection will be denied. command the connection will be denied.
.. index:: [no] bgp listen range <A.B.C.D/M|X:X::X:X/M> peer-group WORD .. index:: [no] bgp listen range <A.B.C.D/M|X:X::X:X/M> peer-group PGNAME
.. clicmd:: [no] bgp listen range <A.B.C.D/M|X:X::X:X/M> peer-group WORD .. clicmd:: [no] bgp listen range <A.B.C.D/M|X:X::X:X/M> peer-group PGNAME
Accept connections from any peers in the specified prefix. Configuration Accept connections from any peers in the specified prefix. Configuration
from the specified peer-group is used to configure these peers. from the specified peer-group is used to configure these peers.
@ -1050,8 +1050,8 @@ and will share updates.
This command defines a new peer group. This command defines a new peer group.
.. index:: neighbor PEER peer-group WORD .. index:: neighbor PEER peer-group PGNAME
.. clicmd:: neighbor PEER peer-group WORD .. clicmd:: neighbor PEER peer-group PGNAME
This command bind specific peer to peer group WORD. This command bind specific peer to peer group WORD.