From: Donald Sharp Date: Fri, 27 Jan 2017 17:39:06 +0000 (-0500) Subject: Merge remote-tracking branch 'origin/pr/113' into pr/111 X-Git-Tag: frr-3.0-branchpoint~70 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=1dc84b65dfb4436d2b63cdb29bf71bc66c0e7940;p=matthieu%2Ffrr.git Merge remote-tracking branch 'origin/pr/113' into pr/111 --- 1dc84b65dfb4436d2b63cdb29bf71bc66c0e7940 diff --cc bgpd/bgp_mplsvpn.c index 6e722bbb55,e0b14a6e4c..d13de9b9e6 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@@ -953,20 -935,41 +937,60 @@@ bgp_show_mpls_vpn (struct vty *vty, afi return CMD_SUCCESS; } +#ifdef KEEP_OLD_VPN_COMMANDS +DEFUN (show_ip_bgp_vpn_all, + show_ip_bgp_vpn_all_cmd, + "show [ip] bgp ", + SHOW_STR + IP_STR + BGP_STR + BGP_VPNVX_HELP_STR) +{ + afi_t afi; + int idx = 0; + + if (argv_find_and_parse_vpnvx (argv, argc, &idx, &afi)) + return bgp_show_mpls_vpn (vty, afi, NULL, bgp_show_type_normal, NULL, 0, 0); ++ ++ return CMD_SUCCESS; ++} ++#endif ++ + 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] [json]", + SHOW_STR + IP_STR + BGP_STR + BGP_VPNVX_HELP_STR + "Display VPN NLRI specific information\n" + "Display information for a route distinguisher\n" + "VPN Route Distinguisher\n" + JSON_STR) + { + int idx_rd = 5; + int ret; + struct prefix_rd prd; + afi_t afi; + int idx = 0; + + if (argv_find_and_parse_afi (argv, argc, &idx, &afi)) + { + if (argc >= 7 && argv[idx_rd]->arg) + { + ret = str2prefix_rd (argv[idx_rd]->arg, &prd); + if (! ret) + { + vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE); + return CMD_WARNING; + } + return bgp_show_mpls_vpn (vty, afi, &prd, bgp_show_type_normal, NULL, 0, use_json (argc, argv)); + } + else + { + return bgp_show_mpls_vpn (vty, afi, NULL, bgp_show_type_normal, NULL, 0, use_json (argc, argv)); + } + } return CMD_SUCCESS; } diff --cc bgpd/bgp_route.c index fb33b234f4,a3dd5f7cf5..9fffde13ad --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@@ -7971,12 -8044,10 +8022,12 @@@ DEFUN (show_ip_bgp_large_community return bgp_show (vty, bgp, afi, safi, bgp_show_type_lcommunity_all, NULL, uj); } +static int bgp_table_stats (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi); + /* BGP route print out function. */ -DEFUN (show_ip_bgp_ipv4, - show_ip_bgp_ipv4_cmd, +DEFUN (show_ip_bgp, + show_ip_bgp_cmd, - "show [ip] bgp [ WORD] [ []]\ + "show [ip] bgp [ WORD] ["BGP_AFI_CMD_STR" ["BGP_SAFI_CMD_STR"]]\ [<\ cidr-only\ |dampening \ @@@ -8194,17 -8247,12 +8237,13 @@@ DEFUN (show_ip_bgp_route DEFUN (show_ip_bgp_regexp, show_ip_bgp_regexp_cmd, - "show [ip] bgp [ WORD] [ []] regexp REGEX...", - "show [ip] bgp ["BGP_AFI_CMD_STR" ["BGP_SAFI_CMD_STR"]] regexp REGEX...", ++ "show [ip] bgp [ WORD] ["BGP_AFI_CMD_STR" ["BGP_SAFI_CMD_STR"]] regexp REGEX...", SHOW_STR IP_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_HELP_STR + BGP_SAFI_HELP_STR "Display routes matching the AS path regular expression\n" "A regular-expression to match the BGP AS paths\n") { @@@ -8234,15 -8283,10 +8273,11 @@@ DEFUN (show_ip_bgp_instance_all IP_STR BGP_STR BGP_INSTANCE_ALL_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_HELP_STR + BGP_SAFI_HELP_STR JSON_STR) { + vrf_id_t vrf = VRF_DEFAULT; afi_t afi = AFI_IP; safi_t safi = SAFI_UNICAST; @@@ -9269,18 -9586,13 +9304,12 @@@ peer_adj_routes (struct vty *vty, struc DEFUN (show_ip_bgp_instance_neighbor_advertised_route, show_ip_bgp_instance_neighbor_advertised_route_cmd, - "show [ip] bgp [ WORD] [ []] " - "show [ip] bgp [ WORD] ["BGP_AFI_CMD_STR" ["BGP_SAFI_CMD_STR"]] neighbors [route-map WORD] [json]", ++ "show [ip] bgp [ WORD] ["BGP_AFI_CMD_STR" ["BGP_SAFI_CMD_STR"]] " + "neighbors [ [route-map WORD]] [json]", SHOW_STR IP_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_HELP_STR - 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" @@@ -9454,8 -9761,7 +9483,8 @@@ bgp_show_neighbor_route (struct vty *vt DEFUN (show_ip_bgp_neighbor_routes, show_ip_bgp_neighbor_routes_cmd, - "show [ip] bgp [ WORD] [ []] " - "show [ip] bgp [ WORD] ["BGP_AFI_CMD_STR" ["BGP_SAFI_CMD_STR"]] neighbors [json]", ++ "show [ip] bgp [ WORD] ["BGP_AFI_CMD_STR" ["BGP_SAFI_CMD_STR"]] " + "neighbors [json]", SHOW_STR IP_STR BGP_STR