summaryrefslogtreecommitdiffstats
path: root/lib/command.h
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 /lib/command.h
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 'lib/command.h')
-rw-r--r--lib/command.h7
1 files changed, 0 insertions, 7 deletions
diff --git a/lib/command.h b/lib/command.h
index f4168dedd..31e5cad23 100644
--- a/lib/command.h
+++ b/lib/command.h
@@ -251,9 +251,6 @@ struct cmd_node {
/* Argc max counts. */
#define CMD_ARGC_MAX 256
-/* Turn off these macros when using cpp with extract.pl */
-#ifndef VTYSH_EXTRACT_PL
-
/* helper defines for end-user DEFUN* macros */
#define DEFUN_CMD_ELEMENT(funcname, cmdname, cmdstr, helpstr, attrs, dnum) \
static const struct cmd_element cmdname = { \
@@ -370,8 +367,6 @@ struct cmd_node {
#define ALIAS_YANG(funcname, cmdname, cmdstr, helpstr) \
ALIAS_ATTR(funcname, cmdname, cmdstr, helpstr, CMD_ATTR_YANG)
-#endif /* VTYSH_EXTRACT_PL */
-
/* Some macroes */
/*
@@ -511,7 +506,6 @@ struct xref_install_element {
enum node_type node_type;
};
-#ifndef VTYSH_EXTRACT_PL
#define install_element(node_type_, cmd_element_) do { \
static const struct xref_install_element _xref \
__attribute__((used)) = { \
@@ -523,7 +517,6 @@ struct xref_install_element {
XREF_LINK(_xref.xref); \
_install_element(node_type_, cmd_element_); \
} while (0)
-#endif
extern void _install_element(enum node_type, const struct cmd_element *);