From 63617a2d2df02054d9d55b2aa2dd56249339fdf1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20H=C3=A4rdeman?= Date: Sun, 5 Oct 2025 17:32:52 +0200 Subject: [PATCH] odhcpd: print compiled-in features in help message MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is mostly useful for hacking, as a way to quickly determine from the command-line how odhcpd has been built. But I also plan to use it in LuCI [1]. [1] https://github.com/openwrt/luci/blob/master/modules/luci-base/root/usr/share/rpcd/ucode/luci Signed-off-by: David Härdeman Link: https://github.com/openwrt/odhcpd/pull/268 Signed-off-by: Álvaro Fernández Rojas --- src/odhcpd.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/odhcpd.c b/src/odhcpd.c index 1cab203..9bb9ddc 100644 --- a/src/odhcpd.c +++ b/src/odhcpd.c @@ -55,6 +55,23 @@ static void sighandler(_unused int signal) static void print_usage(const char *app) { printf("== %s Usage ==\n" + "Features: ra ndp dhcpv6" +#ifdef DHCPV4_SUPPORT + " dhcpv4" +#else + " no-dhcpv4" +#endif /* DHCPV4_SUPPORT */ +#ifdef UBUS + " ubus" +#else + " no-ubus" +#endif /* UBUS */ +#ifdef EXT_CER_ID + " cer" +#else + " no-cer" +#endif /* EXT_CER_ID */ + "\n" "\n" " -c Use an alternative configuration file\n" " -l Specify log level 0..7 (default %d)\n" -- 2.30.2