Skip to content

Commit

Permalink
bgpd: show bgp l3vpn uses peer_adj_routes()
Browse files Browse the repository at this point in the history
Use the new peer_adj_routes() command to dump the BGP updates instead of
using the show_adj_route_vpn. Remove the bgp_vpn.c file.

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Dec 17, 2024
1 parent c2ffd79 commit 3dc2f40
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 234 deletions.
1 change: 0 additions & 1 deletion bgpd/bgp_evpn_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "bgpd/bgp_attr.h"
#include "bgpd/bgp_route.h"
#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/bgp_vpn.h"
#include "bgpd/bgp_evpn_vty.h"
#include "bgpd/bgp_evpn.h"
#include "bgpd/bgp_evpn_private.h"
Expand Down
27 changes: 20 additions & 7 deletions bgpd/bgp_mplsvpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/bgp_packet.h"
#include "bgpd/bgp_vty.h"
#include "bgpd/bgp_vpn.h"
#include "bgpd/bgp_community.h"
#include "bgpd/bgp_ecommunity.h"
#include "bgpd/bgp_zebra.h"
Expand Down Expand Up @@ -3659,6 +3658,13 @@ DEFUN (show_ip_bgp_vpn_all_neighbor_advertised_routes,
bool uj = use_json(argc, argv);
afi_t afi;
int idx = 0;
enum bgp_show_adj_route_type type = bgp_show_adj_route_advertised;
uint16_t show_flags = 0;

if (uj) {
SET_FLAG(show_flags, BGP_SHOW_OPT_JSON);
argc--;
}

if (argv_find_and_parse_vpnvx(argv, argc, &idx, &afi)) {
ret = str2sockunion(argv[idx_ipv4]->arg, &su);
Expand Down Expand Up @@ -3692,8 +3698,8 @@ DEFUN (show_ip_bgp_vpn_all_neighbor_advertised_routes,
"%% No such neighbor or address family\n");
return CMD_WARNING;
}
return show_adj_route_vpn(vty, peer, NULL, AFI_IP,
SAFI_MPLS_VPN, uj);
return peer_adj_routes(vty, peer, afi, SAFI_MPLS_VPN, type, NULL, NULL, show_flags,
NULL);
}
return CMD_SUCCESS;
}
Expand Down Expand Up @@ -3722,6 +3728,13 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_advertised_routes,
bool uj = use_json(argc, argv);
afi_t afi;
int idx = 0;
enum bgp_show_adj_route_type type = bgp_show_adj_route_advertised;
uint16_t show_flags = 0;

if (uj) {
SET_FLAG(show_flags, BGP_SHOW_OPT_JSON);
argc--;
}

if (argv_find_and_parse_vpnvx(argv, argc, &idx, &afi)) {
ret = str2sockunion(argv[idx_ipv4]->arg, &su);
Expand Down Expand Up @@ -3757,8 +3770,8 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_advertised_routes,
}

if (!strcmp(argv[idx_ext_community]->arg, "all"))
return show_adj_route_vpn(vty, peer, NULL, AFI_IP,
SAFI_MPLS_VPN, uj);
return peer_adj_routes(vty, peer, afi, SAFI_MPLS_VPN, type, NULL, NULL,
show_flags, NULL);
ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
if (!ret) {
if (uj) {
Expand All @@ -3776,8 +3789,8 @@ DEFUN (show_ip_bgp_vpn_rd_neighbor_advertised_routes,
return CMD_WARNING;
}

return show_adj_route_vpn(vty, peer, &prd, AFI_IP,
SAFI_MPLS_VPN, uj);
return peer_adj_routes(vty, peer, afi, SAFI_MPLS_VPN, type, NULL, NULL, show_flags,
&prd);
}
return CMD_SUCCESS;
}
Expand Down
209 changes: 0 additions & 209 deletions bgpd/bgp_vpn.c

This file was deleted.

15 changes: 0 additions & 15 deletions bgpd/bgp_vpn.h

This file was deleted.

2 changes: 0 additions & 2 deletions bgpd/subdir.am
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ bgpd_libbgp_a_SOURCES = \
bgpd/bgp_updgrp.c \
bgpd/bgp_updgrp_adv.c \
bgpd/bgp_updgrp_packet.c \
bgpd/bgp_vpn.c \
bgpd/bgp_vty.c \
bgpd/bgp_zebra.c \
bgpd/bgpd.c \
Expand Down Expand Up @@ -156,7 +155,6 @@ noinst_HEADERS += \
bgpd/bgp_snmp_bgp4v2.h \
bgpd/bgp_table.h \
bgpd/bgp_updgrp.h \
bgpd/bgp_vpn.h \
bgpd/bgp_vty.h \
bgpd/bgp_zebra.h \
bgpd/bgpd.h \
Expand Down

0 comments on commit 3dc2f40

Please sign in to comment.