blob: b13fa72d330fba5e890d48abf8fc2728cc1f3bc6 [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 {
Eric Andersenad953732004-01-30 23:45:53 +00007 uint8_t chaddr[16];
8 uint32_t yiaddr; /* network order */
9 uint32_t expires; /* host order */
Russ Dill61fb4892002-10-14 21:41:28 +000010};
11
Eric Andersenad953732004-01-30 23:45:53 +000012extern uint8_t blank_chaddr[];
Russ Dill61fb4892002-10-14 21:41:28 +000013
Eric Andersenad953732004-01-30 23:45:53 +000014void clear_lease(uint8_t *chaddr, uint32_t yiaddr);
15struct dhcpOfferedAddr *add_lease(uint8_t *chaddr, uint32_t yiaddr, unsigned long lease);
Russ Dill61fb4892002-10-14 21:41:28 +000016int lease_expired(struct dhcpOfferedAddr *lease);
17struct dhcpOfferedAddr *oldest_expired_lease(void);
Eric Andersenad953732004-01-30 23:45:53 +000018struct dhcpOfferedAddr *find_lease_by_chaddr(uint8_t *chaddr);
19struct dhcpOfferedAddr *find_lease_by_yiaddr(uint32_t yiaddr);
20uint32_t find_address(int check_expired);
Russ Dill61fb4892002-10-14 21:41:28 +000021
22
23#endif