odhcpd: print compiled-in features in help message
authorDavid Härdeman <[email protected]>
Sun, 5 Oct 2025 15:32:52 +0000 (17:32 +0200)
committerÁlvaro Fernández Rojas <[email protected]>
Tue, 7 Oct 2025 08:45:27 +0000 (10:45 +0200)
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 <[email protected]>
Link: https://github.com/openwrt/odhcpd/pull/268
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
src/odhcpd.c

index 1cab203a92c02ceb41d0a8e81c2ab915c83ddacf..9bb9ddcbdb551dcadbe2614dfede2e379519e6be 100644 (file)
@@ -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 <path>       Use an alternative configuration file\n"
               "        -l <int>        Specify log level 0..7 (default %d)\n"