Lines 126-132
int udhcpc_main(int argc, char *argv[]);
Link Here
|
126 |
int udhcpc_main(int argc, char *argv[]) |
126 |
int udhcpc_main(int argc, char *argv[]) |
127 |
{ |
127 |
{ |
128 |
uint8_t *temp, *message; |
128 |
uint8_t *temp, *message; |
129 |
char *str_c, *str_V, *str_h, *str_F, *str_r, *str_T, *str_t; |
129 |
char *str_c, *str_V, *str_h, *str_F, *str_r, *str_T, *str_t, *str_O; |
130 |
unsigned long t1 = 0, t2 = 0, xid = 0; |
130 |
unsigned long t1 = 0, t2 = 0, xid = 0; |
131 |
unsigned long start = 0, lease = 0; |
131 |
unsigned long start = 0, lease = 0; |
132 |
long now; |
132 |
long now; |
Lines 160-165
int udhcpc_main(int argc, char *argv[])
Link Here
|
160 |
OPT_T = 1 << 15, |
160 |
OPT_T = 1 << 15, |
161 |
OPT_t = 1 << 16, |
161 |
OPT_t = 1 << 16, |
162 |
OPT_v = 1 << 17, |
162 |
OPT_v = 1 << 17, |
|
|
163 |
OPT_O = 1 << 18, |
163 |
}; |
164 |
}; |
164 |
#if ENABLE_GETOPT_LONG |
165 |
#if ENABLE_GETOPT_LONG |
165 |
static const struct option arg_options[] = { |
166 |
static const struct option arg_options[] = { |
Lines 181-186
int udhcpc_main(int argc, char *argv[])
Link Here
|
181 |
{ "timeout", required_argument, 0, 'T' }, |
182 |
{ "timeout", required_argument, 0, 'T' }, |
182 |
{ "version", no_argument, 0, 'v' }, |
183 |
{ "version", no_argument, 0, 'v' }, |
183 |
{ "retries", required_argument, 0, 't' }, |
184 |
{ "retries", required_argument, 0, 't' }, |
|
|
185 |
{ "request-option", required_argument, 0, 'O' }, |
184 |
{ 0, 0, 0, 0 } |
186 |
{ 0, 0, 0, 0 } |
185 |
}; |
187 |
}; |
186 |
#endif |
188 |
#endif |
Lines 196-205
int udhcpc_main(int argc, char *argv[])
Link Here
|
196 |
#if ENABLE_GETOPT_LONG |
198 |
#if ENABLE_GETOPT_LONG |
197 |
applet_long_options = arg_options; |
199 |
applet_long_options = arg_options; |
198 |
#endif |
200 |
#endif |
199 |
opt = getopt32(argc, argv, "c:CV:fbH:h:F:i:np:qRr:s:T:t:v", |
201 |
opt = getopt32(argc, argv, "c:CV:fbH:h:F:i:np:qRr:s:T:t:vO:", |
200 |
&str_c, &str_V, &str_h, &str_h, &str_F, |
202 |
&str_c, &str_V, &str_h, &str_h, &str_F, |
201 |
&client_config.interface, &client_config.pidfile, &str_r, |
203 |
&client_config.interface, &client_config.pidfile, &str_r, |
202 |
&client_config.script, &str_T, &str_t |
204 |
&client_config.script, &str_T, &str_t, &str_O |
203 |
); |
205 |
); |
204 |
|
206 |
|
205 |
if (opt & OPT_c) |
207 |
if (opt & OPT_c) |
Lines 245-250
int udhcpc_main(int argc, char *argv[])
Link Here
|
245 |
printf("version %s\n\n", BB_VER); |
247 |
printf("version %s\n\n", BB_VER); |
246 |
return 0; |
248 |
return 0; |
247 |
} |
249 |
} |
|
|
250 |
if (opt & OPT_O) |
251 |
if (require_option(str_O)) { |
252 |
printf("Option: %s unknown/not-supported\n", str_O); |
253 |
return 1; |
254 |
} |
248 |
|
255 |
|
249 |
/* Start the log, sanitize fd's, and write a pid file */ |
256 |
/* Start the log, sanitize fd's, and write a pid file */ |
250 |
udhcp_start_log_and_pid(client_config.pidfile); |
257 |
udhcp_start_log_and_pid(client_config.pidfile); |