mirror of
https://github.com/xcat2/xNBA.git
synced 2025-01-18 21:43:14 +00:00
Added debugging.
This commit is contained in:
parent
6cd0fa5807
commit
1644238813
@ -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;
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "tables.h"
|
||||
|
||||
struct resolver {
|
||||
const char *name;
|
||||
int ( * resolv ) ( struct in_addr *address, const char *name );
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user