"show [ip] bgp l2vpn evpn [json]",
SHOW_STR IP_STR BGP_STR L2VPN_HELP_STR EVPN_HELP_STR JSON_STR)
{
- return bgp_show_ethernet_vpn(vty, NULL, bgp_show_type_normal, NULL,
- SHOW_DISPLAY_STANDARD,
+ return bgp_show_ethernet_vpn(vty, NULL, bgp_show_type_normal, NULL, 0,
use_json(argc, argv));
}
DEFUN(show_ip_bgp_l2vpn_evpn_rd,
show_ip_bgp_l2vpn_evpn_rd_cmd,
- "show [ip] bgp l2vpn evpn rd <ASN:NN_OR_IP-ADDRESS:NN|all> [json]",
+ "show [ip] bgp l2vpn evpn rd ASN:NN_OR_IP-ADDRESS:NN [json]",
SHOW_STR
IP_STR
BGP_STR
L2VPN_HELP_STR
EVPN_HELP_STR
"Display information for a route distinguisher\n"
- "VPN Route Distinguisher\n"
- "All VPN Route Distinguishers\n"
- JSON_STR)
+ "VPN Route Distinguisher\n" JSON_STR)
{
int idx_ext_community = 0;
int ret;
struct prefix_rd prd;
- int rd_all = 0;
-
- argv_find(argv, argc, "all", &rd_all);
- if (rd_all)
- return bgp_show_ethernet_vpn(vty, NULL, bgp_show_type_normal,
- NULL, SHOW_DISPLAY_STANDARD,
- use_json(argc, argv));
argv_find(argv, argc, "ASN:NN_OR_IP-ADDRESS:NN", &idx_ext_community);
+
ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
if (!ret) {
vty_out(vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING;
}
- return bgp_show_ethernet_vpn(vty, &prd, bgp_show_type_normal, NULL,
- SHOW_DISPLAY_STANDARD,
+ return bgp_show_ethernet_vpn(vty, &prd, bgp_show_type_normal, NULL, 0,
use_json(argc, argv));
}
"Display information about all EVPN NLRIs\n"
"Display BGP tags for prefixes\n")
{
- return bgp_show_ethernet_vpn(vty, NULL, bgp_show_type_normal, NULL,
- SHOW_DISPLAY_TAGS, 0);
+ return bgp_show_ethernet_vpn(vty, NULL, bgp_show_type_normal, NULL, 1,
+ 0);
}
DEFUN(show_ip_bgp_l2vpn_evpn_rd_tags,
show_ip_bgp_l2vpn_evpn_rd_tags_cmd,
- "show [ip] bgp l2vpn evpn rd <ASN:NN_OR_IP-ADDRESS:NN|all> tags",
+ "show [ip] bgp l2vpn evpn rd ASN:NN_OR_IP-ADDRESS:NN tags",
SHOW_STR
IP_STR
BGP_STR
L2VPN_HELP_STR
EVPN_HELP_STR
"Display information for a route distinguisher\n"
- "VPN Route Distinguisher\n"
- "All VPN Route Distinguishers\n"
- "Display BGP tags for prefixes\n")
+ "VPN Route Distinguisher\n" "Display BGP tags for prefixes\n")
{
int idx_ext_community = 0;
int ret;
struct prefix_rd prd;
- int rd_all = 0;
-
- argv_find(argv, argc, "all", &rd_all);
- if (rd_all)
- return bgp_show_ethernet_vpn(vty, NULL, bgp_show_type_normal,
- NULL, SHOW_DISPLAY_TAGS, 0);
argv_find(argv, argc, "ASN:NN_OR_IP-ADDRESS:NN", &idx_ext_community);
+
ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
if (!ret) {
vty_out(vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING;
}
- return bgp_show_ethernet_vpn(vty, &prd, bgp_show_type_normal, NULL,
- SHOW_DISPLAY_TAGS, 0);
+ return bgp_show_ethernet_vpn(vty, &prd, bgp_show_type_normal, NULL, 1,
+ 0);
}
DEFUN(show_ip_bgp_l2vpn_evpn_neighbor_routes,
return CMD_WARNING;
}
- return bgp_show_ethernet_vpn(vty, NULL, bgp_show_type_neighbor, peer,
- SHOW_DISPLAY_STANDARD, uj);
+ return bgp_show_ethernet_vpn(vty, NULL, bgp_show_type_neighbor, peer, 0,
+ uj);
}
DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_routes,
show_ip_bgp_l2vpn_evpn_rd_neighbor_routes_cmd,
- "show [ip] bgp l2vpn evpn rd <ASN:NN_OR_IP-ADDRESS:NN|all> neighbors <A.B.C.D|X:X::X:X|WORD> routes [json]",
+ "show [ip] bgp l2vpn evpn rd ASN:NN_OR_IP-ADDRESS:NN neighbors <A.B.C.D|X:X::X:X|WORD> routes [json]",
SHOW_STR
IP_STR
BGP_STR
EVPN_HELP_STR
"Display information for a route distinguisher\n"
"VPN Route Distinguisher\n"
- "All VPN Route Distinguishers\n"
"Detailed information on TCP and BGP neighbor connections\n"
"IPv4 Neighbor to display information about\n"
"IPv6 Neighbor to display information about\n"
afi_t afi = AFI_L2VPN;
safi_t safi = SAFI_EVPN;
struct bgp *bgp = NULL;
- int rd_all = 0;
bgp_vty_find_and_parse_afi_safi_bgp(vty, argv, argc, &idx, &afi, &safi,
&bgp, uj);
return CMD_WARNING;
}
- argv_find(argv, argc, "all", &rd_all);
- if (!rd_all) {
- argv_find(argv, argc, "ASN:NN_OR_IP-ADDRESS:NN",
- &idx_ext_community);
- ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
- if (!ret) {
- if (uj) {
- json_object *json_no = NULL;
- json_no = json_object_new_object();
- json_object_string_add(
- json_no, "warning",
- "Malformed Route Distinguisher");
- vty_out(vty, "%s\n",
- json_object_to_json_string(json_no));
- json_object_free(json_no);
- } else
- vty_out(vty,
- "%% Malformed Route Distinguisher\n");
- return CMD_WARNING;
- }
+ argv_find(argv, argc, "ASN:NN_OR_IP-ADDRESS:NN", &idx_ext_community);
+ ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
+ if (!ret) {
+ if (uj) {
+ json_object *json_no = NULL;
+ json_no = json_object_new_object();
+ json_object_string_add(json_no, "warning",
+ "Malformed Route Distinguisher");
+ vty_out(vty, "%s\n",
+ json_object_to_json_string(json_no));
+ json_object_free(json_no);
+ } else
+ vty_out(vty, "%% Malformed Route Distinguisher\n");
+ return CMD_WARNING;
}
/* neighbors <A.B.C.D|X:X::X:X|WORD> */
return CMD_WARNING;
}
-
- if (rd_all)
- return bgp_show_ethernet_vpn(vty, NULL, bgp_show_type_neighbor,
- peer, SHOW_DISPLAY_STANDARD, uj);
- else
- return bgp_show_ethernet_vpn(vty, &prd, bgp_show_type_neighbor,
- peer, SHOW_DISPLAY_STANDARD, uj);
+ return bgp_show_ethernet_vpn(vty, &prd, bgp_show_type_neighbor, peer, 0,
+ uj);
}
DEFUN(show_ip_bgp_l2vpn_evpn_neighbor_advertised_routes,
DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_advertised_routes,
show_ip_bgp_l2vpn_evpn_rd_neighbor_advertised_routes_cmd,
- "show [ip] bgp l2vpn evpn rd <ASN:NN_OR_IP-ADDRESS:NN|all> neighbors <A.B.C.D|X:X::X:X|WORD> advertised-routes [json]",
+ "show [ip] bgp l2vpn evpn rd ASN:NN_OR_IP-ADDRESS:NN neighbors <A.B.C.D|X:X::X:X|WORD> advertised-routes [json]",
SHOW_STR
IP_STR
BGP_STR
EVPN_HELP_STR
"Display information for a route distinguisher\n"
"VPN Route Distinguisher\n"
- "All VPN Route Distinguishers\n"
"Detailed information on TCP and BGP neighbor connections\n"
"IPv4 Neighbor to display information about\n"
"IPv6 Neighbor to display information about\n"
char *peerstr = NULL;
afi_t afi = AFI_L2VPN;
safi_t safi = SAFI_EVPN;
- int rd_all = 0;
if (uj)
argc--;
return CMD_WARNING;
}
+ argv_find(argv, argc, "ASN:NN_OR_IP-ADDRESS:NN", &idx_ext_community);
+
/* neighbors <A.B.C.D|X:X::X:X|WORD> */
argv_find(argv, argc, "neighbors", &idx);
peerstr = argv[++idx]->arg;
return CMD_WARNING;
}
- argv_find(argv, argc, "all", &rd_all);
- if (rd_all)
- return show_adj_route_vpn(vty, peer, NULL, AFI_L2VPN, SAFI_EVPN,
- uj);
- else {
- argv_find(argv, argc, "ASN:NN_OR_IP-ADDRESS:NN",
- &idx_ext_community);
- ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
- if (!ret) {
- if (uj) {
- json_object *json_no = NULL;
- json_no = json_object_new_object();
- json_object_string_add(
- json_no, "warning",
- "Malformed Route Distinguisher");
- vty_out(vty, "%s\n",
- json_object_to_json_string(json_no));
- json_object_free(json_no);
- } else
- vty_out(vty,
- "%% Malformed Route Distinguisher\n");
- return CMD_WARNING;
- }
+ ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
+ if (!ret) {
+ if (uj) {
+ json_object *json_no = NULL;
+ json_no = json_object_new_object();
+ json_object_string_add(json_no, "warning",
+ "Malformed Route Distinguisher");
+ vty_out(vty, "%s\n",
+ json_object_to_json_string(json_no));
+ json_object_free(json_no);
+ } else
+ vty_out(vty, "%% Malformed Route Distinguisher\n");
+ return CMD_WARNING;
}
return show_adj_route_vpn(vty, peer, &prd, AFI_L2VPN, SAFI_EVPN, uj);
DEFUN(show_ip_bgp_evpn_rd_overlay,
show_ip_bgp_evpn_rd_overlay_cmd,
- "show [ip] bgp l2vpn evpn rd <ASN:NN_OR_IP-ADDRESS:NN|all> overlay",
+ "show [ip] bgp l2vpn evpn rd ASN:NN_OR_IP-ADDRESS:NN overlay",
SHOW_STR
IP_STR
BGP_STR
EVPN_HELP_STR
"Display information for a route distinguisher\n"
"VPN Route Distinguisher\n"
- "All VPN Route Distinguishers\n"
"Display BGP Overlay Information for prefixes\n")
{
int idx_ext_community = 0;
int ret;
struct prefix_rd prd;
- int rd_all = 0;
-
- argv_find(argv, argc, "all", &rd_all);
- if (rd_all)
- return bgp_show_ethernet_vpn(vty, NULL, bgp_show_type_normal,
- NULL, SHOW_DISPLAY_OVERLAY,
- use_json(argc, argv));
argv_find(argv, argc, "ASN:NN_OR_IP-ADDRESS:NN", &idx_ext_community);
+
ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
if (!ret) {
vty_out(vty, "%% Malformed Route Distinguisher\n");
}
}
-/*
- * Display BGP EVPN routing table -- all RDs and MAC and/or IP
- * (vty handler). Only matching type-2 routes will be displayed.
- */
-static void evpn_show_route_rd_all_macip(struct vty *vty, struct bgp *bgp,
- struct ethaddr *mac, struct ipaddr *ip,
- json_object *json)
-{
- struct bgp_dest *rd_dest;
- struct bgp_table *table;
- struct bgp_dest *dest;
- struct bgp_path_info *pi;
- afi_t afi = AFI_L2VPN;
- safi_t safi = SAFI_EVPN;
- uint32_t prefix_cnt, path_cnt;
- prefix_cnt = path_cnt = 0;
-
- /* EVPN routing table is a 2-level table with the first level being
- * the RD. We need to look in every RD we know about.
- */
- for (rd_dest = bgp_table_top(bgp->rib[afi][safi]); rd_dest;
- rd_dest = bgp_route_next(rd_dest)) {
- json_object *json_paths = NULL; /* paths array for prefix */
- json_object *json_prefix = NULL; /* prefix within an RD */
- json_object *json_rd = NULL; /* holds all prefixes for RD */
- char rd_str[RD_ADDRSTRLEN];
- char prefix_str[BUFSIZ];
- int add_rd_to_json = 0;
- struct prefix_evpn ep;
- const struct prefix *rd_destp = bgp_dest_get_prefix(rd_dest);
-
- table = bgp_dest_get_bgp_table_info(rd_dest);
- if (table == NULL)
- continue;
-
- prefix_rd2str((struct prefix_rd *)rd_destp, rd_str,
- sizeof(rd_str));
-
- /* Construct an RT-2 from the user-supplied mac(ip),
- * then search the l2vpn evpn table for it.
- */
- build_evpn_type2_prefix(&ep, mac, ip);
- dest = bgp_afi_node_lookup(bgp->rib[afi][safi], afi, safi,
- (struct prefix *)&ep,
- (struct prefix_rd *)rd_destp);
- if (!dest)
- continue;
-
- if (json)
- json_rd = json_object_new_object();
-
- const struct prefix *p = bgp_dest_get_prefix(dest);
-
- prefix2str(p, prefix_str, sizeof(prefix_str));
-
- pi = bgp_dest_get_bgp_path_info(dest);
- if (pi) {
- /* RD header - per RD. */
- bgp_evpn_show_route_rd_header(vty, rd_dest, json_rd,
- rd_str, RD_ADDRSTRLEN);
- prefix_cnt++;
- }
-
- if (json) {
- json_prefix = json_object_new_object();
- json_paths = json_object_new_array();
- json_object_string_add(json_prefix, "prefix",
- prefix_str);
- json_object_int_add(json_prefix, "prefixLen",
- p->prefixlen);
- } else
- /* Prefix and num paths displayed once per prefix. */
- route_vty_out_detail_header(
- vty, bgp, dest, (struct prefix_rd *)rd_destp,
- AFI_L2VPN, SAFI_EVPN, json_prefix);
-
- /* For EVPN, the prefix is displayed for each path (to
- * fit in with code that already exists).
- */
- for (; pi; pi = pi->next) {
- json_object *json_path = NULL;
-
- add_rd_to_json = 1;
- path_cnt++;
-
- if (json)
- json_path = json_object_new_array();
-
- route_vty_out_detail(vty, bgp, dest, pi, AFI_L2VPN,
- SAFI_EVPN, json_path);
-
- if (json)
- json_object_array_add(json_paths, json_path);
- else
- vty_out(vty, "\n");
- }
-
- if (json) {
- json_object_object_add(json_prefix, "paths",
- json_paths);
- json_object_object_add(json_rd, prefix_str,
- json_prefix);
- if (add_rd_to_json)
- json_object_object_add(json, rd_str, json_rd);
- else {
- json_object_free(json_rd);
- json_rd = NULL;
- }
- }
- }
-
- if (json) {
- json_object_int_add(json, "numPrefix", prefix_cnt);
- json_object_int_add(json, "numPaths", path_cnt);
- } else {
- if (prefix_cnt == 0) {
- vty_out(vty, "No Matching EVPN prefixes exist\n");
- } else {
- vty_out(vty, "Displayed %u prefixes (%u paths)\n",
- prefix_cnt, path_cnt);
- }
- }
-}
-
/*
* Display BGP EVPN routing table - all routes (vty handler).
* If 'type' is non-zero, only routes matching that type are shown.
*/
for (; pi; pi = pi->next) {
json_object *json_path = NULL;
-
path_cnt++;
add_prefix_to_json = 1;
add_rd_to_json = 1;
*/
DEFUN(show_bgp_l2vpn_evpn_route_rd,
show_bgp_l2vpn_evpn_route_rd_cmd,
- "show bgp l2vpn evpn route rd <ASN:NN_OR_IP-ADDRESS:NN|all> [type "EVPN_TYPE_ALL_LIST"] [json]",
+ "show bgp l2vpn evpn route rd ASN:NN_OR_IP-ADDRESS:NN [type "EVPN_TYPE_ALL_LIST"] [json]",
SHOW_STR
BGP_STR
L2VPN_HELP_STR
EVPN_HELP_STR
EVPN_RT_HELP_STR
EVPN_RT_DIST_HELP_STR
- EVPN_ASN_IP_HELP_STR "All VPN Route Distinguishers\n"
+ EVPN_ASN_IP_HELP_STR
EVPN_TYPE_HELP_STR
EVPN_TYPE_ALL_LIST_HELP_STR
JSON_STR)
int ret;
struct prefix_rd prd;
int type = 0;
+ int rd_idx = 0;
bool uj = false;
json_object *json = NULL;
- int idx_ext_community = 0;
- int rd_all = 0;
bgp = bgp_get_evpn();
if (!bgp)
if (uj)
json = json_object_new_object();
- argv_find(argv, argc, "all", &rd_all);
- if (!rd_all) {
- /* get the RD */
- argv_find(argv, argc, "ASN:NN_OR_IP-ADDRESS:NN",
- &idx_ext_community);
- ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
+ /* get the RD */
+ if (argv_find(argv, argc, "rd", &rd_idx)) {
+ ret = str2prefix_rd(argv[rd_idx + 1]->arg, &prd);
+
if (!ret) {
vty_out(vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING;
if (bgp_evpn_cli_parse_type(&type, argv, argc) < 0)
return CMD_WARNING;
- if (rd_all)
- evpn_show_all_routes(vty, bgp, type, json, 1);
- else
- evpn_show_route_rd(vty, bgp, &prd, type, json);
+ evpn_show_route_rd(vty, bgp, &prd, type, json);
if (uj) {
vty_out(vty, "%s\n", json_object_to_json_string_ext(
*/
DEFUN(show_bgp_l2vpn_evpn_route_rd_macip,
show_bgp_l2vpn_evpn_route_rd_macip_cmd,
- "show bgp l2vpn evpn route rd <ASN:NN_OR_IP-ADDRESS:NN|all> mac WORD [ip WORD] [json]",
+ "show bgp l2vpn evpn route rd ASN:NN_OR_IP-ADDRESS:NN mac WORD [ip WORD] [json]",
SHOW_STR
BGP_STR
L2VPN_HELP_STR
EVPN_HELP_STR
EVPN_RT_HELP_STR
EVPN_RT_DIST_HELP_STR
- EVPN_ASN_IP_HELP_STR "All VPN Route Distinguishers\n"
+ EVPN_ASN_IP_HELP_STR
"MAC\n"
"MAC address (e.g., 00:e0:ec:20:12:62)\n"
"IP\n"
struct prefix_rd prd;
struct ethaddr mac;
struct ipaddr ip;
- int idx_ext_community = 0;
+ int rd_idx = 0;
int mac_idx = 0;
int ip_idx = 0;
bool uj = false;
json_object *json = NULL;
- int rd_all = 0;
memset(&mac, 0, sizeof(struct ethaddr));
memset(&ip, 0, sizeof(struct ipaddr));
json = json_object_new_object();
/* get the prd */
- argv_find(argv, argc, "all", &rd_all);
- if (!rd_all) {
- argv_find(argv, argc, "ASN:NN_OR_IP-ADDRESS:NN",
- &idx_ext_community);
- ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
+ if (argv_find(argv, argc, "rd", &rd_idx)) {
+ ret = str2prefix_rd(argv[rd_idx + 1]->arg, &prd);
if (!ret) {
vty_out(vty, "%% Malformed Route Distinguisher\n");
return CMD_WARNING;
}
}
- if (rd_all)
- evpn_show_route_rd_all_macip(vty, bgp, &mac, &ip, json);
- else
- evpn_show_route_rd_macip(vty, bgp, &prd, &mac, &ip, json);
+ evpn_show_route_rd_macip(vty, bgp, &prd, &mac, &ip, json);
if (uj) {
vty_out(vty, "%s\n", json_object_to_json_string_ext(
DEFUN (show_bgp_ip_vpn_all_rd,
show_bgp_ip_vpn_all_rd_cmd,
- "show bgp "BGP_AFI_CMD_STR" vpn all [rd <ASN:NN_OR_IP-ADDRESS:NN|all>] [json]",
+ "show bgp "BGP_AFI_CMD_STR" vpn all [rd ASN:NN_OR_IP-ADDRESS:NN] [json]",
SHOW_STR
BGP_STR
BGP_VPNVX_HELP_STR
"Display VPN NLRI specific information\n"
"Display information for a route distinguisher\n"
"VPN Route Distinguisher\n"
- "All VPN Route Distinguishers\n"
JSON_STR)
{
int ret;
int idx = 0;
if (argv_find_and_parse_afi(argv, argc, &idx, &afi)) {
- /* Constrain search if user supplies RD && RD != "all" */
- if (argv_find(argv, argc, "rd", &idx)
- && strcmp(argv[idx + 1]->arg, "all")) {
+ if (argv_find(argv, argc, "rd", &idx)) {
ret = str2prefix_rd(argv[idx + 1]->arg, &prd);
if (!ret) {
vty_out(vty,
ALIAS(show_bgp_ip_vpn_all_rd,
show_bgp_ip_vpn_rd_cmd,
- "show bgp "BGP_AFI_CMD_STR" vpn rd <ASN:NN_OR_IP-ADDRESS:NN|all> [json]",
+ "show bgp "BGP_AFI_CMD_STR" vpn rd ASN:NN_OR_IP-ADDRESS:NN [json]",
SHOW_STR
BGP_STR
BGP_VPNVX_HELP_STR
"Display VPN NLRI specific information\n"
"Display information for a route distinguisher\n"
"VPN Route Distinguisher\n"
- "All VPN Route Distinguishers\n"
JSON_STR)
#ifdef KEEP_OLD_VPN_COMMANDS
DEFUN (show_ip_bgp_vpn_rd,
show_ip_bgp_vpn_rd_cmd,
- "show ip bgp "BGP_AFI_CMD_STR" vpn rd <ASN:NN_OR_IP-ADDRESS:NN|all>",
+ "show ip bgp "BGP_AFI_CMD_STR" vpn rd ASN:NN_OR_IP-ADDRESS:NN",
SHOW_STR
IP_STR
BGP_STR
BGP_AFI_HELP_STR
"Address Family modifier\n"
"Display information for a route distinguisher\n"
- "VPN Route Distinguisher\n" "All VPN Route Distinguishers\n")
+ "VPN Route Distinguisher\n")
{
int idx_ext_community = argc - 1;
int ret;
int idx = 0;
if (argv_find_and_parse_vpnvx(argv, argc, &idx, &afi)) {
- if (!strcmp(argv[idx_ext_community]->arg, "all"))
- return bgp_show_mpls_vpn(vty, afi, NULL,
- bgp_show_type_normal, NULL, 0,
- 0);
ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
if (!ret) {
vty_out(vty, "%% Malformed Route Distinguisher\n");
DEFUN (show_ip_bgp_vpn_rd_tags,
show_ip_bgp_vpn_rd_tags_cmd,
- "show [ip] bgp <vpnv4|vpnv6> rd <ASN:NN_OR_IP-ADDRESS:NN|all> tags",
+ "show [ip] bgp <vpnv4|vpnv6> rd ASN:NN_OR_IP-ADDRESS:NN tags",
SHOW_STR
IP_STR
BGP_STR
BGP_VPNVX_HELP_STR
"Display information for a route distinguisher\n"
"VPN Route Distinguisher\n"
- "All VPN Route Distinguishers\n"
"Display BGP tags for prefixes\n")
{
int idx_ext_community = 5;
int idx = 0;
if (argv_find_and_parse_vpnvx(argv, argc, &idx, &afi)) {
- if (!strcmp(argv[idx_ext_community]->arg, "all"))
- return bgp_show_mpls_vpn(vty, afi, NULL,
- bgp_show_type_normal, NULL, 1,
- 0);
ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
if (!ret) {
vty_out(vty, "%% Malformed Route Distinguisher\n");
DEFUN (show_ip_bgp_vpn_rd_neighbor_routes,
show_ip_bgp_vpn_rd_neighbor_routes_cmd,
- "show [ip] bgp <vpnv4|vpnv6> rd <ASN:NN_OR_IP-ADDRESS:NN|all> neighbors A.B.C.D routes [json]",
+ "show [ip] bgp <vpnv4|vpnv6> rd ASN:NN_OR_IP-ADDRESS:NN neighbors A.B.C.D routes [json]",
SHOW_STR
IP_STR
BGP_STR
BGP_VPNVX_HELP_STR
"Display information for a route distinguisher\n"
"VPN Route Distinguisher\n"
- "All VPN Route Distinguishers\n"
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Display routes learned from neighbor\n"
union sockunion su;
struct peer *peer;
struct prefix_rd prd;
- bool prefix_rd_all = false;
bool uj = use_json(argc, argv);
afi_t afi;
int idx = 0;
if (argv_find_and_parse_vpnvx(argv, argc, &idx, &afi)) {
- if (!strcmp(argv[idx_ext_community]->arg, "all"))
- prefix_rd_all = true;
- else {
- ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
- if (!ret) {
- if (uj) {
- json_object *json_no = NULL;
- json_no = json_object_new_object();
- json_object_string_add(
- json_no, "warning",
- "Malformed Route Distinguisher");
- vty_out(vty, "%s\n",
- json_object_to_json_string(
- json_no));
- json_object_free(json_no);
- } else
- vty_out(vty,
- "%% Malformed Route Distinguisher\n");
- return CMD_WARNING;
- }
+ ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
+ if (!ret) {
+ if (uj) {
+ json_object *json_no = NULL;
+ json_no = json_object_new_object();
+ json_object_string_add(
+ json_no, "warning",
+ "Malformed Route Distinguisher");
+ vty_out(vty, "%s\n",
+ json_object_to_json_string(json_no));
+ json_object_free(json_no);
+ } else
+ vty_out(vty,
+ "%% Malformed Route Distinguisher\n");
+ return CMD_WARNING;
}
ret = str2sockunion(argv[idx_ipv4]->arg, &su);
return CMD_WARNING;
}
- if (prefix_rd_all)
- return bgp_show_mpls_vpn(vty, afi, NULL,
- bgp_show_type_neighbor, &su, 0,
- uj);
- else
- return bgp_show_mpls_vpn(vty, afi, &prd,
- bgp_show_type_neighbor, &su, 0,
- uj);
+ return bgp_show_mpls_vpn(vty, afi, &prd, bgp_show_type_neighbor,
+ &su, 0, uj);
}
return CMD_SUCCESS;
}
DEFUN (show_ip_bgp_vpn_rd_neighbor_advertised_routes,
show_ip_bgp_vpn_rd_neighbor_advertised_routes_cmd,
- "show [ip] bgp <vpnv4|vpnv6> rd <ASN:NN_OR_IP-ADDRESS:NN|all> neighbors A.B.C.D advertised-routes [json]",
+ "show [ip] bgp <vpnv4|vpnv6> rd ASN:NN_OR_IP-ADDRESS:NN neighbors A.B.C.D advertised-routes [json]",
SHOW_STR
IP_STR
BGP_STR
BGP_VPNVX_HELP_STR
"Display information for a route distinguisher\n"
"VPN Route Distinguisher\n"
- "All VPN Route Distinguishers\n"
"Detailed information on TCP and BGP neighbor connections\n"
"Neighbor to display information about\n"
"Display the routes advertised to a BGP neighbor\n"
return CMD_WARNING;
}
- if (!strcmp(argv[idx_ext_community]->arg, "all"))
- return show_adj_route_vpn(vty, peer, NULL, AFI_IP,
- SAFI_MPLS_VPN, uj);
ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
if (!ret) {
if (uj) {