aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/static_leases.h
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-10-08 08:49:26 +0000
committerEric Andersen <andersen@codepoet.org>2004-10-08 08:49:26 +0000
commitabf58d6ba5df9bbe04c4c7008cbbc8c7dc626392 (patch)
treec64a5328d250449c9a4e3964d59a657543e06440 /networking/udhcp/static_leases.h
parent751750e3ee0195eef802a1554e97712285bf8fd7 (diff)
downloadbusybox-abf58d6ba5df9bbe04c4c7008cbbc8c7dc626392.tar.gz
Wade Berrier writes:
Hello, Here's a patch for a first attempt at static leases for udhcpd. Included in the tarball are 2 files (static_leases.c, static_leases.h) and a patch against the latest cvs. In the config file you can configure static leases with the following format: static_lease 00:60:08:11:CE:4E 192.168.0.54 static_lease 00:60:08:11:CE:3E 192.168.0.44 Comments/suggestions/improvements are welcome. Wade
Diffstat (limited to 'networking/udhcp/static_leases.h')
-rw-r--r--networking/udhcp/static_leases.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/networking/udhcp/static_leases.h b/networking/udhcp/static_leases.h
new file mode 100644
index 000000000..d06520b23
--- /dev/null
+++ b/networking/udhcp/static_leases.h
@@ -0,0 +1,25 @@
+/* static_leases.h */
+#ifndef _STATIC_LEASES_H
+#define _STATIC_LEASES_H
+
+#include "dhcpd.h"
+
+/* Config file will pass static lease info to this function which will add it
+ * to a data structure that can be searched later */
+int addStaticLease(struct static_lease **lease_struct, uint8_t *mac, uint32_t *ip);
+
+/* Check to see if a mac has an associated static lease */
+uint32_t getIpByMac(struct static_lease *lease_struct, void *arg);
+
+/* Check to see if an ip is reserved as a static ip */
+uint32_t reservedIp(struct static_lease *lease_struct, uint32_t ip);
+
+#ifdef UDHCP_DEBUG
+/* Print out static leases just to check what's going on */
+void printStaticLeases(struct static_lease **lease_struct);
+#endif
+
+#endif
+
+
+