X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=udhcp%2Fstatic_leases.h;fp=udhcp%2Fstatic_leases.h;h=d06520b232a5d4938eddf8871767d07e81586aba;hb=d0c93c365e33f6970a0417dff7009a4a4fe2a3b1;hp=0000000000000000000000000000000000000000;hpb=184a9d3153e3fae4fa1ea20a186c12e9c0a83db2;p=grml-terminalserver.git diff --git a/udhcp/static_leases.h b/udhcp/static_leases.h new file mode 100644 index 0000000..d06520b --- /dev/null +++ b/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 + + +