aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/usage.src.h78
-rw-r--r--networking/udhcp/dhcpc.c78
2 files changed, 78 insertions, 78 deletions
diff --git a/include/usage.src.h b/include/usage.src.h
index 5d7767bb4..b73ca4d89 100644
--- a/include/usage.src.h
+++ b/include/usage.src.h
@@ -4232,84 +4232,6 @@ INSERT
"# tunctl\n" \
"# tunctl -d tun0\n"
-#if defined CONFIG_UDHCP_DEBUG && CONFIG_UDHCP_DEBUG >= 1
-# define IF_UDHCP_VERBOSE(...) __VA_ARGS__
-#else
-# define IF_UDHCP_VERBOSE(...)
-#endif
-#define udhcpc_trivial_usage \
- "[-fbnq"IF_UDHCP_VERBOSE("v")"oCR] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE]\n" \
- " [-H HOSTNAME] [-c CID] [-V VENDOR] [-O DHCP_OPT]..." IF_FEATURE_UDHCP_PORT(" [-P N]")
-#define udhcpc_full_usage "\n" \
- IF_LONG_OPTS( \
- "\n -i,--interface IFACE Interface to use (default eth0)" \
- "\n -p,--pidfile FILE Create pidfile" \
- "\n -r,--request IP IP address to request" \
- "\n -s,--script PROG Run PROG at DHCP events (default "CONFIG_UDHCPC_DEFAULT_SCRIPT")" \
- "\n -t,--retries N Send up to N discover packets" \
- "\n -T,--timeout N Pause between packets (default 3 seconds)" \
- "\n -A,--tryagain N Wait N seconds after failure (default 20)" \
- "\n -f,--foreground Run in foreground" \
- USE_FOR_MMU( \
- "\n -b,--background Background if lease is not obtained" \
- ) \
- "\n -S,--syslog Log to syslog too" \
- "\n -n,--now Exit if lease is not obtained" \
- "\n -q,--quit Exit after obtaining lease" \
- "\n -R,--release Release IP on exit" \
- IF_FEATURE_UDHCP_PORT( \
- "\n -P,--client-port N Use port N (default 68)" \
- ) \
- IF_FEATURE_UDHCPC_ARPING( \
- "\n -a,--arping Use arping to validate offered address" \
- ) \
- "\n -O,--request-option OPT Request DHCP option OPT (cumulative)" \
- "\n -o,--no-default-options Don't request any options (unless -O is given)" \
- "\n -x OPT:VAL Include option OPT in sent packets (cumulative)" \
- "\n -F,--fqdn NAME Ask server to update DNS mapping for NAME" \
- "\n -H,-h,--hostname NAME Send NAME as client hostname (default none)" \
- "\n -V,--vendorclass VENDOR Vendor identifier (default 'udhcp VERSION')" \
- "\n -c,--clientid CLIENTID Client identifier (default own MAC)" \
- "\n -C,--clientid-none Don't send client identifier" \
- IF_UDHCP_VERBOSE( \
- "\n -v Verbose" \
- ) \
- ) \
- IF_NOT_LONG_OPTS( \
- "\n -i IFACE Interface to use (default eth0)" \
- "\n -p FILE Create pidfile" \
- "\n -r IP IP address to request" \
- "\n -s PROG Run PROG at DHCP events (default "CONFIG_UDHCPC_DEFAULT_SCRIPT")" \
- "\n -t N Send up to N discover packets" \
- "\n -T N Pause between packets (default 3 seconds)" \
- "\n -A N Wait N seconds (default 20) after failure" \
- "\n -x OPT:VAL Include option OPT in sent packets" \
- "\n -O OPT Request DHCP option OPT (cumulative)" \
- "\n -o Don't request any options (unless -O is given)" \
- "\n -f Run in foreground" \
- USE_FOR_MMU( \
- "\n -b Background if lease is not obtained" \
- ) \
- "\n -S Log to syslog too" \
- "\n -n Exit if lease is not obtained" \
- "\n -q Exit after obtaining lease" \
- "\n -R Release IP on exit" \
- IF_FEATURE_UDHCP_PORT( \
- "\n -P N Use port N (default 68)" \
- ) \
- IF_FEATURE_UDHCPC_ARPING( \
- "\n -a Use arping to validate offered address" \
- ) \
- "\n -F NAME Ask server to update DNS mapping for NAME" \
- "\n -H,-h NAME Send NAME as client hostname (default none)" \
- "\n -V VENDOR Vendor identifier (default 'udhcp VERSION')" \
- "\n -c CLIENTID Client identifier (default own MAC)" \
- "\n -C Don't send client identifier" \
- IF_UDHCP_VERBOSE( \
- "\n -v Verbose" \
- ) \
- ) \
-
#define udhcpd_trivial_usage \
"[-fS]" IF_FEATURE_UDHCP_PORT(" [-P N]") " [CONFFILE]" \
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 27d6ad1a8..3630129ed 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -765,6 +765,84 @@ static void client_background(void)
}
#endif
+//usage:#if defined CONFIG_UDHCP_DEBUG && CONFIG_UDHCP_DEBUG >= 1
+//usage:# define IF_UDHCP_VERBOSE(...) __VA_ARGS__
+//usage:#else
+//usage:# define IF_UDHCP_VERBOSE(...)
+//usage:#endif
+//usage:#define udhcpc_trivial_usage
+//usage: "[-fbnq"IF_UDHCP_VERBOSE("v")"oCR] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE]\n"
+//usage: " [-H HOSTNAME] [-c CID] [-V VENDOR] [-O DHCP_OPT]..." IF_FEATURE_UDHCP_PORT(" [-P N]")
+//usage:#define udhcpc_full_usage "\n"
+//usage: IF_LONG_OPTS(
+//usage: "\n -i,--interface IFACE Interface to use (default eth0)"
+//usage: "\n -p,--pidfile FILE Create pidfile"
+//usage: "\n -r,--request IP IP address to request"
+//usage: "\n -s,--script PROG Run PROG at DHCP events (default "CONFIG_UDHCPC_DEFAULT_SCRIPT")"
+//usage: "\n -t,--retries N Send up to N discover packets"
+//usage: "\n -T,--timeout N Pause between packets (default 3 seconds)"
+//usage: "\n -A,--tryagain N Wait N seconds after failure (default 20)"
+//usage: "\n -f,--foreground Run in foreground"
+//usage: USE_FOR_MMU(
+//usage: "\n -b,--background Background if lease is not obtained"
+//usage: )
+//usage: "\n -S,--syslog Log to syslog too"
+//usage: "\n -n,--now Exit if lease is not obtained"
+//usage: "\n -q,--quit Exit after obtaining lease"
+//usage: "\n -R,--release Release IP on exit"
+//usage: IF_FEATURE_UDHCP_PORT(
+//usage: "\n -P,--client-port N Use port N (default 68)"
+//usage: )
+//usage: IF_FEATURE_UDHCPC_ARPING(
+//usage: "\n -a,--arping Use arping to validate offered address"
+//usage: )
+//usage: "\n -O,--request-option OPT Request DHCP option OPT (cumulative)"
+//usage: "\n -o,--no-default-options Don't request any options (unless -O is given)"
+//usage: "\n -x OPT:VAL Include option OPT in sent packets (cumulative)"
+//usage: "\n -F,--fqdn NAME Ask server to update DNS mapping for NAME"
+//usage: "\n -H,-h,--hostname NAME Send NAME as client hostname (default none)"
+//usage: "\n -V,--vendorclass VENDOR Vendor identifier (default 'udhcp VERSION')"
+//usage: "\n -c,--clientid CLIENTID Client identifier (default own MAC)"
+//usage: "\n -C,--clientid-none Don't send client identifier"
+//usage: IF_UDHCP_VERBOSE(
+//usage: "\n -v Verbose"
+//usage: )
+//usage: )
+//usage: IF_NOT_LONG_OPTS(
+//usage: "\n -i IFACE Interface to use (default eth0)"
+//usage: "\n -p FILE Create pidfile"
+//usage: "\n -r IP IP address to request"
+//usage: "\n -s PROG Run PROG at DHCP events (default "CONFIG_UDHCPC_DEFAULT_SCRIPT")"
+//usage: "\n -t N Send up to N discover packets"
+//usage: "\n -T N Pause between packets (default 3 seconds)"
+//usage: "\n -A N Wait N seconds (default 20) after failure"
+//usage: "\n -x OPT:VAL Include option OPT in sent packets"
+//usage: "\n -O OPT Request DHCP option OPT (cumulative)"
+//usage: "\n -o Don't request any options (unless -O is given)"
+//usage: "\n -f Run in foreground"
+//usage: USE_FOR_MMU(
+//usage: "\n -b Background if lease is not obtained"
+//usage: )
+//usage: "\n -S Log to syslog too"
+//usage: "\n -n Exit if lease is not obtained"
+//usage: "\n -q Exit after obtaining lease"
+//usage: "\n -R Release IP on exit"
+//usage: IF_FEATURE_UDHCP_PORT(
+//usage: "\n -P N Use port N (default 68)"
+//usage: )
+//usage: IF_FEATURE_UDHCPC_ARPING(
+//usage: "\n -a Use arping to validate offered address"
+//usage: )
+//usage: "\n -F NAME Ask server to update DNS mapping for NAME"
+//usage: "\n -H,-h NAME Send NAME as client hostname (default none)"
+//usage: "\n -V VENDOR Vendor identifier (default 'udhcp VERSION')"
+//usage: "\n -c CLIENTID Client identifier (default own MAC)"
+//usage: "\n -C Don't send client identifier"
+//usage: IF_UDHCP_VERBOSE(
+//usage: "\n -v Verbose"
+//usage: )
+//usage: )
+
int udhcpc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int udhcpc_main(int argc UNUSED_PARAM, char **argv)
{