DEFUN (show_ip_bgp_ipv4,
show_ip_bgp_ipv4_cmd,
- "show ip bgp ipv4 (unicast|multicast) {json}",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" {json}",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"JavaScript Object Notation\n")
{
u_char uj = use_json(argc, argv);
ALIAS (show_ip_bgp_ipv4,
show_bgp_ipv4_safi_cmd,
- "show bgp ipv4 (unicast|multicast) {json}",
+ "show bgp ipv4 "BGP_SAFI_CMD_STR" {json}",
SHOW_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"JavaScript Object Notation\n")
DEFUN (show_ip_bgp_route,
DEFUN (show_bgp_ipv4_safi_route_pathtype,
show_bgp_ipv4_safi_route_pathtype_cmd,
- "show bgp ipv4 (unicast|multicast|vpn|encap) A.B.C.D (bestpath|multipath) {json}",
+ "show bgp ipv4 "BGP_SAFI_CMD_STR" A.B.C.D (bestpath|multipath) {json}",
SHOW_STR
BGP_STR
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"Display only the bestpath\n"
"Display only multipaths\n"
DEFUN (show_ip_bgp_ipv4_route,
show_ip_bgp_ipv4_route_cmd,
- "show ip bgp ipv4 (unicast|multicast|vpn|encap) A.B.C.D {json}",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" A.B.C.D {json}",
SHOW_STR
IP_STR
BGP_STR
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"Network in the BGP routing table to display\n"
"JavaScript Object Notation\n")
{
ALIAS (show_ip_bgp_ipv4_route,
show_bgp_ipv4_safi_route_cmd,
- "show bgp ipv4 (unicast|multicast|vpn|encap) A.B.C.D {json}",
+ "show bgp ipv4 "BGP_SAFI_CMD_STR" A.B.C.D {json}",
SHOW_STR
BGP_STR
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"Network in the BGP routing table to display\n"
"JavaScript Object Notation\n")
DEFUN (show_ip_bgp_ipv4_prefix,
show_ip_bgp_ipv4_prefix_cmd,
- "show ip bgp ipv4 (unicast|multicast|vpn|encap) A.B.C.D/M {json}",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" A.B.C.D/M {json}",
SHOW_STR
IP_STR
BGP_STR
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"JavaScript Object Notation\n")
{
ALIAS (show_ip_bgp_ipv4_prefix,
show_bgp_ipv4_safi_prefix_cmd,
- "show bgp ipv4 (unicast|multicast|vpn|encap) A.B.C.D/M {json}",
+ "show bgp ipv4 "BGP_SAFI_CMD_STR" A.B.C.D/M {json}",
SHOW_STR
BGP_STR
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"JavaScript Object Notation\n")
DEFUN (show_ip_bgp_ipv4_prefix_pathtype,
show_ip_bgp_ipv4_prefix_pathtype_cmd,
- "show ip bgp ipv4 (unicast|multicast|vpn|encap) A.B.C.D/M (bestpath|multipath) {json}",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" A.B.C.D/M (bestpath|multipath) {json}",
SHOW_STR
IP_STR
BGP_STR
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"Display only the bestpath\n"
"Display only multipaths\n"
ALIAS (show_ip_bgp_ipv4_prefix_pathtype,
show_bgp_ipv4_safi_prefix_pathtype_cmd,
- "show bgp ipv4 (unicast|multicast|vpn|encap) A.B.C.D/M (bestpath|multipath) {json}",
+ "show bgp ipv4 "BGP_SAFI_CMD_STR" A.B.C.D/M (bestpath|multipath) {json}",
SHOW_STR
BGP_STR
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"Display only the bestpath\n"
"Display only multipaths\n"
DEFUN (show_bgp_ipv6_safi,
show_bgp_ipv6_safi_cmd,
- "show bgp ipv6 (unicast|multicast) {json}",
+ "show bgp ipv6 "BGP_SAFI_CMD_STR" {json}",
SHOW_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
- AFI_SAFI_STR
+ BGP_SAFI_HELP_STR
"JavaScript Object Notation\n")
{
u_char uj = use_json(argc, argv);
DEFUN (show_bgp_ipv6_safi_route,
show_bgp_ipv6_safi_route_cmd,
- "show bgp ipv6 (unicast|multicast|vpn|encap) X:X::X:X {json}",
+ "show bgp ipv6 "BGP_SAFI_CMD_STR" X:X::X:X {json}",
SHOW_STR
BGP_STR
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"Network in the BGP routing table to display\n"
"JavaScript Object Notation\n")
{
DEFUN (show_bgp_ipv6_safi_route_pathtype,
show_bgp_ipv6_safi_route_pathtype_cmd,
- "show bgp ipv6 (unicast|multicast|vpn|encap) X:X::X:X (bestpath|multipath) {json}",
+ "show bgp ipv6 "BGP_SAFI_CMD_STR" X:X::X:X (bestpath|multipath) {json}",
SHOW_STR
BGP_STR
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"Network in the BGP routing table to display\n"
"Display only the bestpath\n"
"Display only multipaths\n"
DEFUN (show_bgp_ipv6_safi_prefix,
show_bgp_ipv6_safi_prefix_cmd,
- "show bgp ipv6 (unicast|multicast|vpn|encap) X:X::X:X/M {json}",
+ "show bgp ipv6 "BGP_SAFI_CMD_STR" X:X::X:X/M {json}",
SHOW_STR
BGP_STR
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n"
"JavaScript Object Notation\n")
{
DEFUN (show_bgp_ipv6_safi_prefix_pathtype,
show_bgp_ipv6_safi_prefix_pathtype_cmd,
- "show bgp ipv6 (unicast|multicast|vpn|encap) X:X::X:X/M (bestpath|multipath) {json}",
+ "show bgp ipv6 "BGP_SAFI_CMD_STR" X:X::X:X/M (bestpath|multipath) {json}",
SHOW_STR
BGP_STR
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n"
"Display only the bestpath\n"
"Display only multipaths\n"
DEFUN (show_ip_bgp_ipv4_regexp,
show_ip_bgp_ipv4_regexp_cmd,
- "show ip bgp ipv4 (unicast|multicast) regexp .LINE",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" regexp .LINE",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display routes matching the AS path regular expression\n"
"A regular-expression to match the BGP AS paths\n")
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_show_regexp (vty, argc, argv, AFI_IP, SAFI_MULTICAST,
- bgp_show_type_regexp);
-
- return bgp_show_regexp (vty, argc, argv, AFI_IP, SAFI_UNICAST,
- bgp_show_type_regexp);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_show_regexp (vty, argc, argv, AFI_IP, safi,
+ bgp_show_type_regexp);
}
#ifdef HAVE_IPV6
DEFUN (show_ip_bgp_ipv4_prefix_list,
show_ip_bgp_ipv4_prefix_list_cmd,
- "show ip bgp ipv4 (unicast|multicast) prefix-list WORD",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" prefix-list WORD",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display routes conforming to the prefix-list\n"
"IP prefix-list name\n")
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_show_prefix_list (vty, NULL, argv[1], AFI_IP, SAFI_MULTICAST,
- bgp_show_type_prefix_list);
-
- return bgp_show_prefix_list (vty, NULL, argv[1], AFI_IP, SAFI_UNICAST,
- bgp_show_type_prefix_list);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_show_prefix_list (vty, NULL, argv[1], AFI_IP, safi,
+ bgp_show_type_prefix_list);
}
#ifdef HAVE_IPV6
DEFUN (show_ip_bgp_ipv4_filter_list,
show_ip_bgp_ipv4_filter_list_cmd,
- "show ip bgp ipv4 (unicast|multicast) filter-list WORD",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" filter-list WORD",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display routes conforming to the filter-list\n"
"Regular expression access list name\n")
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_show_filter_list (vty, NULL, argv[1], AFI_IP, SAFI_MULTICAST,
- bgp_show_type_filter_list);
-
- return bgp_show_filter_list (vty, NULL, argv[1], AFI_IP, SAFI_UNICAST,
- bgp_show_type_filter_list);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_show_filter_list (vty, NULL, argv[1], AFI_IP, safi,
+ bgp_show_type_filter_list);
}
#ifdef HAVE_IPV6
DEFUN (show_ip_bgp_ipv4_dampening_parameters,
show_ip_bgp_ipv4_dampening_parameters_cmd,
- "show ip bgp ipv4 (unicast|multicast) dampening parameters",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" dampening parameters",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display detailed information about dampening\n"
"Display detail of configured dampening parameters\n")
{
- if (strncmp(argv[0], "m", 1) == 0)
- return bgp_show_dampening_parameters (vty, AFI_IP, SAFI_MULTICAST);
-
- return bgp_show_dampening_parameters (vty, AFI_IP, SAFI_UNICAST);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_show_dampening_parameters (vty, AFI_IP, safi);
}
DEFUN (show_ip_bgp_ipv4_dampening_flap_stats,
show_ip_bgp_ipv4_dampening_flap_stats_cmd,
- "show ip bgp ipv4 (unicast|multicast) dampening flap-statistics",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" dampening flap-statistics",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display detailed information about dampening\n"
"Display flap statistics of routes\n")
{
- if (strncmp(argv[0], "m", 1) == 0)
- return bgp_show (vty, NULL, AFI_IP, SAFI_MULTICAST,
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_show (vty, NULL, AFI_IP, safi,
bgp_show_type_flap_statistics, NULL, 0);
-
- return bgp_show (vty, NULL, AFI_IP, SAFI_MULTICAST,
- bgp_show_type_flap_statistics, NULL, 0);
}
DEFUN (show_ip_bgp_ipv4_dampening_dampd_paths,
show_ip_bgp_ipv4_dampening_dampd_paths_cmd,
- "show ip bgp ipv4 (unicast|multicast) dampening dampened-paths",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" dampening dampened-paths",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display detailed information about dampening\n"
"Display paths suppressed due to dampening\n")
{
- if (strncmp(argv[0], "m", 1) == 0)
- return bgp_show (vty, NULL, AFI_IP, SAFI_MULTICAST,
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_show (vty, NULL, AFI_IP, safi,
bgp_show_type_dampend_paths, NULL, 0);
-
- return bgp_show (vty, NULL, AFI_IP, SAFI_MULTICAST,
- bgp_show_type_dampend_paths, NULL, 0);
}
static int
DEFUN (show_ip_bgp_ipv4_route_map,
show_ip_bgp_ipv4_route_map_cmd,
- "show ip bgp ipv4 (unicast|multicast) route-map WORD",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" route-map WORD",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display routes matching the route-map\n"
"A route-map to match on\n")
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_show_route_map (vty, NULL, argv[1], AFI_IP, SAFI_MULTICAST,
- bgp_show_type_route_map);
-
- return bgp_show_route_map (vty, NULL, argv[1], AFI_IP, SAFI_UNICAST,
- bgp_show_type_route_map);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_show_route_map (vty, NULL, argv[1], AFI_IP, safi,
+ bgp_show_type_route_map);
}
DEFUN (show_bgp_route_map,
DEFUN (show_ip_bgp_ipv4_cidr_only,
show_ip_bgp_ipv4_cidr_only_cmd,
- "show ip bgp ipv4 (unicast|multicast) cidr-only",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" cidr-only",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display only routes with non-natural netmasks\n")
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_show (vty, NULL, AFI_IP, SAFI_MULTICAST,
- bgp_show_type_cidr_only, NULL, 0);
-
- return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST,
- bgp_show_type_cidr_only, NULL, 0);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_show (vty, NULL, AFI_IP, safi,
+ bgp_show_type_cidr_only, NULL, 0);
}
DEFUN (show_ip_bgp_community_all,
DEFUN (show_ip_bgp_ipv4_community_all,
show_ip_bgp_ipv4_community_all_cmd,
- "show ip bgp ipv4 (unicast|multicast) community",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" community",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display routes matching the communities\n")
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_show (vty, NULL, AFI_IP, SAFI_MULTICAST,
- bgp_show_type_community_all, NULL, 0);
-
- return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST,
- bgp_show_type_community_all, NULL, 0);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_show (vty, NULL, AFI_IP, safi,
+ bgp_show_type_community_all, NULL, 0);
}
#ifdef HAVE_IPV6
DEFUN (show_ip_bgp_ipv4_community,
show_ip_bgp_ipv4_community_cmd,
- "show ip bgp ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export)",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" community (AA:NN|local-AS|no-advertise|no-export)",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display routes matching the communities\n"
COMMUNITY_AANN_STR
"Do not send outside local AS (well-known community)\n"
"Do not advertise to any peer (well-known community)\n"
"Do not export to next AS (well-known community)\n")
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_show_community (vty, NULL, argc, argv, 0, AFI_IP, SAFI_MULTICAST);
-
- return bgp_show_community (vty, NULL, argc, argv, 0, AFI_IP, SAFI_UNICAST);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_show_community (vty, NULL, argc, argv, 0, AFI_IP, safi);
}
ALIAS (show_ip_bgp_ipv4_community,
show_ip_bgp_ipv4_community2_cmd,
- "show ip bgp ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display routes matching the communities\n"
COMMUNITY_AANN_STR
"Do not send outside local AS (well-known community)\n"
ALIAS (show_ip_bgp_ipv4_community,
show_ip_bgp_ipv4_community3_cmd,
- "show ip bgp ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display routes matching the communities\n"
COMMUNITY_AANN_STR
"Do not send outside local AS (well-known community)\n"
ALIAS (show_ip_bgp_ipv4_community,
show_ip_bgp_ipv4_community4_cmd,
- "show ip bgp ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display routes matching the communities\n"
COMMUNITY_AANN_STR
"Do not send outside local AS (well-known community)\n"
DEFUN (show_bgp_instance_afi_safi_community_all,
show_bgp_instance_afi_safi_community_all_cmd,
- "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast) community",
+ "show bgp " BGP_INSTANCE_CMD " "BGP_AFI_SAFI_CMD_STR" community",
SHOW_STR
BGP_STR
BGP_INSTANCE_HELP_STR
- "Address family\n"
- "Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_AFI_SAFI_HELP_STR
"Display routes matching the communities\n")
{
int afi;
return CMD_WARNING;
}
- afi = (strncmp (argv[2], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP;
- safi = (strncmp (argv[3], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
+ afi = bgp_vty_safi_from_arg(argv[2]);
+ safi = bgp_vty_safi_from_arg(argv[3]);
return bgp_show (vty, bgp, afi, safi, bgp_show_type_community_all, NULL, 0);
}
DEFUN (show_bgp_instance_afi_safi_community,
show_bgp_instance_afi_safi_community_cmd,
- "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export)",
+ "show bgp " BGP_INSTANCE_CMD " "BGP_AFI_SAFI_CMD_STR" community (AA:NN|local-AS|no-advertise|no-export)",
SHOW_STR
BGP_STR
BGP_INSTANCE_HELP_STR
int afi;
int safi;
- afi = (strncmp (argv[2], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP;
- safi = (strncmp (argv[3], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
+ afi = bgp_vty_safi_from_arg(argv[2]);
+ safi = bgp_vty_safi_from_arg(argv[3]);
return bgp_show_community (vty, argv[1], argc-4, &argv[4], 0, afi, safi);
}
ALIAS (show_bgp_instance_afi_safi_community,
show_bgp_instance_afi_safi_community2_cmd,
- "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
+ "show bgp " BGP_INSTANCE_CMD " "BGP_AFI_SAFI_CMD_STR" community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
SHOW_STR
BGP_STR
BGP_INSTANCE_HELP_STR
ALIAS (show_bgp_instance_afi_safi_community,
show_bgp_instance_afi_safi_community3_cmd,
- "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
+ "show bgp " BGP_INSTANCE_CMD " "BGP_AFI_SAFI_CMD_STR" community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
SHOW_STR
BGP_STR
BGP_INSTANCE_HELP_STR
ALIAS (show_bgp_instance_afi_safi_community,
show_bgp_instance_afi_safi_community4_cmd,
- "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
+ "show bgp " BGP_INSTANCE_CMD " "BGP_AFI_SAFI_CMD_STR" community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
SHOW_STR
BGP_STR
BGP_INSTANCE_HELP_STR
DEFUN (show_ip_bgp_ipv4_community_exact,
show_ip_bgp_ipv4_community_exact_cmd,
- "show ip bgp ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) exact-match",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" community (AA:NN|local-AS|no-advertise|no-export) exact-match",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display routes matching the communities\n"
COMMUNITY_AANN_STR
"Do not send outside local AS (well-known community)\n"
"Do not export to next AS (well-known community)\n"
"Exact match of the communities")
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_show_community (vty, NULL, argc, argv, 1, AFI_IP, SAFI_MULTICAST);
-
- return bgp_show_community (vty, NULL, argc, argv, 1, AFI_IP, SAFI_UNICAST);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_show_community (vty, NULL, argc, argv, 1, AFI_IP, safi);
}
ALIAS (show_ip_bgp_ipv4_community_exact,
show_ip_bgp_ipv4_community2_exact_cmd,
- "show ip bgp ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display routes matching the communities\n"
COMMUNITY_AANN_STR
"Do not send outside local AS (well-known community)\n"
ALIAS (show_ip_bgp_ipv4_community_exact,
show_ip_bgp_ipv4_community3_exact_cmd,
- "show ip bgp ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display routes matching the communities\n"
COMMUNITY_AANN_STR
"Do not send outside local AS (well-known community)\n"
ALIAS (show_ip_bgp_ipv4_community_exact,
show_ip_bgp_ipv4_community4_exact_cmd,
- "show ip bgp ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display routes matching the communities\n"
COMMUNITY_AANN_STR
"Do not send outside local AS (well-known community)\n"
DEFUN (show_ip_bgp_ipv4_community_list,
show_ip_bgp_ipv4_community_list_cmd,
- "show ip bgp ipv4 (unicast|multicast) community-list (<1-500>|WORD)",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" community-list (<1-500>|WORD)",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display routes matching the community-list\n"
"community-list number\n"
"community-list name\n")
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_show_community_list (vty, NULL, argv[1], 0, AFI_IP, SAFI_MULTICAST);
-
- return bgp_show_community_list (vty, NULL, argv[1], 0, AFI_IP, SAFI_UNICAST);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_show_community_list (vty, NULL, argv[1], 0, AFI_IP, safi);
}
DEFUN (show_ip_bgp_community_list_exact,
DEFUN (show_ip_bgp_ipv4_community_list_exact,
show_ip_bgp_ipv4_community_list_exact_cmd,
- "show ip bgp ipv4 (unicast|multicast) community-list (<1-500>|WORD) exact-match",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" community-list (<1-500>|WORD) exact-match",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Display routes matching the community-list\n"
"community-list number\n"
"community-list name\n"
"Exact match of the communities\n")
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_show_community_list (vty, NULL, argv[1], 1, AFI_IP, SAFI_MULTICAST);
-
- return bgp_show_community_list (vty, NULL, argv[1], 1, AFI_IP, SAFI_UNICAST);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_show_community_list (vty, NULL, argv[1], 1, AFI_IP, safi);
}
#ifdef HAVE_IPV6
DEFUN (show_ip_bgp_ipv4_prefix_longer,
show_ip_bgp_ipv4_prefix_longer_cmd,
- "show ip bgp ipv4 (unicast|multicast) A.B.C.D/M longer-prefixes",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" A.B.C.D/M longer-prefixes",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"Display route and more specific routes\n")
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_show_prefix_longer (vty, NULL, argv[1], AFI_IP, SAFI_MULTICAST,
- bgp_show_type_prefix_longer);
-
- return bgp_show_prefix_longer (vty, NULL, argv[1], AFI_IP, SAFI_UNICAST,
- bgp_show_type_prefix_longer);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_show_prefix_longer (vty, NULL, argv[1], AFI_IP, safi,
+ bgp_show_type_prefix_longer);
}
DEFUN (show_ip_bgp_flap_address,
vty_out (vty, "%% No such BGP instance exists%s", VTY_NEWLINE);
return CMD_WARNING;
}
- if (strncmp (afi_str, "ipv", 3) == 0)
- {
- if (strncmp (afi_str, "ipv4", 4) == 0)
- afi = AFI_IP;
- else if (strncmp (afi_str, "ipv6", 4) == 0)
- afi = AFI_IP6;
- else
- {
- vty_out (vty, "%% Invalid address family %s%s",
- afi_str, VTY_NEWLINE);
- return CMD_WARNING;
- }
- if (strncmp (safi_str, "m", 1) == 0)
- safi = SAFI_MULTICAST;
- else if (strncmp (safi_str, "u", 1) == 0)
- safi = SAFI_UNICAST;
- else if (strncmp (safi_str, "e", 1) == 0)
- safi = SAFI_ENCAP;
- else if (strncmp (safi_str, "vpnv4", 5) == 0 || strncmp (safi_str, "vpnv6", 5) == 0)
- safi = SAFI_MPLS_VPN;
- else
- {
- vty_out (vty, "%% Invalid subsequent address family %s%s",
- safi_str, VTY_NEWLINE);
- return CMD_WARNING;
- }
- }
- else
+ afi = bgp_vty_afi_from_arg(afi_str);
+ if (afi == AFI_MAX)
{
vty_out (vty, "%% Invalid address family \"%s\"%s",
afi_str, VTY_NEWLINE);
return CMD_WARNING;
}
+ safi = bgp_vty_safi_from_arg(safi_str);
+ if (safi == SAFI_MAX)
+ {
+ vty_out (vty, "%% Invalid subsequent address family %s%s",
+ safi_str, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
return bgp_table_stats (vty, bgp, afi, safi);
}
DEFUN (show_bgp_statistics,
show_bgp_statistics_cmd,
- "show bgp (ipv4|ipv6) (encap|multicast|unicast|vpn) statistics",
+ "show bgp "BGP_AFI_SAFI_CMD_STR" statistics",
SHOW_STR
BGP_STR
- "Address family\n"
- "Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_INSTANCE_HELP_STR
"BGP RIB advertisement statistics\n")
{
return bgp_table_stats_vty (vty, NULL, argv[0], argv[1]);
DEFUN (show_bgp_statistics_view,
show_bgp_statistics_view_cmd,
- "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast|vpn|encap) statistics",
+ "show bgp " BGP_INSTANCE_CMD " "BGP_AFI_SAFI_CMD_STR" statistics",
SHOW_STR
BGP_STR
BGP_INSTANCE_HELP_STR
- "Address family\n"
- "Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_AFI_SAFI_HELP_STR
"BGP RIB advertisement statistics\n")
{
return bgp_table_stats_vty (vty, NULL, argv[1], argv[2]);
DEFUN (show_ip_bgp_ipv4_neighbor_prefix_counts,
show_ip_bgp_ipv4_neighbor_prefix_counts_cmd,
- "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD) prefix-counts {json}",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" neighbors (A.B.C.D|X:X::X:X|WORD) prefix-counts {json}",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Neighbor to display information about\n"
if (! peer)
return CMD_WARNING;
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_peer_counts (vty, peer, AFI_IP, SAFI_MULTICAST, uj);
-
- return bgp_peer_counts (vty, peer, AFI_IP, SAFI_UNICAST, uj);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_peer_counts (vty, peer, AFI_IP, safi, uj);
}
DEFUN (show_ip_bgp_vpnv4_neighbor_prefix_counts,
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Neighbor to display information about\n"
"JavaScript Object Notation\n")
DEFUN (show_ip_bgp_ipv4_neighbor_advertised_route,
show_ip_bgp_ipv4_neighbor_advertised_route_cmd,
- "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD) advertised-routes {json}",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" neighbors (A.B.C.D|X:X::X:X|WORD) advertised-routes {json}",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Neighbor to display information about\n"
{
struct peer *peer;
const char *rmap_name = NULL;
+ safi_t safi;
+
u_char uj = use_json(argc, argv);
peer = peer_lookup_in_view (vty, NULL, argv[1], uj);
if ((argc == 4) || (argc == 3 && argv[2] && strcmp(argv[2], "json") != 0))
rmap_name = argv[2];
- if (strncmp (argv[0], "m", 1) == 0)
- return peer_adj_routes (vty, peer, AFI_IP, SAFI_MULTICAST, 0, rmap_name, uj);
- else
- return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 0, rmap_name, uj);
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return peer_adj_routes (vty, peer, AFI_IP, safi, 0, rmap_name, uj);
}
ALIAS (show_ip_bgp_ipv4_neighbor_advertised_route,
show_ip_bgp_ipv4_neighbor_advertised_route_rmap_cmd,
- "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD) advertised-routes route-map WORD {json}",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" neighbors (A.B.C.D|X:X::X:X|WORD) advertised-routes route-map WORD {json}",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Neighbor to display information about\n"
DEFUN (show_ip_bgp_ipv4_neighbor_received_routes,
show_ip_bgp_ipv4_neighbor_received_routes_cmd,
- "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD) received-routes {json}",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" neighbors (A.B.C.D|X:X::X:X|WORD) received-routes {json}",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Neighbor to display information about\n"
{
struct peer *peer;
const char *rmap_name = NULL;
+ safi_t safi;
u_char uj = use_json(argc, argv);
peer = peer_lookup_in_view (vty, NULL, argv[1], uj);
if (argc == 4 || (argc == 3 && argv[2] && strcmp(argv[2], "json") != 0))
rmap_name = argv[2];
- if (strncmp (argv[0], "m", 1) == 0)
- return peer_adj_routes (vty, peer, AFI_IP, SAFI_MULTICAST, 1, rmap_name, uj);
- else
- return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 1, rmap_name, uj);
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return peer_adj_routes (vty, peer, AFI_IP, safi, 1, rmap_name, uj);
}
ALIAS (show_ip_bgp_ipv4_neighbor_received_routes,
show_ip_bgp_ipv4_neighbor_received_routes_rmap_cmd,
- "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD) received-routes route-map WORD {json}",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" neighbors (A.B.C.D|X:X::X:X|WORD) received-routes route-map WORD {json}",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Neighbor to display information about\n"
DEFUN (show_bgp_instance_afi_safi_neighbor_adv_recd_routes,
show_bgp_instance_afi_safi_neighbor_adv_recd_routes_cmd,
- "show bgp " BGP_INSTANCE_CMD " (ipv4|ipv6) (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD) (advertised-routes|received-routes) {json}",
+ "show bgp " BGP_INSTANCE_CMD " "BGP_AFI_SAFI_CMD_STR" neighbors (A.B.C.D|X:X::X:X|WORD) (advertised-routes|received-routes) {json}",
SHOW_STR
BGP_STR
BGP_INSTANCE_HELP_STR
- "Address family\n"
- "Address family\n"
- "Address family modifier\n"
- "Address family modifier\n"
+ BGP_AFI_SAFI_HELP_STR
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Neighbor to display information about\n"
if (! peer)
return CMD_WARNING;
- afi = (strncmp (argv[2], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP;
- safi = (strncmp (argv[3], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
+ afi = bgp_vty_safi_from_arg(argv[2]);
+ safi = bgp_vty_safi_from_arg(argv[3]);
in = (strncmp (argv[5], "r", 1) == 0) ? 1 : 0;
return peer_adj_routes (vty, peer, afi, safi, in, NULL, uj);
DEFUN (show_ip_bgp_ipv4_neighbor_received_prefix_filter,
show_ip_bgp_ipv4_neighbor_received_prefix_filter_cmd,
- "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD) received prefix-filter {json}",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" neighbors (A.B.C.D|X:X::X:X|WORD) received prefix-filter {json}",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Neighbor to display information about\n"
}
}
- if (strncmp (argv[0], "m", 1) == 0)
- {
- sprintf (name, "%s.%d.%d", peer->host, AFI_IP, SAFI_MULTICAST);
- count = prefix_bgp_show_prefix_list (NULL, AFI_IP, name, uj);
- if (count)
- {
- if (!uj)
- vty_out (vty, "Address family: IPv4 Multicast%s", VTY_NEWLINE);
- prefix_bgp_show_prefix_list (vty, AFI_IP, name, uj);
- }
- else
- {
- if (uj)
- {
- json_object *json_no = NULL;
- json_no = json_object_new_object();
- json_object_boolean_true_add(json_no, "noFuntionalOutput");
- vty_out (vty, "%s%s", json_object_to_json_string(json_no), VTY_NEWLINE);
- json_object_free(json_no);
- }
- else
- vty_out (vty, "No functional output%s", VTY_NEWLINE);
- }
- }
- else
{
- sprintf (name, "%s.%d.%d", peer->host, AFI_IP, SAFI_UNICAST);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ sprintf (name, "%s.%d.%d", peer->host, AFI_IP, safi);
count = prefix_bgp_show_prefix_list (NULL, AFI_IP, name, uj);
if (count)
{
if (!uj)
- vty_out (vty, "Address family: IPv4 Unicast%s", VTY_NEWLINE);
+ vty_out (vty, "Address family: %s%s",
+ afi_safi_print (AFI_IP, safi), VTY_NEWLINE);
prefix_bgp_show_prefix_list (vty, AFI_IP, name, uj);
}
else
DEFUN (show_ip_bgp_ipv4_neighbor_routes,
show_ip_bgp_ipv4_neighbor_routes_cmd,
- "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD) routes {json}",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" neighbors (A.B.C.D|X:X::X:X|WORD) routes {json}",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Neighbor to display information about\n"
"JavaScript Object Notation\n")
{
struct peer *peer;
+ safi_t safi;
u_char uj = use_json(argc, argv);
peer = peer_lookup_in_view (vty, NULL, argv[1], uj);
if (! peer)
return CMD_WARNING;
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_show_neighbor_route (vty, peer, AFI_IP, SAFI_MULTICAST,
- bgp_show_type_neighbor, uj);
-
- return bgp_show_neighbor_route (vty, peer, AFI_IP, SAFI_UNICAST,
- bgp_show_type_neighbor, uj);
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_show_neighbor_route (vty, peer, AFI_IP, safi,
+ bgp_show_type_neighbor, uj);
}
#ifdef HAVE_IPV6
return safi;
}
-int
-bgp_parse_afi(const char *str, afi_t *afi)
+/* supports (ipv4|ipv6) */
+afi_t
+bgp_vty_afi_from_arg(const char *afi_str)
{
- if (!strcmp(str, "ipv4")) {
- *afi = AFI_IP;
- return 0;
+ afi_t afi = AFI_MAX; /* unknown */
+ if (!strcmp(afi_str, "ipv4")) {
+ afi = AFI_IP;
}
#ifdef HAVE_IPV6
- if (!strcmp(str, "ipv6")) {
- *afi = AFI_IP6;
- return 0;
- }
+ else if (!strcmp(afi_str, "ipv6")) {
+ afi = AFI_IP6;
+ }
#endif /* HAVE_IPV6 */
+ return afi;
+}
+
+int
+bgp_parse_afi(const char *str, afi_t *afi)
+{
+ *afi = bgp_vty_afi_from_arg(str);
+ if (*afi != AFI_MAX)
+ return 0;
+ else
return -1;
}
+
/* supports (unicast|multicast|vpn|encap) */
safi_t
bgp_vty_safi_from_arg(const char *safi_str)
else if (strncmp (safi_str, "e", 1) == 0)
safi = SAFI_ENCAP;
else if (strncmp (safi_str, "v", 1) == 0)
- safi = SAFI_MPLS_VPN;
+ safi = SAFI_MPLS_VPN;
return safi;
}
{
case BGP_ERR_AF_UNCONFIGURED:
vty_out (vty,
- "%%BGP: Enable %s %s address family for the neighbor %s%s",
- afi == AFI_IP6 ? "IPv6" : safi == SAFI_MPLS_VPN ? "VPNv4" : "IPv4",
- safi == SAFI_MULTICAST ? "Multicast" : "Unicast",
- peer->host, VTY_NEWLINE);
+ "%%BGP: Enable %s address family for the neighbor %s%s",
+ afi_safi_print(afi, safi), peer->host, VTY_NEWLINE);
break;
case BGP_ERR_SOFT_RECONFIG_UNCONFIGURED:
vty_out (vty, "%%BGP: Inbound soft reconfig for %s not possible as it%s has neither refresh capability, nor inbound soft reconfig%s", peer->host, VTY_NEWLINE, VTY_NEWLINE);
DEFUN (address_family_ipv4_safi,
address_family_ipv4_safi_cmd,
- "address-family ipv4 (unicast|multicast)",
+ "address-family ipv4 "BGP_SAFI_CMD_STR,
"Enter Address Family command mode\n"
- AFI_SAFI_STR)
+ "Address Family\n"
+ BGP_SAFI_HELP_STR)
{
switch (bgp_vty_safi_from_arg(argv[0]))
{
DEFUN (address_family_ipv6_safi,
address_family_ipv6_safi_cmd,
- "address-family ipv6 (unicast|multicast)",
+ "address-family ipv6 "BGP_SAFI_CMD_STR,
"Enter Address Family command mode\n"
- "Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n")
+ "Address Family\n"
+ BGP_SAFI_HELP_STR)
{
- if (strncmp (argv[0], "m", 1) == 0)
- vty->node = BGP_IPV6M_NODE;
- else
- vty->node = BGP_IPV6_NODE;
+ int idx_safi = 0;
+ switch (bgp_vty_safi_from_arg(argv[idx_safi]))
+ {
+ case SAFI_MULTICAST:
+ vty->node = BGP_IPV6M_NODE;
+ break;
+ case SAFI_ENCAP:
+ vty->node = BGP_ENCAPV6_NODE;
+ break;
+ case SAFI_MPLS_VPN:
+ vty->node = BGP_VPNV6_NODE;
+ break;
+ case SAFI_UNICAST:
+ default:
+ vty->node = BGP_IPV6_NODE;
+ break;
+ }
return CMD_SUCCESS;
}
DEFUN (clear_ip_bgp_all_ipv4_soft_out,
clear_ip_bgp_all_ipv4_soft_out_cmd,
- "clear ip bgp * ipv4 (unicast|multicast) soft out",
+ "clear ip bgp * ipv4 "BGP_SAFI_CMD_STR" soft out",
CLEAR_STR
IP_STR
BGP_STR
"Clear all peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_OUT_STR)
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all,
- BGP_CLEAR_SOFT_OUT, NULL);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all,
- BGP_CLEAR_SOFT_OUT, NULL);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_all,
+ BGP_CLEAR_SOFT_OUT, NULL);
}
DEFUN (clear_ip_bgp_instance_all_ipv4_soft_out,
clear_ip_bgp_instance_all_ipv4_soft_out_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " * ipv4 (unicast|multicast) soft out",
+ "clear ip bgp " BGP_INSTANCE_CMD " * ipv4 "BGP_SAFI_CMD_STR" soft out",
CLEAR_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Clear all peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_OUT_STR)
{
- if (strncmp (argv[2], "m", 1) == 0)
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_MULTICAST, clear_all,
- BGP_CLEAR_SOFT_OUT, NULL);
-
- return bgp_clear_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, clear_all,
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[2]);
+ return bgp_clear_vty (vty, argv[1], AFI_IP, safi, clear_all,
BGP_CLEAR_SOFT_OUT, NULL);
}
ALIAS (clear_ip_bgp_all_ipv4_soft_out,
clear_ip_bgp_all_ipv4_out_cmd,
- "clear ip bgp * ipv4 (unicast|multicast) out",
+ "clear ip bgp * ipv4 "BGP_SAFI_CMD_STR" out",
CLEAR_STR
IP_STR
BGP_STR
"Clear all peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_OUT_STR)
ALIAS (clear_ip_bgp_instance_all_ipv4_soft_out,
clear_ip_bgp_instance_all_ipv4_out_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " * ipv4 (unicast|multicast) out",
+ "clear ip bgp " BGP_INSTANCE_CMD " * ipv4 "BGP_SAFI_CMD_STR" out",
CLEAR_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Clear all peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_OUT_STR)
DEFUN (clear_ip_bgp_all_vpnv4_soft_out,
DEFUN (clear_bgp_ipv6_safi_prefix,
clear_bgp_ipv6_safi_prefix_cmd,
- "clear bgp ipv6 (unicast|multicast) prefix X:X::X:X/M",
+ "clear bgp ipv6 "BGP_SAFI_CMD_STR" prefix X:X::X:X/M",
CLEAR_STR
BGP_STR
"Address family\n"
"Clear bestpath and re-advertise\n"
"IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n")
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_clear_prefix (vty, NULL, argv[1], AFI_IP6, SAFI_MULTICAST, NULL);
- else
- return bgp_clear_prefix (vty, NULL, argv[1], AFI_IP6, SAFI_UNICAST, NULL);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_clear_prefix (vty, NULL, argv[1], AFI_IP6, safi, NULL);
}
DEFUN (clear_bgp_instance_ipv6_safi_prefix,
clear_bgp_instance_ipv6_safi_prefix_cmd,
- "clear bgp " BGP_INSTANCE_CMD " ipv6 (unicast|multicast) prefix X:X::X:X/M",
+ "clear bgp " BGP_INSTANCE_CMD " ipv6 "BGP_SAFI_CMD_STR" prefix X:X::X:X/M",
CLEAR_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Clear bestpath and re-advertise\n"
"IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n")
{
- if (strncmp (argv[2], "m", 1) == 0)
- return bgp_clear_prefix (vty, argv[1], argv[3], AFI_IP6, SAFI_MULTICAST, NULL);
- else
- return bgp_clear_prefix (vty, argv[1], argv[3], AFI_IP6, SAFI_UNICAST, NULL);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[2]);
+ return bgp_clear_prefix (vty, argv[1], argv[3], AFI_IP6, safi, NULL);
}
DEFUN (clear_ip_bgp_peer_soft_out,
DEFUN (clear_ip_bgp_peer_ipv4_soft_out,
clear_ip_bgp_peer_ipv4_soft_out_cmd,
- "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) soft out",
+ "clear ip bgp (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR" soft out",
CLEAR_STR
IP_STR
BGP_STR
"BGP neighbor address to clear\n"
"BGP neighbor on interface to clear\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_OUT_STR)
{
- if (strncmp (argv[1], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer,
- BGP_CLEAR_SOFT_OUT, argv[0]);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer,
- BGP_CLEAR_SOFT_OUT, argv[0]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[1]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_peer,
+ BGP_CLEAR_SOFT_OUT, argv[0]);
}
DEFUN (clear_ip_bgp_instance_peer_ipv4_soft_out,
clear_ip_bgp_instance_peer_ipv4_soft_out_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " (A.B.C.D|WORD) ipv4 (unicast|multicast) soft out",
+ "clear ip bgp " BGP_INSTANCE_CMD " (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR" soft out",
CLEAR_STR
IP_STR
BGP_STR
"BGP neighbor address to clear\n"
"BGP neighbor on interface to clear\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_OUT_STR)
{
- if (strncmp (argv[3], "m", 1) == 0)
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_MULTICAST, clear_peer,
- BGP_CLEAR_SOFT_OUT, argv[2]);
-
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_UNICAST, clear_peer,
- BGP_CLEAR_SOFT_OUT, argv[2]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[3]);
+ return bgp_clear_vty (vty, argv[1], AFI_IP, safi, clear_peer,
+ BGP_CLEAR_SOFT_OUT, argv[2]);
}
ALIAS (clear_ip_bgp_peer_ipv4_soft_out,
clear_ip_bgp_peer_ipv4_out_cmd,
- "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) out",
+ "clear ip bgp (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR" out",
CLEAR_STR
IP_STR
BGP_STR
"BGP neighbor address to clear\n"
"BGP neighbor on interface to clear\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_OUT_STR)
ALIAS (clear_ip_bgp_instance_peer_ipv4_soft_out,
clear_ip_bgp_instance_peer_ipv4_out_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " (A.B.C.D|WORD) ipv4 (unicast|multicast) out",
+ "clear ip bgp " BGP_INSTANCE_CMD " (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR" out",
CLEAR_STR
IP_STR
BGP_STR
"BGP neighbor address to clear\n"
"BGP neighbor on interface to clear\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_OUT_STR)
/* NOTE: WORD peers have not been tested for vpnv4 */
DEFUN (clear_ip_bgp_peer_group_ipv4_soft_out,
clear_ip_bgp_peer_group_ipv4_soft_out_cmd,
- "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft out",
+ "clear ip bgp peer-group WORD ipv4 "BGP_SAFI_CMD_STR" soft out",
CLEAR_STR
IP_STR
BGP_STR
"Clear all members of peer-group\n"
"BGP peer-group name\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_OUT_STR)
{
- if (strncmp (argv[1], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group,
- BGP_CLEAR_SOFT_OUT, argv[0]);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group,
- BGP_CLEAR_SOFT_OUT, argv[0]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[1]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_group,
+ BGP_CLEAR_SOFT_OUT, argv[0]);
}
DEFUN (clear_ip_bgp_instance_peer_group_ipv4_soft_out,
clear_ip_bgp_instance_peer_group_ipv4_soft_out_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " peer-group WORD ipv4 (unicast|multicast) soft out",
+ "clear ip bgp " BGP_INSTANCE_CMD " peer-group WORD ipv4 "BGP_SAFI_CMD_STR" soft out",
CLEAR_STR
IP_STR
BGP_STR
"Clear all members of peer-group\n"
"BGP peer-group name\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_OUT_STR)
{
- if (strncmp (argv[3], "m", 1) == 0)
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_MULTICAST, clear_group,
- BGP_CLEAR_SOFT_OUT, argv[2]);
-
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_UNICAST, clear_group,
- BGP_CLEAR_SOFT_OUT, argv[2]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[3]);
+ return bgp_clear_vty (vty, argv[1], AFI_IP, safi, clear_group,
+ BGP_CLEAR_SOFT_OUT, argv[2]);
}
ALIAS (clear_ip_bgp_peer_group_ipv4_soft_out,
clear_ip_bgp_peer_group_ipv4_out_cmd,
- "clear ip bgp peer-group WORD ipv4 (unicast|multicast) out",
+ "clear ip bgp peer-group WORD ipv4 "BGP_SAFI_CMD_STR" out",
CLEAR_STR
IP_STR
BGP_STR
"Clear all members of peer-group\n"
"BGP peer-group name\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_OUT_STR)
ALIAS (clear_ip_bgp_instance_peer_group_ipv4_soft_out,
clear_ip_bgp_instance_peer_group_ipv4_out_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " peer-group WORD ipv4 (unicast|multicast) out",
+ "clear ip bgp " BGP_INSTANCE_CMD " peer-group WORD ipv4 "BGP_SAFI_CMD_STR" out",
CLEAR_STR
IP_STR
BGP_STR
"Clear all members of peer-group\n"
"BGP peer-group name\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_OUT_STR)
DEFUN (clear_bgp_peer_group_soft_out,
DEFUN (clear_ip_bgp_external_ipv4_soft_out,
clear_ip_bgp_external_ipv4_soft_out_cmd,
- "clear ip bgp external ipv4 (unicast|multicast) soft out",
+ "clear ip bgp external ipv4 "BGP_SAFI_CMD_STR" soft out",
CLEAR_STR
IP_STR
BGP_STR
"Clear all external peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_OUT_STR)
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external,
- BGP_CLEAR_SOFT_OUT, NULL);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external,
- BGP_CLEAR_SOFT_OUT, NULL);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_external,
+ BGP_CLEAR_SOFT_OUT, NULL);
}
DEFUN (clear_ip_bgp_instance_external_ipv4_soft_out,
clear_ip_bgp_instance_external_ipv4_soft_out_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " external ipv4 (unicast|multicast) soft out",
+ "clear ip bgp " BGP_INSTANCE_CMD " external ipv4 "BGP_SAFI_CMD_STR" soft out",
CLEAR_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Clear all external peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_OUT_STR)
{
- if (strncmp (argv[2], "m", 1) == 0)
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_MULTICAST, clear_external,
- BGP_CLEAR_SOFT_OUT, NULL);
-
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_UNICAST, clear_external,
- BGP_CLEAR_SOFT_OUT, NULL);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[2]);
+ return bgp_clear_vty (vty, argv[1], AFI_IP, safi, clear_external,
+ BGP_CLEAR_SOFT_OUT, NULL);
}
ALIAS (clear_ip_bgp_external_ipv4_soft_out,
clear_ip_bgp_external_ipv4_out_cmd,
- "clear ip bgp external ipv4 (unicast|multicast) out",
+ "clear ip bgp external ipv4 "BGP_SAFI_CMD_STR" out",
CLEAR_STR
IP_STR
BGP_STR
"Clear all external peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_OUT_STR)
ALIAS (clear_ip_bgp_instance_external_ipv4_soft_out,
clear_ip_bgp_instance_external_ipv4_out_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " external ipv4 (unicast|multicast) out",
+ "clear ip bgp " BGP_INSTANCE_CMD " external ipv4 "BGP_SAFI_CMD_STR" out",
CLEAR_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Clear all external peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_OUT_STR)
DEFUN (clear_bgp_external_soft_out,
DEFUN (clear_ip_bgp_as_ipv4_soft_out,
clear_ip_bgp_as_ipv4_soft_out_cmd,
- "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) soft out",
+ "clear ip bgp " CMD_AS_RANGE " ipv4 "BGP_SAFI_CMD_STR" soft out",
CLEAR_STR
IP_STR
BGP_STR
"Clear peers with the AS number\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_OUT_STR)
{
- if (strncmp (argv[1], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as,
- BGP_CLEAR_SOFT_OUT, argv[0]);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as,
- BGP_CLEAR_SOFT_OUT, argv[0]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[1]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_as,
+ BGP_CLEAR_SOFT_OUT, argv[0]);
}
DEFUN (clear_ip_bgp_instance_as_ipv4_soft_out,
clear_ip_bgp_instance_as_ipv4_soft_out_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " " CMD_AS_RANGE " ipv4 (unicast|multicast) soft out",
+ "clear ip bgp " BGP_INSTANCE_CMD " " CMD_AS_RANGE " ipv4 "BGP_SAFI_CMD_STR" soft out",
CLEAR_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Clear peers with the AS number\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_OUT_STR)
{
- if (strncmp (argv[3], "m", 1) == 0)
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_MULTICAST, clear_as,
- BGP_CLEAR_SOFT_OUT, argv[2]);
-
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_UNICAST, clear_as,
- BGP_CLEAR_SOFT_OUT, argv[2]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[3]);
+ return bgp_clear_vty (vty, argv[1], AFI_IP, safi, clear_as,
+ BGP_CLEAR_SOFT_OUT, argv[2]);
}
ALIAS (clear_ip_bgp_as_ipv4_soft_out,
clear_ip_bgp_as_ipv4_out_cmd,
- "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) out",
+ "clear ip bgp " CMD_AS_RANGE " ipv4 "BGP_SAFI_CMD_STR" out",
CLEAR_STR
IP_STR
BGP_STR
"Clear peers with the AS number\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_OUT_STR)
ALIAS (clear_ip_bgp_instance_as_ipv4_soft_out,
clear_ip_bgp_instance_as_ipv4_out_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " " CMD_AS_RANGE " ipv4 (unicast|multicast) out",
+ "clear ip bgp " BGP_INSTANCE_CMD " " CMD_AS_RANGE " ipv4 "BGP_SAFI_CMD_STR" out",
CLEAR_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Clear peers with the AS number\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_OUT_STR)
DEFUN (clear_ip_bgp_as_vpnv4_soft_out,
DEFUN (clear_ip_bgp_all_ipv4_soft_in,
clear_ip_bgp_all_ipv4_soft_in_cmd,
- "clear ip bgp * ipv4 (unicast|multicast) soft in",
+ "clear ip bgp * ipv4 "BGP_SAFI_CMD_STR" soft in",
CLEAR_STR
IP_STR
BGP_STR
"Clear all peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_IN_STR)
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all,
- BGP_CLEAR_SOFT_IN, NULL);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all,
- BGP_CLEAR_SOFT_IN, NULL);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_all,
+ BGP_CLEAR_SOFT_IN, NULL);
}
DEFUN (clear_ip_bgp_instance_all_ipv4_soft_in,
clear_ip_bgp_instance_all_ipv4_soft_in_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " * ipv4 (unicast|multicast) soft in",
+ "clear ip bgp " BGP_INSTANCE_CMD " * ipv4 "BGP_SAFI_CMD_STR" soft in",
CLEAR_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Clear all peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_IN_STR)
{
- if (strncmp (argv[2], "m", 1) == 0)
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_MULTICAST, clear_all,
- BGP_CLEAR_SOFT_IN, NULL);
-
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_UNICAST, clear_all,
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[2]);
+ return bgp_clear_vty (vty, argv[1], AFI_IP, safi, clear_all,
BGP_CLEAR_SOFT_IN, NULL);
}
ALIAS (clear_ip_bgp_all_ipv4_soft_in,
clear_ip_bgp_all_ipv4_in_cmd,
- "clear ip bgp * ipv4 (unicast|multicast) in",
+ "clear ip bgp * ipv4 "BGP_SAFI_CMD_STR" in",
CLEAR_STR
IP_STR
BGP_STR
"Clear all peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_IN_STR)
ALIAS (clear_ip_bgp_instance_all_ipv4_soft_in,
clear_ip_bgp_instance_all_ipv4_in_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " * ipv4 (unicast|multicast) in",
+ "clear ip bgp " BGP_INSTANCE_CMD " * ipv4 "BGP_SAFI_CMD_STR" in",
CLEAR_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Clear all peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_IN_STR)
DEFUN (clear_ip_bgp_all_ipv4_in_prefix_filter,
clear_ip_bgp_all_ipv4_in_prefix_filter_cmd,
- "clear ip bgp * ipv4 (unicast|multicast) in prefix-filter",
+ "clear ip bgp * ipv4 "BGP_SAFI_CMD_STR" in prefix-filter",
CLEAR_STR
IP_STR
BGP_STR
"Clear all peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_IN_STR
"Push out prefix-list ORF and do inbound soft reconfig\n")
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all,
- BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all,
- BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_all,
+ BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL);
}
DEFUN (clear_ip_bgp_all_vpnv4_soft_in,
DEFUN (clear_ip_bgp_peer_ipv4_soft_in,
clear_ip_bgp_peer_ipv4_soft_in_cmd,
- "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) soft in",
+ "clear ip bgp (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR" soft in",
CLEAR_STR
IP_STR
BGP_STR
"BGP neighbor address to clear\n"
"BGP neighbor on interface to clear\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_IN_STR)
{
- if (strncmp (argv[1], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer,
- BGP_CLEAR_SOFT_IN, argv[0]);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer,
- BGP_CLEAR_SOFT_IN, argv[0]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[1]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_peer,
+ BGP_CLEAR_SOFT_IN, argv[0]);
}
DEFUN (clear_ip_bgp_instance_peer_ipv4_soft_in,
clear_ip_bgp_instance_peer_ipv4_soft_in_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " (A.B.C.D|WORD) ipv4 (unicast|multicast) soft in",
+ "clear ip bgp " BGP_INSTANCE_CMD " (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR" soft in",
CLEAR_STR
IP_STR
BGP_STR
"BGP neighbor address to clear\n"
"BGP neighbor on interface to clear\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_IN_STR)
{
- if (strncmp (argv[3], "m", 1) == 0)
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_MULTICAST, clear_peer,
- BGP_CLEAR_SOFT_IN, argv[2]);
-
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_UNICAST, clear_peer,
- BGP_CLEAR_SOFT_IN, argv[2]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[3]);
+ return bgp_clear_vty (vty, argv[1], AFI_IP, safi, clear_peer,
+ BGP_CLEAR_SOFT_IN, argv[2]);
}
ALIAS (clear_ip_bgp_peer_ipv4_soft_in,
clear_ip_bgp_peer_ipv4_in_cmd,
- "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) in",
+ "clear ip bgp (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR" in",
CLEAR_STR
IP_STR
BGP_STR
"BGP neighbor address to clear\n"
"BGP neighbor on interface to clear\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_IN_STR)
ALIAS (clear_ip_bgp_instance_peer_ipv4_soft_in,
clear_ip_bgp_instance_peer_ipv4_in_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " (A.B.C.D|WORD) ipv4 (unicast|multicast) in",
+ "clear ip bgp " BGP_INSTANCE_CMD " (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR" in",
CLEAR_STR
IP_STR
BGP_STR
"BGP neighbor address to clear\n"
"BGP neighbor on interface to clear\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_IN_STR)
DEFUN (clear_ip_bgp_peer_ipv4_in_prefix_filter,
clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd,
- "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) in prefix-filter",
+ "clear ip bgp (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR" in prefix-filter",
CLEAR_STR
IP_STR
BGP_STR
"BGP neighbor address to clear\n"
"BGP neighbor on interface to clear\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_IN_STR
"Push out the existing ORF prefix-list\n")
{
- if (strncmp (argv[1], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer,
- BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer,
- BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[1]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_peer,
+ BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
}
DEFUN (clear_ip_bgp_peer_vpnv4_soft_in,
DEFUN (clear_ip_bgp_peer_group_ipv4_soft_in,
clear_ip_bgp_peer_group_ipv4_soft_in_cmd,
- "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft in",
+ "clear ip bgp peer-group WORD ipv4 "BGP_SAFI_CMD_STR" soft in",
CLEAR_STR
IP_STR
BGP_STR
"Clear all members of peer-group\n"
"BGP peer-group name\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_IN_STR)
{
- if (strncmp (argv[1], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group,
- BGP_CLEAR_SOFT_IN, argv[0]);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group,
- BGP_CLEAR_SOFT_IN, argv[0]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[1]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_group,
+ BGP_CLEAR_SOFT_IN, argv[0]);
}
DEFUN (clear_ip_bgp_instance_peer_group_ipv4_soft_in,
clear_ip_bgp_instance_peer_group_ipv4_soft_in_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " peer-group WORD ipv4 (unicast|multicast) soft in",
+ "clear ip bgp " BGP_INSTANCE_CMD " peer-group WORD ipv4 "BGP_SAFI_CMD_STR" soft in",
CLEAR_STR
IP_STR
BGP_STR
"Clear all members of peer-group\n"
"BGP peer-group name\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_IN_STR)
{
- if (strncmp (argv[3], "m", 1) == 0)
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_MULTICAST, clear_group,
- BGP_CLEAR_SOFT_IN, argv[2]);
-
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_UNICAST, clear_group,
- BGP_CLEAR_SOFT_IN, argv[2]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[3]);
+ return bgp_clear_vty (vty, argv[1], AFI_IP, safi, clear_group,
+ BGP_CLEAR_SOFT_IN, argv[2]);
}
ALIAS (clear_ip_bgp_peer_group_ipv4_soft_in,
clear_ip_bgp_peer_group_ipv4_in_cmd,
- "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in",
+ "clear ip bgp peer-group WORD ipv4 "BGP_SAFI_CMD_STR" in",
CLEAR_STR
IP_STR
BGP_STR
"Clear all members of peer-group\n"
"BGP peer-group name\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_IN_STR)
ALIAS (clear_ip_bgp_instance_peer_group_ipv4_soft_in,
clear_ip_bgp_instance_peer_group_ipv4_in_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " peer-group WORD ipv4 (unicast|multicast) in",
+ "clear ip bgp " BGP_INSTANCE_CMD " peer-group WORD ipv4 "BGP_SAFI_CMD_STR" in",
CLEAR_STR
IP_STR
BGP_STR
"Clear all members of peer-group\n"
"BGP peer-group name\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_IN_STR)
DEFUN (clear_ip_bgp_peer_group_ipv4_in_prefix_filter,
clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd,
- "clear ip bgp peer-group WORD ipv4 (unicast|multicast) in prefix-filter",
+ "clear ip bgp peer-group WORD ipv4 "BGP_SAFI_CMD_STR" in prefix-filter",
CLEAR_STR
IP_STR
BGP_STR
"Clear all members of peer-group\n"
"BGP peer-group name\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_IN_STR
"Push out prefix-list ORF and do inbound soft reconfig\n")
{
- if (strncmp (argv[1], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group,
- BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group,
- BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[1]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_group,
+ BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
}
DEFUN (clear_bgp_peer_group_soft_in,
DEFUN (clear_ip_bgp_external_ipv4_soft_in,
clear_ip_bgp_external_ipv4_soft_in_cmd,
- "clear ip bgp external ipv4 (unicast|multicast) soft in",
+ "clear ip bgp external ipv4 "BGP_SAFI_CMD_STR" soft in",
CLEAR_STR
IP_STR
BGP_STR
"Clear all external peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_IN_STR)
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external,
- BGP_CLEAR_SOFT_IN, NULL);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external,
- BGP_CLEAR_SOFT_IN, NULL);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_external,
+ BGP_CLEAR_SOFT_IN, NULL);
}
DEFUN (clear_ip_bgp_instance_external_ipv4_soft_in,
clear_ip_bgp_instance_external_ipv4_soft_in_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " external ipv4 (unicast|multicast) soft in",
+ "clear ip bgp " BGP_INSTANCE_CMD " external ipv4 "BGP_SAFI_CMD_STR" soft in",
CLEAR_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Clear all external peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_IN_STR)
{
- if (strncmp (argv[2], "m", 1) == 0)
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_MULTICAST, clear_external,
- BGP_CLEAR_SOFT_IN, NULL);
-
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_UNICAST, clear_external,
- BGP_CLEAR_SOFT_IN, NULL);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[2]);
+ return bgp_clear_vty (vty, argv[1], AFI_IP, safi, clear_external,
+ BGP_CLEAR_SOFT_IN, NULL);
}
ALIAS (clear_ip_bgp_external_ipv4_soft_in,
clear_ip_bgp_external_ipv4_in_cmd,
- "clear ip bgp external ipv4 (unicast|multicast) in",
+ "clear ip bgp external ipv4 "BGP_SAFI_CMD_STR" in",
CLEAR_STR
IP_STR
BGP_STR
"Clear all external peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_IN_STR)
ALIAS (clear_ip_bgp_instance_external_ipv4_soft_in,
clear_ip_bgp_instance_external_ipv4_in_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " external ipv4 (unicast|multicast) in",
+ "clear ip bgp " BGP_INSTANCE_CMD " external ipv4 "BGP_SAFI_CMD_STR" in",
CLEAR_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Clear all external peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_IN_STR)
DEFUN (clear_ip_bgp_external_ipv4_in_prefix_filter,
clear_ip_bgp_external_ipv4_in_prefix_filter_cmd,
- "clear ip bgp external ipv4 (unicast|multicast) in prefix-filter",
+ "clear ip bgp external ipv4 "BGP_SAFI_CMD_STR" in prefix-filter",
CLEAR_STR
IP_STR
BGP_STR
"Clear all external peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_IN_STR
"Push out prefix-list ORF and do inbound soft reconfig\n")
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external,
- BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external,
- BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_external,
+ BGP_CLEAR_SOFT_IN_ORF_PREFIX, NULL);
}
DEFUN (clear_bgp_external_soft_in,
DEFUN (clear_ip_bgp_as_ipv4_soft_in,
clear_ip_bgp_as_ipv4_soft_in_cmd,
- "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) soft in",
+ "clear ip bgp " CMD_AS_RANGE " ipv4 "BGP_SAFI_CMD_STR" soft in",
CLEAR_STR
IP_STR
BGP_STR
"Clear peers with the AS number\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_IN_STR)
{
- if (strncmp (argv[1], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as,
- BGP_CLEAR_SOFT_IN, argv[0]);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as,
- BGP_CLEAR_SOFT_IN, argv[0]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[1]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_as,
+ BGP_CLEAR_SOFT_IN, argv[0]);
}
DEFUN (clear_ip_bgp_instance_as_ipv4_soft_in,
clear_ip_bgp_instance_as_ipv4_soft_in_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " " CMD_AS_RANGE " ipv4 (unicast|multicast) soft in",
+ "clear ip bgp " BGP_INSTANCE_CMD " " CMD_AS_RANGE " ipv4 "BGP_SAFI_CMD_STR" soft in",
CLEAR_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Clear peers with the AS number\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR
BGP_SOFT_IN_STR)
{
- if (strncmp (argv[3], "m", 1) == 0)
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_MULTICAST, clear_as,
- BGP_CLEAR_SOFT_IN, argv[2]);
-
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_UNICAST, clear_as,
- BGP_CLEAR_SOFT_IN, argv[2]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[3]);
+ return bgp_clear_vty (vty, argv[1], AFI_IP, safi, clear_as,
+ BGP_CLEAR_SOFT_IN, argv[2]);
}
ALIAS (clear_ip_bgp_as_ipv4_soft_in,
clear_ip_bgp_as_ipv4_in_cmd,
- "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) in",
+ "clear ip bgp " CMD_AS_RANGE " ipv4 "BGP_SAFI_CMD_STR" in",
CLEAR_STR
IP_STR
BGP_STR
"Clear peers with the AS number\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_IN_STR)
ALIAS (clear_ip_bgp_instance_as_ipv4_soft_in,
clear_ip_bgp_instance_as_ipv4_in_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " " CMD_AS_RANGE " ipv4 (unicast|multicast) in",
+ "clear ip bgp " BGP_INSTANCE_CMD " " CMD_AS_RANGE " ipv4 "BGP_SAFI_CMD_STR" in",
CLEAR_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Clear peers with the AS number\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_IN_STR)
DEFUN (clear_ip_bgp_as_ipv4_in_prefix_filter,
clear_ip_bgp_as_ipv4_in_prefix_filter_cmd,
- "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) in prefix-filter",
+ "clear ip bgp " CMD_AS_RANGE " ipv4 "BGP_SAFI_CMD_STR" in prefix-filter",
CLEAR_STR
IP_STR
BGP_STR
"Clear peers with the AS number\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_IN_STR
"Push out prefix-list ORF and do inbound soft reconfig\n")
{
- if (strncmp (argv[1], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as,
- BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_as,
- BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[1]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_as,
+ BGP_CLEAR_SOFT_IN_ORF_PREFIX, argv[0]);
}
DEFUN (clear_ip_bgp_as_vpnv4_soft_in,
DEFUN (clear_ip_bgp_all_ipv4_soft,
clear_ip_bgp_all_ipv4_soft_cmd,
- "clear ip bgp * ipv4 (unicast|multicast) soft",
+ "clear ip bgp * ipv4 "BGP_SAFI_CMD_STR" soft",
CLEAR_STR
IP_STR
BGP_STR
"Address Family Modifier\n"
BGP_SOFT_STR)
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_all,
- BGP_CLEAR_SOFT_BOTH, NULL);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all,
- BGP_CLEAR_SOFT_BOTH, NULL);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_all,
+ BGP_CLEAR_SOFT_BOTH, NULL);
}
DEFUN (clear_ip_bgp_instance_all_ipv4_soft,
clear_ip_bgp_instance_all_ipv4_soft_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " * ipv4 (unicast|multicast) soft",
+ "clear ip bgp " BGP_INSTANCE_CMD " * ipv4 "BGP_SAFI_CMD_STR" soft",
CLEAR_STR
IP_STR
BGP_STR
"Address Family Modifier\n"
BGP_SOFT_STR)
{
- if (strncmp (argv[2], "m", 1) == 0)
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_MULTICAST, clear_all,
- BGP_CLEAR_SOFT_BOTH, NULL);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_all,
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[2]);
+ return bgp_clear_vty (vty, argv[1], AFI_IP, safi, clear_all,
BGP_CLEAR_SOFT_BOTH, NULL);
}
DEFUN (clear_ip_bgp_peer_ipv4_soft,
clear_ip_bgp_peer_ipv4_soft_cmd,
- "clear ip bgp (A.B.C.D|WORD) ipv4 (unicast|multicast) soft",
+ "clear ip bgp (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR" soft",
CLEAR_STR
IP_STR
BGP_STR
"Address Family Modifier\n"
BGP_SOFT_STR)
{
- if (strncmp (argv[1], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_peer,
- BGP_CLEAR_SOFT_BOTH, argv[0]);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_peer,
- BGP_CLEAR_SOFT_BOTH, argv[0]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[1]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_peer,
+ BGP_CLEAR_SOFT_BOTH, argv[0]);
}
DEFUN (clear_ip_bgp_instance_peer_ipv4_soft,
clear_ip_bgp_instance_peer_ipv4_soft_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " (A.B.C.D|WORD) ipv4 (unicast|multicast) soft",
+ "clear ip bgp " BGP_INSTANCE_CMD " (A.B.C.D|WORD) ipv4 "BGP_SAFI_CMD_STR" soft",
CLEAR_STR
IP_STR
BGP_STR
"Address Family Modifier\n"
BGP_SOFT_STR)
{
- if (strncmp (argv[3], "m", 1) == 0)
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_MULTICAST, clear_peer,
- BGP_CLEAR_SOFT_BOTH, argv[2]);
-
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_UNICAST, clear_peer,
- BGP_CLEAR_SOFT_BOTH, argv[2]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[3]);
+ return bgp_clear_vty (vty, argv[1], AFI_IP, safi, clear_peer,
+ BGP_CLEAR_SOFT_BOTH, argv[2]);
}
DEFUN (clear_ip_bgp_peer_vpnv4_soft,
DEFUN (clear_ip_bgp_peer_group_ipv4_soft,
clear_ip_bgp_peer_group_ipv4_soft_cmd,
- "clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft",
+ "clear ip bgp peer-group WORD ipv4 "BGP_SAFI_CMD_STR" soft",
CLEAR_STR
IP_STR
BGP_STR
"Clear all members of peer-group\n"
"BGP peer-group name\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR)
{
- if (strncmp (argv[1], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_group,
- BGP_CLEAR_SOFT_BOTH, argv[0]);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_group,
- BGP_CLEAR_SOFT_BOTH, argv[0]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[1]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_group,
+ BGP_CLEAR_SOFT_BOTH, argv[0]);
}
DEFUN (clear_ip_bgp_instance_peer_group_ipv4_soft,
clear_ip_bgp_instance_peer_group_ipv4_soft_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " peer-group WORD ipv4 (unicast|multicast) soft",
+ "clear ip bgp " BGP_INSTANCE_CMD " peer-group WORD ipv4 "BGP_SAFI_CMD_STR" soft",
CLEAR_STR
IP_STR
BGP_STR
"Clear all members of peer-group\n"
"BGP peer-group name\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR)
{
- if (strncmp (argv[3], "m", 1) == 0)
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_MULTICAST, clear_group,
- BGP_CLEAR_SOFT_BOTH, argv[2]);
-
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_UNICAST, clear_group,
- BGP_CLEAR_SOFT_BOTH, argv[2]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[3]);
+ return bgp_clear_vty (vty, argv[1], AFI_IP, safi, clear_group,
+ BGP_CLEAR_SOFT_BOTH, argv[2]);
}
DEFUN (clear_bgp_peer_group_soft,
DEFUN (clear_ip_bgp_external_ipv4_soft,
clear_ip_bgp_external_ipv4_soft_cmd,
- "clear ip bgp external ipv4 (unicast|multicast) soft",
+ "clear ip bgp external ipv4 "BGP_SAFI_CMD_STR" soft",
CLEAR_STR
IP_STR
BGP_STR
"Clear all external peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR)
{
- if (strncmp (argv[0], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_external,
- BGP_CLEAR_SOFT_BOTH, NULL);
-
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_UNICAST, clear_external,
- BGP_CLEAR_SOFT_BOTH, NULL);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[0]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_external,
+ BGP_CLEAR_SOFT_BOTH, NULL);
}
DEFUN (clear_ip_bgp_instance_external_ipv4_soft,
clear_ip_bgp_instance_external_ipv4_soft_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " external ipv4 (unicast|multicast) soft",
+ "clear ip bgp " BGP_INSTANCE_CMD " external ipv4 "BGP_SAFI_CMD_STR" soft",
CLEAR_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Clear all external peers\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
BGP_SOFT_STR)
{
- if (strncmp (argv[2], "m", 1) == 0)
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_MULTICAST, clear_external,
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[2]);
+ return bgp_clear_vty (vty, argv[1], AFI_IP, safi, clear_external,
BGP_CLEAR_SOFT_BOTH, NULL);
-
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_UNICAST, clear_external,
- BGP_CLEAR_SOFT_BOTH, NULL);
}
DEFUN (clear_bgp_external_soft,
DEFUN (clear_ip_bgp_as_ipv4_soft,
clear_ip_bgp_as_ipv4_soft_cmd,
- "clear ip bgp " CMD_AS_RANGE " ipv4 (unicast|multicast) soft",
+ "clear ip bgp " CMD_AS_RANGE " ipv4 "BGP_SAFI_CMD_STR" soft",
CLEAR_STR
IP_STR
BGP_STR
"Address Family Modifier\n"
BGP_SOFT_STR)
{
- if (strncmp (argv[1], "m", 1) == 0)
- return bgp_clear_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, clear_as,
- BGP_CLEAR_SOFT_BOTH, argv[0]);
-
- return bgp_clear_vty (vty, NULL,AFI_IP, SAFI_UNICAST, clear_as,
- BGP_CLEAR_SOFT_BOTH, argv[0]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[1]);
+ return bgp_clear_vty (vty, NULL, AFI_IP, safi, clear_as,
+ BGP_CLEAR_SOFT_BOTH, argv[0]);
}
DEFUN (clear_ip_bgp_instance_as_ipv4_soft,
clear_ip_bgp_instance_as_ipv4_soft_cmd,
- "clear ip bgp " BGP_INSTANCE_CMD " " CMD_AS_RANGE " ipv4 (unicast|multicast) soft",
+ "clear ip bgp " BGP_INSTANCE_CMD " " CMD_AS_RANGE " ipv4 "BGP_SAFI_CMD_STR" soft",
CLEAR_STR
IP_STR
BGP_STR
"Address Family Modifier\n"
BGP_SOFT_STR)
{
- if (strncmp (argv[3], "m", 1) == 0)
- return bgp_clear_vty (vty, argv[1], AFI_IP, SAFI_MULTICAST, clear_as,
- BGP_CLEAR_SOFT_BOTH, argv[2]);
-
- return bgp_clear_vty (vty, argv[1],AFI_IP, SAFI_UNICAST, clear_as,
- BGP_CLEAR_SOFT_BOTH, argv[2]);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[3]);
+ return bgp_clear_vty (vty, argv[1], AFI_IP, safi, clear_as,
+ BGP_CLEAR_SOFT_BOTH, argv[2]);
}
DEFUN (clear_ip_bgp_as_vpnv4_soft,
{
if (use_json)
vty_out(vty, "{\"error\": {\"message\": \"No %s neighbor configured\"}}%s",
- afi == AFI_IP ? "IPv4" : "IPv6", VTY_NEWLINE);
+ afi_safi_print(afi, safi), VTY_NEWLINE);
else
vty_out (vty, "No %s neighbor is configured%s",
- afi == AFI_IP ? "IPv4" : "IPv6", VTY_NEWLINE);
+ afi_safi_print(afi, safi), VTY_NEWLINE);
}
if (dn_count && ! use_json)
SHOW_STR
IP_STR
BGP_STR
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"Summary of BGP neighbor status\n"
"JavaScript Object Notation\n")
{
"show bgp ipv4 (unicast|multicast|vpn|encap) summary {json}",
SHOW_STR
BGP_STR
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"Summary of BGP neighbor status\n")
DEFUN (show_ip_bgp_instance_ipv4_summary,
show_ip_bgp_instance_ipv4_summary_cmd,
- "show ip bgp view WORD ipv4 (unicast|multicast) summary {json}",
+ "show ip bgp view WORD ipv4 "BGP_SAFI_CMD_STR" summary {json}",
SHOW_STR
IP_STR
BGP_STR
"BGP view\n"
"View name\n"
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Summary of BGP neighbor status\n"
"JavaScript Object Notation\n")
{
u_char uj = use_json(argc, argv);
- if (strncmp (argv[1], "m", 1) == 0)
- return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST, uj);
- else
- return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, uj);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[1]);
+ return bgp_show_summary_vty (vty, argv[0], AFI_IP, safi, uj);
}
ALIAS (show_ip_bgp_instance_ipv4_summary,
show_bgp_instance_ipv4_safi_summary_cmd,
- "show bgp view WORD ipv4 (unicast|multicast) summary {json}",
+ "show bgp view WORD ipv4 "BGP_SAFI_CMD_STR" summary {json}",
SHOW_STR
BGP_STR
"BGP view\n"
"View name\n"
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"Summary of BGP neighbor status\n")
DEFUN (show_ip_bgp_vpnv4_all_summary,
"show bgp ipv6 (unicast|multicast|vpn|encap) summary {json}",
SHOW_STR
BGP_STR
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"Summary of BGP neighbor status\n"
"JavaScript Object Notation\n")
{
DEFUN (show_bgp_instance_ipv6_safi_summary,
show_bgp_instance_ipv6_safi_summary_cmd,
- "show bgp " BGP_INSTANCE_CMD " ipv6 (unicast|multicast) summary {json}",
+ "show bgp " BGP_INSTANCE_CMD " ipv6 "BGP_SAFI_CMD_STR" summary {json}",
SHOW_STR
BGP_STR
BGP_INSTANCE_HELP_STR
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"Summary of BGP neighbor status\n"
"JavaScript Object Notation\n")
{
u_char uj = use_json(argc, argv);
- if (strncmp (argv[2], "m", 1) == 0)
- return bgp_show_summary_vty (vty, argv[1], AFI_IP6, SAFI_MULTICAST, uj);
-
- return bgp_show_summary_vty (vty, argv[1], AFI_IP6, SAFI_UNICAST, uj);
+ safi_t safi;
+ safi = bgp_vty_safi_from_arg(argv[2]);
+ return bgp_show_summary_vty (vty, argv[1], AFI_IP6, safi, uj);
}
/* old command */
else if (afi == AFI_IP && safi == SAFI_MULTICAST)
return "IPv4 Multicast";
else if (afi == AFI_IP && safi == SAFI_MPLS_VPN)
- return "VPN-IPv4 Unicast";
+ return "IPv4 VPN";
else if (afi == AFI_IP && safi == SAFI_ENCAP)
- return "ENCAP-IPv4 Unicast";
+ return "IPv4 Encap";
else if (afi == AFI_IP6 && safi == SAFI_UNICAST)
return "IPv6 Unicast";
else if (afi == AFI_IP6 && safi == SAFI_MULTICAST)
return "IPv6 Multicast";
else if (afi == AFI_IP6 && safi == SAFI_MPLS_VPN)
- return "VPN-IPv6 Unicast";
+ return "IPv6 VPN";
else if (afi == AFI_IP6 && safi == SAFI_ENCAP)
- return "ENCAP-IPv6 Unicast";
+ return "IPv6 Encap";
else
return "Unknown";
}
ALIAS (show_ip_bgp_neighbors,
show_ip_bgp_ipv4_neighbors_cmd,
- "show ip bgp ipv4 (unicast|multicast) neighbors {json}",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" neighbors {json}",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Detailed information on TCP and BGP neighbor connections\n"
"JavaScript Object Notation\n")
ALIAS (show_ip_bgp_neighbors_peer,
show_ip_bgp_ipv4_neighbors_peer_cmd,
- "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X|WORD) {json}",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" neighbors (A.B.C.D|X:X::X:X|WORD) {json}",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Neighbor to display information about\n"
DEFUN (show_ip_bgp_ipv4_paths,
show_ip_bgp_ipv4_paths_cmd,
- "show ip bgp ipv4 (unicast|multicast) paths",
+ "show ip bgp ipv4 "BGP_SAFI_CMD_STR" paths",
SHOW_STR
IP_STR
BGP_STR
"Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_SAFI_HELP_STR
"Path information\n")
{
vty_out (vty, "Address Refcnt Path\r\n");
DEFUN (show_bgp_updgrps,
show_bgp_updgrps_cmd,
- "show bgp (ipv4|ipv6) (unicast|multicast|vpn|encap) update-groups",
+ "show bgp "BGP_AFI_SAFI_CMD_STR" update-groups",
SHOW_STR
BGP_STR
- "Address family\n"
- "Address family\n"
- "Address Family modifier\n"
- "Address Family modifier\n"
+ BGP_AFI_SAFI_HELP_STR
"Detailed info about dynamic update groups\n")
{
afi_t afi;
safi_t safi;
- afi = (strcmp(argv[0], "ipv4") == 0) ? AFI_IP : AFI_IP6;
+ afi = bgp_vty_safi_from_arg(argv[0]);
safi = bgp_vty_safi_from_arg(argv[1]);
return (bgp_show_update_groups(vty, NULL, afi, safi, 0));
}
DEFUN (show_bgp_updgrps_s,
show_bgp_updgrps_s_cmd,
- "show bgp (ipv4|ipv6) (unicast|multicast|vpn|encap) update-groups SUBGROUP-ID",
+ "show bgp "BGP_AFI_SAFI_CMD_STR" update-groups SUBGROUP-ID",
SHOW_STR
BGP_STR
"Address family\n"
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"Detailed info about v6 dynamic update groups\n"
"Specific subgroup to display detailed info for")
{
safi_t safi;
uint64_t subgrp_id;
- afi = (strcmp(argv[0], "ipv4") == 0) ? AFI_IP : AFI_IP6;
+ afi = bgp_vty_safi_from_arg(argv[0]);
safi = bgp_vty_safi_from_arg(argv[1]);
VTY_GET_ULL("subgroup-id", subgrp_id, argv[2]);
return(bgp_show_update_groups(vty, NULL, afi, safi, subgrp_id));
DEFUN (show_bgp_updgrps_afi_adj,
show_bgp_updgrps_afi_adj_cmd,
- "show bgp (ipv4|ipv6) (unicast|multicast|vpn|encap) update-groups (advertise-queue|advertised-routes|packet-queue)",
+ "show bgp "BGP_AFI_SAFI_CMD_STR" update-groups (advertise-queue|advertised-routes|packet-queue)",
SHOW_STR
BGP_STR
- "Address family\n"
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"BGP update groups\n"
"Advertisement queue\n"
"Announced routes\n"
afi_t afi;
safi_t safi;
- afi = (strcmp(argv[0], "ipv4") == 0) ? AFI_IP : AFI_IP6;
+ afi = bgp_vty_safi_from_arg(argv[0]);
safi = bgp_vty_safi_from_arg(argv[1]);
show_bgp_updgrps_adj_info_aux(vty, NULL, afi, safi, argv[2], 0);
return CMD_SUCCESS;
DEFUN (show_bgp_updgrps_afi_adj_s,
show_bgp_updgrps_afi_adj_s_cmd,
- "show bgp (ipv4|ipv6) (unicast|multicast|vpn|encap) update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
+ "show bgp "BGP_AFI_SAFI_CMD_STR" update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue)",
SHOW_STR
BGP_STR
- "Address family\n"
- AFI_SAFI_STR
+ BGP_AFI_SAFI_HELP_STR
"BGP update groups\n"
"Specific subgroup to display info for\n"
"Advertisement queue\n"
safi_t safi;
uint64_t subgrp_id;
- afi = (strcmp(argv[0], "ipv4") == 0) ? AFI_IP : AFI_IP6;
+ afi = bgp_vty_safi_from_arg(argv[0]);
safi = bgp_vty_safi_from_arg(argv[1]);
VTY_GET_ULL("subgroup-id", subgrp_id, argv[2]);