#include <errno.h>
#include "secnet.h"
+#ifndef HAVE_LIBADNS
+#error secnet requires ADNS version 1.0 or above
+#endif
#include <adns.h>
+
struct adns {
closure_t cl;
struct resolver_if ops;
adns_query query;
};
-static bool_t resolve_request(void *sst, string_t name,
+static resolve_request_fn resolve_request;
+static bool_t resolve_request(void *sst, cstring_t name,
resolve_answer_fn *cb, void *cst)
{
struct adns *st=sst;
}
static int resolver_beforepoll(void *sst, struct pollfd *fds, int *nfds_io,
- int *timeout_io, const struct timeval *tv_now,
- uint64_t *now)
+ int *timeout_io)
{
struct adns *st=sst;
return adns_beforepoll(st->ast, fds, nfds_io, timeout_io, tv_now);
}
-static void resolver_afterpoll(void *sst, struct pollfd *fds, int nfds,
- const struct timeval *tv_now, uint64_t *now)
+static void resolver_afterpoll(void *sst, struct pollfd *fds, int nfds)
{
struct adns *st=sst;
adns_query aq;
} else if (rv==EAGAIN || rv==ESRCH) {
break;
} else {
- fatal("resolver_afterpoll: adns_check() returned %d\n",rv);
+ fatal("resolver_afterpoll: adns_check() returned %d",rv);
}
}
return new_closure(&st->cl);
}
-init_module resolver_module;
void resolver_module(dict_t *dict)
{
add_closure(dict,"adns",adnsresolver_apply);