mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-17 19:05:44 +00:00
Merge pull request #4116 from nitinsoniism/show_l2vpn_evpn_route_detail
bgpd: new show cmd - bgp l2vpn evpn route detail
This commit is contained in:
commit
fd5c2ea54c
@ -2396,13 +2396,13 @@ static void evpn_show_route_rd(struct vty *vty, struct bgp *bgp,
|
|||||||
* If 'type' is non-zero, only routes matching that type are shown.
|
* 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,
|
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_node *rd_rn;
|
||||||
struct bgp_table *table;
|
struct bgp_table *table;
|
||||||
struct bgp_node *rn;
|
struct bgp_node *rn;
|
||||||
struct bgp_path_info *pi;
|
struct bgp_path_info *pi;
|
||||||
int header = 1;
|
int header = detail ? 0 : 1;
|
||||||
int rd_header;
|
int rd_header;
|
||||||
afi_t afi;
|
afi_t afi;
|
||||||
safi_t safi;
|
safi_t safi;
|
||||||
@ -2482,6 +2482,13 @@ static void evpn_show_all_routes(struct vty *vty, struct bgp *bgp, int type,
|
|||||||
rn->p.prefixlen);
|
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
|
/* For EVPN, the prefix is displayed for each path (to
|
||||||
* fit in
|
* fit in
|
||||||
* with code that already exists).
|
* with code that already exists).
|
||||||
@ -2495,8 +2502,13 @@ static void evpn_show_all_routes(struct vty *vty, struct bgp *bgp, int type,
|
|||||||
if (json)
|
if (json)
|
||||||
json_path = json_object_new_array();
|
json_path = json_object_new_array();
|
||||||
|
|
||||||
route_vty_out(vty, &rn->p, pi, 0, SAFI_EVPN,
|
if (detail) {
|
||||||
json_path);
|
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)
|
if (json)
|
||||||
json_object_array_add(json_paths,
|
json_object_array_add(json_paths,
|
||||||
@ -3633,12 +3645,13 @@ DEFUN(show_bgp_l2vpn_evpn_summary,
|
|||||||
*/
|
*/
|
||||||
DEFUN(show_bgp_l2vpn_evpn_route,
|
DEFUN(show_bgp_l2vpn_evpn_route,
|
||||||
show_bgp_l2vpn_evpn_route_cmd,
|
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
|
SHOW_STR
|
||||||
BGP_STR
|
BGP_STR
|
||||||
L2VPN_HELP_STR
|
L2VPN_HELP_STR
|
||||||
EVPN_HELP_STR
|
EVPN_HELP_STR
|
||||||
"EVPN route information\n"
|
"EVPN route information\n"
|
||||||
|
"Display Detailed Information\n"
|
||||||
"Specify Route type\n"
|
"Specify Route type\n"
|
||||||
"MAC-IP (Type-2) route\n"
|
"MAC-IP (Type-2) route\n"
|
||||||
"Multicast (Type-3) route\n"
|
"Multicast (Type-3) route\n"
|
||||||
@ -3648,6 +3661,7 @@ DEFUN(show_bgp_l2vpn_evpn_route,
|
|||||||
{
|
{
|
||||||
struct bgp *bgp;
|
struct bgp *bgp;
|
||||||
int type_idx = 0;
|
int type_idx = 0;
|
||||||
|
int detail = 0;
|
||||||
int type = 0;
|
int type = 0;
|
||||||
bool uj = false;
|
bool uj = false;
|
||||||
json_object *json = NULL;
|
json_object *json = NULL;
|
||||||
@ -3676,7 +3690,10 @@ DEFUN(show_bgp_l2vpn_evpn_route,
|
|||||||
return CMD_WARNING;
|
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) {
|
if (uj) {
|
||||||
vty_out(vty, "%s\n", json_object_to_json_string_ext(
|
vty_out(vty, "%s\n", json_object_to_json_string_ext(
|
||||||
@ -4298,9 +4315,10 @@ ALIAS_HIDDEN(show_bgp_l2vpn_evpn_summary, show_bgp_evpn_summary_cmd,
|
|||||||
"Summary of BGP neighbor status\n" JSON_STR)
|
"Summary of BGP neighbor status\n" JSON_STR)
|
||||||
|
|
||||||
ALIAS_HIDDEN(show_bgp_l2vpn_evpn_route, show_bgp_evpn_route_cmd,
|
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
|
SHOW_STR BGP_STR EVPN_HELP_STR
|
||||||
"EVPN route information\n"
|
"EVPN route information\n"
|
||||||
|
"Display Detailed Information\n"
|
||||||
"Specify Route type\n"
|
"Specify Route type\n"
|
||||||
"MAC-IP (Type-2) route\n"
|
"MAC-IP (Type-2) route\n"
|
||||||
"Multicast (Type-3) route\n")
|
"Multicast (Type-3) route\n")
|
||||||
|
Loading…
Reference in New Issue
Block a user