summaryrefslogtreecommitdiff
path: root/networking/udhcp/static_leases.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/static_leases.c')
-rw-r--r--networking/udhcp/static_leases.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/networking/udhcp/static_leases.c b/networking/udhcp/static_leases.c
index b7f9e5c..3be7a52 100644
--- a/networking/udhcp/static_leases.c
+++ b/networking/udhcp/static_leases.c
@@ -9,39 +9,6 @@
#include "common.h"
#include "dhcpd.h"
-/* Takes the address of the pointer to the static_leases linked list,
- * address to a 6 byte mac address,
- * 4 byte IP address */
-void FAST_FUNC add_static_lease(struct static_lease **st_lease_pp,
- uint8_t *mac,
- uint32_t nip)
-{
- struct static_lease *st_lease;
-
- /* Find the tail of the list */
- while ((st_lease = *st_lease_pp) != NULL) {
- st_lease_pp = &st_lease->next;
- }
-
- /* Add new node */
- *st_lease_pp = st_lease = xzalloc(sizeof(*st_lease));
- memcpy(st_lease->mac, mac, 6);
- st_lease->nip = nip;
- /*st_lease->next = NULL;*/
-}
-
-/* Find static lease IP by mac */
-uint32_t FAST_FUNC get_static_nip_by_mac(struct static_lease *st_lease, void *mac)
-{
- while (st_lease) {
- if (memcmp(st_lease->mac, mac, 6) == 0)
- return st_lease->nip;
- st_lease = st_lease->next;
- }
-
- return 0;
-}
-
/* Check to see if an IP is reserved as a static IP */
int FAST_FUNC is_nip_reserved(struct static_lease *st_lease, uint32_t nip)
{
@@ -53,25 +20,3 @@ int FAST_FUNC is_nip_reserved(struct static_lease *st_lease, uint32_t nip)
return 0;
}
-
-#if defined CONFIG_UDHCP_DEBUG && CONFIG_UDHCP_DEBUG >= 2
-/* Print out static leases just to check what's going on */
-/* Takes the address of the pointer to the static_leases linked list */
-void FAST_FUNC log_static_leases(struct static_lease **st_lease_pp)
-{
- struct static_lease *cur;
-
- if (dhcp_verbose < 2)
- return;
-
- cur = *st_lease_pp;
- while (cur) {
- bb_error_msg("static lease: mac:%02x:%02x:%02x:%02x:%02x:%02x nip:%x",
- cur->mac[0], cur->mac[1], cur->mac[2],
- cur->mac[3], cur->mac[4], cur->mac[5],
- cur->nip
- );
- cur = cur->next;
- }
-}
-#endif