summaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-04-11 16:14:55 +0000
committerRoy Marples <roy@marples.name>2008-04-11 16:14:55 +0000
commit1a60d14fa2f91876b9ec14d6e6c88d97dacf6c4c (patch)
tree9e992f64d969ddef2e7d3836afa0d4065f69706a /common.h
parent211da073490c5decd1deb46034385437a54ca977 (diff)
downloaddhcpcd-1a60d14fa2f91876b9ec14d6e6c88d97dacf6c4c.tar.xz
Normally I hate massive code drops, but heh.
The code has been drastically re-arranged. Instead of populating a custom structure while parsing dhcp messages, we now pluck what we need right out of the message itself. We have custom functions and a lookup table to make this really easy. This makes us more like dhclient and udhcpc, and will enable us to easily add (and remove!) more dhcp options without having to actually change the code (much). We now store the real dhcp message we got in /var/db/dhcpcd-$iface.lease, the mtime of the file being used as when we got the lease. This file is read in when re-using an old lease instead of parsing the .info file. The benefit of all of this means that we're actually ~15k smaller when compiled with the same features. This has been tested for quite some time, and I'm pretty sure most bugs with the 3.2 branch have been fixed whilst making this. Right now, we are 99% command line compatible with the 3.2 branch.
Diffstat (limited to 'common.h')
-rw-r--r--common.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/common.h b/common.h
index f5b93ae4..8689cf1e 100644
--- a/common.h
+++ b/common.h
@@ -29,6 +29,7 @@
#define COMMON_H
/* string.h pulls in features.h so the below define checks work */
+#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
#include <string.h>
@@ -59,7 +60,7 @@ int close_on_exec(int);
ssize_t get_line(char **, size_t *, FILE *);
int get_time(struct timeval *);
time_t uptime(void);
-void writepid(int, pid_t);
+int writepid(int, pid_t);
void *xrealloc(void *, size_t);
void *xmalloc(size_t);
void *xzalloc(size_t);