sresolv  1.12.11devel
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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>
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 enum {
55 #define SRES_RETRANSMIT_INTERVAL (SRES_RETRANSMIT_INTERVAL)
56 
59 #define SRES_RETRY_INTERVAL (SRES_RETRY_INTERVAL)
60 
63 #define SRES_MAX_RETRY_COUNT (SRES_MAX_RETRY_COUNT)
64 
67 #define SRES_MAX_SEARCH (SRES_MAX_SEARCH)
68 
71 #define SRES_MAX_NAMESERVERS (SRES_MAX_NAMESERVERS)
72 
74  SRES_MAXDNAME = 1025,
75 #define SRES_MAXDNAME (SRES_MAXDNAME)
76 
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 
113 
117 sres_resolver_new_with_cache(char const *conf_file_path,
118  sres_cache_t *cache,
119  char const *options, ...);
120 
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 
130 
133 
135 SRESPUBFUN int sres_resolver_update(sres_resolver_t *res, int always);
136 
139 void *sres_resolver_set_userdata(sres_resolver_t *res, void *userdata);
140 
144 
151 typedef void sres_answer_f(sres_context_t *context,
152  sres_query_t *query,
153  sres_record_t **answers);
154 
158  sres_answer_f *callback,
159  sres_context_t *context,
160  uint16_t type,
161  char const *domain);
162 
166  sres_answer_f *callback,
167  sres_context_t *context,
168  uint16_t type,
169  char const *name);
170 
174  sres_answer_f *callback,
175  sres_context_t *context,
176  uint16_t type,
177  struct sockaddr const *addr);
178 
182  sres_answer_f *callback,
183  sres_context_t *context,
184  int dummy,
185  uint16_t type,
186  char const *domain);
187 
191  sres_answer_f *callback,
192  sres_context_t *context,
193  int dummy,
194  uint16_t type,
195  struct sockaddr const *addr);
196 
200  sres_answer_f *callback,
201  sres_context_t *context);
202 
206  uint16_t type,
207  char const *domain);
208 
212  uint16_t type,
213  char const *name);
214 
218  uint16_t type,
219  struct sockaddr const *addr);
220 
224  char const *domain,
225  char const *target,
226  uint16_t port,
227  uint32_t newttl,
228  uint16_t newprio);
229 
230 
234  uint16_t type,
235  char const *domain,
236  int ignore_cache,
237  sres_record_t ***return_records);
238 
242  uint16_t type,
243  char const *name,
244  int ignore_cache,
245  sres_record_t ***return_records);
246 
250  uint16_t type,
251  struct sockaddr const *addr,
252  int ignore_cache,
253  sres_record_t ***return_records);
254 
257 
260 
264  sres_record_t **answers,
265  uint16_t type);
266 
269 
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.