blob: 1d3a6b4b0ffa24eb6403dc953dc9568f058c80ec [file] [log] [blame]
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +00001Index: include/usage.h
2===================================================================
3RCS file: /var/cvs/busybox/include/usage.h,v
4retrieving revision 1.191
5diff -u -r1.191 usage.h
6--- a/include/usage.h 25 Feb 2004 10:35:55 -0000 1.191
7+++ b/include/usage.h 5 Mar 2004 13:20:11 -0000
8@@ -2606,7 +2606,8 @@
9 "\t-p,\t--pidfile=file\tStore process ID of daemon in file\n" \
10 "\t-q,\t--quit\tQuit after obtaining lease\n" \
11 "\t-r,\t--request=IP\tIP address to request (default: none)\n" \
12- "\t-s,\t--script=file\tRun file at dhcp events (default: /usr/share/udhcpc/default.script)\n" \
13+ "\t-s,\t--script=file\tRun file at dhcp events (default: " \
14+ CONFIG_UDHCPC_SCRIPT_PATH ")\n" \
15 "\t-v,\t--version\tDisplay version"
Eric Andersenc7bda1c2004-03-15 08:29:22 +000016
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +000017 #define udhcpd_trivial_usage \
18Index: networking/udhcp/AUTHORS
19===================================================================
20RCS file: /var/cvs/busybox/networking/udhcp/AUTHORS,v
21retrieving revision 1.3
22diff -u -r1.3 AUTHORS
23--- a/networking/udhcp/AUTHORS 18 Dec 2003 22:25:38 -0000 1.3
24+++ b/networking/udhcp/AUTHORS 5 Mar 2004 13:20:11 -0000
25@@ -10,5 +10,5 @@
26 Moreton Bay (http://www.moretonbay.com/)
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +000027 Vladimir Oleynik <dzo@simtrea.ru> Size optimizations
Eric Andersenc7bda1c2004-03-15 08:29:22 +000028
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +000029-
30+Tony J. White <tjw@tjw.org> additional busybox build options
Eric Andersenc7bda1c2004-03-15 08:29:22 +000031
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +000032Index: networking/udhcp/Config.in
33===================================================================
34RCS file: /var/cvs/busybox/networking/udhcp/Config.in,v
35retrieving revision 1.5
36diff -u -r1.5 Config.in
37--- a/networking/udhcp/Config.in 22 Oct 2003 09:58:38 -0000 1.5
38+++ b/networking/udhcp/Config.in 5 Mar 2004 13:20:11 -0000
39@@ -58,5 +58,62 @@
Eric Andersenc7bda1c2004-03-15 08:29:22 +000040
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +000041 See http://udhcp.busybox.net for further details.
Eric Andersenc7bda1c2004-03-15 08:29:22 +000042
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +000043+menu "udhcpd Configuration Options"
44+ depends on CONFIG_UDHCPD
Eric Andersenc7bda1c2004-03-15 08:29:22 +000045+
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +000046+config CONFIG_UDHCPD_CONF_PATH
47+ string "Path to default udhcpd.conf"
Eric Andersenc7bda1c2004-03-15 08:29:22 +000048+ default "/etc/udhcpd.conf"
49+ depends on CONFIG_UDHCPD
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +000050+ help
51+ The full path to udhcpd's default configuration file.
52+ (default is: /etc/udhcpd.conf)
53+
54+config CONFIG_UDHCPD_LEASE_PATH
55+ string "Path to default udhcpd.leases"
Eric Andersenc7bda1c2004-03-15 08:29:22 +000056+ default "/var/lib/misc/udhcpd.leases"
57+ depends on CONFIG_UDHCPD
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +000058+ help
59+ The full path to udhcpd's default leases file.
60+ (default is: /var/lib/misc/udhcpd.leases)
61+
62+config CONFIG_UDHCPD_PID_PATH
63+ string "Path to default udhcpd PID file"
Eric Andersenc7bda1c2004-03-15 08:29:22 +000064+ default "/var/run/udhcpd.pid"
65+ depends on CONFIG_UDHCPD
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +000066+ help
67+ The full path to udhcpd's default pid file.
68+ (default is: /var/run/udhcpd.pid)
69+
70+endmenu
71+
72+menu "udhcpc Configuration Options"
73+ depends on CONFIG_UDHCPC
74+
75+config CONFIG_UDHCPC_SCRIPT_PATH
76+ string "Path to default udhcpc event script"
77+ depends on CONFIG_UDHCPC
78+ help
79+ The full path to udhcpc's default event script file.
80+ (default is: /usr/share/udhcpc/default.script OR
81+ /share/udhcpc/default.script if CONFIG_INSTALL_NO_USR is set)
Eric Andersenc7bda1c2004-03-15 08:29:22 +000082+
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +000083+ When udhcpc is started it executes this script to take care
84+ of system tasks after it completes DHCP communication. Such
Eric Andersenc7bda1c2004-03-15 08:29:22 +000085+ tasks include putting network interfaces up or down, setting
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +000086+ DNS info, adding routing information, etc.
87+
88+if CONFIG_INSTALL_NO_USR
89+config CONFIG_UDHCPC_SCRIPT_PATH
Eric Andersenc7bda1c2004-03-15 08:29:22 +000090+ default "/share/udhcpc/default.script"
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +000091+endif
92+
93+if !CONFIG_INSTALL_NO_USR
94+config CONFIG_UDHCPC_SCRIPT_PATH
Eric Andersenc7bda1c2004-03-15 08:29:22 +000095+ default "/usr/share/udhcpc/default.script"
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +000096+endif
Eric Andersenc7bda1c2004-03-15 08:29:22 +000097+
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +000098+endmenu
99+
100 endmenu
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000101
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000102Index: networking/udhcp/README
103===================================================================
104RCS file: /var/cvs/busybox/networking/udhcp/README,v
105retrieving revision 1.3
106diff -u -r1.3 README
107--- a/networking/udhcp/README 18 Dec 2003 22:25:38 -0000 1.3
108+++ b/networking/udhcp/README 5 Mar 2004 13:20:11 -0000
109@@ -9,27 +9,42 @@
110 compile time options
111 -------------------
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000112
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000113-The Makefile contains three of the compile time options:
114+The following options can be adjusted when configuring busybox:
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000115
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000116- UDHCP_DEBUG: If UDHCP_DEBUG is defined, udhcpd will output extra
117- debugging output, compile with -g, and not fork to the background when
118- run.
119- UDHCP_SYSLOG: If UDHCP_SYSLOG is defined, udhcpd will log all its
120- messages syslog, otherwise, it will attempt to log them to stdout.
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000121-
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000122- COMBINED_BINARY: If COMBINED_BINARY is define, one binary, udhcpd,
123- is created. If called as udhcpd, the dhcp server will be started.
124- If called as udhcpc, the dhcp client will be started.
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000125-
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000126-dhcpd.h contains the other three compile time options:
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000127-
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000128- LEASE_TIME: The default lease time if not specified in the config
129- file.
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000130+ CONFIG_FEATURE_UDHCP_DEBUG:
131+ If this is defined, udhcpd will output extra debugging output,
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000132+ compile with -g, and not fork to the background when run.
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000133
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000134- LEASES_FILE: The default file for storing leases.
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000135-
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000136- DHCPD_CONFIG_FILE: The defualt config file to use.
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000137+ CONFIG_FEATURE_UDHCP_SYSLOG:
138+ If this is defined, udhcpd will log all its messages syslog,
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000139+ otherwise, it will attempt to log them to stdout.
140+
141+ CONFIG_UDHCPD_CONF_PATH:
142+ The full path to udhcpd's default configuration file.
143+
144+ CONFIG_UDHCPD_LEASE_PATH:
145+ The full path to udhcpd's default leases file.
146+
147+ CONFIG_UDHCPD_PID_PATH:
148+ The full path to udhcpd's default pid file.
149+
150+ CONFIG_UDHCPC_SCRIPT_PATH:
151+ The full path to udhcpc's default event script file.
152+ (default is: /usr/share/udhcpc/default.script)
153+
154+ When udhcpc is started it executes this script to take care
155+ of system tasks after it completes DHCP communication. Such
156+ tasks include putting network interfaces up or down, setting
157+ DNS info, adding routing information, etc.
158+
159+
160+dhcpd.h contains the another compile time option:
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000161
162+ LEASE_TIME:
163+ The default lease time if not specified in the config file.
164+ This option can also be changed at runtime with the 'lease'
165+ configuration option.
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000166+
167 options.c contains a set of dhcp options for the client:
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000168
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000169 name[10]: The name of the option as it will appear in scripts
170Index: networking/udhcp/README.udhcpc
171===================================================================
172RCS file: /var/cvs/busybox/networking/udhcp/README.udhcpc,v
173retrieving revision 1.3
174diff -u -r1.3 README.udhcpc
175--- a/networking/udhcp/README.udhcpc 11 Dec 2002 21:12:44 -0000 1.3
176+++ b/networking/udhcp/README.udhcpc 5 Mar 2004 13:20:11 -0000
177@@ -23,7 +23,8 @@
178 -q, --quit Quit after obtaining lease
179 -r, --request=IP IP address to request (default: none)
180 -s, --script=file Run file at dhcp events (default:
181- /usr/share/udhcpc/default.script)
182+ /usr/share/udhcpc/default.script or
183+ CONFIG_UDHCPC_SCRIPT_PATH at build time)
184 -v, --version Display version
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000185
186
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000187Index: networking/udhcp/README.udhcpd
188===================================================================
189RCS file: /var/cvs/busybox/networking/udhcp/README.udhcpd,v
190retrieving revision 1.1
191diff -u -r1.1 README.udhcpd
192--- a/networking/udhcp/README.udhcpd 31 Oct 2002 19:21:27 -0000 1.1
193+++ b/networking/udhcp/README.udhcpd 5 Mar 2004 13:20:11 -0000
194@@ -50,10 +50,14 @@
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000195
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000196 compile time options
197 -------------------
198+
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000199+During busybox configuration, you can change the default paths for
200+udhcpd.conf, udhcpd.leases, and udhcpd.pid files. See README for
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000201+more details.
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000202
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000203-dhcpd.h contains the other two compile time options:
204+dhcpd.h contains the compile time option:
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000205
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000206 LEASE_TIME: The default lease time if not specified in the config
207 file.
208+
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000209
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000210- DHCPD_CONFIG_FILE: The defualt config file to use.
211Index: networking/udhcp/dhcpc.h
212===================================================================
213RCS file: /var/cvs/busybox/networking/udhcp/dhcpc.h,v
214retrieving revision 1.4
215diff -u -r1.4 dhcpc.h
216--- a/networking/udhcp/dhcpc.h 30 Jan 2004 23:45:12 -0000 1.4
217+++ b/networking/udhcp/dhcpc.h 5 Mar 2004 13:20:11 -0000
218@@ -2,7 +2,11 @@
219 #ifndef _DHCPC_H
220 #define _DHCPC_H
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000221
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000222-#define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script"
223+#ifdef CONFIG_UDHCPC_SCRIPT_PATH
224+ #define DEFAULT_SCRIPT CONFIG_UDHCPC_SCRIPT_PATH
225+#else
226+ #define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script"
227+#endif
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000228
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000229 /* allow libbb_udhcp.h to redefine DEFAULT_SCRIPT */
230 #include "libbb_udhcp.h"
231Index: networking/udhcp/dhcpd.c
232===================================================================
233RCS file: /var/cvs/busybox/networking/udhcp/dhcpd.c,v
234retrieving revision 1.5
235diff -u -r1.5 dhcpd.c
236--- a/networking/udhcp/dhcpd.c 30 Jan 2004 23:45:12 -0000 1.5
237+++ b/networking/udhcp/dhcpd.c 5 Mar 2004 13:20:11 -0000
238@@ -70,6 +70,13 @@
239 struct dhcpOfferedAddr *lease;
240 int max_sock;
241 unsigned long num_ips;
242+ int daemonize = 1;
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000243+
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000244+ while (strcmp(argv[1],"-f")==0 || strcmp(argv[1],"--foreground")==0) {
245+ daemonize = 0;
246+ argv++;
247+ argc--;
248+ }
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000249
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000250 memset(&server_config, 0, sizeof(struct server_config_t));
251 read_config(argc < 2 ? DHCPD_CONF_FILE : argv[1]);
252@@ -99,9 +106,8 @@
253 &server_config.server, server_config.arp) < 0)
254 return 1;
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000255
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000256-#ifndef UDHCP_DEBUG
257- background(server_config.pidfile); /* hold lock during fork. */
258-#endif
259+ if(daemonize)
260+ background(server_config.pidfile); /* hold lock during fork. */
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000261
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000262 /* Setup the signal pipe */
263 udhcp_sp_setup();
264Index: networking/udhcp/dhcpd.h
265===================================================================
266RCS file: /var/cvs/busybox/networking/udhcp/dhcpd.h,v
267retrieving revision 1.5
268diff -u -r1.5 dhcpd.h
269--- a/networking/udhcp/dhcpd.h 30 Jan 2004 23:45:12 -0000 1.5
270+++ b/networking/udhcp/dhcpd.h 5 Mar 2004 13:20:12 -0000
271@@ -15,11 +15,25 @@
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000272
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000273 /* the period of time the client is allowed to use that address */
274 #define LEASE_TIME (60*60*24*10) /* 10 days of seconds */
275-#define LEASES_FILE "/var/lib/misc/udhcpd.leases"
276+
277+#ifdef CONFIG_UDHCPD_LEASE_PATH
278+ #define LEASES_FILE CONFIG_UDHCPD_LEASE_PATH
279+#else
280+ #define LEASES_FILE "/var/lib/misc/udhcpd.leases"
281+#endif
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000282
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000283 /* where to find the DHCP server configuration file */
284-#define DHCPD_CONF_FILE "/etc/udhcpd.conf"
285+#ifdef CONFIG_UDHCPD_CONF_PATH
286+ #define DHCPD_CONF_FILE CONFIG_UDHCPD_CONF_PATH
287+#else
288+ #define DHCPD_CONF_FILE "/etc/udhcpd.conf"
289+#endif
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000290
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000291+#ifdef CONFIG_UDHCPD_PID_PATH
292+ #define DHCPD_PID_FILE CONFIG_UDHCPD_PID_PATH
293+#else
294+ #define DHCPD_PID_FILE "/var/run/udhcpd.pid"
295+#endif
296 /*****************************************************************/
297 /* Do not modify below here unless you know what you are doing!! */
298 /*****************************************************************/
299Index: networking/udhcp/files.c
300===================================================================
301RCS file: /var/cvs/busybox/networking/udhcp/files.c,v
302retrieving revision 1.13
303diff -u -r1.13 files.c
304--- a/networking/udhcp/files.c 30 Jan 2004 23:45:12 -0000 1.13
305+++ b/networking/udhcp/files.c 5 Mar 2004 13:20:13 -0000
306@@ -166,7 +166,7 @@
307 {"offer_time", read_u32, &(server_config.offer_time), "60"},
308 {"min_lease", read_u32, &(server_config.min_lease), "60"},
309 {"lease_file", read_str, &(server_config.lease_file), LEASES_FILE},
310- {"pidfile", read_str, &(server_config.pidfile), "/var/run/udhcpd.pid"},
311+ {"pidfile", read_str, &(server_config.pidfile), DHCPD_PID_FILE},
312 {"notify_file", read_str, &(server_config.notify_file), ""},
313 {"siaddr", read_ip, &(server_config.siaddr), "0.0.0.0"},
314 {"sname", read_str, &(server_config.sname), ""},
315Index: networking/udhcp/libbb_udhcp.h
316===================================================================
317RCS file: /var/cvs/busybox/networking/udhcp/libbb_udhcp.h,v
318retrieving revision 1.5
319diff -u -r1.5 libbb_udhcp.h
320--- a/networking/udhcp/libbb_udhcp.h 18 Dec 2003 22:25:38 -0000 1.5
321+++ b/networking/udhcp/libbb_udhcp.h 5 Mar 2004 13:20:13 -0000
322@@ -3,11 +3,6 @@
323 /* bit of a hack, do this no matter what the order of the includes.
324 * (for busybox) */
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000325
Glenn L McGrath1bdc5d82004-03-05 13:23:40 +0000326-#ifdef CONFIG_INSTALL_NO_USR
327-#undef DEFUALT_SCRIPT
328-#define DEFAULT_SCRIPT "/share/udhcpc/default.script"
329-#endif
330-
331 #ifndef _LIBBB_UDHCP_H
332 #define _LIBBB_UDHCP_H
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000333