blob: d54cd11cc4d475084b0b97cb76d7db3bc39e4784 [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
Glenn L McGrath24833432003-06-10 17:22:49 +000012extern const char leases_file[];
13
Russ Dill61fb4892002-10-14 21:41:28 +000014extern unsigned char blank_chaddr[];
15
16void clear_lease(u_int8_t *chaddr, u_int32_t yiaddr);
17struct dhcpOfferedAddr *add_lease(u_int8_t *chaddr, u_int32_t yiaddr, unsigned long lease);
18int lease_expired(struct dhcpOfferedAddr *lease);
19struct dhcpOfferedAddr *oldest_expired_lease(void);
20struct dhcpOfferedAddr *find_lease_by_chaddr(u_int8_t *chaddr);
21struct dhcpOfferedAddr *find_lease_by_yiaddr(u_int32_t yiaddr);
22u_int32_t find_address(int check_expired);
Russ Dill61fb4892002-10-14 21:41:28 +000023
24
25#endif