Lines 149-154
Link Here
|
149 |
status = read_client_conf_file (path_dhclient_conf, |
149 |
status = read_client_conf_file (path_dhclient_conf, |
150 |
(struct interface_info *)0, |
150 |
(struct interface_info *)0, |
151 |
&top_level_config); |
151 |
&top_level_config); |
|
|
152 |
|
153 |
/* Read any extra configuration from stdin */ |
154 |
read_client_conf_stdin ((struct interface_info *)0, |
155 |
&top_level_config); |
156 |
|
152 |
if (status != ISC_R_SUCCESS) { |
157 |
if (status != ISC_R_SUCCESS) { |
153 |
; |
158 |
; |
154 |
#ifdef LATER |
159 |
#ifdef LATER |
Lines 201-220
Link Here
|
201 |
return status; |
206 |
return status; |
202 |
} |
207 |
} |
203 |
|
208 |
|
204 |
int read_client_conf_file (const char *name, struct interface_info *ip, |
209 |
int read_client_conf_actual (int file, const char *name, |
205 |
struct client_config *client) |
210 |
struct interface_info *ip, |
|
|
211 |
struct client_config *client) |
206 |
{ |
212 |
{ |
207 |
int file; |
|
|
208 |
struct parse *cfile; |
213 |
struct parse *cfile; |
209 |
const char *val; |
214 |
const char *val; |
210 |
int token; |
215 |
int token; |
211 |
isc_result_t status; |
216 |
isc_result_t status; |
212 |
|
217 |
|
213 |
if ((file = open (name, O_RDONLY)) < 0) |
|
|
214 |
return uerr2isc (errno); |
215 |
|
216 |
cfile = (struct parse *)0; |
218 |
cfile = (struct parse *)0; |
217 |
new_parse (&cfile, file, (char *)0, 0, path_dhclient_conf, 0); |
219 |
new_parse (&cfile, file, (char *)0, 0, name , 0); |
218 |
|
220 |
|
219 |
do { |
221 |
do { |
220 |
token = peek_token (&val, (unsigned *)0, cfile); |
222 |
token = peek_token (&val, (unsigned *)0, cfile); |
Lines 230-235
Link Here
|
230 |
return status; |
232 |
return status; |
231 |
} |
233 |
} |
232 |
|
234 |
|
|
|
235 |
int read_client_conf_file (const char *name, struct interface_info *ip, |
236 |
struct client_config *client) |
237 |
{ |
238 |
int file; |
239 |
isc_result_t status; |
240 |
|
241 |
if ((file = open (name, O_RDONLY)) < 0) |
242 |
return uerr2isc (errno); |
243 |
|
244 |
status = read_client_conf_actual(file, name, ip, client); |
245 |
|
246 |
return status; |
247 |
} |
248 |
|
249 |
|
250 |
int read_client_conf_stdin (struct interface_info *ip, |
251 |
struct client_config *client) |
252 |
{ |
253 |
int file = fileno(stdin); |
254 |
isc_result_t status; |
255 |
|
256 |
if (isatty(file)) return ISC_R_NOTFOUND; |
257 |
status = read_client_conf_actual(file, "stdin", ip, client); |
258 |
|
259 |
return status; |
260 |
} |
233 |
|
261 |
|
234 |
/* lease-file :== client-lease-statements END_OF_FILE |
262 |
/* lease-file :== client-lease-statements END_OF_FILE |
235 |
client-lease-statements :== <nil> |
263 |
client-lease-statements :== <nil> |