dhcp: merge leases.c and static_leases.c into dhcpd.c

function                                             old     new   delta
send_offer                                           292     461    +169
udhcpd_main                                         1531    1588     +57
read_leases                                          330     332      +2
add_lease                                            314     312      -2
find_lease_by_mac                                     68       -     -68
find_free_or_expired_nip                             174       -    -174
------------------------------------------------------------------------------
(add/remove: 0/4 grow/shrink: 3/1 up/down: 228/-244)          Total: -16 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2016-10-04 00:51:38 +02:00
parent d2ae66cb3e
commit a85740c8af
6 changed files with 219 additions and 253 deletions

View File

@@ -90,20 +90,6 @@ struct dyn_lease {
/* total size is a multiply of 4 */
} PACKED;
extern struct dyn_lease *g_leases;
struct dyn_lease *add_lease(
const uint8_t *chaddr, uint32_t yiaddr,
leasetime_t leasetime,
const char *hostname, int hostname_len
) FAST_FUNC;
int is_expired_lease(struct dyn_lease *lease) FAST_FUNC;
struct dyn_lease *find_lease_by_mac(const uint8_t *mac) FAST_FUNC;
struct dyn_lease *find_lease_by_nip(uint32_t nip) FAST_FUNC;
uint32_t find_free_or_expired_nip(const uint8_t *safe_mac, unsigned arpping_ms) FAST_FUNC;
int is_nip_reserved(struct static_lease *st_lease, uint32_t nip) FAST_FUNC;
POP_SAVED_FUNCTION_VISIBILITY
#endif