24 #include <sys/types.h>
25 #include <sys/socket.h>
asyncns_t * asyncns_new(unsigned n_proc)
Allocate a new libasyncns session with n_proc worker processes/threads.
int asyncns_getnameinfo_done(asyncns_t *asyncns, asyncns_query_t *q, char *ret_host, size_t hostlen, char *ret_serv, size_t servlen)
Retrieve the results of a preceding asyncns_getnameinfo() call.
int asyncns_fd(asyncns_t *asyncns)
Return the UNIX file descriptor to select() for readability on.
int asyncns_getnqueries(asyncns_t *asyncns)
Return the number of query objects (completed or not) attached to this session.
asyncns_query_t * asyncns_res_search(asyncns_t *asyncns, const char *dname, int class, int type)
Issue an resolver query on the specified session.
struct asyncns asyncns_t
An opaque libasyncns session structure.
Definition: asyncns.h:51
int asyncns_res_done(asyncns_t *asyncns, asyncns_query_t *q, unsigned char **answer)
Retrieve the results of a preceding asyncns_res_query() or asyncns_res_search call.
void asyncns_cancel(asyncns_t *asyncns, asyncns_query_t *q)
Cancel a currently running query.
void asyncns_setuserdata(asyncns_t *asyncns, asyncns_query_t *q, void *userdata)
Assign some opaque userdata with a query object.
void * asyncns_getuserdata(asyncns_t *asyncns, asyncns_query_t *q)
Return userdata assigned to a query object.
asyncns_query_t * asyncns_res_query(asyncns_t *asyncns, const char *dname, int class, int type)
Issue a resolver query on the specified session.
void asyncns_freeaddrinfo(struct addrinfo *ai)
Free the addrinfo structure as returned by asyncns_getaddrinfo_done().
int asyncns_wait(asyncns_t *asyncns, int block)
Process pending responses.
asyncns_query_t * asyncns_getnameinfo(asyncns_t *asyncns, const struct sockaddr *sa, socklen_t salen, int flags, int gethost, int getserv)
Issue an address to name query on the specified session.
void asyncns_freeanswer(unsigned char *answer)
Free the answer data as returned by asyncns_res_done().
asyncns_query_t * asyncns_getnext(asyncns_t *asyncns)
Return the next completed query object.
int asyncns_isdone(asyncns_t *asyncns, asyncns_query_t *q)
Returns non-zero when the query operation specified by q has been completed.
int asyncns_getaddrinfo_done(asyncns_t *asyncns, asyncns_query_t *q, struct addrinfo **ret_res)
Retrieve the results of a preceding asyncns_getaddrinfo() call.
void asyncns_free(asyncns_t *asyncns)
Free a libasyncns session.
asyncns_query_t * asyncns_getaddrinfo(asyncns_t *asyncns, const char *node, const char *service, const struct addrinfo *hints)
Issue a name to address query on the specified session.
struct asyncns_query asyncns_query_t
An opaque libasyncns query structure.
Definition: asyncns.h:54