2 ===================================================================
3 RCS file: /var/cvs/busybox/include/usage.h,v
4 retrieving revision 1.191
5 diff -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 14:32:45 -0000
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-R,\t--require=NAME\tAdd NAME to request\n" \
13 "\t-s,\t--script=file\tRun file at dhcp events (default: /usr/share/udhcpc/default.script)\n" \
14 "\t-v,\t--version\tDisplay version"
16 Index: networking/udhcp/README.udhcpc
17 ===================================================================
18 RCS file: /var/cvs/busybox/networking/udhcp/README.udhcpc,v
19 retrieving revision 1.3
20 diff -u -r1.3 README.udhcpc
21 --- a/networking/udhcp/README.udhcpc 11 Dec 2002 21:12:44 -0000 1.3
22 +++ b/networking/udhcp/README.udhcpc 5 Mar 2004 14:32:46 -0000
24 -p, --pidfile=file Store process ID of daemon in file
25 -q, --quit Quit after obtaining lease
26 -r, --request=IP IP address to request (default: none)
27 +-R, --require=NAME Add NAME to request
28 -s, --script=file Run file at dhcp events (default:
29 /usr/share/udhcpc/default.script)
30 -v, --version Display version
33 additional options are easily added in options.c.
35 +By default, only a few basic items are requested. To request additional
36 +items use the -R option. Example: "-R rootpath"
38 note on udhcpc's random seed
39 ---------------------------
40 Index: networking/udhcp/dhcpc.c
41 ===================================================================
42 RCS file: /var/cvs/busybox/networking/udhcp/dhcpc.c,v
43 retrieving revision 1.16
44 diff -u -r1.16 dhcpc.c
45 --- a/networking/udhcp/dhcpc.c 30 Jan 2004 23:45:12 -0000 1.16
46 +++ b/networking/udhcp/dhcpc.c 5 Mar 2004 14:32:46 -0000
48 " -p, --pidfile=file Store process ID of daemon in file\n"
49 " -q, --quit Quit after obtaining lease\n"
50 " -r, --request=IP IP address to request (default: none)\n"
51 +" -R, --require=NAME Add NAME to the request\n"
52 " -s, --script=file Run file at dhcp events (default:\n"
53 " " DEFAULT_SCRIPT ")\n"
54 " -v, --version Display version\n"
56 {"pidfile", required_argument, 0, 'p'},
57 {"quit", no_argument, 0, 'q'},
58 {"request", required_argument, 0, 'r'},
59 + {"require", required_argument, 0, 'R'},
60 {"script", required_argument, 0, 's'},
61 {"version", no_argument, 0, 'v'},
67 - c = getopt_long(argc, argv, "c:fbH:h:i:np:qr:s:v", arg_options, &option_index);
68 + c = getopt_long(argc, argv, "c:fbH:h:i:np:qr:R:s:v", arg_options, &option_index);
74 requested_ip = inet_addr(optarg);
77 + if (require_option(optarg)) {
78 + fprintf(stderr,"WARNING: %s unknown/not-supported (Ignored)\n", optarg );
82 client_config.script = optarg;
84 Index: networking/udhcp/options.c
85 ===================================================================
86 RCS file: /var/cvs/busybox/networking/udhcp/options.c,v
87 retrieving revision 1.7
88 diff -u -r1.7 options.c
89 --- a/networking/udhcp/options.c 30 Jan 2004 23:45:12 -0000 1.7
90 +++ b/networking/udhcp/options.c 5 Mar 2004 14:32:46 -0000
96 +/* find and mark requested item as required */
97 +int require_option(char *name)
100 + for (i = 0; dhcp_options[i].code; i++) {
101 + if (strcmp(name, dhcp_options[i].name) == 0 ){
102 + dhcp_options[i].flags |= OPTION_REQ;
109 /* get an option with bounds checking (warning, not aligned). */
110 uint8_t *get_option(struct dhcpMessage *packet, int code)
112 Index: networking/udhcp/options.h
113 ===================================================================
114 RCS file: /var/cvs/busybox/networking/udhcp/options.h,v
115 retrieving revision 1.5
116 diff -u -r1.5 options.h
117 --- a/networking/udhcp/options.h 30 Jan 2004 23:45:12 -0000 1.5
118 +++ b/networking/udhcp/options.h 5 Mar 2004 14:32:46 -0000
120 extern struct dhcp_option dhcp_options[];
121 extern int option_lengths[];
123 +int require_option(char *name);
124 uint8_t *get_option(struct dhcpMessage *packet, int code);
125 int end_option(uint8_t *optionptr);
126 int add_option_string(uint8_t *optionptr, uint8_t *string);