diff options
author | Russ Dill | 2003-12-16 02:28:20 +0000 |
---|---|---|
committer | Russ Dill | 2003-12-16 02:28:20 +0000 |
commit | 4b77acafa6f8b907903ea4a140b7c4a314ed71b2 (patch) | |
tree | eb9fcbf83020bdcc0f4cfbab13a22384cbec34a7 /networking/udhcp/dhcpc.c | |
parent | 7becf5987a1712e1366c6b7d3eeab70f3978a089 (diff) | |
download | busybox-4b77acafa6f8b907903ea4a140b7c4a314ed71b2.zip busybox-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.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index d18a963..55664ab 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(); } } |