asyncns.h

Go to the documentation of this file.
00001 #ifndef fooasyncnshfoo
00002 #define fooasyncnshfoo
00003 
00004 /* $Id: asyncns.h 23 2007-02-16 12:49:17Z lennart $ */
00005 
00006 /***
00007   This file is part of libasyncns.
00008  
00009   libasyncns is free software; you can redistribute it and/or modify
00010   it under the terms of the GNU Lesser General Public License as
00011   published by the Free Software Foundation; either version 2 of the
00012   License, or (at your option) any later version.
00013  
00014   libasyncns is distributed in the hope that it will be useful, but
00015   WITHOUT ANY WARRANTY; without even the implied warranty of
00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00017   General Public License for more details.
00018  
00019   You should have received a copy of the GNU Lesser General Public
00020   License along with libasyncns; if not, write to the Free Software
00021   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00022   USA.
00023 ***/
00024 
00025 #include <sys/types.h>
00026 #include <sys/socket.h>
00027 #include <netdb.h>
00028 
00047 #ifdef  __cplusplus
00048 extern "C" {
00049 #endif
00050 
00052 typedef struct asyncns asyncns_t;
00053 
00055 typedef struct asyncns_query asyncns_query_t;
00056 
00058 asyncns_t* asyncns_new(unsigned n_proc);
00059 
00062 void asyncns_free(asyncns_t *asyncns);
00063 
00067 int asyncns_fd(asyncns_t *asyncns);
00068 
00074 int asyncns_wait(asyncns_t *asyncns, int block);
00075 
00081 asyncns_query_t* asyncns_getaddrinfo(asyncns_t *asyncns, const char *node, const char *service, const struct addrinfo *hints);
00082 
00090 int asyncns_getaddrinfo_done(asyncns_t *asyncns, asyncns_query_t* q, struct addrinfo **ret_res);
00091 
00098 asyncns_query_t* asyncns_getnameinfo(asyncns_t *asyncns, const struct sockaddr *sa, socklen_t salen, int flags, int gethost, int getserv);
00099 
00105 int asyncns_getnameinfo_done(asyncns_t *asyncns, asyncns_query_t* q, char *ret_host, size_t hostlen, char *ret_serv, size_t servlen);
00106 
00111 asyncns_query_t* asyncns_res_query(asyncns_t *asyncns, const char *dname, int class, int type);
00112 
00117 asyncns_query_t* asyncns_res_search(asyncns_t *asyncns, const char *dname, int class, int type);
00118 
00124 int asyncns_res_done(asyncns_t *asyncns, asyncns_query_t* q, unsigned char
00125 **answer);
00126 
00130 asyncns_query_t* asyncns_getnext(asyncns_t *asyncns);
00131 
00134 int asyncns_getnqueries(asyncns_t *asyncns);
00135 
00138 void asyncns_cancel(asyncns_t *asyncns, asyncns_query_t* q);
00139 
00143 void asyncns_freeaddrinfo(struct addrinfo *ai);
00144 
00146 int asyncns_isdone(asyncns_t *asyncns, asyncns_query_t*q);
00147 
00149 void asyncns_setuserdata(asyncns_t *asyncns, asyncns_query_t *q, void *userdata);
00150 
00154 void* asyncns_getuserdata(asyncns_t *asyncns, asyncns_query_t *q);
00155 
00156 #ifdef  __cplusplus
00157 }
00158 #endif
00159     
00160 #endif

Generated on Thu Mar 1 17:36:08 2007 for libasyncns by  doxygen 1.5.1