aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/files.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-06-16 10:25:35 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-06-16 10:25:35 +0200
commit56f2d06c6496e49d7e752d1ee5ac5ea420b4ed11 (patch)
tree2f972e9026ee995e1ebe146b05e608af3b2785ee /networking/udhcp/files.c
parent990a617edfd9040594c0889d2dd23eb7ef91c695 (diff)
downloadbusybox-w32-56f2d06c6496e49d7e752d1ee5ac5ea420b4ed11.tar.gz
busybox-w32-56f2d06c6496e49d7e752d1ee5ac5ea420b4ed11.tar.bz2
busybox-w32-56f2d06c6496e49d7e752d1ee5ac5ea420b4ed11.zip
udhcp: rename sprintip to sprint_nip, siaddr to siaddr_nip
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/files.c')
-rw-r--r--networking/udhcp/files.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/networking/udhcp/files.c b/networking/udhcp/files.c
index 671ea94c9..a69a7531b 100644
--- a/networking/udhcp/files.c
+++ b/networking/udhcp/files.c
@@ -24,7 +24,7 @@ static inline uint64_t hton64(uint64_t v)
24 24
25 25
26/* on these functions, make sure your datatype matches */ 26/* on these functions, make sure your datatype matches */
27static int FAST_FUNC read_ip(const char *line, void *arg) 27static int FAST_FUNC read_nip(const char *line, void *arg)
28{ 28{
29 len_and_sockaddr *lsa; 29 len_and_sockaddr *lsa;
30 30
@@ -187,15 +187,15 @@ static int FAST_FUNC read_opt(const char *const_line, void *arg)
187 opt = buffer; /* new meaning for variable opt */ 187 opt = buffer; /* new meaning for variable opt */
188 switch (option->flags & TYPE_MASK) { 188 switch (option->flags & TYPE_MASK) {
189 case OPTION_IP: 189 case OPTION_IP:
190 retval = read_ip(val, buffer); 190 retval = read_nip(val, buffer);
191 break; 191 break;
192 case OPTION_IP_PAIR: 192 case OPTION_IP_PAIR:
193 retval = read_ip(val, buffer); 193 retval = read_nip(val, buffer);
194 val = strtok(NULL, ", \t/-"); 194 val = strtok(NULL, ", \t/-");
195 if (!val) 195 if (!val)
196 retval = 0; 196 retval = 0;
197 if (retval) 197 if (retval)
198 retval = read_ip(val, buffer + 4); 198 retval = read_nip(val, buffer + 4);
199 break; 199 break;
200 case OPTION_STRING: 200 case OPTION_STRING:
201#if ENABLE_FEATURE_UDHCP_RFC3397 201#if ENABLE_FEATURE_UDHCP_RFC3397
@@ -266,7 +266,7 @@ static int FAST_FUNC read_staticlease(const char *const_line, void *arg)
266 266
267 /* Read ip */ 267 /* Read ip */
268 ip_string = strtok_r(NULL, " \t", &line); 268 ip_string = strtok_r(NULL, " \t", &line);
269 read_ip(ip_string, &ip); 269 read_nip(ip_string, &ip);
270 270
271 addStaticLease(arg, (uint8_t*) &mac_bytes, ip); 271 addStaticLease(arg, (uint8_t*) &mac_bytes, ip);
272 272
@@ -285,13 +285,12 @@ struct config_keyword {
285 285
286static const struct config_keyword keywords[] = { 286static const struct config_keyword keywords[] = {
287 /* keyword handler variable address default */ 287 /* keyword handler variable address default */
288 {"start", read_ip, &(server_config.start_ip), "192.168.0.20"}, 288 {"start", read_nip, &(server_config.start_ip), "192.168.0.20"},
289 {"end", read_ip, &(server_config.end_ip), "192.168.0.254"}, 289 {"end", read_nip, &(server_config.end_ip), "192.168.0.254"},
290 {"interface", read_str, &(server_config.interface), "eth0"}, 290 {"interface", read_str, &(server_config.interface), "eth0"},
291 /* Avoid "max_leases value not sane" warning by setting default 291 /* Avoid "max_leases value not sane" warning by setting default
292 * to default_end_ip - default_start_ip + 1: */ 292 * to default_end_ip - default_start_ip + 1: */
293 {"max_leases", read_u32, &(server_config.max_leases), "235"}, 293 {"max_leases", read_u32, &(server_config.max_leases), "235"},
294// {"remaining", read_yn, &(server_config.remaining), "yes"},
295 {"auto_time", read_u32, &(server_config.auto_time), "7200"}, 294 {"auto_time", read_u32, &(server_config.auto_time), "7200"},
296 {"decline_time", read_u32, &(server_config.decline_time), "3600"}, 295 {"decline_time", read_u32, &(server_config.decline_time), "3600"},
297 {"conflict_time",read_u32, &(server_config.conflict_time),"3600"}, 296 {"conflict_time",read_u32, &(server_config.conflict_time),"3600"},
@@ -299,7 +298,7 @@ static const struct config_keyword keywords[] = {
299 {"min_lease", read_u32, &(server_config.min_lease), "60"}, 298 {"min_lease", read_u32, &(server_config.min_lease), "60"},
300 {"lease_file", read_str, &(server_config.lease_file), LEASES_FILE}, 299 {"lease_file", read_str, &(server_config.lease_file), LEASES_FILE},
301 {"pidfile", read_str, &(server_config.pidfile), "/var/run/udhcpd.pid"}, 300 {"pidfile", read_str, &(server_config.pidfile), "/var/run/udhcpd.pid"},
302 {"siaddr", read_ip, &(server_config.siaddr), "0.0.0.0"}, 301 {"siaddr", read_nip, &(server_config.siaddr_nip), "0.0.0.0"},
303 /* keywords with no defaults must be last! */ 302 /* keywords with no defaults must be last! */
304 {"option", read_opt, &(server_config.options), ""}, 303 {"option", read_opt, &(server_config.options), ""},
305 {"opt", read_opt, &(server_config.options), ""}, 304 {"opt", read_opt, &(server_config.options), ""},