blob: 8dba65e29ccd795e3d09b861308ab9e7a96f24bc [file] [log] [blame]
"Robert P. J. Day"63fc1a92006-07-02 19:47:05 +00001/* vi: set sw=4 ts=4: */
Mike Frysinger7031f622006-05-08 03:20:50 +00002/* leases.h */
3#ifndef _LEASES_H
4#define _LEASES_H
5
6
7struct dhcpOfferedAddr {
8 uint8_t chaddr[16];
9 uint32_t yiaddr; /* network order */
10 uint32_t expires; /* host order */
11};
12
13extern uint8_t blank_chaddr[];
14
15void clear_lease(uint8_t *chaddr, uint32_t yiaddr);
16struct dhcpOfferedAddr *add_lease(uint8_t *chaddr, uint32_t yiaddr, unsigned long lease);
17int lease_expired(struct dhcpOfferedAddr *lease);
18struct dhcpOfferedAddr *oldest_expired_lease(void);
19struct dhcpOfferedAddr *find_lease_by_chaddr(uint8_t *chaddr);
20struct dhcpOfferedAddr *find_lease_by_yiaddr(uint32_t yiaddr);
21uint32_t find_address(int check_expired);
22
23
24#endif