* If 'type' is non-zero, only routes matching that type are shown.
*/
static void evpn_show_all_routes(struct vty *vty, struct bgp *bgp, int type,
- json_object *json)
+ json_object *json, int detail)
{
struct bgp_node *rd_rn;
struct bgp_table *table;
struct bgp_node *rn;
struct bgp_path_info *pi;
- int header = 1;
+ int header = detail ? 0 : 1;
int rd_header;
afi_t afi;
safi_t safi;
rn->p.prefixlen);
}
+ /* Prefix and num paths displayed once per prefix. */
+ if (detail)
+ route_vty_out_detail_header(
+ vty, bgp, rn,
+ (struct prefix_rd *)&rd_rn->p,
+ AFI_L2VPN, SAFI_EVPN, json_prefix);
+
/* For EVPN, the prefix is displayed for each path (to
* fit in
* with code that already exists).
if (json)
json_path = json_object_new_array();
- route_vty_out(vty, &rn->p, pi, 0, SAFI_EVPN,
- json_path);
+ if (detail) {
+ route_vty_out_detail(
+ vty, bgp, &rn->p, pi, AFI_L2VPN,
+ SAFI_EVPN, json_path);
+ } else
+ route_vty_out(vty, &rn->p, pi, 0,
+ SAFI_EVPN, json_path);
if (json)
json_object_array_add(json_paths,
*/
DEFUN(show_bgp_l2vpn_evpn_route,
show_bgp_l2vpn_evpn_route_cmd,
- "show bgp l2vpn evpn route [type <macip|multicast|es|prefix>] [json]",
+ "show bgp l2vpn evpn route [detail] [type <macip|multicast|es|prefix>] [json]",
SHOW_STR
BGP_STR
L2VPN_HELP_STR
EVPN_HELP_STR
"EVPN route information\n"
+ "Display Detailed Information\n"
"Specify Route type\n"
"MAC-IP (Type-2) route\n"
"Multicast (Type-3) route\n"
{
struct bgp *bgp;
int type_idx = 0;
+ int detail = 0;
int type = 0;
bool uj = false;
json_object *json = NULL;
return CMD_WARNING;
}
- evpn_show_all_routes(vty, bgp, type, json);
+ if (argv_find(argv, argc, "detail", &detail))
+ detail = 1;
+
+ evpn_show_all_routes(vty, bgp, type, json, detail);
if (uj) {
vty_out(vty, "%s\n", json_object_to_json_string_ext(
"Summary of BGP neighbor status\n" JSON_STR)
ALIAS_HIDDEN(show_bgp_l2vpn_evpn_route, show_bgp_evpn_route_cmd,
- "show bgp evpn route [type <macip|multicast>]",
+ "show bgp evpn route [detail] [type <macip|multicast>]",
SHOW_STR BGP_STR EVPN_HELP_STR
"EVPN route information\n"
+ "Display Detailed Information\n"
"Specify Route type\n"
"MAC-IP (Type-2) route\n"
"Multicast (Type-3) route\n")