libasyncns
0.8
Main Page
Files
Examples
File List
Globals
asyncns.h
Go to the documentation of this file.
1
#ifndef fooasyncnshfoo
2
#define fooasyncnshfoo
3
4
/***
5
This file is part of libasyncns.
6
7
Copyright 2005-2008 Lennart Poettering
8
9
libasyncns is free software; you can redistribute it and/or modify
10
it under the terms of the GNU Lesser General Public License as
11
published by the Free Software Foundation, either version 2.1 of the
12
License, or (at your option) any later version.
13
14
libasyncns is distributed in the hope that it will be useful, but
15
WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Lesser General Public License for more details.
18
19
You should have received a copy of the GNU Lesser General Public
20
License along with libasyncns. If not, see
21
<http://www.gnu.org/licenses/>.
22
***/
23
24
#include <sys/types.h>
25
#include <sys/socket.h>
26
#include <netdb.h>
27
46
#ifdef __cplusplus
47
extern
"C"
{
48
#endif
49
51
typedef
struct
asyncns
asyncns_t
;
52
54
typedef
struct
asyncns_query
asyncns_query_t
;
55
57
asyncns_t
*
asyncns_new
(
unsigned
n_proc);
58
61
void
asyncns_free
(
asyncns_t
*asyncns);
62
66
int
asyncns_fd
(
asyncns_t
*asyncns);
67
73
int
asyncns_wait
(
asyncns_t
*asyncns,
int
block);
74
80
asyncns_query_t
*
asyncns_getaddrinfo
(
asyncns_t
*asyncns,
const
char
*node,
const
char
*service,
const
struct
addrinfo *hints);
81
89
int
asyncns_getaddrinfo_done
(
asyncns_t
*asyncns,
asyncns_query_t
* q,
struct
addrinfo **ret_res);
90
97
asyncns_query_t
*
asyncns_getnameinfo
(
asyncns_t
*asyncns,
const
struct
sockaddr *sa, socklen_t salen,
int
flags,
int
gethost,
int
getserv);
98
104
int
asyncns_getnameinfo_done
(
asyncns_t
*asyncns,
asyncns_query_t
* q,
char
*ret_host,
size_t
hostlen,
char
*ret_serv,
size_t
servlen);
105
110
asyncns_query_t
*
asyncns_res_query
(
asyncns_t
*asyncns,
const
char
*dname,
int
class
,
int
type);
111
116
asyncns_query_t
*
asyncns_res_search
(
asyncns_t
*asyncns,
const
char
*dname,
int
class
,
int
type);
117
125
int
asyncns_res_done
(
asyncns_t
*asyncns,
asyncns_query_t
* q,
unsigned
char
**answer);
126
130
asyncns_query_t
*
asyncns_getnext
(
asyncns_t
*asyncns);
131
134
int
asyncns_getnqueries
(
asyncns_t
*asyncns);
135
138
void
asyncns_cancel
(
asyncns_t
*asyncns,
asyncns_query_t
* q);
139
143
void
asyncns_freeaddrinfo
(
struct
addrinfo *ai);
144
146
void
asyncns_freeanswer
(
unsigned
char
*answer);
147
149
int
asyncns_isdone
(
asyncns_t
*asyncns,
asyncns_query_t
*q);
150
152
void
asyncns_setuserdata
(
asyncns_t
*asyncns,
asyncns_query_t
*q,
void
*userdata);
153
157
void
*
asyncns_getuserdata
(
asyncns_t
*asyncns,
asyncns_query_t
*q);
158
159
#ifdef __cplusplus
160
}
161
#endif
162
163
#endif
libasyncns
asyncns.h
Generated on Mon May 6 2013 23:43:22 for libasyncns by
1.8.1.2