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