sresolv
1.12.11devel
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
libsofia-sip-ua
sresolv
sofia-resolv
sres.h
Go to the documentation of this file.
1
/*
2
* This file is part of the Sofia-SIP package
3
*
4
* Copyright (C) 2005 Nokia Corporation.
5
*
6
* Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
7
*
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public License
10
* as published by the Free Software Foundation; either version 2.1 of
11
* the License, or (at your option) any later version.
12
*
13
* This library is distributed in the hope that it will be useful, but
14
* WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
17
*
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this library; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21
* 02110-1301 USA
22
*
23
*/
24
25
#ifndef SOFIA_RESOLV_SRES_H
26
27
#define SOFIA_RESOLV_SRES_H
28
45
#include <stdarg.h>
46
#include "
sofia-resolv/sres_config.h
"
47
48
#ifdef __cplusplus
49
extern
"C"
{
50
#endif
51
52
enum
{
54
SRES_RETRANSMIT_INTERVAL
= 500,
55
#define SRES_RETRANSMIT_INTERVAL (SRES_RETRANSMIT_INTERVAL)
56
58
SRES_RETRY_INTERVAL
= 1,
59
#define SRES_RETRY_INTERVAL (SRES_RETRY_INTERVAL)
60
62
SRES_MAX_RETRY_COUNT
= 6,
63
#define SRES_MAX_RETRY_COUNT (SRES_MAX_RETRY_COUNT)
64
66
SRES_MAX_SEARCH
= 6,
67
#define SRES_MAX_SEARCH (SRES_MAX_SEARCH)
68
70
SRES_MAX_NAMESERVERS
= 6,
71
#define SRES_MAX_NAMESERVERS (SRES_MAX_NAMESERVERS)
72
74
SRES_MAXDNAME
= 1025,
75
#define SRES_MAXDNAME (SRES_MAXDNAME)
76
78
SRES_MAX_SORTLIST
= 10
79
#define SRES_MAX_SORTLIST (SRES_MAX_SORTLIST)
80
};
81
82
#ifndef SRES_RECORD_T
83
#define SRES_RECORD_T
84
85
typedef
union
sres_record
sres_record_t
;
86
#endif
87
88
#ifndef SRES_CACHE_T
89
#define SRES_CACHE_T
90
91
typedef
struct
sres_cache
sres_cache_t
;
92
#endif
93
95
typedef
struct
sres_resolver_s
sres_resolver_t
;
96
97
#ifndef SRES_CONTEXT_T
98
#define SRES_CONTEXT_T struct sres_context_s
99
#endif
100
101
typedef
SRES_CONTEXT_T
sres_context_t
;
102
104
typedef
struct
sres_query_s
sres_query_t
;
105
106
struct
sockaddr;
107
109
SRESPUBFUN
sres_resolver_t
*
sres_resolver_new
(
char
const
*resolv_conf_path);
110
112
SRESPUBFUN
sres_resolver_t
*
sres_resolver_copy
(
sres_resolver_t
*);
113
115
SRESPUBFUN
116
sres_resolver_t
*
117
sres_resolver_new_with_cache
(
char
const
*conf_file_path,
118
sres_cache_t
*cache,
119
char
const
*options, ...);
120
122
SRESPUBFUN
123
sres_resolver_t
*
124
sres_resolver_new_with_cache_va
(
char
const
*conf_file_path,
125
sres_cache_t
*cache,
126
char
const
*options, va_list va);
127
129
SRESPUBFUN
sres_resolver_t
*
sres_resolver_ref
(
sres_resolver_t
*res);
130
132
SRESPUBFUN
void
sres_resolver_unref
(
sres_resolver_t
*res);
133
135
SRESPUBFUN
int
sres_resolver_update
(
sres_resolver_t
*res,
int
always);
136
138
SRESPUBFUN
139
void
*
sres_resolver_set_userdata
(
sres_resolver_t
*res,
void
*userdata);
140
142
SRESPUBFUN
143
void
*
sres_resolver_get_userdata
(
sres_resolver_t
const
*res);
144
151
typedef
void
sres_answer_f
(sres_context_t *context,
152
sres_query_t
*query,
153
sres_record_t
**answers);
154
156
SRESPUBFUN
157
sres_query_t
*
sres_query
(
sres_resolver_t
*res,
158
sres_answer_f
*callback,
159
sres_context_t *context,
160
uint16_t
type,
161
char
const
*domain);
162
164
SRESPUBFUN
165
sres_query_t
*
sres_search
(
sres_resolver_t
*res,
166
sres_answer_f
*callback,
167
sres_context_t *context,
168
uint16_t
type,
169
char
const
*name);
170
172
SRESPUBFUN
173
sres_query_t
*
sres_query_sockaddr
(
sres_resolver_t
*res,
174
sres_answer_f
*callback,
175
sres_context_t *context,
176
uint16_t
type,
177
struct
sockaddr
const
*addr);
178
180
SRESPUBFUN
181
sres_query_t
*
sres_query_make
(
sres_resolver_t
*res,
182
sres_answer_f
*callback,
183
sres_context_t *context,
184
int
dummy,
185
uint16_t
type,
186
char
const
*domain);
187
189
SRESPUBFUN
190
sres_query_t
*
sres_query_make_sockaddr
(
sres_resolver_t
*res,
191
sres_answer_f
*callback,
192
sres_context_t *context,
193
int
dummy,
194
uint16_t
type,
195
struct
sockaddr
const
*addr);
196
198
SRESPUBFUN
199
void
sres_query_bind
(
sres_query_t
*q,
200
sres_answer_f
*callback,
201
sres_context_t *context);
202
204
SRESPUBFUN
205
sres_record_t
**
sres_cached_answers
(
sres_resolver_t
*res,
206
uint16_t
type,
207
char
const
*domain);
208
210
SRESPUBFUN
211
sres_record_t
**
sres_search_cached_answers
(
sres_resolver_t
*res,
212
uint16_t
type,
213
char
const
*name);
214
216
SRESPUBFUN
217
sres_record_t
**
sres_cached_answers_sockaddr
(
sres_resolver_t
*res,
218
uint16_t
type,
219
struct
sockaddr
const
*addr);
220
222
SRESPUBFUN
223
int
sres_set_cached_srv_priority
(
sres_resolver_t
*res,
224
char
const
*domain,
225
char
const
*target,
226
uint16_t
port,
227
uint32_t
newttl,
228
uint16_t
newprio);
229
230
232
SRESPUBFUN
233
int
sres_blocking_query
(
sres_resolver_t
*res,
234
uint16_t
type,
235
char
const
*domain,
236
int
ignore_cache,
237
sres_record_t
***return_records);
238
240
SRESPUBFUN
241
int
sres_blocking_search
(
sres_resolver_t
*res,
242
uint16_t
type,
243
char
const
*name,
244
int
ignore_cache,
245
sres_record_t
***return_records);
246
248
SRESPUBFUN
249
int
sres_blocking_query_sockaddr
(
sres_resolver_t
*res,
250
uint16_t
type,
251
struct
sockaddr
const
*addr,
252
int
ignore_cache,
253
sres_record_t
***return_records);
254
256
SRESPUBFUN
int
sres_is_blocking
(
sres_resolver_t
*res);
257
259
SRESPUBFUN
int
sres_sort_answers
(
sres_resolver_t
*,
sres_record_t
**answers);
260
262
SRESPUBFUN
263
int
sres_filter_answers
(
sres_resolver_t
*res,
264
sres_record_t
**answers,
265
uint16_t
type);
266
268
SRESPUBFUN
void
sres_free_answers
(
sres_resolver_t
*,
sres_record_t
**answers);
269
271
SRESPUBFUN
void
sres_free_answer
(
sres_resolver_t
*res,
sres_record_t
*answer);
272
273
#ifdef __cplusplus
274
}
275
#endif
276
277
#endif
/* SOFIA_RESOLV_SRES_H */
Sofia-SIP 1.12.11devel - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.