#include <glib.h>
#include "host_addr.h"
Go to the source code of this file.
Typedefs | |
typedef void(* | adns_callback_t )(const host_addr_t *, gpointer) |
typedef void(* | adns_reverse_callback_t )(const gchar *, gpointer) |
Functions | |
void | adns_init (void) |
Initializes the adns helper i.e., fork()s a child process which will be used to resolve hostnames asynchronously. | |
gboolean | adns_resolve (const gchar *, adns_callback_t, gpointer) |
Creates a DNS resolve query for ``hostname''. | |
gboolean | adns_reverse_lookup (const host_addr_t, adns_reverse_callback_t, gpointer) |
Creates a DNS reverse lookup query for ``addr''. | |
void | adns_close (void) |
Removes the callback and frees the cache. |
|
|
|
|
|
Removes the callback and frees the cache.
|
|
Initializes the adns helper i.e., fork()s a child process which will be used to resolve hostnames asynchronously.
|
|
Creates a DNS resolve query for ``hostname''. The given function ``user_callback'' (which MUST NOT be NULL) will be invoked with the resolved IP address and ``user_data'' as its parameters. The IP address 0.0.0.0 i.e., ``(guint32) 0'' is used to indicate a failure. In case the hostname is given as an IP string, it will be directly converted and the callback immediately invoked. If the adns helper process is ``out of service'' the query will be resolved synchronously.
|
|
Creates a DNS reverse lookup query for ``addr''. The given function ``user_callback'' (which MUST NOT be NULL) will be invoked with the resolved hostname and ``user_data'' as its parameters. If the lookup failed, the callback will be invoked with ``hostname'' NULL. If the adns helper process is ``out of service'' the query will be processed synchronously.
|