dns-lookup.h revision 7d102c66eb1755e1894cf56e3594cd744e855238
#ifndef DNS_LOOKUP_H
#define DNS_LOOKUP_H
struct dns_lookup;
struct dns_lookup_settings {
const char *dns_client_socket_path;
unsigned int timeout_msecs;
};
struct dns_lookup_result {
/* all is ok if ret=0, otherwise it contains net_gethosterror()
compatible error code. error string is always set if ret != 0. */
int ret;
const char *error;
/* how many milliseconds the lookup took. */
unsigned int msecs;
unsigned int ips_count;
};
void *context);
/* Do asynchronous DNS lookup via dns-client UNIX socket. Returns 0 if lookup
started, -1 if there was an error communicating with the UNIX socket.
When failing with -1, the callback is called before returning from the
function. */
struct dns_lookup **lookup_r,
callback, const struct dns_lookup_result *, \
/* Abort the DNS lookup without calling the callback. */
#endif