Added debugging.
authorMichael Brown <mcb30@etherboot.org>
Sat, 30 Apr 2005 14:41:37 +0000 (14:41 +0000)
committerMichael Brown <mcb30@etherboot.org>
Sat, 30 Apr 2005 14:41:37 +0000 (14:41 +0000)
src/core/resolv.c
src/include/resolv.h

index 24483b8..0737294 100644 (file)
@@ -12,14 +12,20 @@ int resolv ( struct in_addr *address, const char *name ) {
        struct resolver *resolver;
 
        /* Check for a dotted quad IP address first */
-       if ( inet_aton ( name, address ) )
+       if ( inet_aton ( name, address ) ) {
+               DBG ( "RESOLV saw valid IP address %s\n", name );
                return 1;
+       }
 
        /* Try any compiled-in name resolution modules */
        for ( resolver = resolvers ; resolver < resolvers_end ; resolver++ ) {
-               if ( resolver->resolv ( address, name ) )
+               if ( resolver->resolv ( address, name ) ) {
+                       DBG ( "RESOLV resolved \"%s\" to %@ using %s\n",
+                             name, address->s_addr, resolver->name );
                        return 1;
+               }
        }
 
+       DBG ( "RESOLV failed to resolve %s\n", name );
        return 0;
 }
index 99e3b29..1ca8a58 100644 (file)
@@ -5,6 +5,7 @@
 #include "tables.h"
 
 struct resolver {
+       const char *name;
        int ( * resolv ) ( struct in_addr *address, const char *name );
 };