Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 1 | /* leases.h */ |
| 2 | #ifndef _LEASES_H |
| 3 | #define _LEASES_H |
| 4 | |
| 5 | |
| 6 | struct 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 McGrath | 2483343 | 2003-06-10 17:22:49 +0000 | [diff] [blame] | 12 | extern const char leases_file[]; |
| 13 | |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 14 | extern unsigned char blank_chaddr[]; |
| 15 | |
| 16 | void clear_lease(u_int8_t *chaddr, u_int32_t yiaddr); |
| 17 | struct dhcpOfferedAddr *add_lease(u_int8_t *chaddr, u_int32_t yiaddr, unsigned long lease); |
| 18 | int lease_expired(struct dhcpOfferedAddr *lease); |
| 19 | struct dhcpOfferedAddr *oldest_expired_lease(void); |
| 20 | struct dhcpOfferedAddr *find_lease_by_chaddr(u_int8_t *chaddr); |
| 21 | struct dhcpOfferedAddr *find_lease_by_yiaddr(u_int32_t yiaddr); |
| 22 | u_int32_t find_address(int check_expired); |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 23 | |
| 24 | |
| 25 | #endif |