summaryrefslogtreecommitdiff
path: root/vtysh
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-06-12 11:39:12 -0300
committerRenato Westphal <renato@openbsd.org>2017-06-16 14:43:42 -0300
commitc740f7d3678a8ea2c70a062c1207157e999bd6e8 (patch)
tree43dd4ca1494eb53827854efa1476ee0ae9e5b838 /vtysh
parent62e4232010330e515630399838288f6281d04de6 (diff)
ldpd: convert cli and get rid of the xml interface
The xml2cli.pl script was useful years ago when the vty code was very rudimentary. This is not the case anymore, so convert all ldpd CLI commands to use DEFUNs directly and get rid of the XML interface. The benefits are: * Consistency with the other daemons; * One less build dependency (the LibXML perl module); * Easier to add new commands. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'vtysh')
-rw-r--r--vtysh/Makefile.am25
1 files changed, 6 insertions, 19 deletions
diff --git a/vtysh/Makefile.am b/vtysh/Makefile.am
index 587f72c809..8b66ba2564 100644
--- a/vtysh/Makefile.am
+++ b/vtysh/Makefile.am
@@ -108,6 +108,10 @@ vtysh_scan += $(top_srcdir)/ripngd/ripng_zebra.c
vtysh_scan += $(top_srcdir)/ripngd/ripngd.c
endif
+if LDPD
+vtysh_scan += $(top_srcdir)/ldpd/ldp_vty_cmds.c
+endif
+
if NHRPD
vtysh_scan += $(top_srcdir)/nhrpd/nhrp_vty.c
endif
@@ -146,22 +150,5 @@ vtysh_cmd_FILES = $(vtysh_scan) \
$(top_srcdir)/watchfrr/watchfrr_vty.c \
$(BGP_VNC_RFAPI_SRC) $(BGP_VNC_RFP_SRC)
-# this is slightly iffy... ldp_vty_cmds.c can be located in either
-# $srcdir or $builddir depending on whether it's coming pre-built from a
-# dist tarball or being built. automake uses VPATH to find it, but that
-# doesn't work here...
-# so after running "make ldp_vty_cmds.c", the file can be in either of the
-# two directories. we need to do some magic to find out which.
-vtysh_cmd_DEPS = $(vtysh_cmd_FILES)
-if LDPD
-$(top_builddir)/ldpd/ldp_vty_cmds.c:
- make -C "$(top_builddir)/ldpd" ldp_vty_cmds.c
-vtysh_cmd_DEPS += $(top_builddir)/ldpd/ldp_vty_cmds.c
-endif
-
-vtysh_cmd.c: $(vtysh_cmd_DEPS) extract.pl
- if test -n "${LDPD}"; then \
- ldpcmds="$(top_srcdir)/ldpd/ldp_vty_cmds.c"; \
- test -f "$(top_builddir)/ldpd/ldp_vty_cmds.c" && ldpcmds="$(top_builddir)/ldpd/ldp_vty_cmds.c"; \
- fi; \
- ./extract.pl $(vtysh_cmd_FILES) $${ldpcmds} > vtysh_cmd.c
+vtysh_cmd.c: $(vtysh_cmd_FILES) extract.pl
+ ./extract.pl $(vtysh_cmd_FILES) > vtysh_cmd.c