From 798e297be094c9872d7dd4121e61d39698e09ebc Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 16 Feb 2007 12:49:17 +0000 Subject: Merge res_query patch from Sjoerd Simons git-svn-id: file:///home/lennart/svn/public/libasyncns/trunk@23 cc0fb855-19ed-0310-866e-8c1d96e4abae --- libasyncns/asyncns.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'libasyncns/asyncns.h') diff --git a/libasyncns/asyncns.h b/libasyncns/asyncns.h index 6d3b542..87f0744 100644 --- a/libasyncns/asyncns.h +++ b/libasyncns/asyncns.h @@ -104,6 +104,26 @@ asyncns_query_t* asyncns_getnameinfo(asyncns_t *asyncns, const struct sockaddr * * returned. */ int asyncns_getnameinfo_done(asyncns_t *asyncns, asyncns_query_t* q, char *ret_host, size_t hostlen, char *ret_serv, size_t servlen); +/** Issue an resolver query on the specified session. The arguments are + * compatible with the ones of libc's res_query(3). The function returns a new + * query object. When the query is completed you may retrieve the results using + * asyncns_res_done(). */ +asyncns_query_t* asyncns_res_query(asyncns_t *asyncns, const char *dname, int class, int type); + +/** Issue an resolver query on the specified session. The arguments are + * compatible with the ones of libc's res_search(3). The function returns a new + * query object. When the query is completed you may retrieve the results using + * asyncns_res_done(). */ +asyncns_query_t* asyncns_res_search(asyncns_t *asyncns, const char *dname, int class, int type); + +/** Retrieve the results of a preceding asyncns_res_query)( or + * asyncns_res_search call. The query object q is destroyed by this call and + * may not be used any further. Returns a pointer to the answer of the + * res_query call. If the query is not completed yet -EAGAIN is returned, on + * failure -errno is returned otherwise the length of answer is returned. */ +int asyncns_res_done(asyncns_t *asyncns, asyncns_query_t* q, unsigned char +**answer); + /** Return the next completed query object. If no query has been * completed yet, return NULL. Please note that you need to run * asyncns_wait() before this function will return sensible data. */ -- cgit