summaryrefslogtreecommitdiff
path: root/networking/udhcp
diff options
context:
space:
mode:
authorTim Riker2006-01-25 00:08:53 +0000
committerTim Riker2006-01-25 00:08:53 +0000
commitc1ef7bdd8d002ae0889efcf883d0e1b7faa938d4 (patch)
tree5f329b7d0c7f20ecced0dc7581a9ba6dc720d965 /networking/udhcp
parentf64ff682a3d58dbb627e760e6fe1ec21d9ccdf61 (diff)
downloadbusybox-c1ef7bdd8d002ae0889efcf883d0e1b7faa938d4.zip
busybox-c1ef7bdd8d002ae0889efcf883d0e1b7faa938d4.tar.gz
just whitespace
Diffstat (limited to 'networking/udhcp')
-rw-r--r--networking/udhcp/arpping.c6
-rw-r--r--networking/udhcp/clientpacket.c4
-rw-r--r--networking/udhcp/common.h2
-rw-r--r--networking/udhcp/dhcpc.c6
-rw-r--r--networking/udhcp/dhcpd.c2
-rw-r--r--networking/udhcp/dhcpd.h22
-rw-r--r--networking/udhcp/files.c2
-rw-r--r--networking/udhcp/leases.c2
-rw-r--r--networking/udhcp/libbb_udhcp.h20
-rw-r--r--networking/udhcp/options.c4
-rw-r--r--networking/udhcp/packet.c8
-rw-r--r--networking/udhcp/script.c2
-rw-r--r--networking/udhcp/serverpacket.c4
13 files changed, 42 insertions, 42 deletions
diff --git a/networking/udhcp/arpping.c b/networking/udhcp/arpping.c
index 7cc2be4..4831d43 100644
--- a/networking/udhcp/arpping.c
+++ b/networking/udhcp/arpping.c
@@ -23,7 +23,7 @@
* ip - our ip
* mac - our arp address
* interface - interface to use
- * retn: 1 addr free
+ * retn: 1 addr free
* 0 addr used
* -1 error
*/
@@ -33,7 +33,7 @@ int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *mac, char *interface)
{
int timeout = 2;
- int optval = 1;
+ int optval = 1;
int s; /* socket */
int rv = 1; /* return value */
struct sockaddr addr; /* for interface name */
@@ -101,6 +101,6 @@ int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *mac, char *interface)
prevTime = uptime();
}
close(s);
- DEBUG(LOG_INFO, "%salid arp replies for this address", rv ? "No v" : "V");
+ DEBUG(LOG_INFO, "%salid arp replies for this address", rv ? "No v" : "V");
return rv;
}
diff --git a/networking/udhcp/clientpacket.c b/networking/udhcp/clientpacket.c
index 528befd..e377bd2 100644
--- a/networking/udhcp/clientpacket.c
+++ b/networking/udhcp/clientpacket.c
@@ -205,8 +205,8 @@ int get_raw_packet(struct dhcpMessage *payload, int fd)
packet.ip.ihl != sizeof(packet.ip) >> 2 || packet.udp.dest != htons(CLIENT_PORT) ||
bytes > (int) sizeof(struct udp_dhcp_packet) ||
ntohs(packet.udp.len) != (uint16_t) (bytes - sizeof(packet.ip))) {
- DEBUG(LOG_INFO, "unrelated/bogus packet");
- return -2;
+ DEBUG(LOG_INFO, "unrelated/bogus packet");
+ return -2;
}
/* check IP checksum */
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h
index efa8fd4..071a5c4 100644
--- a/networking/udhcp/common.h
+++ b/networking/udhcp/common.h
@@ -43,7 +43,7 @@ long uptime(void);
void background(const char *pidfile);
void start_log_and_pid(const char *client_server, const char *pidfile);
void udhcp_logging(int level, const char *fmt, ...);
-
+
#define LOG(level, str, args...) udhcp_logging(level, str, ## args)
#ifdef UDHCP_DEBUG
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index c4277e3..a4afb0c 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -196,7 +196,7 @@ int main(int argc, char *argv[])
{"hostname", required_argument, 0, 'h'},
{"fqdn", required_argument, 0, 'F'},
{"interface", required_argument, 0, 'i'},
- {"now", no_argument, 0, 'n'},
+ {"now", no_argument, 0, 'n'},
{"pidfile", required_argument, 0, 'p'},
{"quit", no_argument, 0, 'q'},
{"request", required_argument, 0, 'r'},
@@ -314,7 +314,7 @@ int main(int argc, char *argv[])
client_config.vendorclass[OPT_CODE] = DHCP_VENDOR;
client_config.vendorclass[OPT_LEN] = sizeof("udhcp "VERSION) - 1;
client_config.vendorclass[OPT_DATA] = 1;
- memcpy(&client_config.vendorclass[OPT_DATA],
+ memcpy(&client_config.vendorclass[OPT_DATA],
"udhcp "VERSION, sizeof("udhcp "VERSION) - 1);
}
@@ -370,7 +370,7 @@ int main(int argc, char *argv[])
} else if (client_config.abort_if_no_lease) {
LOG(LOG_INFO, "No lease, failing.");
return 1;
- }
+ }
/* wait to try again */
packet_num = 0;
timeout = now + 60;
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c
index 2812e6e..0dfc0b5 100644
--- a/networking/udhcp/dhcpd.c
+++ b/networking/udhcp/dhcpd.c
@@ -193,7 +193,7 @@ int main(int argc, char *argv[])
LOG(LOG_ERR, "send OFFER failed");
}
break;
- case DHCPREQUEST:
+ case DHCPREQUEST:
DEBUG(LOG_INFO, "received REQUEST");
requested = get_option(&packet, DHCP_REQUESTED_IP);
diff --git a/networking/udhcp/dhcpd.h b/networking/udhcp/dhcpd.h
index 65c8348..a060002 100644
--- a/networking/udhcp/dhcpd.h
+++ b/networking/udhcp/dhcpd.h
@@ -108,23 +108,23 @@ struct static_lease {
struct server_config_t {
uint32_t server; /* Our IP, in network order */
- uint32_t start; /* Start address of leases, network order */
+ uint32_t start; /* Start address of leases, network order */
uint32_t end; /* End of leases, network order */
struct option_set *options; /* List of DHCP options loaded from the config file */
char *interface; /* The name of the interface to use */
int ifindex; /* Index number of the interface to use */
- uint8_t arp[6]; /* Our arp address */
+ uint8_t arp[6]; /* Our arp address */
unsigned long lease; /* lease time in seconds (host order) */
- unsigned long max_leases; /* maximum number of leases (including reserved address) */
- char remaining; /* should the lease file be interpreted as lease time remaining, or
- * as the time the lease expires */
- unsigned long auto_time; /* how long should udhcpd wait before writing a config file.
+ unsigned long max_leases; /* maximum number of leases (including reserved address) */
+ char remaining; /* should the lease file be interpreted as lease time remaining, or
+ * as the time the lease expires */
+ unsigned long auto_time; /* how long should udhcpd wait before writing a config file.
* if this is zero, it will only write one on SIGUSR1 */
- unsigned long decline_time; /* how long an address is reserved if a client returns a
- * decline message */
- unsigned long conflict_time; /* how long an arp conflict offender is leased for */
- unsigned long offer_time; /* how long an offered address is reserved */
- unsigned long min_lease; /* minimum lease a client can request*/
+ unsigned long decline_time; /* how long an address is reserved if a client returns a
+ * decline message */
+ unsigned long conflict_time; /* how long an arp conflict offender is leased for */
+ unsigned long offer_time; /* how long an offered address is reserved */
+ unsigned long min_lease; /* minimum lease a client can request*/
char *lease_file;
char *pidfile;
char *notify_file; /* What to run whenever leases are written */
diff --git a/networking/udhcp/files.c b/networking/udhcp/files.c
index 40e68a0..01534f2 100644
--- a/networking/udhcp/files.c
+++ b/networking/udhcp/files.c
@@ -271,7 +271,7 @@ static const struct config_keyword keywords[] = {
{"boot_file", read_str, &(server_config.boot_file), ""},
{"static_lease",read_staticlease, &(server_config.static_leases), ""},
/*ADDME: static lease */
- {"", NULL, NULL, ""}
+ {"", NULL, NULL, ""}
};
diff --git a/networking/udhcp/leases.c b/networking/udhcp/leases.c
index 4da21a2..bb08c3a 100644
--- a/networking/udhcp/leases.c
+++ b/networking/udhcp/leases.c
@@ -148,7 +148,7 @@ uint32_t find_address(int check_expired)
(check_expired && lease_expired(lease))) &&
/* and it isn't on the network */
- !check_ip(ret)) {
+ !check_ip(ret)) {
return ret;
break;
}
diff --git a/networking/udhcp/libbb_udhcp.h b/networking/udhcp/libbb_udhcp.h
index 0dae401..30e167f 100644
--- a/networking/udhcp/libbb_udhcp.h
+++ b/networking/udhcp/libbb_udhcp.h
@@ -29,19 +29,19 @@
/* make safe the exported namespace */
/* from common.h */
-#define background udhcp_background
-#define start_log_and_pid udhcp_start_log_and_pid
+#define background udhcp_background
+#define start_log_and_pid udhcp_start_log_and_pid
/* from script.h */
-#define run_script udhcp_run_script
+#define run_script udhcp_run_script
/* from packet.h */
-#define init_header udhcp_init_header
-#define get_packet udhcp_get_packet
-#define checksum udhcp_checksum
-#define raw_packet udhcp_raw_packet
-#define kernel_packet udhcp_kernel_packet
+#define init_header udhcp_init_header
+#define get_packet udhcp_get_packet
+#define checksum udhcp_checksum
+#define raw_packet udhcp_raw_packet
+#define kernel_packet udhcp_kernel_packet
/* from pidfile.h */
-#define pidfile_acquire udhcp_pidfile_acquire
-#define pidfile_write_release udhcp_pidfile_write_release
+#define pidfile_acquire udhcp_pidfile_acquire
+#define pidfile_write_release udhcp_pidfile_write_release
/* from options.h */
#define get_option udhcp_get_option
#define end_option udhcp_end_option
diff --git a/networking/udhcp/options.c b/networking/udhcp/options.c
index 1443451..eebcaaa 100644
--- a/networking/udhcp/options.c
+++ b/networking/udhcp/options.c
@@ -154,11 +154,11 @@ int add_simple_option(uint8_t *optionptr, uint8_t code, uint32_t data)
for (dh=dhcp_options; dh->code; dh++) {
if (dh->code == code) {
uint8_t option[6], len;
-
+
option[OPT_CODE] = code;
len = option_lengths[dh->flags & TYPE_MASK];
option[OPT_LEN] = len;
- if (__BYTE_ORDER == __BIG_ENDIAN)
+ if (__BYTE_ORDER == __BIG_ENDIAN)
data <<= 8 * (4 - len);
/* This memcpy is for broken processors which can't
* handle a simple unaligned 32-bit assignment */
diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c
index 1c6bb0c..64a9100 100644
--- a/networking/udhcp/packet.c
+++ b/networking/udhcp/packet.c
@@ -71,13 +71,13 @@ int get_packet(struct dhcpMessage *packet, int fd)
for (i = 0; broken_vendors[i][0]; i++) {
if (vendor[OPT_LEN - 2] == (uint8_t) strlen(broken_vendors[i]) &&
!strncmp(vendor, broken_vendors[i], vendor[OPT_LEN - 2])) {
- DEBUG(LOG_INFO, "broken client (%s), forcing broadcast",
- broken_vendors[i]);
- packet->flags |= htons(BROADCAST_FLAG);
+ DEBUG(LOG_INFO, "broken client (%s), forcing broadcast",
+ broken_vendors[i]);
+ packet->flags |= htons(BROADCAST_FLAG);
}
}
}
-
+
return bytes;
}
diff --git a/networking/udhcp/script.c b/networking/udhcp/script.c
index c04c69f..b6b0e0d 100644
--- a/networking/udhcp/script.c
+++ b/networking/udhcp/script.c
@@ -97,7 +97,7 @@ static void fill_options(char *dest, uint8_t *option, struct dhcp_option *type_p
optlen = 4;
case OPTION_IP: /* Works regardless of host byte order. */
dest += sprintip(dest, "", option);
- break;
+ break;
case OPTION_BOOLEAN:
dest += sprintf(dest, *option ? "yes" : "no");
break;
diff --git a/networking/udhcp/serverpacket.c b/networking/udhcp/serverpacket.c
index c6a8209..1b89862 100644
--- a/networking/udhcp/serverpacket.c
+++ b/networking/udhcp/serverpacket.c
@@ -138,11 +138,11 @@ int sendOffer(struct dhcpMessage *oldpacket)
/* and the ip is in the lease range */
ntohl(req_align) >= ntohl(server_config.start) &&
ntohl(req_align) <= ntohl(server_config.end) &&
-
+
!static_lease_ip && /* Check that its not a static lease */
/* and is not already taken/offered */
((!(lease = find_lease_by_yiaddr(req_align)) ||
-
+
/* or its taken, but expired */ /* ADDME: or maybe in here */
lease_expired(lease)))) {
packet.yiaddr = req_align; /* FIXME: oh my, is there a host using this IP? */