/* Extern from bgp_dump.c */
extern const char *bgp_origin_str[];
extern const char *bgp_origin_long_str[];
+char csv = ',';
static struct bgp_node *
bgp_afi_node_get (struct bgp_table *table, afi_t afi, safi_t safi, struct prefix *p,
/* called from terminal list command */
void
route_vty_out (struct vty *vty, struct prefix *p,
- struct bgp_info *binfo, int display, safi_t safi)
+ struct bgp_info *binfo, int display, safi_t safi, char *delim)
{
struct attr *attr;
-
- /* short status lead text */
+
+ /* short status lead text */
route_vty_short_status_out (vty, binfo);
-
+
+ if (delim)
+ vty_out (vty, "%c", *delim);
+
/* print prefix and mask */
if (! display)
route_vty_out_route (p, vty);
else
vty_out (vty, "%*s", 17, " ");
+ if (delim)
+ vty_out (vty, "%c", *delim);
+
/* Print attribute */
attr = binfo->attr;
if (attr)
}
#endif /* HAVE_IPV6 */
+ if (delim)
+ vty_out (vty, "%c", *delim);
+
if (attr->flag & ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC))
vty_out (vty, "%10u", attr->med);
else
vty_out (vty, " ");
+ if (delim)
+ vty_out (vty, "%c", *delim);
+
if (attr->flag & ATTR_FLAG_BIT (BGP_ATTR_LOCAL_PREF))
vty_out (vty, "%7u", attr->local_pref);
else
vty_out (vty, " ");
+ if (delim)
+ vty_out (vty, "%c", *delim);
+
vty_out (vty, "%7u ", (attr->extra ? attr->extra->weight : 0));
-
+
+ if (delim)
+ vty_out (vty, "%c", *delim);
+
/* Print aspath */
if (attr->aspath)
aspath_print_vty (vty, "%s", attr->aspath, " ");
+ if (delim)
+ vty_out (vty, "%c", *delim);
+
/* Print origin */
vty_out (vty, "%s", bgp_origin_str[attr->origin]);
}
/* called from terminal list command */
void
route_vty_out_tmp (struct vty *vty, struct prefix *p,
- struct attr *attr, safi_t safi)
+ struct attr *attr, safi_t safi, char *delim)
{
/* Route status display. */
vty_out (vty, "*");
vty_out (vty, ">");
vty_out (vty, " ");
+ if (delim)
+ vty_out (vty, "%c", *delim);
+
/* print prefix and mask */
route_vty_out_route (p, vty);
+ if (delim)
+ vty_out (vty, "%c", *delim);
+
/* Print attribute */
if (attr)
{
}
#endif /* HAVE_IPV6 */
+ if (delim)
+ vty_out (vty, "%c", *delim);
+
if (attr->flag & ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC))
vty_out (vty, "%10u", attr->med);
else
vty_out (vty, " ");
+ if (delim)
+ vty_out (vty, "%c", *delim);
+
if (attr->flag & ATTR_FLAG_BIT (BGP_ATTR_LOCAL_PREF))
vty_out (vty, "%7u", attr->local_pref);
else
vty_out (vty, " ");
+ if (delim)
+ vty_out (vty, "%c", *delim);
+
vty_out (vty, "%7u ", (attr->extra ? attr->extra->weight : 0));
+ if (delim)
+ vty_out (vty, "%c", *delim);
+
/* Print aspath */
if (attr->aspath)
aspath_print_vty (vty, "%s", attr->aspath, " ");
+ if (delim)
+ vty_out (vty, "%c", *delim);
+
/* Print origin */
vty_out (vty, "%s", bgp_origin_str[attr->origin]);
}
" i internal, r RIB-failure, S Stale, R Removed%s"
#define BGP_SHOW_OCODE_HEADER "Origin codes: i - IGP, e - EGP, ? - incomplete%s%s"
#define BGP_SHOW_HEADER " Network Next Hop Metric LocPrf Weight Path%s"
+#define BGP_SHOW_HEADER_CSV "Flags, Network, Next Hop, Metric, LocPrf, Weight, Path%s"
#define BGP_SHOW_DAMP_HEADER " Network From Reuse Path%s"
#define BGP_SHOW_FLAP_HEADER " Network From Flaps Duration Reuse Path%s"
static int
bgp_show_table (struct vty *vty, struct bgp_table *table, struct in_addr *router_id,
- enum bgp_show_type type, void *output_arg)
+ enum bgp_show_type type, void *output_arg, char *delim)
{
struct bgp_info *ri;
struct bgp_node *rn;
continue;
}
- if (header)
+ if (delim)
+ {
+ if (header)
+ {
+ vty_out (vty, BGP_SHOW_HEADER_CSV, VTY_NEWLINE);
+ header = 0;
+ }
+ }
+ else if (header)
{
vty_out (vty, "BGP table version is 0, local router ID is %s%s", inet_ntoa (*router_id), VTY_NEWLINE);
vty_out (vty, BGP_SHOW_SCODE_HEADER, VTY_NEWLINE, VTY_NEWLINE);
|| type == bgp_show_type_flap_neighbor)
flap_route_vty_out (vty, &rn->p, ri, display, SAFI_UNICAST);
else
- route_vty_out (vty, &rn->p, ri, display, SAFI_UNICAST);
+ route_vty_out (vty, &rn->p, ri, display, SAFI_UNICAST, delim);
display++;
}
if (display)
static int
bgp_show (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
- enum bgp_show_type type, void *output_arg)
+ enum bgp_show_type type, void *output_arg, char *delim)
{
struct bgp_table *table;
table = bgp->rib[afi][safi];
- return bgp_show_table (vty, table, &bgp->router_id, type, output_arg);
+ return bgp_show_table (vty, table, &bgp->router_id, type, output_arg, delim);
}
/* Header of detailed BGP route information */
IP_STR
BGP_STR)
{
- return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST, bgp_show_type_normal, NULL);
+ return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST, bgp_show_type_normal, NULL, NULL);
+}
+
+DEFUN (show_ip_bgp_csv,
+ show_ip_bgp_csv_cmd,
+ "show ip bgp csv",
+ SHOW_STR
+ IP_STR
+ BGP_STR)
+{
+ return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST, bgp_show_type_normal, NULL, &csv);
}
DEFUN (show_ip_bgp_ipv4,
{
if (strncmp (argv[0], "m", 1) == 0)
return bgp_show (vty, NULL, AFI_IP, SAFI_MULTICAST, bgp_show_type_normal,
- NULL);
+ NULL, NULL);
- return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST, bgp_show_type_normal, NULL);
+ return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST, bgp_show_type_normal, NULL, NULL);
}
ALIAS (show_ip_bgp_ipv4,
"Address Family modifier\n"
"Address Family modifier\n")
+DEFUN (show_ip_bgp_ipv4_csv,
+ show_bgp_ipv4_safi_csv_cmd,
+ "show bgp ipv4 (unicast|multicast) csv",
+ SHOW_STR
+ BGP_STR
+ "Address family\n"
+ "Address Family modifier\n"
+ "Address Family modifier\n")
+{
+ if (strncmp (argv[0], "m", 1) == 0)
+ return bgp_show (vty, NULL, AFI_IP, SAFI_MULTICAST, bgp_show_type_normal,
+ NULL, &csv);
+
+ return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST, bgp_show_type_normal, NULL, &csv);
+}
+
DEFUN (show_ip_bgp_route,
show_ip_bgp_route_cmd,
"show ip bgp A.B.C.D",
return CMD_WARNING;
}
- return bgp_show (vty, bgp, AFI_IP, SAFI_UNICAST, bgp_show_type_normal, NULL);
+ return bgp_show (vty, bgp, AFI_IP, SAFI_UNICAST, bgp_show_type_normal, NULL, NULL);
}
DEFUN (show_ip_bgp_view_route,
BGP_STR)
{
return bgp_show (vty, NULL, AFI_IP6, SAFI_UNICAST, bgp_show_type_normal,
- NULL);
+ NULL, NULL);
}
ALIAS (show_bgp,
{
if (strncmp (argv[0], "m", 1) == 0)
return bgp_show (vty, NULL, AFI_IP6, SAFI_MULTICAST, bgp_show_type_normal,
- NULL);
+ NULL, NULL);
- return bgp_show (vty, NULL, AFI_IP6, SAFI_UNICAST, bgp_show_type_normal, NULL);
+ return bgp_show (vty, NULL, AFI_IP6, SAFI_UNICAST, bgp_show_type_normal, NULL, NULL);
+}
+
+DEFUN (show_bgp_ipv6_safi_csv,
+ show_bgp_ipv6_safi_csv_cmd,
+ "show bgp ipv6 (unicast|multicast) csv",
+ SHOW_STR
+ BGP_STR
+ "Address family\n"
+ "Address Family modifier\n"
+ "Address Family modifier\n")
+{
+ if (strncmp (argv[0], "m", 1) == 0)
+ return bgp_show (vty, NULL, AFI_IP6, SAFI_MULTICAST, bgp_show_type_normal,
+ NULL, &csv);
+
+ return bgp_show (vty, NULL, AFI_IP6, SAFI_UNICAST, bgp_show_type_normal, NULL, &csv);
}
/* old command */
BGP_STR)
{
return bgp_show (vty, NULL, AFI_IP6, SAFI_UNICAST, bgp_show_type_normal,
- NULL);
+ NULL, NULL);
}
DEFUN (show_bgp_route,
return CMD_WARNING;
}
- return bgp_show (vty, bgp, AFI_IP6, SAFI_UNICAST, bgp_show_type_normal, NULL);
+ return bgp_show (vty, bgp, AFI_IP6, SAFI_UNICAST, bgp_show_type_normal, NULL, NULL);
}
ALIAS (show_bgp_view,
MBGP_STR)
{
return bgp_show (vty, NULL, AFI_IP6, SAFI_MULTICAST, bgp_show_type_normal,
- NULL);
+ NULL, NULL);
}
/* old command */
return CMD_WARNING;
}
- rc = bgp_show (vty, NULL, afi, safi, type, regex);
+ rc = bgp_show (vty, NULL, afi, safi, type, regex, NULL);
bgp_regex_free (regex);
return rc;
}
return CMD_WARNING;
}
- return bgp_show (vty, NULL, afi, safi, type, plist);
+ return bgp_show (vty, NULL, afi, safi, type, plist, NULL);
}
DEFUN (show_ip_bgp_prefix_list,
return CMD_WARNING;
}
- return bgp_show (vty, NULL, afi, safi, type, as_list);
+ return bgp_show (vty, NULL, afi, safi, type, as_list, NULL);
}
DEFUN (show_ip_bgp_filter_list,
return CMD_WARNING;
}
- return bgp_show (vty, NULL, afi, safi, type, rmap);
+ return bgp_show (vty, NULL, afi, safi, type, rmap, NULL);
}
DEFUN (show_ip_bgp_route_map,
"Display only routes with non-natural netmasks\n")
{
return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST,
- bgp_show_type_cidr_only, NULL);
+ bgp_show_type_cidr_only, NULL, NULL);
}
DEFUN (show_ip_bgp_flap_cidr_only,
"Display only routes with non-natural netmasks\n")
{
return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST,
- bgp_show_type_flap_cidr_only, NULL);
+ bgp_show_type_flap_cidr_only, NULL, NULL);
}
DEFUN (show_ip_bgp_ipv4_cidr_only,
{
if (strncmp (argv[0], "m", 1) == 0)
return bgp_show (vty, NULL, AFI_IP, SAFI_MULTICAST,
- bgp_show_type_cidr_only, NULL);
+ bgp_show_type_cidr_only, NULL, NULL);
return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST,
- bgp_show_type_cidr_only, NULL);
+ bgp_show_type_cidr_only, NULL, NULL);
}
DEFUN (show_ip_bgp_community_all,
"Display routes matching the communities\n")
{
return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST,
- bgp_show_type_community_all, NULL);
+ bgp_show_type_community_all, NULL, NULL);
}
DEFUN (show_ip_bgp_ipv4_community_all,
{
if (strncmp (argv[0], "m", 1) == 0)
return bgp_show (vty, NULL, AFI_IP, SAFI_MULTICAST,
- bgp_show_type_community_all, NULL);
+ bgp_show_type_community_all, NULL, NULL);
return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST,
- bgp_show_type_community_all, NULL);
+ bgp_show_type_community_all, NULL, NULL);
}
#ifdef HAVE_IPV6
"Display routes matching the communities\n")
{
return bgp_show (vty, NULL, AFI_IP6, SAFI_UNICAST,
- bgp_show_type_community_all, NULL);
+ bgp_show_type_community_all, NULL, NULL);
}
ALIAS (show_bgp_community_all,
"Display routes matching the communities\n")
{
return bgp_show (vty, NULL, AFI_IP6, SAFI_UNICAST,
- bgp_show_type_community_all, NULL);
+ bgp_show_type_community_all, NULL, NULL);
}
/* old command */
"Display routes matching the communities\n")
{
return bgp_show (vty, NULL, AFI_IP6, SAFI_MULTICAST,
- bgp_show_type_community_all, NULL);
+ bgp_show_type_community_all, NULL, NULL);
}
#endif /* HAVE_IPV6 */
return bgp_show (vty, bgp, afi, safi,
(exact ? bgp_show_type_community_exact :
- bgp_show_type_community), com);
+ bgp_show_type_community), com, NULL);
}
DEFUN (show_ip_bgp_community,
afi = AFI_IP;
safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
#endif
- return bgp_show (vty, bgp, afi, safi, bgp_show_type_community_all, NULL);
+ return bgp_show (vty, bgp, afi, safi, bgp_show_type_community_all, NULL, NULL);
}
DEFUN (show_bgp_view_afi_safi_community,
return bgp_show (vty, NULL, afi, safi,
(exact ? bgp_show_type_community_list_exact :
- bgp_show_type_community_list), list);
+ bgp_show_type_community_list), list, NULL);
}
DEFUN (show_ip_bgp_community_list,
return CMD_WARNING;
}
- ret = bgp_show (vty, NULL, afi, safi, type, p);
+ ret = bgp_show (vty, NULL, afi, safi, type, p, NULL);
prefix_free(p);
return ret;
}
static void
show_adj_route (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi,
- int in)
+ int in, char *delim)
{
struct bgp_table *table;
struct bgp_adj_in *ain;
if (! bgp)
return;
+ if (delim)
+ header1 = 0;
+
table = bgp->rib[afi][safi];
output_count = 0;
-
+
if (! in && CHECK_FLAG (peer->af_sflags[afi][safi],
PEER_STATUS_DEFAULT_ORIGINATE))
{
}
if (header2)
{
- vty_out (vty, BGP_SHOW_HEADER, VTY_NEWLINE);
+ if (delim)
+ vty_out (vty, BGP_SHOW_HEADER_CSV, VTY_NEWLINE);
+ else
+ vty_out (vty, BGP_SHOW_HEADER, VTY_NEWLINE);
header2 = 0;
}
if (ain->attr)
- {
- route_vty_out_tmp (vty, &rn->p, ain->attr, safi);
+ {
+ route_vty_out_tmp (vty, &rn->p, ain->attr, safi, delim);
output_count++;
}
}
}
if (header2)
{
- vty_out (vty, BGP_SHOW_HEADER, VTY_NEWLINE);
+ if (delim)
+ vty_out (vty, BGP_SHOW_HEADER_CSV, VTY_NEWLINE);
+ else
+ vty_out (vty, BGP_SHOW_HEADER, VTY_NEWLINE);
header2 = 0;
}
if (adj->attr)
- {
- route_vty_out_tmp (vty, &rn->p, adj->attr, safi);
+ {
+ route_vty_out_tmp (vty, &rn->p, adj->attr, safi, delim);
output_count++;
}
}
}
-
+
if (output_count != 0)
vty_out (vty, "%sTotal number of prefixes %ld%s",
VTY_NEWLINE, output_count, VTY_NEWLINE);
}
static int
-peer_adj_routes (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, int in)
+peer_adj_routes (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi,
+ int in, char *delim)
{
if (! peer || ! peer->afc[afi][safi])
{
return CMD_WARNING;
}
- show_adj_route (vty, peer, afi, safi, in);
+ show_adj_route (vty, peer, afi, safi, in, delim);
return CMD_SUCCESS;
}
if (! peer)
return CMD_WARNING;
- return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 0);
+ return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 0, NULL);
}
ALIAS (show_ip_bgp_view_neighbor_advertised_route,
"Neighbor to display information about\n"
"Display the routes advertised to a BGP neighbor\n")
+DEFUN (show_ip_bgp_neighbor_advertised_route_csv,
+ show_ip_bgp_neighbor_advertised_route_csv_cmd,
+ "show ip bgp neighbors (A.B.C.D|X:X::X:X) advertised-routes csv",
+ SHOW_STR
+ IP_STR
+ BGP_STR
+ "BGP view\n"
+ "View name\n"
+ "Detailed information on TCP and BGP neighbor connections\n"
+ "Neighbor to display information about\n"
+ "Neighbor to display information about\n"
+ "Display the routes advertised to a BGP neighbor\n")
+{
+ struct peer *peer;
+
+ if (argc == 2)
+ peer = peer_lookup_in_view (vty, argv[0], argv[1]);
+ else
+ peer = peer_lookup_in_view (vty, NULL, argv[0]);
+
+ if (! peer)
+ return CMD_WARNING;
+
+ return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 0, &csv);
+}
+
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) advertised-routes",
return CMD_WARNING;
if (strncmp (argv[0], "m", 1) == 0)
- return peer_adj_routes (vty, peer, AFI_IP, SAFI_MULTICAST, 0);
+ return peer_adj_routes (vty, peer, AFI_IP, SAFI_MULTICAST, 0, NULL);
- return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 0);
+ return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 0, NULL);
}
#ifdef HAVE_IPV6
if (! peer)
return CMD_WARNING;
- return peer_adj_routes (vty, peer, AFI_IP6, SAFI_UNICAST, 0);
+ return peer_adj_routes (vty, peer, AFI_IP6, SAFI_UNICAST, 0, NULL);
+}
+
+DEFUN (show_bgp_view_neighbor_advertised_route_csv,
+ show_bgp_view_neighbor_advertised_route_csv_cmd,
+ "show bgp view WORD neighbors (A.B.C.D|X:X::X:X) advertised-routes csv",
+ SHOW_STR
+ BGP_STR
+ "BGP view\n"
+ "View name\n"
+ "Detailed information on TCP and BGP neighbor connections\n"
+ "Neighbor to display information about\n"
+ "Neighbor to display information about\n"
+ "Display the routes advertised to a BGP neighbor\n")
+{
+ struct peer *peer;
+
+ if (argc == 2)
+ peer = peer_lookup_in_view (vty, argv[0], argv[1]);
+ else
+ peer = peer_lookup_in_view (vty, NULL, argv[0]);
+
+ if (! peer)
+ return CMD_WARNING;
+
+ return peer_adj_routes (vty, peer, AFI_IP6, SAFI_UNICAST, 0, &csv);
}
ALIAS (show_bgp_view_neighbor_advertised_route,
"Neighbor to display information about\n"
"Display the routes advertised to a BGP neighbor\n")
+ALIAS (show_bgp_view_neighbor_advertised_route_csv,
+ show_bgp_view_ipv6_neighbor_advertised_route_csv_cmd,
+ "show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X) advertised-routes csv",
+ SHOW_STR
+ BGP_STR
+ "BGP view\n"
+ "View name\n"
+ "Address family\n"
+ "Detailed information on TCP and BGP neighbor connections\n"
+ "Neighbor to display information about\n"
+ "Neighbor to display information about\n"
+ "Display the routes advertised to a BGP neighbor\n")
+
DEFUN (show_bgp_view_neighbor_received_routes,
show_bgp_view_neighbor_received_routes_cmd,
"show bgp view WORD neighbors (A.B.C.D|X:X::X:X) received-routes",
if (! peer)
return CMD_WARNING;
- return peer_adj_routes (vty, peer, AFI_IP6, SAFI_UNICAST, 1);
+ return peer_adj_routes (vty, peer, AFI_IP6, SAFI_UNICAST, 1, NULL);
}
ALIAS (show_bgp_view_neighbor_received_routes,
"Neighbor to display information about\n"
"Display the routes advertised to a BGP neighbor\n")
+ALIAS (show_bgp_view_neighbor_advertised_route_csv,
+ show_bgp_neighbor_advertised_route_csv_cmd,
+ "show bgp neighbors (A.B.C.D|X:X::X:X) advertised-routes csv",
+ SHOW_STR
+ BGP_STR
+ "Detailed information on TCP and BGP neighbor connections\n"
+ "Neighbor to display information about\n"
+ "Neighbor to display information about\n"
+ "Display the routes advertised to a BGP neighbor\n")
+
+ALIAS (show_bgp_view_neighbor_advertised_route_csv,
+ show_bgp_ipv6_neighbor_advertised_route_csv_cmd,
+ "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X) advertised-routes csv",
+ SHOW_STR
+ BGP_STR
+ "Address family\n"
+ "Detailed information on TCP and BGP neighbor connections\n"
+ "Neighbor to display information about\n"
+ "Neighbor to display information about\n"
+ "Display the routes advertised to a BGP neighbor\n")
+
/* old command */
ALIAS (show_bgp_view_neighbor_advertised_route,
ipv6_bgp_neighbor_advertised_route_cmd,
if (! peer)
return CMD_WARNING;
- return peer_adj_routes (vty, peer, AFI_IP6, SAFI_MULTICAST, 0);
+ return peer_adj_routes (vty, peer, AFI_IP6, SAFI_MULTICAST, 0, NULL);
}
#endif /* HAVE_IPV6 */
if (! peer)
return CMD_WARNING;
- return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 1);
+ return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 1, NULL);
}
ALIAS (show_ip_bgp_view_neighbor_received_routes,
return CMD_WARNING;
if (strncmp (argv[0], "m", 1) == 0)
- return peer_adj_routes (vty, peer, AFI_IP, SAFI_MULTICAST, 1);
+ return peer_adj_routes (vty, peer, AFI_IP, SAFI_MULTICAST, 1, NULL);
- return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 1);
+ return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 1, NULL);
}
DEFUN (show_bgp_view_afi_safi_neighbor_adv_recd_routes,
in = (strncmp (argv[3], "r", 1) == 0) ? 1 : 0;
#endif
- return peer_adj_routes (vty, peer, afi, safi, in);
+ return peer_adj_routes (vty, peer, afi, safi, in, NULL);
}
DEFUN (show_ip_bgp_neighbor_received_prefix_filter,
if (! peer)
return CMD_WARNING;
- return peer_adj_routes (vty, peer, AFI_IP6, SAFI_MULTICAST, 1);
+ return peer_adj_routes (vty, peer, AFI_IP6, SAFI_MULTICAST, 1, NULL);
}
DEFUN (show_bgp_view_neighbor_received_prefix_filter,
static int
bgp_show_neighbor_route (struct vty *vty, struct peer *peer, afi_t afi,
- safi_t safi, enum bgp_show_type type)
+ safi_t safi, enum bgp_show_type type, char *delim)
{
if (! peer || ! peer->afc[afi][safi])
{
vty_out (vty, "%% No such neighbor or address family%s", VTY_NEWLINE);
return CMD_WARNING;
}
-
- return bgp_show (vty, peer->bgp, afi, safi, type, &peer->su);
+
+ return bgp_show (vty, peer->bgp, afi, safi, type, &peer->su, delim);
}
DEFUN (show_ip_bgp_neighbor_routes,
return CMD_WARNING;
return bgp_show_neighbor_route (vty, peer, AFI_IP, SAFI_UNICAST,
- bgp_show_type_neighbor);
+ bgp_show_type_neighbor, NULL);
+}
+
+DEFUN (show_ip_bgp_neighbor_routes_csv,
+ show_ip_bgp_neighbor_routes_csv_cmd,
+ "show ip bgp neighbors (A.B.C.D|X:X::X:X) routes csv",
+ SHOW_STR
+ IP_STR
+ BGP_STR
+ "Detailed information on TCP and BGP neighbor connections\n"
+ "Neighbor to display information about\n"
+ "Neighbor to display information about\n"
+ "Display routes learned from neighbor\n")
+{
+ struct peer *peer;
+
+ peer = peer_lookup_in_view (vty, NULL, argv[0]);
+ if (! peer)
+ return CMD_WARNING;
+
+ return bgp_show_neighbor_route (vty, peer, AFI_IP, SAFI_UNICAST,
+ bgp_show_type_neighbor, &csv);
}
DEFUN (show_ip_bgp_neighbor_flap,
return CMD_WARNING;
return bgp_show_neighbor_route (vty, peer, AFI_IP, SAFI_UNICAST,
- bgp_show_type_flap_neighbor);
+ bgp_show_type_flap_neighbor, NULL);
}
DEFUN (show_ip_bgp_neighbor_damp,
return CMD_WARNING;
return bgp_show_neighbor_route (vty, peer, AFI_IP, SAFI_UNICAST,
- bgp_show_type_damp_neighbor);
+ bgp_show_type_damp_neighbor, NULL);
}
DEFUN (show_ip_bgp_ipv4_neighbor_routes,
if (strncmp (argv[0], "m", 1) == 0)
return bgp_show_neighbor_route (vty, peer, AFI_IP, SAFI_MULTICAST,
- bgp_show_type_neighbor);
+ bgp_show_type_neighbor, NULL);
return bgp_show_neighbor_route (vty, peer, AFI_IP, SAFI_UNICAST,
- bgp_show_type_neighbor);
+ bgp_show_type_neighbor, NULL);
}
DEFUN (show_ip_bgp_view_rsclient,
table = peer->rib[AFI_IP][SAFI_UNICAST];
- return bgp_show_table (vty, table, &peer->remote_id, bgp_show_type_normal, NULL);
+ return bgp_show_table (vty, table, &peer->remote_id, bgp_show_type_normal,
+ NULL, NULL);
}
ALIAS (show_ip_bgp_view_rsclient,
table = peer->rib[AFI_IP][safi];
- return bgp_show_table (vty, table, &peer->remote_id, bgp_show_type_normal, NULL);
+ return bgp_show_table (vty, table, &peer->remote_id, bgp_show_type_normal,
+ NULL, NULL);
}
ALIAS (show_bgp_view_ipv4_safi_rsclient,
return CMD_WARNING;
return bgp_show_neighbor_route (vty, peer, AFI_IP6, SAFI_UNICAST,
- bgp_show_type_neighbor);
+ bgp_show_type_neighbor, NULL);
+}
+
+DEFUN (show_bgp_view_neighbor_routes_csv,
+ show_bgp_view_neighbor_routes_csv_cmd,
+ "show bgp view WORD neighbors (A.B.C.D|X:X::X:X) routes csv",
+ SHOW_STR
+ BGP_STR
+ "BGP view\n"
+ "BGP view name\n"
+ "Detailed information on TCP and BGP neighbor connections\n"
+ "Neighbor to display information about\n"
+ "Neighbor to display information about\n"
+ "Display routes learned from neighbor\n")
+{
+ struct peer *peer;
+
+ if (argc == 2)
+ peer = peer_lookup_in_view (vty, argv[0], argv[1]);
+ else
+ peer = peer_lookup_in_view (vty, NULL, argv[0]);
+
+ if (! peer)
+ return CMD_WARNING;
+
+ return bgp_show_neighbor_route (vty, peer, AFI_IP6, SAFI_UNICAST,
+ bgp_show_type_neighbor, &csv);
}
ALIAS (show_bgp_view_neighbor_routes,
return CMD_WARNING;
return bgp_show_neighbor_route (vty, peer, AFI_IP6, SAFI_UNICAST,
- bgp_show_type_damp_neighbor);
+ bgp_show_type_damp_neighbor, NULL);
}
ALIAS (show_bgp_view_neighbor_damp,
return CMD_WARNING;
return bgp_show_neighbor_route (vty, peer, AFI_IP6, SAFI_UNICAST,
- bgp_show_type_flap_neighbor);
+ bgp_show_type_flap_neighbor, NULL);
}
ALIAS (show_bgp_view_neighbor_flap,
"Neighbor to display information about\n"
"Display routes learned from neighbor\n")
+ALIAS (show_bgp_view_neighbor_routes_csv,
+ show_bgp_neighbor_routes_csv_cmd,
+ "show bgp neighbors (A.B.C.D|X:X::X:X) routes csv",
+ SHOW_STR
+ BGP_STR
+ "Detailed information on TCP and BGP neighbor connections\n"
+ "Neighbor to display information about\n"
+ "Neighbor to display information about\n"
+ "Display routes learned from neighbor\n")
+
+
+ALIAS (show_bgp_view_neighbor_routes_csv,
+ show_bgp_ipv6_neighbor_routes_csv_cmd,
+ "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X) routes csv",
+ SHOW_STR
+ BGP_STR
+ "Address family\n"
+ "Detailed information on TCP and BGP neighbor connections\n"
+ "Neighbor to display information about\n"
+ "Neighbor to display information about\n"
+ "Display routes learned from neighbor\n")
+
+/* old command */
+ALIAS (show_bgp_view_neighbor_routes_csv,
+ ipv6_bgp_neighbor_routes_csv_cmd,
+ "show ipv6 bgp neighbors (A.B.C.D|X:X::X:X) routes csv",
+ SHOW_STR
+ IPV6_STR
+ BGP_STR
+ "Detailed information on TCP and BGP neighbor connections\n"
+ "Neighbor to display information about\n"
+ "Neighbor to display information about\n"
+ "Display routes learned from neighbor\n")
+
/* old command */
DEFUN (ipv6_mbgp_neighbor_routes,
ipv6_mbgp_neighbor_routes_cmd,
return CMD_WARNING;
return bgp_show_neighbor_route (vty, peer, AFI_IP6, SAFI_MULTICAST,
- bgp_show_type_neighbor);
+ bgp_show_type_neighbor, NULL);
}
ALIAS (show_bgp_view_neighbor_flap,
table = peer->rib[AFI_IP6][SAFI_UNICAST];
- return bgp_show_table (vty, table, &peer->remote_id, bgp_show_type_normal, NULL);
+ return bgp_show_table (vty, table, &peer->remote_id, bgp_show_type_normal,
+ NULL, NULL);
}
ALIAS (show_bgp_view_rsclient,
table = peer->rib[AFI_IP6][safi];
- return bgp_show_table (vty, table, &peer->remote_id, bgp_show_type_normal, NULL);
+ return bgp_show_table (vty, table, &peer->remote_id, bgp_show_type_normal,
+ NULL, NULL);
}
ALIAS (show_bgp_view_ipv6_safi_rsclient,
"Display paths suppressed due to dampening\n")
{
return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST, bgp_show_type_dampend_paths,
- NULL);
+ NULL, NULL);
}
DEFUN (show_ip_bgp_flap_statistics,
"Display flap statistics of routes\n")
{
return bgp_show (vty, NULL, AFI_IP, SAFI_UNICAST,
- bgp_show_type_flap_statistics, NULL);
+ bgp_show_type_flap_statistics, NULL, NULL);
}
/* Display specified route of BGP table. */
install_element (BGP_IPV4M_NODE, &no_aggregate_address_mask_summary_as_set_cmd);
install_element (VIEW_NODE, &show_ip_bgp_cmd);
+ install_element (VIEW_NODE, &show_ip_bgp_csv_cmd);
install_element (VIEW_NODE, &show_ip_bgp_ipv4_cmd);
install_element (VIEW_NODE, &show_bgp_ipv4_safi_cmd);
+ install_element (VIEW_NODE, &show_bgp_ipv4_safi_csv_cmd);
install_element (VIEW_NODE, &show_ip_bgp_route_cmd);
install_element (VIEW_NODE, &show_ip_bgp_ipv4_route_cmd);
install_element (VIEW_NODE, &show_bgp_ipv4_safi_route_cmd);
install_element (VIEW_NODE, &show_ip_bgp_prefix_longer_cmd);
install_element (VIEW_NODE, &show_ip_bgp_ipv4_prefix_longer_cmd);
install_element (VIEW_NODE, &show_ip_bgp_neighbor_advertised_route_cmd);
+ install_element (VIEW_NODE, &show_ip_bgp_neighbor_advertised_route_csv_cmd);
install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbor_advertised_route_cmd);
install_element (VIEW_NODE, &show_ip_bgp_neighbor_received_routes_cmd);
install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbor_received_routes_cmd);
install_element (VIEW_NODE, &show_bgp_view_afi_safi_neighbor_adv_recd_routes_cmd);
install_element (VIEW_NODE, &show_ip_bgp_neighbor_routes_cmd);
+ install_element (VIEW_NODE, &show_ip_bgp_neighbor_routes_csv_cmd);
install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbor_routes_cmd);
install_element (VIEW_NODE, &show_ip_bgp_neighbor_received_prefix_filter_cmd);
install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbor_received_prefix_filter_cmd);
install_element (RESTRICTED_NODE, &show_bgp_view_ipv4_safi_rsclient_prefix_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_cmd);
+ install_element (ENABLE_NODE, &show_ip_bgp_csv_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_ipv4_cmd);
install_element (ENABLE_NODE, &show_bgp_ipv4_safi_cmd);
+ install_element (ENABLE_NODE, &show_bgp_ipv4_safi_csv_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_route_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_ipv4_route_cmd);
install_element (ENABLE_NODE, &show_bgp_ipv4_safi_route_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_prefix_longer_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_ipv4_prefix_longer_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_neighbor_advertised_route_cmd);
+ install_element (ENABLE_NODE, &show_ip_bgp_neighbor_advertised_route_csv_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_advertised_route_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_neighbor_received_routes_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_received_routes_cmd);
install_element (ENABLE_NODE, &show_bgp_view_afi_safi_neighbor_adv_recd_routes_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_neighbor_routes_cmd);
+ install_element (ENABLE_NODE, &show_ip_bgp_neighbor_routes_csv_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_routes_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_neighbor_received_prefix_filter_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_received_prefix_filter_cmd);
install_element (VIEW_NODE, &show_bgp_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_safi_cmd);
+ install_element (VIEW_NODE, &show_bgp_ipv6_safi_csv_cmd);
install_element (VIEW_NODE, &show_bgp_route_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_route_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_safi_route_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_prefix_longer_cmd);
install_element (VIEW_NODE, &show_bgp_neighbor_advertised_route_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_neighbor_advertised_route_cmd);
+ install_element (VIEW_NODE, &show_bgp_neighbor_advertised_route_csv_cmd);
+ install_element (VIEW_NODE, &show_bgp_ipv6_neighbor_advertised_route_csv_cmd);
install_element (VIEW_NODE, &show_bgp_neighbor_received_routes_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_neighbor_received_routes_cmd);
install_element (VIEW_NODE, &show_bgp_neighbor_routes_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_neighbor_routes_cmd);
+ install_element (VIEW_NODE, &show_bgp_neighbor_routes_csv_cmd);
+ install_element (VIEW_NODE, &show_bgp_ipv6_neighbor_routes_csv_cmd);
install_element (VIEW_NODE, &show_bgp_neighbor_received_prefix_filter_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_neighbor_received_prefix_filter_cmd);
install_element (VIEW_NODE, &show_bgp_neighbor_flap_cmd);
install_element (VIEW_NODE, &show_bgp_view_ipv6_prefix_cmd);
install_element (VIEW_NODE, &show_bgp_view_neighbor_advertised_route_cmd);
install_element (VIEW_NODE, &show_bgp_view_ipv6_neighbor_advertised_route_cmd);
+ install_element (VIEW_NODE, &show_bgp_view_neighbor_advertised_route_csv_cmd);
+ install_element (VIEW_NODE, &show_bgp_view_ipv6_neighbor_advertised_route_csv_cmd);
install_element (VIEW_NODE, &show_bgp_view_neighbor_received_routes_cmd);
install_element (VIEW_NODE, &show_bgp_view_ipv6_neighbor_received_routes_cmd);
install_element (VIEW_NODE, &show_bgp_view_neighbor_routes_cmd);
+ install_element (VIEW_NODE, &show_bgp_view_neighbor_routes_csv_cmd);
install_element (VIEW_NODE, &show_bgp_view_ipv6_neighbor_routes_cmd);
install_element (VIEW_NODE, &show_bgp_view_neighbor_received_prefix_filter_cmd);
install_element (VIEW_NODE, &show_bgp_view_ipv6_neighbor_received_prefix_filter_cmd);
install_element (ENABLE_NODE, &show_bgp_cmd);
install_element (ENABLE_NODE, &show_bgp_ipv6_cmd);
install_element (ENABLE_NODE, &show_bgp_ipv6_safi_cmd);
+ install_element (ENABLE_NODE, &show_bgp_ipv6_safi_csv_cmd);
install_element (ENABLE_NODE, &show_bgp_route_cmd);
install_element (ENABLE_NODE, &show_bgp_ipv6_route_cmd);
install_element (ENABLE_NODE, &show_bgp_ipv6_safi_route_cmd);
install_element (ENABLE_NODE, &show_bgp_ipv6_prefix_longer_cmd);
install_element (ENABLE_NODE, &show_bgp_neighbor_advertised_route_cmd);
install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_advertised_route_cmd);
+ install_element (ENABLE_NODE, &show_bgp_neighbor_advertised_route_csv_cmd);
+ install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_advertised_route_csv_cmd);
install_element (ENABLE_NODE, &show_bgp_neighbor_received_routes_cmd);
install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_received_routes_cmd);
install_element (ENABLE_NODE, &show_bgp_neighbor_routes_cmd);
install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_routes_cmd);
+ install_element (ENABLE_NODE, &show_bgp_neighbor_routes_csv_cmd);
+ install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_routes_csv_cmd);
install_element (ENABLE_NODE, &show_bgp_neighbor_received_prefix_filter_cmd);
install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_received_prefix_filter_cmd);
install_element (ENABLE_NODE, &show_bgp_neighbor_flap_cmd);
install_element (ENABLE_NODE, &show_bgp_view_ipv6_prefix_cmd);
install_element (ENABLE_NODE, &show_bgp_view_neighbor_advertised_route_cmd);
install_element (ENABLE_NODE, &show_bgp_view_ipv6_neighbor_advertised_route_cmd);
+ install_element (ENABLE_NODE, &show_bgp_view_neighbor_advertised_route_csv_cmd);
+ install_element (ENABLE_NODE, &show_bgp_view_ipv6_neighbor_advertised_route_csv_cmd);
install_element (ENABLE_NODE, &show_bgp_view_neighbor_received_routes_cmd);
install_element (ENABLE_NODE, &show_bgp_view_ipv6_neighbor_received_routes_cmd);
install_element (ENABLE_NODE, &show_bgp_view_neighbor_routes_cmd);
+ install_element (ENABLE_NODE, &show_bgp_view_neighbor_routes_csv_cmd);
install_element (ENABLE_NODE, &show_bgp_view_ipv6_neighbor_routes_cmd);
install_element (ENABLE_NODE, &show_bgp_view_neighbor_received_prefix_filter_cmd);
install_element (ENABLE_NODE, &show_bgp_view_ipv6_neighbor_received_prefix_filter_cmd);
return CMD_SUCCESS;
}
+static int
+bgp_adj_out_count (struct peer *peer, int afi, int safi)
+{
+ struct bgp_table *table;
+ struct bgp_node *rn;
+ struct bgp_adj_out *adj;
+ int count = 0;
+
+ if (!peer) return(0);
+
+ table = peer->bgp->rib[afi][safi];
+ if (!table) return(0);
+ for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn))
+ if (bgp_adj_out_lookup(peer, NULL, afi, safi, rn))
+ count++;
+ return (count);
+}
+
/* Show BGP peer's summary information. */
static int
-bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi)
+bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi, char *delimit)
{
struct peer *peer;
struct listnode *node, *nnode;
/* Header string for each address family. */
static char header[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd";
-
+ static char header_csv[] = "Neighbor, V, AS, MsgRcvd, MsgSent, TblVer, InQ, OutQ, Up/Down, State/PfxRcd, PfxAdv";
+
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
if (peer->afc[afi][safi])
{
- if (!count)
+ if (delimit)
+ {
+ if (!count)
+ {
+ vty_out (vty, "%s%s", header_csv, VTY_NEWLINE);
+ }
+ }
+ else if (!count)
{
unsigned long ents;
char memstrbuf[MTYPE_MEMSTR_LEN];
else
vty_out (vty, "%*s", len, " ");
- vty_out (vty, "4 ");
+ if (delimit)
+ vty_out(vty, "%c", *delimit);
- vty_out (vty, "%5u %7d %7d %8d %4d %4lu ",
- peer->as,
- peer->open_in + peer->update_in + peer->keepalive_in
- + peer->notify_in + peer->refresh_in + peer->dynamic_cap_in,
- peer->open_out + peer->update_out + peer->keepalive_out
- + peer->notify_out + peer->refresh_out
- + peer->dynamic_cap_out,
- 0, 0, (unsigned long) peer->obuf->count);
+ vty_out (vty, "4 ");
- vty_out (vty, "%8s",
+ if (delimit)
+ vty_out(vty, "%c", *delimit);
+
+ if (!delimit)
+ vty_out (vty, "%5u %7d %7d %8d %4d %4lu",
+ peer->as,
+ peer->open_in + peer->update_in + peer->keepalive_in
+ + peer->notify_in + peer->refresh_in
+ + peer->dynamic_cap_in,
+ peer->open_out + peer->update_out + peer->keepalive_out
+ + peer->notify_out + peer->refresh_out
+ + peer->dynamic_cap_out,
+ 0,
+ 0,
+ (unsigned long) peer->obuf->count);
+ else
+ vty_out (vty, "%5u %c %7d %c %7d %c %8d %c %4d %c %4lu %c",
+ peer->as, *delimit,
+ peer->open_in + peer->update_in + peer->keepalive_in
+ + peer->notify_in + peer->refresh_in
+ + peer->dynamic_cap_in, *delimit,
+ peer->open_out + peer->update_out + peer->keepalive_out
+ + peer->notify_out + peer->refresh_out
+ + peer->dynamic_cap_out, *delimit,
+ 0, *delimit,
+ 0, *delimit,
+ (unsigned long) peer->obuf->count, *delimit);
+
+ vty_out (vty, "%8s",
peer_uptime (peer->uptime, timebuf, BGP_UPTIME_LEN));
+ if (delimit)
+ vty_out(vty, "%c", *delimit);
if (peer->status == Established)
- {
vty_out (vty, " %8ld", peer->pcount[afi][safi]);
- }
else
{
if (CHECK_FLAG (peer->flags, PEER_FLAG_SHUTDOWN))
else
vty_out (vty, " %-11s", LOOKUP(bgp_status_msg, peer->status));
}
+ if (delimit)
+ vty_out(vty, ", %d", bgp_adj_out_count(peer, afi, safi));
vty_out (vty, "%s", VTY_NEWLINE);
}
return CMD_SUCCESS;
}
-static int
-bgp_show_summary_vty (struct vty *vty, const char *name,
- afi_t afi, safi_t safi)
+static int
+bgp_show_summary_vty (struct vty *vty, const char *name,
+ afi_t afi, safi_t safi, char *delimit)
{
struct bgp *bgp;
if (name)
{
bgp = bgp_lookup_by_name (name);
-
+
if (! bgp)
{
- vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE);
+ vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE);
return CMD_WARNING;
}
- bgp_show_summary (vty, bgp, afi, safi);
+ bgp_show_summary (vty, bgp, afi, safi, delimit);
return CMD_SUCCESS;
}
-
+
bgp = bgp_get_default ();
if (bgp)
- bgp_show_summary (vty, bgp, afi, safi);
-
+ bgp_show_summary (vty, bgp, afi, safi, delimit);
+
return CMD_SUCCESS;
}
/* `show ip bgp summary' commands. */
-DEFUN (show_ip_bgp_summary,
+DEFUN (show_ip_bgp_summary,
show_ip_bgp_summary_cmd,
"show ip bgp summary",
SHOW_STR
BGP_STR
"Summary of BGP neighbor status\n")
{
- return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST);
+ return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST, NULL);
+}
+
+DEFUN (show_ip_bgp_summary_csv,
+ show_ip_bgp_summary_csv_cmd,
+ "show ip bgp summary csv",
+ SHOW_STR
+ IP_STR
+ BGP_STR
+ "Summary of BGP neighbor status\n")
+{
+ char csv = ',';
+ return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST, &csv);
}
DEFUN (show_ip_bgp_instance_summary,
"View name\n"
"Summary of BGP neighbor status\n")
{
- return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST);
+ return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, NULL);
}
DEFUN (show_ip_bgp_ipv4_summary,
"Summary of BGP neighbor status\n")
{
if (strncmp (argv[0], "m", 1) == 0)
- return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST);
+ return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MULTICAST, NULL);
- return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST);
+ return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_UNICAST, NULL);
}
ALIAS (show_ip_bgp_ipv4_summary,
"Summary of BGP neighbor status\n")
{
if (strncmp (argv[1], "m", 1) == 0)
- return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST);
+ return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_MULTICAST, NULL);
else
- return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST);
+ return bgp_show_summary_vty (vty, argv[0], AFI_IP, SAFI_UNICAST, NULL);
}
ALIAS (show_ip_bgp_instance_ipv4_summary,
"Display information about all VPNv4 NLRIs\n"
"Summary of BGP neighbor status\n")
{
- return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN);
+ return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, NULL);
}
DEFUN (show_ip_bgp_vpnv4_rd_summary,
return CMD_WARNING;
}
- return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN);
+ return bgp_show_summary_vty (vty, NULL, AFI_IP, SAFI_MPLS_VPN, NULL);
}
#ifdef HAVE_IPV6
-DEFUN (show_bgp_summary,
+DEFUN (show_bgp_summary,
show_bgp_summary_cmd,
"show bgp summary",
SHOW_STR
BGP_STR
"Summary of BGP neighbor status\n")
{
- return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
+ return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, NULL);
+}
+
+DEFUN (show_bgp_summary_csv,
+ show_bgp_summary_csv_cmd,
+ "show bgp summary csv",
+ SHOW_STR
+ BGP_STR
+ "Summary of BGP neighbor status\n")
+{
+ char csv = ',';
+ return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, &csv);
}
DEFUN (show_bgp_instance_summary,
"View name\n"
"Summary of BGP neighbor status\n")
{
- return bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST);
+ return bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, NULL);
}
ALIAS (show_bgp_summary,
"Summary of BGP neighbor status\n")
{
if (strncmp (argv[0], "m", 1) == 0)
- return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST);
+ return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST, NULL);
- return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
+ return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, NULL);
}
DEFUN (show_bgp_instance_ipv6_safi_summary,
"Summary of BGP neighbor status\n")
{
if (strncmp (argv[1], "m", 1) == 0)
- return bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST);
+ return bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_MULTICAST, NULL);
- return bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST);
+ return bgp_show_summary_vty (vty, argv[0], AFI_IP6, SAFI_UNICAST, NULL);
}
/* old command */
BGP_STR
"Summary of BGP neighbor status\n")
{
- return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST);
+ return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_UNICAST, NULL);
}
/* old command */
MBGP_STR
"Summary of BGP neighbor status\n")
{
- return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST);
+ return bgp_show_summary_vty (vty, NULL, AFI_IP6, SAFI_MULTICAST, NULL);
}
#endif /* HAVE_IPV6 */
/* "show ip bgp summary" commands. */
install_element (VIEW_NODE, &show_ip_bgp_summary_cmd);
+ install_element (VIEW_NODE, &show_ip_bgp_summary_csv_cmd);
install_element (VIEW_NODE, &show_ip_bgp_instance_summary_cmd);
install_element (VIEW_NODE, &show_ip_bgp_ipv4_summary_cmd);
install_element (VIEW_NODE, &show_bgp_ipv4_safi_summary_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd);
#ifdef HAVE_IPV6
install_element (VIEW_NODE, &show_bgp_summary_cmd);
+ install_element (VIEW_NODE, &show_bgp_summary_csv_cmd);
install_element (VIEW_NODE, &show_bgp_instance_summary_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_summary_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_safi_summary_cmd);
install_element (VIEW_NODE, &show_bgp_instance_ipv6_safi_summary_cmd);
#endif /* HAVE_IPV6 */
install_element (RESTRICTED_NODE, &show_ip_bgp_summary_cmd);
+ install_element (RESTRICTED_NODE, &show_ip_bgp_summary_csv_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_instance_summary_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_ipv4_summary_cmd);
install_element (RESTRICTED_NODE, &show_bgp_ipv4_safi_summary_cmd);
install_element (RESTRICTED_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd);
#ifdef HAVE_IPV6
install_element (RESTRICTED_NODE, &show_bgp_summary_cmd);
+ install_element (RESTRICTED_NODE, &show_bgp_summary_csv_cmd);
install_element (RESTRICTED_NODE, &show_bgp_instance_summary_cmd);
install_element (RESTRICTED_NODE, &show_bgp_ipv6_summary_cmd);
install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_summary_cmd);
install_element (RESTRICTED_NODE, &show_bgp_instance_ipv6_safi_summary_cmd);
#endif /* HAVE_IPV6 */
install_element (ENABLE_NODE, &show_ip_bgp_summary_cmd);
+ install_element (ENABLE_NODE, &show_ip_bgp_summary_csv_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_instance_summary_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_ipv4_summary_cmd);
install_element (ENABLE_NODE, &show_bgp_ipv4_safi_summary_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd);
#ifdef HAVE_IPV6
install_element (ENABLE_NODE, &show_bgp_summary_cmd);
+ install_element (ENABLE_NODE, &show_bgp_summary_csv_cmd);
install_element (ENABLE_NODE, &show_bgp_instance_summary_cmd);
install_element (ENABLE_NODE, &show_bgp_ipv6_summary_cmd);
install_element (ENABLE_NODE, &show_bgp_ipv6_safi_summary_cmd);