summaryrefslogtreecommitdiff
path: root/networking/udhcp/files.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-11-18 19:51:32 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-11-18 19:51:32 +0000
commit5a3395bc01cd4b11309595a6ecdaf32f8279f378 (patch)
tree1e63aa591a05e9ec75aefdcd639ca4188e583648 /networking/udhcp/files.c
parentabfc4cf6d8b9c59724aceb70df5081a1368fdb62 (diff)
downloadbusybox-w32-5a3395bc01cd4b11309595a6ecdaf32f8279f378.tar.gz
busybox-w32-5a3395bc01cd4b11309595a6ecdaf32f8279f378.tar.bz2
busybox-w32-5a3395bc01cd4b11309595a6ecdaf32f8279f378.zip
udhcp: fix indentation and style.
Eliminate (group) a lot of smallish *.h files Remove lots of unneeded #includes
Diffstat (limited to 'networking/udhcp/files.c')
-rw-r--r--networking/udhcp/files.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/networking/udhcp/files.c b/networking/udhcp/files.c
index 36bcc31d9..317e861c0 100644
--- a/networking/udhcp/files.c
+++ b/networking/udhcp/files.c
@@ -4,21 +4,12 @@
4 * Rewrite by Russ Dill <Russ.Dill@asu.edu> July 2001 4 * Rewrite by Russ Dill <Russ.Dill@asu.edu> July 2001
5 */ 5 */
6 6
7#include <sys/socket.h>
8#include <arpa/inet.h>
9#include <string.h>
10#include <stdlib.h>
11#include <time.h>
12#include <ctype.h>
13#include <netdb.h>
14
15#include <netinet/ether.h> 7#include <netinet/ether.h>
16#include "static_leases.h"
17 8
9#include "common.h"
18#include "dhcpd.h" 10#include "dhcpd.h"
19#include "options.h" 11#include "options.h"
20#include "files.h" 12
21#include "common.h"
22 13
23/* 14/*
24 * Domain names may have 254 chars, and string options can be 254 15 * Domain names may have 254 chars, and string options can be 254
@@ -51,7 +42,7 @@ static int read_mac(const char *line, void *arg)
51 42
52 temp_ether_addr = ether_aton(line); 43 temp_ether_addr = ether_aton(line);
53 44
54 if(temp_ether_addr == NULL) 45 if (temp_ether_addr == NULL)
55 retval = 0; 46 retval = 0;
56 else 47 else
57 memcpy(mac_bytes, temp_ether_addr, 6); 48 memcpy(mac_bytes, temp_ether_addr, 6);
@@ -217,7 +208,6 @@ static int read_opt(const char *const_line, void *arg)
217 208
218static int read_staticlease(const char *const_line, void *arg) 209static int read_staticlease(const char *const_line, void *arg)
219{ 210{
220
221 char *line; 211 char *line;
222 char *mac_string; 212 char *mac_string;
223 char *ip_string; 213 char *ip_string;
@@ -243,7 +233,6 @@ static int read_staticlease(const char *const_line, void *arg)
243 if (ENABLE_FEATURE_UDHCP_DEBUG) printStaticLeases(arg); 233 if (ENABLE_FEATURE_UDHCP_DEBUG) printStaticLeases(arg);
244 234
245 return 1; 235 return 1;
246
247} 236}
248 237
249 238
@@ -308,9 +297,9 @@ int read_config(const char *file)
308 for (i = 0; keywords[i].keyword[0]; i++) 297 for (i = 0; keywords[i].keyword[0]; i++)
309 if (!strcasecmp(token, keywords[i].keyword)) 298 if (!strcasecmp(token, keywords[i].keyword))
310 if (!keywords[i].handler(line, keywords[i].var)) { 299 if (!keywords[i].handler(line, keywords[i].var)) {
311 bb_error_msg("failure parsing line %d of %s", lm, file); 300 bb_error_msg("cannot parse line %d of %s", lm, file);
312 if (ENABLE_FEATURE_UDHCP_DEBUG) 301 if (ENABLE_FEATURE_UDHCP_DEBUG)
313 bb_error_msg("unable to parse '%s'", debug_orig); 302 bb_error_msg("cannot parse '%s'", debug_orig);
314 /* reset back to the default value */ 303 /* reset back to the default value */
315 keywords[i].handler(keywords[i].def, keywords[i].var); 304 keywords[i].handler(keywords[i].def, keywords[i].var);
316 } 305 }