aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/dhcpc.c
diff options
context:
space:
mode:
authorRuss Dill <Russ.Dill@asu.edu>2003-12-16 02:28:20 +0000
committerRuss Dill <Russ.Dill@asu.edu>2003-12-16 02:28:20 +0000
commit4b77acafa6f8b907903ea4a140b7c4a314ed71b2 (patch)
treeeb9fcbf83020bdcc0f4cfbab13a22384cbec34a7 /networking/udhcp/dhcpc.c
parent7becf5987a1712e1366c6b7d3eeab70f3978a089 (diff)
downloadbusybox-4b77acafa6f8b907903ea4a140b7c4a314ed71b2.tar.gz
start attempting to bring udhcp in busybox back to the state where it is (ideally) an exact copy of udhcp outside of busybox so that its easy to merge back and forth
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r--networking/udhcp/dhcpc.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index d18a963a9..55664abf9 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -75,6 +75,35 @@ struct client_config_t client_config = {
arp: "\0\0\0\0\0\0", /* appease gcc-3.0 */
};
+#ifndef IN_BUSYBOX
+static void __attribute__ ((noreturn)) show_usage(void)
+{
+ printf(
+"Usage: udhcpc [OPTIONS]\n\n"
+" -c, --clientid=CLIENTID Client identifier\n"
+" -H, --hostname=HOSTNAME Client hostname\n"
+" -h Alias for -H\n"
+" -f, --foreground Do not fork after getting lease\n"
+" -b, --background Fork to background if lease cannot be\n"
+" immediately negotiated.\n"
+" -i, --interface=INTERFACE Interface to use (default: eth0)\n"
+" -n, --now Exit with failure if lease cannot be\n"
+" immediately negotiated.\n"
+" -p, --pidfile=file Store process ID of daemon in file\n"
+" -q, --quit Quit after obtaining lease\n"
+" -r, --request=IP IP address to request (default: none)\n"
+" -s, --script=file Run file at dhcp events (default:\n"
+" " DEFAULT_SCRIPT ")\n"
+" -v, --version Display version\n"
+ );
+ exit(0);
+}
+#else
+#define show_usage bb_show_usage
+extern void show_usage(void) __attribute__ ((noreturn));
+#endif
+
+
/* just a little helper */
static void change_mode(int new_mode)
{
@@ -233,7 +262,7 @@ int udhcpc_main(int argc, char *argv[])
return(0);
break;
default:
- bb_show_usage();
+ show_usage();
}
}