udhcpc: tweak help text
[oweals/busybox.git] / networking / udhcp / static_leases.c
index 7d1aa2f27e427036b01e1453fd76b7a9815a7562..f4a24ab627a955180f6d385dedb58b424fc42de5 100644 (file)
@@ -1,17 +1,14 @@
 /* vi: set sw=4 ts=4: */
 /*
- * static_leases.c -- Couple of functions to assist with storing and
- * retrieving data for static leases
+ * Storing and retrieving data for static leases
  *
  * Wade Berrier <wberrier@myrealbox.com> September 2004
  *
- * Licensed under GPLv2, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2, see file LICENSE in this source tree.
  */
-
 #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 */
@@ -57,19 +54,23 @@ int FAST_FUNC is_nip_reserved(struct static_lease *st_lease, uint32_t nip)
        return 0;
 }
 
-#if ENABLE_UDHCP_DEBUG
+#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 print_static_leases(struct static_lease **st_lease_pp)
+void FAST_FUNC log_static_leases(struct static_lease **st_lease_pp)
 {
-       struct static_lease *cur = *st_lease_pp;
+       struct static_lease *cur;
+
+       if (dhcp_verbose < 2)
+               return;
 
+       cur = *st_lease_pp;
        while (cur) {
-               printf("PrintStaticLeases: lease mac: %02x:%02x:%02x:%02x:%02x:%02x\n",
+               bb_info_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->mac[3], cur->mac[4], cur->mac[5],
+                       cur->nip
                );
-               printf("PrintStaticLeases: lease ip: %x\n", cur->nip);
                cur = cur->next;
        }
 }