summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2022-10-04 18:44:36 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2022-10-26 18:12:34 +0200
commit89cb86aeb0262e17ee39c1d791effe9515bd0dc8 (patch)
treea1643fa620a97ffdc2da9442abd7cff29d86e434 /zebra
parentMerge pull request #11673 from cscarpitta/srv6-per-vrf-sid (diff)
downloadfrr-89cb86aeb0262e17ee39c1d791effe9515bd0dc8.tar.xz
frr-89cb86aeb0262e17ee39c1d791effe9515bd0dc8.zip
build, vtysh: extract vtysh commands from .xref
Rather than running selected source files through the preprocessor and a bunch of perl regex'ing to get the list of all DEFUNs, use the data collected in frr.xref. This not only eliminates issues we've been having with preprocessor failures due to nonexistent header files, but is also much faster. Where extract.pl would take 5s, this now finishes in 0.2s. And since this is a non-parallelizable build step towards the end of the build (dependent on a lot of other things being done already), the speedup is actually noticeable. Also files containing CLI no longer need to be listed in `vtysh_scan` since the .xref data covers everything. `#ifndef VTYSH_EXTRACT_PL` checks are equally obsolete. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/debug.c2
-rw-r--r--zebra/dpdk/zebra_dplane_dpdk_vty.c2
-rw-r--r--zebra/interface.c2
-rw-r--r--zebra/rtadv.c2
-rw-r--r--zebra/subdir.am25
-rw-r--r--zebra/zebra_evpn_mh.c2
-rw-r--r--zebra/zebra_mlag_vty.c2
-rw-r--r--zebra/zebra_routemap.c2
-rw-r--r--zebra/zebra_srv6_vty.c2
-rw-r--r--zebra/zebra_vrf.c2
-rw-r--r--zebra/zebra_vty.c2
11 files changed, 0 insertions, 45 deletions
diff --git a/zebra/debug.c b/zebra/debug.c
index 25102145d..16aac7909 100644
--- a/zebra/debug.c
+++ b/zebra/debug.c
@@ -23,9 +23,7 @@
#include "command.h"
#include "debug.h"
-#ifndef VTYSH_EXTRACT_PL
#include "zebra/debug_clippy.c"
-#endif
/* For debug statement. */
unsigned long zebra_debug_event;
diff --git a/zebra/dpdk/zebra_dplane_dpdk_vty.c b/zebra/dpdk/zebra_dplane_dpdk_vty.c
index 748bce9e3..d1814af3b 100644
--- a/zebra/dpdk/zebra_dplane_dpdk_vty.c
+++ b/zebra/dpdk/zebra_dplane_dpdk_vty.c
@@ -23,9 +23,7 @@
#include "lib/json.h"
#include "zebra/dpdk/zebra_dplane_dpdk.h"
-#ifndef VTYSH_EXTRACT_PL
#include "zebra/dpdk/zebra_dplane_dpdk_vty_clippy.c"
-#endif
#define ZD_STR "Zebra dataplane information\n"
#define ZD_DPDK_STR "DPDK offload information\n"
diff --git a/zebra/interface.c b/zebra/interface.c
index c674b499a..52e6bc81d 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -2603,9 +2603,7 @@ static void interface_update_stats(void)
#endif /* HAVE_NET_RT_IFLIST */
}
-#ifndef VTYSH_EXTRACT_PL
#include "zebra/interface_clippy.c"
-#endif
/* Show all interfaces to vty. */
DEFPY(show_interface, show_interface_cmd,
"show interface vrf NAME$vrf_name [brief$brief] [json$uj]",
diff --git a/zebra/rtadv.c b/zebra/rtadv.c
index 127888d65..a8ec60844 100644
--- a/zebra/rtadv.c
+++ b/zebra/rtadv.c
@@ -51,9 +51,7 @@ static uint32_t interfaces_configured_for_ra_from_bgp;
#if defined(HAVE_RTADV)
-#ifndef VTYSH_EXTRACT_PL
#include "zebra/rtadv_clippy.c"
-#endif
DEFINE_MTYPE_STATIC(ZEBRA, RTADV_PREFIX, "Router Advertisement Prefix");
DEFINE_MTYPE_STATIC(ZEBRA, ADV_IF, "Advertised Interface");
diff --git a/zebra/subdir.am b/zebra/subdir.am
index 298b71598..984293149 100644
--- a/zebra/subdir.am
+++ b/zebra/subdir.am
@@ -4,29 +4,6 @@
if ZEBRA
sbin_PROGRAMS += zebra/zebra
-vtysh_scan += \
- zebra/debug.c \
- zebra/interface.c \
- zebra/router-id.c \
- zebra/rtadv.c \
- zebra/zebra_gr.c \
- zebra/zebra_mlag_vty.c \
- zebra/zebra_evpn_mh.c \
- zebra/zebra_mpls_vty.c \
- zebra/zebra_srv6_vty.c \
- zebra/zebra_ptm.c \
- zebra/zebra_pw.c \
- zebra/zebra_routemap.c \
- zebra/zebra_vty.c \
- zebra/zserv.c \
- zebra/zebra_vrf.c \
- zebra/dpdk/zebra_dplane_dpdk_vty.c \
- # end
-
-# can be loaded as DSO - always include for vtysh
-vtysh_scan += zebra/irdp_interface.c
-vtysh_scan += zebra/zebra_fpm.c
-
vtysh_daemons += zebra
if IRDP
@@ -255,8 +232,6 @@ module_LTLIBRARIES += zebra/dplane_fpm_nl.la
zebra_dplane_fpm_nl_la_SOURCES = zebra/dplane_fpm_nl.c
zebra_dplane_fpm_nl_la_LDFLAGS = $(MODULE_LDFLAGS)
zebra_dplane_fpm_nl_la_LIBADD =
-
-vtysh_scan += zebra/dplane_fpm_nl.c
endif
if NETLINK_DEBUG
diff --git a/zebra/zebra_evpn_mh.c b/zebra/zebra_evpn_mh.c
index 064c91b72..98120accf 100644
--- a/zebra/zebra_evpn_mh.c
+++ b/zebra/zebra_evpn_mh.c
@@ -3252,9 +3252,7 @@ int zebra_evpn_mh_if_write(struct vty *vty, struct interface *ifp)
return 0;
}
-#ifndef VTYSH_EXTRACT_PL
#include "zebra/zebra_evpn_mh_clippy.c"
-#endif
/* CLI for setting an ES in bypass mode */
DEFPY_HIDDEN(zebra_evpn_es_bypass, zebra_evpn_es_bypass_cmd,
"[no] evpn mh bypass",
diff --git a/zebra/zebra_mlag_vty.c b/zebra/zebra_mlag_vty.c
index ebaaf03da..a1c544d5d 100644
--- a/zebra/zebra_mlag_vty.c
+++ b/zebra/zebra_mlag_vty.c
@@ -29,9 +29,7 @@
#include "debug.h"
#include "zapi_msg.h"
-#ifndef VTYSH_EXTRACT_PL
#include "zebra/zebra_mlag_vty_clippy.c"
-#endif
DEFUN_HIDDEN (show_mlag,
show_mlag_cmd,
diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c
index 2cc84a1f7..13d1995d5 100644
--- a/zebra/zebra_routemap.c
+++ b/zebra/zebra_routemap.c
@@ -40,9 +40,7 @@
#include "zebra/zebra_rnh.h"
#include "zebra/zebra_routemap.h"
-#ifndef VTYSH_EXTRACT_PL
#include "zebra/zebra_routemap_clippy.c"
-#endif
static uint32_t zebra_rmap_update_timer = ZEBRA_RMAP_DEFAULT_UPDATE_TIMER;
static struct thread *zebra_t_rmap_update = NULL;
diff --git a/zebra/zebra_srv6_vty.c b/zebra/zebra_srv6_vty.c
index 9adfc6550..e6810bdc5 100644
--- a/zebra/zebra_srv6_vty.c
+++ b/zebra/zebra_srv6_vty.c
@@ -40,9 +40,7 @@
#include "zebra/zebra_routemap.h"
#include "zebra/zebra_dplane.h"
-#ifndef VTYSH_EXTRACT_PL
#include "zebra/zebra_srv6_vty_clippy.c"
-#endif
static int zebra_sr_config(struct vty *vty);
diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c
index a2844ca95..c99aa2e8f 100644
--- a/zebra/zebra_vrf.c
+++ b/zebra/zebra_vrf.c
@@ -44,9 +44,7 @@
#include "zebra/zebra_vxlan.h"
#include "zebra/zebra_netns_notify.h"
#include "zebra/zebra_routemap.h"
-#ifndef VTYSH_EXTRACT_PL
#include "zebra/zebra_vrf_clippy.c"
-#endif
#include "zebra/table_manager.h"
static void zebra_vrf_table_create(struct zebra_vrf *zvrf, afi_t afi,
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 525e0366e..f68a65671 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -46,9 +46,7 @@
#include "lib/route_opaque.h"
#include "zebra/zebra_vxlan.h"
#include "zebra/zebra_evpn_mh.h"
-#ifndef VTYSH_EXTRACT_PL
#include "zebra/zebra_vty_clippy.c"
-#endif
#include "zebra/zserv.h"
#include "zebra/router-id.h"
#include "zebra/ipforward.h"