diff options
-rw-r--r-- | include/usage.src.h | 78 | ||||
-rw-r--r-- | networking/udhcp/dhcpc.c | 78 |
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 | |||
4232 | "# tunctl\n" \ | 4232 | "# tunctl\n" \ |
4233 | "# tunctl -d tun0\n" | 4233 | "# tunctl -d tun0\n" |
4234 | 4234 | ||
4235 | #if defined CONFIG_UDHCP_DEBUG && CONFIG_UDHCP_DEBUG >= 1 | ||
4236 | # define IF_UDHCP_VERBOSE(...) __VA_ARGS__ | ||
4237 | #else | ||
4238 | # define IF_UDHCP_VERBOSE(...) | ||
4239 | #endif | ||
4240 | #define udhcpc_trivial_usage \ | ||
4241 | "[-fbnq"IF_UDHCP_VERBOSE("v")"oCR] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE]\n" \ | ||
4242 | " [-H HOSTNAME] [-c CID] [-V VENDOR] [-O DHCP_OPT]..." IF_FEATURE_UDHCP_PORT(" [-P N]") | ||
4243 | #define udhcpc_full_usage "\n" \ | ||
4244 | IF_LONG_OPTS( \ | ||
4245 | "\n -i,--interface IFACE Interface to use (default eth0)" \ | ||
4246 | "\n -p,--pidfile FILE Create pidfile" \ | ||
4247 | "\n -r,--request IP IP address to request" \ | ||
4248 | "\n -s,--script PROG Run PROG at DHCP events (default "CONFIG_UDHCPC_DEFAULT_SCRIPT")" \ | ||
4249 | "\n -t,--retries N Send up to N discover packets" \ | ||
4250 | "\n -T,--timeout N Pause between packets (default 3 seconds)" \ | ||
4251 | "\n -A,--tryagain N Wait N seconds after failure (default 20)" \ | ||
4252 | "\n -f,--foreground Run in foreground" \ | ||
4253 | USE_FOR_MMU( \ | ||
4254 | "\n -b,--background Background if lease is not obtained" \ | ||
4255 | ) \ | ||
4256 | "\n -S,--syslog Log to syslog too" \ | ||
4257 | "\n -n,--now Exit if lease is not obtained" \ | ||
4258 | "\n -q,--quit Exit after obtaining lease" \ | ||
4259 | "\n -R,--release Release IP on exit" \ | ||
4260 | IF_FEATURE_UDHCP_PORT( \ | ||
4261 | "\n -P,--client-port N Use port N (default 68)" \ | ||
4262 | ) \ | ||
4263 | IF_FEATURE_UDHCPC_ARPING( \ | ||
4264 | "\n -a,--arping Use arping to validate offered address" \ | ||
4265 | ) \ | ||
4266 | "\n -O,--request-option OPT Request DHCP option OPT (cumulative)" \ | ||
4267 | "\n -o,--no-default-options Don't request any options (unless -O is given)" \ | ||
4268 | "\n -x OPT:VAL Include option OPT in sent packets (cumulative)" \ | ||
4269 | "\n -F,--fqdn NAME Ask server to update DNS mapping for NAME" \ | ||
4270 | "\n -H,-h,--hostname NAME Send NAME as client hostname (default none)" \ | ||
4271 | "\n -V,--vendorclass VENDOR Vendor identifier (default 'udhcp VERSION')" \ | ||
4272 | "\n -c,--clientid CLIENTID Client identifier (default own MAC)" \ | ||
4273 | "\n -C,--clientid-none Don't send client identifier" \ | ||
4274 | IF_UDHCP_VERBOSE( \ | ||
4275 | "\n -v Verbose" \ | ||
4276 | ) \ | ||
4277 | ) \ | ||
4278 | IF_NOT_LONG_OPTS( \ | ||
4279 | "\n -i IFACE Interface to use (default eth0)" \ | ||
4280 | "\n -p FILE Create pidfile" \ | ||
4281 | "\n -r IP IP address to request" \ | ||
4282 | "\n -s PROG Run PROG at DHCP events (default "CONFIG_UDHCPC_DEFAULT_SCRIPT")" \ | ||
4283 | "\n -t N Send up to N discover packets" \ | ||
4284 | "\n -T N Pause between packets (default 3 seconds)" \ | ||
4285 | "\n -A N Wait N seconds (default 20) after failure" \ | ||
4286 | "\n -x OPT:VAL Include option OPT in sent packets" \ | ||
4287 | "\n -O OPT Request DHCP option OPT (cumulative)" \ | ||
4288 | "\n -o Don't request any options (unless -O is given)" \ | ||
4289 | "\n -f Run in foreground" \ | ||
4290 | USE_FOR_MMU( \ | ||
4291 | "\n -b Background if lease is not obtained" \ | ||
4292 | ) \ | ||
4293 | "\n -S Log to syslog too" \ | ||
4294 | "\n -n Exit if lease is not obtained" \ | ||
4295 | "\n -q Exit after obtaining lease" \ | ||
4296 | "\n -R Release IP on exit" \ | ||
4297 | IF_FEATURE_UDHCP_PORT( \ | ||
4298 | "\n -P N Use port N (default 68)" \ | ||
4299 | ) \ | ||
4300 | IF_FEATURE_UDHCPC_ARPING( \ | ||
4301 | "\n -a Use arping to validate offered address" \ | ||
4302 | ) \ | ||
4303 | "\n -F NAME Ask server to update DNS mapping for NAME" \ | ||
4304 | "\n -H,-h NAME Send NAME as client hostname (default none)" \ | ||
4305 | "\n -V VENDOR Vendor identifier (default 'udhcp VERSION')" \ | ||
4306 | "\n -c CLIENTID Client identifier (default own MAC)" \ | ||
4307 | "\n -C Don't send client identifier" \ | ||
4308 | IF_UDHCP_VERBOSE( \ | ||
4309 | "\n -v Verbose" \ | ||
4310 | ) \ | ||
4311 | ) \ | ||
4312 | |||
4313 | #define udhcpd_trivial_usage \ | 4235 | #define udhcpd_trivial_usage \ |
4314 | "[-fS]" IF_FEATURE_UDHCP_PORT(" [-P N]") " [CONFFILE]" \ | 4236 | "[-fS]" IF_FEATURE_UDHCP_PORT(" [-P N]") " [CONFFILE]" \ |
4315 | 4237 | ||
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) | |||
765 | } | 765 | } |
766 | #endif | 766 | #endif |
767 | 767 | ||
768 | //usage:#if defined CONFIG_UDHCP_DEBUG && CONFIG_UDHCP_DEBUG >= 1 | ||
769 | //usage:# define IF_UDHCP_VERBOSE(...) __VA_ARGS__ | ||
770 | //usage:#else | ||
771 | //usage:# define IF_UDHCP_VERBOSE(...) | ||
772 | //usage:#endif | ||
773 | //usage:#define udhcpc_trivial_usage | ||
774 | //usage: "[-fbnq"IF_UDHCP_VERBOSE("v")"oCR] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE]\n" | ||
775 | //usage: " [-H HOSTNAME] [-c CID] [-V VENDOR] [-O DHCP_OPT]..." IF_FEATURE_UDHCP_PORT(" [-P N]") | ||
776 | //usage:#define udhcpc_full_usage "\n" | ||
777 | //usage: IF_LONG_OPTS( | ||
778 | //usage: "\n -i,--interface IFACE Interface to use (default eth0)" | ||
779 | //usage: "\n -p,--pidfile FILE Create pidfile" | ||
780 | //usage: "\n -r,--request IP IP address to request" | ||
781 | //usage: "\n -s,--script PROG Run PROG at DHCP events (default "CONFIG_UDHCPC_DEFAULT_SCRIPT")" | ||
782 | //usage: "\n -t,--retries N Send up to N discover packets" | ||
783 | //usage: "\n -T,--timeout N Pause between packets (default 3 seconds)" | ||
784 | //usage: "\n -A,--tryagain N Wait N seconds after failure (default 20)" | ||
785 | //usage: "\n -f,--foreground Run in foreground" | ||
786 | //usage: USE_FOR_MMU( | ||
787 | //usage: "\n -b,--background Background if lease is not obtained" | ||
788 | //usage: ) | ||
789 | //usage: "\n -S,--syslog Log to syslog too" | ||
790 | //usage: "\n -n,--now Exit if lease is not obtained" | ||
791 | //usage: "\n -q,--quit Exit after obtaining lease" | ||
792 | //usage: "\n -R,--release Release IP on exit" | ||
793 | //usage: IF_FEATURE_UDHCP_PORT( | ||
794 | //usage: "\n -P,--client-port N Use port N (default 68)" | ||
795 | //usage: ) | ||
796 | //usage: IF_FEATURE_UDHCPC_ARPING( | ||
797 | //usage: "\n -a,--arping Use arping to validate offered address" | ||
798 | //usage: ) | ||
799 | //usage: "\n -O,--request-option OPT Request DHCP option OPT (cumulative)" | ||
800 | //usage: "\n -o,--no-default-options Don't request any options (unless -O is given)" | ||
801 | //usage: "\n -x OPT:VAL Include option OPT in sent packets (cumulative)" | ||
802 | //usage: "\n -F,--fqdn NAME Ask server to update DNS mapping for NAME" | ||
803 | //usage: "\n -H,-h,--hostname NAME Send NAME as client hostname (default none)" | ||
804 | //usage: "\n -V,--vendorclass VENDOR Vendor identifier (default 'udhcp VERSION')" | ||
805 | //usage: "\n -c,--clientid CLIENTID Client identifier (default own MAC)" | ||
806 | //usage: "\n -C,--clientid-none Don't send client identifier" | ||
807 | //usage: IF_UDHCP_VERBOSE( | ||
808 | //usage: "\n -v Verbose" | ||
809 | //usage: ) | ||
810 | //usage: ) | ||
811 | //usage: IF_NOT_LONG_OPTS( | ||
812 | //usage: "\n -i IFACE Interface to use (default eth0)" | ||
813 | //usage: "\n -p FILE Create pidfile" | ||
814 | //usage: "\n -r IP IP address to request" | ||
815 | //usage: "\n -s PROG Run PROG at DHCP events (default "CONFIG_UDHCPC_DEFAULT_SCRIPT")" | ||
816 | //usage: "\n -t N Send up to N discover packets" | ||
817 | //usage: "\n -T N Pause between packets (default 3 seconds)" | ||
818 | //usage: "\n -A N Wait N seconds (default 20) after failure" | ||
819 | //usage: "\n -x OPT:VAL Include option OPT in sent packets" | ||
820 | //usage: "\n -O OPT Request DHCP option OPT (cumulative)" | ||
821 | //usage: "\n -o Don't request any options (unless -O is given)" | ||
822 | //usage: "\n -f Run in foreground" | ||
823 | //usage: USE_FOR_MMU( | ||
824 | //usage: "\n -b Background if lease is not obtained" | ||
825 | //usage: ) | ||
826 | //usage: "\n -S Log to syslog too" | ||
827 | //usage: "\n -n Exit if lease is not obtained" | ||
828 | //usage: "\n -q Exit after obtaining lease" | ||
829 | //usage: "\n -R Release IP on exit" | ||
830 | //usage: IF_FEATURE_UDHCP_PORT( | ||
831 | //usage: "\n -P N Use port N (default 68)" | ||
832 | //usage: ) | ||
833 | //usage: IF_FEATURE_UDHCPC_ARPING( | ||
834 | //usage: "\n -a Use arping to validate offered address" | ||
835 | //usage: ) | ||
836 | //usage: "\n -F NAME Ask server to update DNS mapping for NAME" | ||
837 | //usage: "\n -H,-h NAME Send NAME as client hostname (default none)" | ||
838 | //usage: "\n -V VENDOR Vendor identifier (default 'udhcp VERSION')" | ||
839 | //usage: "\n -c CLIENTID Client identifier (default own MAC)" | ||
840 | //usage: "\n -C Don't send client identifier" | ||
841 | //usage: IF_UDHCP_VERBOSE( | ||
842 | //usage: "\n -v Verbose" | ||
843 | //usage: ) | ||
844 | //usage: ) | ||
845 | |||
768 | int udhcpc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 846 | int udhcpc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
769 | int udhcpc_main(int argc UNUSED_PARAM, char **argv) | 847 | int udhcpc_main(int argc UNUSED_PARAM, char **argv) |
770 | { | 848 | { |