Lines Matching refs:lease
21 /* clear every lease out that chaddr OR yiaddr matches and is nonzero */
36 /* add a lease into the table, clearing out any old ones */
37 struct dhcpOfferedAddr *add_lease(u_int8_t *chaddr, u_int32_t yiaddr, unsigned long lease)
49 oldest->expires = time(0) + lease;
56 /* true if a lease has expired */
57 int lease_expired(struct dhcpOfferedAddr *lease)
59 return (lease->expires < (unsigned long) time(0));
63 /* Find the oldest expired lease, NULL if there are no expired leases */
81 /* Find the first lease that matches chaddr, NULL if no match */
93 /* Find the first lease that matches yiaddr, NULL is no match */
108 struct dhcpOfferedAddr *lease = NULL;
142 /* lease is not taken */
144 if ((!(lease = find_lease_by_yiaddr(ret)) ||
147 (check_expired && lease_expired(lease))) &&
163 struct dhcpOfferedAddr *lease = NULL;
174 /* lease is not taken */
176 if ((!(lease = find_lease_by_yiaddr(ret)) ||
179 (check_expired && lease_expired(lease))) &&
191 /* check is an IP is taken, if it is, add it to the lease table */