summaryrefslogtreecommitdiffstats
path: root/libasyncns/asyncns.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-02-16 12:49:17 +0000
committerLennart Poettering <lennart@poettering.net>2007-02-16 12:49:17 +0000
commit798e297be094c9872d7dd4121e61d39698e09ebc (patch)
treebb8b5ea6690e8ae8384c1a39320aaf99f1f9951e /libasyncns/asyncns.h
parent26a4d2b3d1bbe6eeb5e95ce3a0900e31b89e42ce (diff)
Merge res_query patch from Sjoerd Simons
git-svn-id: file:///home/lennart/svn/public/libasyncns/trunk@23 cc0fb855-19ed-0310-866e-8c1d96e4abae
Diffstat (limited to 'libasyncns/asyncns.h')
-rw-r--r--libasyncns/asyncns.h20
1 files changed, 20 insertions, 0 deletions
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. */