blob: bc50f68de570eb94c41f67151a64424e8d200450 [file] [log] [blame]
Russ Dill61fb4892002-10-14 21:41:28 +00001/* leases.h */
2#ifndef _LEASES_H
3#define _LEASES_H
4
5
6struct dhcpOfferedAddr {
7 u_int8_t chaddr[16];
8 u_int32_t yiaddr; /* network order */
9 u_int32_t expires; /* host order */
10};
11
12extern unsigned char blank_chaddr[];
13
14void clear_lease(u_int8_t *chaddr, u_int32_t yiaddr);
15struct dhcpOfferedAddr *add_lease(u_int8_t *chaddr, u_int32_t yiaddr, unsigned long lease);
16int lease_expired(struct dhcpOfferedAddr *lease);
17struct dhcpOfferedAddr *oldest_expired_lease(void);
18struct dhcpOfferedAddr *find_lease_by_chaddr(u_int8_t *chaddr);
19struct dhcpOfferedAddr *find_lease_by_yiaddr(u_int32_t yiaddr);
20u_int32_t find_address(int check_expired);
21int check_ip(u_int32_t addr);
22
23
24#endif