|
0 |
/**
|
|
1 |
* \file
|
|
2 |
* \brief Public interface to getdns that is ADDITIONAL to the official getdns API, include
|
|
3 |
* in your application to use additional functionality offered by
|
|
4 |
* this implementation.
|
|
5 |
*/
|
|
6 |
|
0 | 7 |
/*
|
1 | 8 |
* Copyright (c) 2013, NLNet Labs, Verisign, Inc.
|
2 | 9 |
* All rights reserved.
|
|
36 | 43 |
extern "C" {
|
37 | 44 |
#endif
|
38 | 45 |
|
39 | |
/* Enable the return_dnssec_status extension on every request.
|
40 | |
value is either GETDNS_EXTENSION_TRUE or GETDNS_EXTENSION_FALSE
|
41 | |
returns GETDNS_RETURN_GOOD on success or GETDNS_RETURN_INVALID_PARAMETER
|
42 | |
if context or value is invalid */
|
43 | |
getdns_return_t getdns_context_set_return_dnssec_status(
|
44 | |
getdns_context *context, int enabled);
|
45 | |
|
46 | |
/* dict util */
|
47 | |
/* set a string as bindata */
|
48 | |
getdns_return_t getdns_dict_util_set_string(struct getdns_dict * dict,
|
49 | |
char *name, const char *value);
|
50 | |
|
51 | |
/* get a string from a dict. the result must be freed if valid */
|
52 | |
getdns_return_t getdns_dict_util_get_string(struct getdns_dict * dict,
|
53 | |
char *name, char **result);
|
54 | |
|
55 | |
/* tells underlying unbound to use background threads or fork */
|
56 | |
getdns_return_t getdns_context_set_use_threads(getdns_context* context,
|
57 | |
int use_threads);
|
58 | |
|
59 | |
/* Async support */
|
60 | |
uint32_t getdns_context_get_num_pending_requests(getdns_context* context,
|
61 | |
struct timeval* next_timeout);
|
62 | |
|
63 | |
/* process async reqs */
|
64 | |
getdns_return_t getdns_context_process_async(getdns_context* context);
|
65 | |
|
66 | |
/***************** functions for eventloop extensions ******************/
|
|
46 |
/** \defgroup UnofficialgetdnsAPI Additional API for getdns implementation
|
|
47 |
* @{
|
|
48 |
*/
|
|
49 |
|
|
50 |
/** \defgroup Uvaluesandtexts Additional values and texts
|
|
51 |
* @{
|
|
52 |
*/
|
|
53 |
|
|
54 |
/**
|
|
55 |
* \defgroup Ureturnvaluesandtext Additional return values and texts
|
|
56 |
* @{
|
|
57 |
*/
|
|
58 |
#define GETDNS_RETURN_NEED_MORE_SPACE ((getdns_return_t) 399 )
|
|
59 |
#define GETDNS_RETURN_NEED_MORE_SPACE_TEXT "The buffer was too small"
|
|
60 |
/** @}
|
|
61 |
*/
|
|
62 |
|
|
63 |
|
|
64 |
/**
|
|
65 |
* \defgroup Ucontextcodes Additional context codes and texts
|
|
66 |
* @{
|
|
67 |
*/
|
|
68 |
#define GETDNS_CONTEXT_CODE_TLS_AUTHENTICATION 618
|
|
69 |
#define GETDNS_CONTEXT_CODE_TLS_AUTHENTICATION_TEXT "Change related to getdns_context_set_tls_authentication"
|
|
70 |
#define GETDNS_CONTEXT_CODE_EDNS_CLIENT_SUBNET_PRIVATE 619
|
|
71 |
#define GETDNS_CONTEXT_CODE_EDNS_CLIENT_SUBNET_PRIVATE_TEXT "Change related to getdns_context_set_edns_client_subnet_private"
|
|
72 |
#define GETDNS_CONTEXT_CODE_TLS_QUERY_PADDING_BLOCKSIZE 620
|
|
73 |
#define GETDNS_CONTEXT_CODE_TLS_QUERY_PADDING_BLOCKSIZE_TEXT "Change related to getdns_context_set_tls_query_padding_blocksize"
|
|
74 |
#define GETDNS_CONTEXT_CODE_PUBKEY_PINSET 621
|
|
75 |
#define GETDNS_CONTEXT_CODE_PUBKEY_PINSET_TEXT "Change related to getdns_context_set_pubkey_pinset"
|
|
76 |
/** @}
|
|
77 |
*/
|
|
78 |
|
|
79 |
|
|
80 |
/**
|
|
81 |
* \defgroup versions Additional version values
|
|
82 |
* @{
|
|
83 |
*/
|
|
84 |
#define GETDNS_VERSION "@GETDNS_VERSION@"
|
|
85 |
#define GETDNS_NUMERIC_VERSION @GETDNS_NUMERIC_VERSION@
|
|
86 |
#define GETDNS_API_VERSION "@API_VERSION@"
|
|
87 |
#define GETDNS_API_NUMERIC_VERSION @API_NUMERIC_VERSION@
|
|
88 |
/** @}
|
|
89 |
*/
|
|
90 |
|
|
91 |
|
|
92 |
/* an alias for REQUIRED */
|
|
93 |
#define GETDNS_AUTHENTICATION_HOSTNAME GETDNS_AUTHENTICATION_REQUIRED
|
|
94 |
|
|
95 |
/**
|
|
96 |
* \defgroup authvaulesandtext Additional authentication values and texts
|
|
97 |
* @{
|
|
98 |
*/
|
|
99 |
/* Authentication options used when doing TLS */
|
|
100 |
typedef enum getdns_tls_authentication_t {
|
|
101 |
GETDNS_AUTHENTICATION_NONE = 1300,
|
|
102 |
GETDNS_AUTHENTICATION_REQUIRED = 1301
|
|
103 |
} getdns_tls_authentication_t;
|
|
104 |
|
|
105 |
#define GETDNS_AUTHENTICATION_NONE_TEXT "See getdns_context_set_tls_authentication()"
|
|
106 |
#define GETDNS_AUTHENTICATION_REQUIRED_TEXT "See getdns_context_set_tls_authentication()"
|
|
107 |
/** @}
|
|
108 |
*/
|
|
109 |
|
|
110 |
|
|
111 |
/**
|
|
112 |
* \defgroup appendname Additional append name values and texts
|
|
113 |
* @{
|
|
114 |
*/
|
|
115 |
#define GETDNS_APPEND_NAME_TO_SINGLE_LABEL_FIRST ((getdns_append_name_t) 554 )
|
|
116 |
#define GETDNS_APPEND_NAME_TO_SINGLE_LABEL_FIRST_TEXT "See getdns_context_set_append_name()"
|
|
117 |
/** @}
|
|
118 |
*/
|
|
119 |
|
|
120 |
|
|
121 |
/**
|
|
122 |
* \defgroup Uvaluesandtextsdepricated Additional transport values and texts (will be deprecated)
|
|
123 |
* @{
|
|
124 |
*/
|
|
125 |
|
|
126 |
/** WARNING! Do not use the constants below. They will be removed from future
|
|
127 |
* releases. Please use the getdns_context_set_dns_transport_list with the
|
|
128 |
* GETDNS_TRANSPORT_UDP, GETDNS_TRANSPORT_TCP and GETDNS_TRANSPORT_TLS
|
|
129 |
* constants instead.
|
|
130 |
*/
|
|
131 |
#define GETDNS_TRANSPORT_TLS_ONLY_KEEP_CONNECTIONS_OPEN 544
|
|
132 |
#define GETDNS_TRANSPORT_TLS_ONLY_KEEP_CONNECTIONS_OPEN_TEXT "See getdns_context_set_dns_transport()"
|
|
133 |
#define GETDNS_TRANSPORT_TLS_FIRST_AND_FALL_BACK_TO_TCP_KEEP_CONNECTIONS_OPEN 545
|
|
134 |
#define GETDNS_TRANSPORT_TLS_FIRST_AND_FALL_BACK_TO_TCP_KEEP_CONNECTIONS_OPEN_TEXT "See getdns_context_set_dns_transport()"
|
|
135 |
|
|
136 |
/** @}
|
|
137 |
*/
|
|
138 |
/** @}
|
|
139 |
*/
|
|
140 |
|
|
141 |
|
|
142 |
/**
|
|
143 |
* \defgroup Ufunctions Additional functions
|
|
144 |
* @{
|
|
145 |
*/
|
|
146 |
|
|
147 |
/**
|
|
148 |
* \defgroup Ueventloops Additional event loop extension functions
|
|
149 |
* @{
|
|
150 |
*/
|
67 | 151 |
|
68 | 152 |
typedef void (*getdns_eventloop_callback)(void *userarg);
|
69 | 153 |
|
|
130 | 214 |
/* Run the context's event loop until nothing more to do */
|
131 | 215 |
void
|
132 | 216 |
getdns_context_run(getdns_context *context);
|
133 | |
|
134 | |
/** begin getters **/
|
135 | |
getdns_return_t
|
136 | |
getdns_context_get_resolution_type(getdns_context *context,
|
137 | |
getdns_resolution_t* value);
|
138 | |
|
139 | |
/** users must call free on the resulting namespaces if not NULL */
|
140 | |
getdns_return_t
|
141 | |
getdns_context_get_namespaces(getdns_context *context,
|
142 | |
size_t* namespace_count, getdns_namespace_t **namespaces);
|
143 | |
|
144 | |
getdns_return_t
|
145 | |
getdns_context_get_dns_transport(getdns_context *context,
|
146 | |
getdns_transport_t* value);
|
147 | |
|
148 | |
getdns_return_t
|
149 | |
getdns_context_get_dns_transport_list(getdns_context *context,
|
150 | |
size_t* transport_count, getdns_transport_list_t **transports);
|
151 | |
|
152 | |
getdns_return_t
|
153 | |
getdns_context_get_limit_outstanding_queries(getdns_context *context,
|
154 | |
uint16_t* limit);
|
155 | |
|
156 | |
getdns_return_t
|
157 | |
getdns_context_get_timeout(getdns_context *context, uint64_t* timeout);
|
158 | |
|
159 | |
getdns_return_t
|
160 | |
getdns_context_get_idle_timeout(getdns_context *context, uint64_t* timeout);
|
161 | |
|
162 | |
getdns_return_t
|
163 | |
getdns_context_get_follow_redirects(getdns_context *context,
|
164 | |
getdns_redirects_t* value);
|
165 | |
|
166 | |
getdns_return_t
|
167 | |
getdns_context_get_dns_root_servers(getdns_context *context,
|
168 | |
getdns_list **addresses);
|
169 | |
|
170 | |
getdns_return_t
|
171 | |
getdns_context_get_append_name(getdns_context *context,
|
172 | |
getdns_append_name_t* value);
|
173 | |
|
174 | |
getdns_return_t
|
175 | |
getdns_context_get_suffix(getdns_context *context, getdns_list **value);
|
176 | |
|
177 | |
getdns_return_t
|
178 | |
getdns_context_get_dnssec_trust_anchors(getdns_context *context,
|
179 | |
getdns_list **value);
|
180 | |
|
181 | |
getdns_return_t
|
182 | |
getdns_context_get_dnssec_allowed_skew(getdns_context *context,
|
183 | |
uint32_t* value);
|
184 | |
|
185 | |
getdns_return_t
|
186 | |
getdns_context_get_upstream_recursive_servers(getdns_context *context,
|
187 | |
getdns_list **upstream_list);
|
188 | |
|
189 | |
getdns_return_t
|
190 | |
getdns_context_get_edns_maximum_udp_payload_size(getdns_context *context,
|
191 | |
uint16_t* value);
|
192 | |
|
193 | |
getdns_return_t
|
194 | |
getdns_context_get_edns_extended_rcode(getdns_context *context,
|
195 | |
uint8_t* value);
|
196 | |
|
197 | |
getdns_return_t
|
198 | |
getdns_context_get_edns_version(getdns_context *context, uint8_t* value);
|
199 | |
|
200 | |
getdns_return_t
|
201 | |
getdns_context_get_edns_do_bit(getdns_context *context, uint8_t* value);
|
202 | |
|
203 | |
getdns_return_t
|
204 | |
getdns_context_set_edns_client_subnet_private(getdns_context *context, uint8_t value);
|
205 | |
getdns_return_t
|
206 | |
getdns_context_get_edns_client_subnet_private(getdns_context *context, uint8_t* value);
|
207 | |
|
208 | |
getdns_return_t
|
209 | |
getdns_context_set_tls_query_padding_blocksize(getdns_context *context, uint16_t value);
|
210 | |
getdns_return_t
|
211 | |
getdns_context_get_tls_query_padding_blocksize(getdns_context *context, uint16_t* value);
|
212 | |
|
213 | |
|
214 | |
/**
|
215 | |
* Pretty print the getdns_dict in a given buffer snprintf style.
|
216 | |
* @param str pointer to the buffer to print to
|
217 | |
* @param size size of the given buffer. No more than size bytes (including
|
218 | |
* the terminating null byte) will be written to str.
|
219 | |
* @param dict getdns_dict to print
|
220 | |
* @return The number of characters written excluding the terminating null byte
|
221 | |
* or the number of characters which would have been written if enough space
|
222 | |
* had been available.
|
223 | |
*/
|
224 | |
int
|
225 | |
getdns_pretty_snprint_dict(char *str, size_t size, const getdns_dict *dict);
|
226 | |
|
227 | |
/**
|
228 | |
* creates a string that describes the list in a human readable form.
|
229 | |
* @param some_list list to pretty print
|
230 | |
* @return character array (caller must free this) containing pretty string
|
231 | |
*/
|
232 | |
char *
|
233 | |
getdns_pretty_print_list(const getdns_list *some_list);
|
234 | |
|
235 | |
/**
|
236 | |
* Pretty print the getdns_list in a given buffer snprintf style.
|
237 | |
* @param str pointer to the buffer to print to
|
238 | |
* @param size size of the given buffer. No more than size bytes (including
|
239 | |
* the terminating null byte) will be written to str.
|
240 | |
* @param list getdns_list to print
|
241 | |
* @return The number of characters written excluding the terminating null byte
|
242 | |
* or the number of characters which would have been written if enough space
|
243 | |
* had been available.
|
244 | |
*/
|
245 | |
int
|
246 | |
getdns_pretty_snprint_list(char *str, size_t size, const getdns_list *list);
|
247 | |
|
248 | |
/**
|
249 | |
* creates a string containing a json representation of some_dict.
|
250 | |
* bindatas are converted to strings when possible, including bindatas for
|
251 | |
* addresses, dnames and other printable data. All other bindatas are
|
252 | |
* converted to lists of byte values.
|
253 | |
* @param some_dict dict to represent as json data
|
254 | |
* @param pretty when non-zero returns formatted json
|
255 | |
* @return character array (caller must free this) containing pretty string
|
256 | |
*/
|
257 | |
char *
|
258 | |
getdns_print_json_dict(const getdns_dict *some_dict, int pretty);
|
259 | |
|
260 | |
/**
|
261 | |
* Prints a json representation of dict in a given buffer snprintf style.
|
262 | |
* bindatas are converted to strings when possible, including bindatas for
|
263 | |
* addresses, dnames and other printable data. All other bindatas are
|
264 | |
* converted to lists of byte values.
|
265 | |
* @param str pointer to the buffer to print to
|
266 | |
* @param size size of the given buffer. No more than size bytes (including
|
267 | |
* the terminating null byte) will be written to str.
|
268 | |
* @param dict dict to represent as json data
|
269 | |
* @param pretty when non-zero returns formatted json
|
270 | |
* @return The number of characters written excluding the terminating null byte
|
271 | |
* or the number of characters which would have been written if enough space
|
272 | |
* had been available.
|
273 | |
*/
|
274 | |
int
|
275 | |
getdns_snprint_json_dict(
|
276 | |
char *str, size_t size, const getdns_dict *dict, int pretty);
|
277 | |
|
278 | |
/**
|
279 | |
* creates a string containing a json representation of some_list.
|
280 | |
* bindatas are converted to strings when possible, including bindatas for
|
281 | |
* addresses, dnames and other printable data. All other bindatas are
|
282 | |
* converted to lists of byte values.
|
283 | |
* @param some_list list to represent as json data
|
284 | |
* @param pretty when non-zero returns formatted json
|
285 | |
* @return character array (caller must free this) containing pretty string
|
286 | |
*/
|
287 | |
char *
|
288 | |
getdns_print_json_list(const getdns_list *some_list, int pretty);
|
289 | |
|
290 | |
/**
|
291 | |
* Prints a json representation of list in a given buffer snprintf style.
|
292 | |
* bindatas are converted to strings when possible, including bindatas for
|
293 | |
* addresses, dnames and other printable data. All other bindatas are
|
294 | |
* converted to lists of byte values.
|
295 | |
* @param str pointer to the buffer to print to
|
296 | |
* @param size size of the given buffer. No more than size bytes (including
|
297 | |
* the terminating null byte) will be written to str.
|
298 | |
* @param list list to represent as json data
|
299 | |
* @param pretty when non-zero returns formatted json
|
300 | |
* @return The number of characters written excluding the terminating null byte
|
301 | |
* or the number of characters which would have been written if enough space
|
302 | |
* had been available.
|
303 | |
*/
|
304 | |
int
|
305 | |
getdns_snprint_json_list(
|
306 | |
char *str, size_t size, const getdns_list *list, int pretty);
|
307 | |
|
|
217 |
/** @}
|
|
218 |
*/
|
|
219 |
|
|
220 |
|
|
221 |
/**
|
|
222 |
* \defgroup contextfunction Additional getdns_context async functions
|
|
223 |
* @{
|
|
224 |
*/
|
|
225 |
/* process async reqs */
|
|
226 |
getdns_return_t getdns_context_process_async(getdns_context* context);
|
|
227 |
/** @}
|
|
228 |
*/
|
|
229 |
|
|
230 |
/**
|
|
231 |
* \defgroup Ucontextset Additional getdns_context_set functions
|
|
232 |
* @{
|
|
233 |
*/
|
308 | 234 |
/**
|
309 | 235 |
* Register a callback function for context changes.
|
310 | 236 |
* @param context The context to monitor for changes
|
|
320 | 246 |
getdns_return_t
|
321 | 247 |
getdns_context_set_update_callback(getdns_context *context, void *userarg,
|
322 | 248 |
void (*value) (getdns_context *, getdns_context_code_t, void *));
|
|
249 |
|
|
250 |
/* Enable the return_dnssec_status extension on every request.
|
|
251 |
value is either GETDNS_EXTENSION_TRUE or GETDNS_EXTENSION_FALSE
|
|
252 |
returns GETDNS_RETURN_GOOD on success or GETDNS_RETURN_INVALID_PARAMETER
|
|
253 |
if context or value is invalid */
|
|
254 |
getdns_return_t getdns_context_set_return_dnssec_status(
|
|
255 |
getdns_context *context, int enabled);
|
|
256 |
|
|
257 |
/* tells underlying unbound to use background threads or fork */
|
|
258 |
getdns_return_t getdns_context_set_use_threads(getdns_context* context,
|
|
259 |
int use_threads);
|
|
260 |
|
|
261 |
getdns_return_t
|
|
262 |
getdns_context_set_tls_authentication(
|
|
263 |
getdns_context *context, getdns_tls_authentication_t value);
|
|
264 |
|
|
265 |
getdns_return_t
|
|
266 |
getdns_context_set_edns_client_subnet_private(getdns_context *context, uint8_t value);
|
|
267 |
|
|
268 |
getdns_return_t
|
|
269 |
getdns_context_set_tls_query_padding_blocksize(getdns_context *context, uint16_t value);
|
|
270 |
/** @}
|
|
271 |
*/
|
|
272 |
|
|
273 |
/**
|
|
274 |
* \defgroup Ucontextget Additional getdns_context_get functions
|
|
275 |
* @{
|
|
276 |
*/
|
|
277 |
/** begin getters **/
|
|
278 |
getdns_return_t
|
|
279 |
getdns_context_get_resolution_type(getdns_context *context,
|
|
280 |
getdns_resolution_t* value);
|
|
281 |
|
|
282 |
/** users must call free on the resulting namespaces if not NULL */
|
|
283 |
getdns_return_t
|
|
284 |
getdns_context_get_namespaces(getdns_context *context,
|
|
285 |
size_t* namespace_count, getdns_namespace_t **namespaces);
|
|
286 |
|
|
287 |
getdns_return_t
|
|
288 |
getdns_context_get_dns_transport(getdns_context *context,
|
|
289 |
getdns_transport_t* value);
|
|
290 |
|
|
291 |
getdns_return_t
|
|
292 |
getdns_context_get_dns_transport_list(getdns_context *context,
|
|
293 |
size_t* transport_count, getdns_transport_list_t **transports);
|
|
294 |
|
|
295 |
getdns_return_t
|
|
296 |
getdns_context_get_limit_outstanding_queries(getdns_context *context,
|
|
297 |
uint16_t* limit);
|
|
298 |
|
|
299 |
getdns_return_t
|
|
300 |
getdns_context_get_timeout(getdns_context *context, uint64_t* timeout);
|
|
301 |
|
|
302 |
getdns_return_t
|
|
303 |
getdns_context_get_idle_timeout(getdns_context *context, uint64_t* timeout);
|
|
304 |
|
|
305 |
getdns_return_t
|
|
306 |
getdns_context_get_follow_redirects(getdns_context *context,
|
|
307 |
getdns_redirects_t* value);
|
|
308 |
|
|
309 |
getdns_return_t
|
|
310 |
getdns_context_get_dns_root_servers(getdns_context *context,
|
|
311 |
getdns_list **addresses);
|
|
312 |
|
|
313 |
getdns_return_t
|
|
314 |
getdns_context_get_append_name(getdns_context *context,
|
|
315 |
getdns_append_name_t* value);
|
|
316 |
|
|
317 |
getdns_return_t
|
|
318 |
getdns_context_get_suffix(getdns_context *context, getdns_list **value);
|
|
319 |
|
|
320 |
getdns_return_t
|
|
321 |
getdns_context_get_dnssec_trust_anchors(getdns_context *context,
|
|
322 |
getdns_list **value);
|
|
323 |
|
|
324 |
getdns_return_t
|
|
325 |
getdns_context_get_dnssec_allowed_skew(getdns_context *context,
|
|
326 |
uint32_t* value);
|
|
327 |
|
|
328 |
getdns_return_t
|
|
329 |
getdns_context_get_upstream_recursive_servers(getdns_context *context,
|
|
330 |
getdns_list **upstream_list);
|
|
331 |
|
|
332 |
getdns_return_t
|
|
333 |
getdns_context_get_edns_maximum_udp_payload_size(getdns_context *context,
|
|
334 |
uint16_t* value);
|
|
335 |
|
|
336 |
getdns_return_t
|
|
337 |
getdns_context_get_edns_extended_rcode(getdns_context *context,
|
|
338 |
uint8_t* value);
|
|
339 |
|
|
340 |
getdns_return_t
|
|
341 |
getdns_context_get_edns_version(getdns_context *context, uint8_t* value);
|
|
342 |
|
|
343 |
getdns_return_t
|
|
344 |
getdns_context_get_edns_do_bit(getdns_context *context, uint8_t* value);
|
|
345 |
|
|
346 |
getdns_return_t
|
|
347 |
getdns_context_get_edns_client_subnet_private(getdns_context *context, uint8_t* value);
|
|
348 |
|
|
349 |
getdns_return_t
|
|
350 |
getdns_context_get_tls_query_padding_blocksize(getdns_context *context, uint16_t* value);
|
|
351 |
|
|
352 |
getdns_return_t
|
|
353 |
getdns_context_get_tls_authentication(getdns_context *context,
|
|
354 |
getdns_tls_authentication_t* value);
|
323 | 355 |
|
324 | 356 |
/**
|
325 | 357 |
* Get the currently registered callback function and user defined argument
|
|
338 | 370 |
getdns_context_get_update_callback(getdns_context *context, void **userarg,
|
339 | 371 |
void (**value) (getdns_context *, getdns_context_code_t, void *));
|
340 | 372 |
|
|
373 |
/* Async support */
|
|
374 |
uint32_t getdns_context_get_num_pending_requests(getdns_context* context,
|
|
375 |
struct timeval* next_timeout);
|
|
376 |
/** @}
|
|
377 |
*/
|
|
378 |
|
|
379 |
|
|
380 |
/**
|
|
381 |
* \defgroup Uutilityfunctions Additional utility functions
|
|
382 |
* @{
|
|
383 |
*/
|
|
384 |
|
|
385 |
const char *getdns_get_version(void);
|
|
386 |
uint32_t getdns_get_version_number(void);
|
|
387 |
const char *getdns_get_api_version(void);
|
|
388 |
uint32_t getdns_get_api_version_number(void);
|
|
389 |
|
341 | 390 |
/**
|
342 | 391 |
* Returns a text describing the getdns error code, or NULL when the error
|
343 | 392 |
* code is unkown.
|
|
347 | 396 |
*/
|
348 | 397 |
const char *getdns_get_errorstr_by_id(uint16_t err);
|
349 | 398 |
|
350 | |
|
351 | |
|
352 | |
/**
|
353 | |
* Public Key Pinning functionality:
|
354 | |
*
|
355 | |
* a public key pinset is a list of dicts. each dict should have a
|
356 | |
* "digest" and a "value".
|
357 | |
*
|
358 | |
* "digest": a string indicating the type of digest. at the moment, we
|
359 | |
* only support a "digest" of "sha256".
|
360 | |
*
|
361 | |
* "value": a binary representation of the digest provided.
|
362 | |
*
|
363 | |
* given a such a pinset, we should be able to validate a chain
|
364 | |
* properly according to section 2.6 of RFC 7469.
|
365 | |
*/
|
366 | |
|
367 | |
/**
|
368 | |
* convert an HPKP-style pin description to an appropriate getdns data
|
369 | |
* structure. An example string is: (with the quotes, without any
|
370 | |
* leading or trailing whitespace):
|
371 | |
*
|
372 | |
* pin-sha256="E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g="
|
373 | |
*
|
374 | |
* It is the caller's responsibility to call getdns_dict_destroy() on
|
375 | |
* the dict returned when it is no longer needed.
|
376 | |
*
|
377 | |
* @param context a context to use to create the dict, or NULL to create
|
378 | |
* it generically
|
379 | |
* @param str the pinning string to parse
|
380 | |
* @return a dict created from ctx, or NULL if the string did not match.
|
381 | |
*/
|
382 | |
getdns_dict* getdns_pubkey_pin_create_from_string(
|
383 | |
getdns_context* context,
|
384 | |
const char* str);
|
385 | |
|
386 | |
|
387 | |
/**
|
388 | |
* Test whether a given pinset is reasonable, including:
|
389 | |
*
|
390 | |
* is it well-formed?
|
391 | |
* are there at least two pins?
|
392 | |
* are the digests used sane?
|
393 | |
*
|
394 | |
* @param pinset the set of public key pins to check for sanity. This
|
395 | |
* should be a list of dicts.
|
396 | |
* @return errorlist if not NULL, a list of human-readable strings is
|
397 | |
* appended to errorlist.
|
398 | |
* @return GETDNS_RETURN_GOOD if the pinset passes the sanity check.
|
399 | |
*/
|
400 | |
getdns_return_t getdns_pubkey_pinset_sanity_check(
|
401 | |
const getdns_list* pinset,
|
402 | |
getdns_list* errorlist);
|
403 | |
|
404 | |
|
405 | |
|
406 | |
/* WARNING! Function getdns_strerror is not in the API specification and
|
407 | |
* is likely to be removed from future versions of our implementation, to be
|
408 | |
* replaced by getdns_get_errorstr_by_id or something similar.
|
409 | |
* Please use getdns_get_errorstr_by_id instead of getdns_strerror.
|
410 | |
*/
|
411 | |
getdns_return_t getdns_strerror(getdns_return_t err, char *buf, size_t buflen);
|
412 | |
|
413 | |
#define GETDNS_VERSION "@GETDNS_VERSION@"
|
414 | |
#define GETDNS_NUMERIC_VERSION @GETDNS_NUMERIC_VERSION@
|
415 | |
#define GETDNS_API_VERSION "@API_VERSION@"
|
416 | |
#define GETDNS_API_NUMERIC_VERSION @API_NUMERIC_VERSION@
|
417 | |
|
418 | |
const char *getdns_get_version(void);
|
419 | |
uint32_t getdns_get_version_number(void);
|
420 | |
const char *getdns_get_api_version(void);
|
421 | |
uint32_t getdns_get_api_version_number(void);
|
422 | |
|
423 | |
/* Authentication options used when doing TLS */
|
424 | |
typedef enum getdns_tls_authentication_t {
|
425 | |
GETDNS_AUTHENTICATION_NONE = 1300,
|
426 | |
GETDNS_AUTHENTICATION_REQUIRED = 1301
|
427 | |
} getdns_tls_authentication_t;
|
428 | |
|
429 | |
/* an alias for REQUIRED */
|
430 | |
#define GETDNS_AUTHENTICATION_HOSTNAME GETDNS_AUTHENTICATION_REQUIRED
|
431 | |
|
432 | |
/**
|
433 | |
* \defgroup authtext Authentication texts
|
434 | |
* @{
|
435 | |
*/
|
436 | |
#define GETDNS_AUTHENTICATION_NONE_TEXT "See getdns_context_set_tls_authentication()"
|
437 | |
#define GETDNS_AUTHENTICATION_REQUIRED_TEXT "See getdns_context_set_tls_authentication()"
|
438 | |
/** @}
|
439 | |
*/
|
440 | |
|
441 | |
#define GETDNS_CONTEXT_CODE_TLS_AUTHENTICATION 618
|
442 | |
#define GETDNS_CONTEXT_CODE_TLS_AUTHENTICATION_TEXT "Change related to getdns_context_set_tls_authentication"
|
443 | |
#define GETDNS_CONTEXT_CODE_EDNS_CLIENT_SUBNET_PRIVATE 619
|
444 | |
#define GETDNS_CONTEXT_CODE_EDNS_CLIENT_SUBNET_PRIVATE_TEXT "Change related to getdns_context_set_edns_client_subnet_private"
|
445 | |
#define GETDNS_CONTEXT_CODE_TLS_QUERY_PADDING_BLOCKSIZE 620
|
446 | |
#define GETDNS_CONTEXT_CODE_TLS_QUERY_PADDING_BLOCKSIZE_TEXT "Change related to getdns_context_set_tls_query_padding_blocksize"
|
447 | |
#define GETDNS_CONTEXT_CODE_PUBKEY_PINSET 621
|
448 | |
#define GETDNS_CONTEXT_CODE_PUBKEY_PINSET_TEXT "Change related to getdns_context_set_pubkey_pinset"
|
449 | |
|
450 | |
getdns_return_t
|
451 | |
getdns_context_set_tls_authentication(
|
452 | |
getdns_context *context, getdns_tls_authentication_t value);
|
453 | |
|
454 | |
getdns_return_t
|
455 | |
getdns_context_get_tls_authentication(getdns_context *context,
|
456 | |
getdns_tls_authentication_t* value);
|
457 | |
|
458 | |
|
459 | |
/* WARNING! Do not use the constants below. They will be removed from future
|
460 | |
* releases. Please use the getdns_context_set_dns_transport_list with the
|
461 | |
* GETDNS_TRANSPORT_UDP, GETDNS_TRANSPORT_TCP and GETDNS_TRANSPORT_TLS
|
462 | |
* constants instead.
|
463 | |
*/
|
464 | |
#define GETDNS_TRANSPORT_TLS_ONLY_KEEP_CONNECTIONS_OPEN 544
|
465 | |
#define GETDNS_TRANSPORT_TLS_ONLY_KEEP_CONNECTIONS_OPEN_TEXT "See getdns_context_set_dns_transport()"
|
466 | |
#define GETDNS_TRANSPORT_TLS_FIRST_AND_FALL_BACK_TO_TCP_KEEP_CONNECTIONS_OPEN 545
|
467 | |
#define GETDNS_TRANSPORT_TLS_FIRST_AND_FALL_BACK_TO_TCP_KEEP_CONNECTIONS_OPEN_TEXT "See getdns_context_set_dns_transport()"
|
468 | |
|
469 | |
#define GETDNS_RETURN_NEED_MORE_SPACE ((getdns_return_t) 399 )
|
470 | |
#define GETDNS_RETURN_NEED_MORE_SPACE_TEXT "The buffer was too small"
|
471 | |
|
472 | |
/**
|
473 | |
* Convert rr_dict to wireformat representation of the resource record.
|
474 | |
*
|
475 | |
* @param rr_dict The getdns dict representation of the resource record
|
476 | |
* @return wire A newly allocated buffer which will contain the wireformat.
|
477 | |
* @return wire_sz The size of the allocated buffer and the wireformat.
|
478 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
479 | |
*/
|
480 | |
getdns_return_t
|
481 | |
getdns_rr_dict2wire(
|
482 | |
const getdns_dict *rr_dict, uint8_t **wire, size_t *wire_sz);
|
483 | |
|
484 | |
/**
|
485 | |
* Convert rr_dict to wireformat representation of the resource record.
|
486 | |
*
|
487 | |
* @param rr_dict The getdns dict representation of the resource record
|
488 | |
* @param wire The buffer in which the wireformat will be written
|
489 | |
* @param wire_sz On input the size of the wire buffer,
|
490 | |
* On output the amount of wireformat needed for the
|
491 | |
* wireformat representation of the resource record;
|
492 | |
* even if it did not fit.
|
493 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
494 | |
* GETDNS_RETURN_NEED_MORE_SPACE will be returned when the buffer was too
|
495 | |
* small. wire_sz will be set to the needed buffer space then.
|
496 | |
*/
|
497 | |
getdns_return_t
|
498 | |
getdns_rr_dict2wire_buf(
|
499 | |
const getdns_dict *rr_dict, uint8_t *wire, size_t *wire_sz);
|
500 | |
|
501 | |
/**
|
502 | |
* Convert rr_dict to wireformat representation of the resource record.
|
503 | |
*
|
504 | |
* @param rr_dict The getdns dict representation of the resource record
|
505 | |
* @param wire A pointer to the buffer pointer in which the wireformat
|
506 | |
* will be written.
|
507 | |
* On output the buffer pointer will have moved along
|
508 | |
* the buffer and point right after the just written RR.
|
509 | |
* @param wire_sz On input the size of the wire buffer,
|
510 | |
* On output the amount of wireformat needed for the
|
511 | |
* wireformat will have been substracted from wire_sz.
|
512 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
513 | |
* GETDNS_RETURN_NEED_MORE_SPACE will be returned when the buffer was too
|
514 | |
* small. The function will pretend that it had written beyond the end
|
515 | |
* of the buffer, and wire will point past the buffer and wire_sz will
|
516 | |
* contain a negative value.
|
517 | |
*/
|
518 | |
getdns_return_t
|
519 | |
getdns_rr_dict2wire_scan(
|
520 | |
const getdns_dict *rr_dict, uint8_t **wire, int *wire_sz);
|
521 | |
|
522 | |
|
523 | |
/**
|
524 | |
* Convert wireformat resource record in a getdns rr_dict representation.
|
525 | |
*
|
526 | |
* @param wire Buffer containing the wireformat rr
|
527 | |
* @param wire_sz Size of the wire buffer
|
528 | |
* @return rr_dict The returned rr_dict
|
529 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
530 | |
*/
|
531 | |
getdns_return_t
|
532 | |
getdns_wire2rr_dict(
|
533 | |
const uint8_t *wire, size_t wire_sz, getdns_dict **rr_dict);
|
534 | |
|
535 | |
/**
|
536 | |
* Convert wireformat resource record in a getdns rr_dict representation.
|
537 | |
*
|
538 | |
* @param wire Buffer containing the wireformat rr
|
539 | |
* @param wire_sz On input the size of the wire buffer
|
540 | |
* On output the length of the wireformat rr.
|
541 | |
* @return rr_dict The returned rr_dict
|
542 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
543 | |
*/
|
544 | |
getdns_return_t
|
545 | |
getdns_wire2rr_dict_buf(
|
546 | |
const uint8_t *wire, size_t *wire_sz, getdns_dict **rr_dict);
|
547 | |
|
548 | |
/**
|
549 | |
* Convert wireformat resource record in a getdns rr_dict representation.
|
550 | |
*
|
551 | |
* @param wire A pointer to the pointer of the wireformat buffer.
|
552 | |
* On return this pointer is moved to after first read
|
553 | |
* in resource record.
|
554 | |
* @param wire_sz On input the size of the wire buffer
|
555 | |
* On output the size is decreased with the length
|
556 | |
* of the wireformat resource record.
|
557 | |
* @return rr_dict The returned rr_dict
|
558 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
559 | |
*/
|
560 | |
getdns_return_t
|
561 | |
getdns_wire2rr_dict_scan(
|
562 | |
const uint8_t **wire, size_t *wire_sz, getdns_dict **rr_dict);
|
563 | |
|
564 | |
|
565 | |
/**
|
566 | |
* Convert rr_dict to the string representation of the resource record.
|
567 | |
*
|
568 | |
* @param rr_dict The getdns dict representation of the resource record
|
569 | |
* @return str A newly allocated string representation of the rr
|
570 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
571 | |
*/
|
572 | |
getdns_return_t
|
573 | |
getdns_rr_dict2str(
|
574 | |
const getdns_dict *rr_dict, char **str);
|
575 | |
|
576 | |
/**
|
577 | |
* Convert rr_dict to the string representation of the resource record.
|
578 | |
*
|
579 | |
* @param rr_dict The getdns dict representation of the resource record
|
580 | |
* @param str The buffer in which the string will be written
|
581 | |
* @param str_len On input the size of the text buffer,
|
582 | |
* On output the amount of characters needed to write
|
583 | |
* the string representation of the rr. Even if it does
|
584 | |
* not fit.
|
585 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
586 | |
* GETDNS_RETURN_NEED_MORE_SPACE will be returned when the buffer was too
|
587 | |
* small. str_len will be set to the needed buffer space then.
|
588 | |
*/
|
589 | |
getdns_return_t
|
590 | |
getdns_rr_dict2str_buf(
|
591 | |
const getdns_dict *rr_dict, char *str, size_t *str_len);
|
592 | |
|
593 | |
/**
|
594 | |
* Convert rr_dict to the string representation of the resource record.
|
595 | |
*
|
596 | |
* @param rr_dict The getdns dict representation of the resource record
|
597 | |
* @param str A pointer to the buffer pointer in which the string
|
598 | |
* will be written.
|
599 | |
* On output the buffer pointer will have moved along
|
600 | |
* the buffer and point right after the just written RR.
|
601 | |
* @param str_len On input the size of the str buffer,
|
602 | |
* On output the number of characters needed for the
|
603 | |
* string will have been substracted from strlen.
|
604 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
605 | |
* GETDNS_RETURN_NEED_MORE_SPACE will be returned when the buffer was too
|
606 | |
* small. The function will pretend that it had written beyond the end
|
607 | |
* of the buffer, and str will point past the buffer and str_len will
|
608 | |
* contain a negative value.
|
609 | |
*/
|
610 | |
getdns_return_t
|
611 | |
getdns_rr_dict2str_scan(
|
612 | |
const getdns_dict *rr_dict, char **str, int *str_len);
|
613 | |
|
614 | |
|
615 | |
/**
|
616 | |
* Convert the string representation of the resource record to rr_dict format.
|
617 | |
*
|
618 | |
* @param str String representation of the resource record.
|
619 | |
* @return rr_dict The result getdns dict representation of the resource record
|
620 | |
* @param origin Default suffix for not fully qualified domain names
|
621 | |
* @param default_ttl Default ttl
|
622 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
623 | |
*/
|
624 | |
getdns_return_t
|
625 | |
getdns_str2rr_dict(
|
626 | |
const char *str, getdns_dict **rr_dict,
|
627 | |
const char *origin, uint32_t default_ttl);
|
628 | |
|
629 | |
/**
|
630 | |
* Read the zonefile and convert to a list of rr_dict's.
|
631 | |
*
|
632 | |
* @param fp An opened FILE pointer on the zone file.
|
633 | |
* @return rr_list The result list of rr_dicts representing the zone file.
|
634 | |
* @param origin Default suffix for not fully qualified domain names
|
635 | |
* @param default_ttl Default ttl
|
636 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
637 | |
*/
|
638 | |
getdns_return_t
|
639 | |
getdns_fp2rr_list(
|
640 | |
FILE *in, getdns_list **rr_list,
|
641 | |
const char *origin, uint32_t default_ttl);
|
642 | |
|
643 | |
/**
|
644 | |
* Convert DNS message dict to wireformat representation.
|
645 | |
*
|
646 | |
* @param msg_dict The getdns dict representation of a DNS message
|
647 | |
* @return wire A newly allocated buffer which will contain the wireformat.
|
648 | |
* @return wire_sz The size of the allocated buffer and the wireformat.
|
649 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
650 | |
*/
|
651 | |
getdns_return_t
|
652 | |
getdns_msg_dict2wire(
|
653 | |
const getdns_dict *msg_dict, uint8_t **wire, size_t *wire_sz);
|
654 | |
|
655 | |
/**
|
656 | |
* Convert DNS message dict to wireformat representation.
|
657 | |
*
|
658 | |
* @param msg_dict The getdns dict representation of a DNS message
|
659 | |
* @param wire The buffer in which the wireformat will be written
|
660 | |
* @param wire_sz On input the size of the wire buffer,
|
661 | |
* On output the amount of wireformat needed for the
|
662 | |
* wireformat representation of the DNS message;
|
663 | |
* even if it did not fit.
|
664 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
665 | |
* GETDNS_RETURN_NEED_MORE_SPACE will be returned when the buffer was too
|
666 | |
* small. wire_sz will be set to the needed buffer space then.
|
667 | |
*/
|
668 | |
getdns_return_t
|
669 | |
getdns_msg_dict2wire_buf(
|
670 | |
const getdns_dict *msg_dict, uint8_t *wire, size_t *wire_sz);
|
671 | |
|
672 | |
/**
|
673 | |
* Convert DNS message dict to wireformat representation.
|
674 | |
*
|
675 | |
* @param msg_dict The getdns dict representation of the DNS message
|
676 | |
* @param wire A pointer to the buffer pointer in which the wireformat
|
677 | |
* will be written.
|
678 | |
* On output the buffer pointer will have moved along
|
679 | |
* the buffer and point right after the just written RR.
|
680 | |
* @param wire_sz On input the size of the wire buffer,
|
681 | |
* On output the amount of wireformat needed for the
|
682 | |
* wireformat will have been substracted from wire_sz.
|
683 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
684 | |
* GETDNS_RETURN_NEED_MORE_SPACE will be returned when the buffer was too
|
685 | |
* small. The function will pretend that it had written beyond the end
|
686 | |
* of the buffer, and wire will point past the buffer and wire_sz will
|
687 | |
* contain a negative value.
|
688 | |
*/
|
689 | |
getdns_return_t
|
690 | |
getdns_msg_dict2wire_scan(
|
691 | |
const getdns_dict *msg_dict, uint8_t **wire, int *wire_sz);
|
692 | |
|
693 | |
|
694 | |
/**
|
695 | |
* Convert wireformat DNS message in a getdns msg_dict representation.
|
696 | |
*
|
697 | |
* @param wire Buffer containing the wireformat rr
|
698 | |
* @param wire_sz Size of the wire buffer
|
699 | |
* @return msg_dict The returned DNS message
|
700 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
701 | |
*/
|
702 | |
getdns_return_t
|
703 | |
getdns_wire2msg_dict(
|
704 | |
const uint8_t *wire, size_t wire_sz, getdns_dict **msg_dict);
|
705 | |
|
706 | |
/**
|
707 | |
* Convert wireformat DNS message in a getdns msg_dict representation.
|
708 | |
*
|
709 | |
* @param wire Buffer containing the wireformat rr
|
710 | |
* @param wire_sz On input the size of the wire buffer
|
711 | |
* On output the length of the wireformat rr.
|
712 | |
* @return msg_dict The returned DNS message
|
713 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
714 | |
*/
|
715 | |
getdns_return_t
|
716 | |
getdns_wire2msg_dict_buf(
|
717 | |
const uint8_t *wire, size_t *wire_sz, getdns_dict **msg_dict);
|
718 | |
|
719 | |
/**
|
720 | |
* Convert wireformat DNS message in a getdns msg_dic representation.
|
721 | |
*
|
722 | |
* @param wire A pointer to the pointer of the wireformat buffer.
|
723 | |
* On return this pointer is moved to after first read
|
724 | |
* in resource record.
|
725 | |
* @param wire_sz On input the size of the wire buffer
|
726 | |
* On output the size is decreased with the length
|
727 | |
* of the wireformat DNS message.
|
728 | |
* @return msg_dict The returned DNS message
|
729 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
730 | |
*/
|
731 | |
getdns_return_t
|
732 | |
getdns_wire2msg_dict_scan(
|
733 | |
const uint8_t **wire, size_t *wire_sz, getdns_dict **msg_dict);
|
734 | |
|
735 | |
|
736 | |
/**
|
737 | |
* Convert msg_dict to the string representation of the DNS message.
|
738 | |
*
|
739 | |
* @param msg_dict The getdns dict representation of the DNS message
|
740 | |
* @return str A newly allocated string representation of the rr
|
741 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
742 | |
*/
|
743 | |
getdns_return_t
|
744 | |
getdns_msg_dict2str(
|
745 | |
const getdns_dict *msg_dict, char **str);
|
746 | |
|
747 | |
/**
|
748 | |
* Convert msg_dict to the string representation of the DNS message.
|
749 | |
*
|
750 | |
* @param msg_dict The getdns dict representation of the resource record
|
751 | |
* @param str The buffer in which the string will be written
|
752 | |
* @param str_len On input the size of the text buffer,
|
753 | |
* On output the amount of characters needed to write
|
754 | |
* the string representation of the rr. Even if it does
|
755 | |
* not fit.
|
756 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
757 | |
* GETDNS_RETURN_NEED_MORE_SPACE will be returned when the buffer was too
|
758 | |
* small. str_len will be set to the needed buffer space then.
|
759 | |
*/
|
760 | |
getdns_return_t
|
761 | |
getdns_msg_dict2str_buf(
|
762 | |
const getdns_dict *msg_dict, char *str, size_t *str_len);
|
763 | |
|
764 | |
/**
|
765 | |
* Convert msg_dict to the string representation of the resource record.
|
766 | |
*
|
767 | |
* @param msg_dict The getdns dict representation of the resource record
|
768 | |
* @param str A pointer to the buffer pointer in which the string
|
769 | |
* will be written.
|
770 | |
* On output the buffer pointer will have moved along
|
771 | |
* the buffer and point right after the just written RR.
|
772 | |
* @param str_len On input the size of the str buffer,
|
773 | |
* On output the number of characters needed for the
|
774 | |
* string will have been substracted from strlen.
|
775 | |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
776 | |
* GETDNS_RETURN_NEED_MORE_SPACE will be returned when the buffer was too
|
777 | |
* small. The function will pretend that it had written beyond the end
|
778 | |
* of the buffer, and str will point past the buffer and str_len will
|
779 | |
* contain a negative value.
|
780 | |
*/
|
781 | |
getdns_return_t
|
782 | |
getdns_msg_dict2str_scan(
|
783 | |
const getdns_dict *msg_dict, char **str, int *str_len);
|
784 | |
|
|
399 |
/* dict util */
|
|
400 |
/* set a string as bindata */
|
|
401 |
getdns_return_t getdns_dict_util_set_string(struct getdns_dict * dict,
|
|
402 |
char *name, const char *value);
|
|
403 |
|
|
404 |
/* get a string from a dict. the result must be freed if valid */
|
|
405 |
getdns_return_t getdns_dict_util_get_string(struct getdns_dict * dict,
|
|
406 |
char *name, char **result);
|
785 | 407 |
|
786 | 408 |
/**
|
787 | 409 |
* Validate replies or resource records.
|
|
817 | 439 |
getdns_list *trust_anchors,
|
818 | 440 |
time_t validation_time, uint32_t skew);
|
819 | 441 |
|
820 | |
|
821 | |
#define GETDNS_APPEND_NAME_TO_SINGLE_LABEL_FIRST ((getdns_append_name_t) 554 )
|
822 | |
#define GETDNS_APPEND_NAME_TO_SINGLE_LABEL_FIRST_TEXT "See getdns_context_set_append_name()"
|
823 | |
|
|
442 |
/**
|
|
443 |
* Public Key Pinning functionality:
|
|
444 |
*
|
|
445 |
* a public key pinset is a list of dicts. each dict should have a
|
|
446 |
* "digest" and a "value".
|
|
447 |
*
|
|
448 |
* "digest": a string indicating the type of digest. at the moment, we
|
|
449 |
* only support a "digest" of "sha256".
|
|
450 |
*
|
|
451 |
* "value": a binary representation of the digest provided.
|
|
452 |
*
|
|
453 |
* given a such a pinset, we should be able to validate a chain
|
|
454 |
* properly according to section 2.6 of RFC 7469.
|
|
455 |
*/
|
|
456 |
|
|
457 |
/**
|
|
458 |
* convert an HPKP-style pin description to an appropriate getdns data
|
|
459 |
* structure. An example string is: (with the quotes, without any
|
|
460 |
* leading or trailing whitespace):
|
|
461 |
*
|
|
462 |
* pin-sha256="E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g="
|
|
463 |
*
|
|
464 |
* It is the caller's responsibility to call getdns_dict_destroy() on
|
|
465 |
* the dict returned when it is no longer needed.
|
|
466 |
*
|
|
467 |
* @param context a context to use to create the dict, or NULL to create
|
|
468 |
* it generically
|
|
469 |
* @param str the pinning string to parse
|
|
470 |
* @return a dict created from ctx, or NULL if the string did not match.
|
|
471 |
*/
|
|
472 |
getdns_dict* getdns_pubkey_pin_create_from_string(
|
|
473 |
getdns_context* context,
|
|
474 |
const char* str);
|
|
475 |
|
|
476 |
|
|
477 |
/**
|
|
478 |
* Test whether a given pinset is reasonable, including:
|
|
479 |
*
|
|
480 |
* is it well-formed?
|
|
481 |
* are there at least two pins?
|
|
482 |
* are the digests used sane?
|
|
483 |
*
|
|
484 |
* @param pinset the set of public key pins to check for sanity. This
|
|
485 |
* should be a list of dicts.
|
|
486 |
* @return errorlist if not NULL, a list of human-readable strings is
|
|
487 |
* appended to errorlist.
|
|
488 |
* @return GETDNS_RETURN_GOOD if the pinset passes the sanity check.
|
|
489 |
*/
|
|
490 |
getdns_return_t getdns_pubkey_pinset_sanity_check(
|
|
491 |
const getdns_list* pinset,
|
|
492 |
getdns_list* errorlist);
|
|
493 |
|
|
494 |
|
|
495 |
/**
|
|
496 |
* Pretty print the getdns_dict in a given buffer snprintf style.
|
|
497 |
* @param str pointer to the buffer to print to
|
|
498 |
* @param size size of the given buffer. No more than size bytes (including
|
|
499 |
* the terminating null byte) will be written to str.
|
|
500 |
* @param dict getdns_dict to print
|
|
501 |
* @return The number of characters written excluding the terminating null byte
|
|
502 |
* or the number of characters which would have been written if enough space
|
|
503 |
* had been available.
|
|
504 |
*/
|
|
505 |
int
|
|
506 |
getdns_pretty_snprint_dict(char *str, size_t size, const getdns_dict *dict);
|
|
507 |
|
|
508 |
/**
|
|
509 |
* creates a string that describes the list in a human readable form.
|
|
510 |
* @param some_list list to pretty print
|
|
511 |
* @return character array (caller must free this) containing pretty string
|
|
512 |
*/
|
|
513 |
char *
|
|
514 |
getdns_pretty_print_list(const getdns_list *some_list);
|
|
515 |
|
|
516 |
/**
|
|
517 |
* Pretty print the getdns_list in a given buffer snprintf style.
|
|
518 |
* @param str pointer to the buffer to print to
|
|
519 |
* @param size size of the given buffer. No more than size bytes (including
|
|
520 |
* the terminating null byte) will be written to str.
|
|
521 |
* @param list getdns_list to print
|
|
522 |
* @return The number of characters written excluding the terminating null byte
|
|
523 |
* or the number of characters which would have been written if enough space
|
|
524 |
* had been available.
|
|
525 |
*/
|
|
526 |
int
|
|
527 |
getdns_pretty_snprint_list(char *str, size_t size, const getdns_list *list);
|
|
528 |
|
|
529 |
/**
|
|
530 |
* creates a string containing a json representation of some_dict.
|
|
531 |
* bindatas are converted to strings when possible, including bindatas for
|
|
532 |
* addresses, dnames and other printable data. All other bindatas are
|
|
533 |
* converted to lists of byte values.
|
|
534 |
* @param some_dict dict to represent as json data
|
|
535 |
* @param pretty when non-zero returns formatted json
|
|
536 |
* @return character array (caller must free this) containing pretty string
|
|
537 |
*/
|
|
538 |
char *
|
|
539 |
getdns_print_json_dict(const getdns_dict *some_dict, int pretty);
|
|
540 |
|
|
541 |
/**
|
|
542 |
* Prints a json representation of dict in a given buffer snprintf style.
|
|
543 |
* bindatas are converted to strings when possible, including bindatas for
|
|
544 |
* addresses, dnames and other printable data. All other bindatas are
|
|
545 |
* converted to lists of byte values.
|
|
546 |
* @param str pointer to the buffer to print to
|
|
547 |
* @param size size of the given buffer. No more than size bytes (including
|
|
548 |
* the terminating null byte) will be written to str.
|
|
549 |
* @param dict dict to represent as json data
|
|
550 |
* @param pretty when non-zero returns formatted json
|
|
551 |
* @return The number of characters written excluding the terminating null byte
|
|
552 |
* or the number of characters which would have been written if enough space
|
|
553 |
* had been available.
|
|
554 |
*/
|
|
555 |
int
|
|
556 |
getdns_snprint_json_dict(
|
|
557 |
char *str, size_t size, const getdns_dict *dict, int pretty);
|
|
558 |
|
|
559 |
/**
|
|
560 |
* creates a string containing a json representation of some_list.
|
|
561 |
* bindatas are converted to strings when possible, including bindatas for
|
|
562 |
* addresses, dnames and other printable data. All other bindatas are
|
|
563 |
* converted to lists of byte values.
|
|
564 |
* @param some_list list to represent as json data
|
|
565 |
* @param pretty when non-zero returns formatted json
|
|
566 |
* @return character array (caller must free this) containing pretty string
|
|
567 |
*/
|
|
568 |
char *
|
|
569 |
getdns_print_json_list(const getdns_list *some_list, int pretty);
|
|
570 |
|
|
571 |
/**
|
|
572 |
* Prints a json representation of list in a given buffer snprintf style.
|
|
573 |
* bindatas are converted to strings when possible, including bindatas for
|
|
574 |
* addresses, dnames and other printable data. All other bindatas are
|
|
575 |
* converted to lists of byte values.
|
|
576 |
* @param str pointer to the buffer to print to
|
|
577 |
* @param size size of the given buffer. No more than size bytes (including
|
|
578 |
* the terminating null byte) will be written to str.
|
|
579 |
* @param list list to represent as json data
|
|
580 |
* @param pretty when non-zero returns formatted json
|
|
581 |
* @return The number of characters written excluding the terminating null byte
|
|
582 |
* or the number of characters which would have been written if enough space
|
|
583 |
* had been available.
|
|
584 |
*/
|
|
585 |
int
|
|
586 |
getdns_snprint_json_list(
|
|
587 |
char *str, size_t size, const getdns_list *list, int pretty);
|
|
588 |
|
|
589 |
|
|
590 |
/**
|
|
591 |
* Convert rr_dict to wireformat representation of the resource record.
|
|
592 |
*
|
|
593 |
* @param rr_dict The getdns dict representation of the resource record
|
|
594 |
* @return wire A newly allocated buffer which will contain the wireformat.
|
|
595 |
* @return wire_sz The size of the allocated buffer and the wireformat.
|
|
596 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
597 |
*/
|
|
598 |
getdns_return_t
|
|
599 |
getdns_rr_dict2wire(
|
|
600 |
const getdns_dict *rr_dict, uint8_t **wire, size_t *wire_sz);
|
|
601 |
|
|
602 |
/**
|
|
603 |
* Convert rr_dict to wireformat representation of the resource record.
|
|
604 |
*
|
|
605 |
* @param rr_dict The getdns dict representation of the resource record
|
|
606 |
* @param wire The buffer in which the wireformat will be written
|
|
607 |
* @param wire_sz On input the size of the wire buffer,
|
|
608 |
* On output the amount of wireformat needed for the
|
|
609 |
* wireformat representation of the resource record;
|
|
610 |
* even if it did not fit.
|
|
611 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
612 |
* GETDNS_RETURN_NEED_MORE_SPACE will be returned when the buffer was too
|
|
613 |
* small. wire_sz will be set to the needed buffer space then.
|
|
614 |
*/
|
|
615 |
getdns_return_t
|
|
616 |
getdns_rr_dict2wire_buf(
|
|
617 |
const getdns_dict *rr_dict, uint8_t *wire, size_t *wire_sz);
|
|
618 |
|
|
619 |
/**
|
|
620 |
* Convert rr_dict to wireformat representation of the resource record.
|
|
621 |
*
|
|
622 |
* @param rr_dict The getdns dict representation of the resource record
|
|
623 |
* @param wire A pointer to the buffer pointer in which the wireformat
|
|
624 |
* will be written.
|
|
625 |
* On output the buffer pointer will have moved along
|
|
626 |
* the buffer and point right after the just written RR.
|
|
627 |
* @param wire_sz On input the size of the wire buffer,
|
|
628 |
* On output the amount of wireformat needed for the
|
|
629 |
* wireformat will have been substracted from wire_sz.
|
|
630 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
631 |
* GETDNS_RETURN_NEED_MORE_SPACE will be returned when the buffer was too
|
|
632 |
* small. The function will pretend that it had written beyond the end
|
|
633 |
* of the buffer, and wire will point past the buffer and wire_sz will
|
|
634 |
* contain a negative value.
|
|
635 |
*/
|
|
636 |
getdns_return_t
|
|
637 |
getdns_rr_dict2wire_scan(
|
|
638 |
const getdns_dict *rr_dict, uint8_t **wire, int *wire_sz);
|
|
639 |
|
|
640 |
|
|
641 |
/**
|
|
642 |
* Convert wireformat resource record in a getdns rr_dict representation.
|
|
643 |
*
|
|
644 |
* @param wire Buffer containing the wireformat rr
|
|
645 |
* @param wire_sz Size of the wire buffer
|
|
646 |
* @return rr_dict The returned rr_dict
|
|
647 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
648 |
*/
|
|
649 |
getdns_return_t
|
|
650 |
getdns_wire2rr_dict(
|
|
651 |
const uint8_t *wire, size_t wire_sz, getdns_dict **rr_dict);
|
|
652 |
|
|
653 |
/**
|
|
654 |
* Convert wireformat resource record in a getdns rr_dict representation.
|
|
655 |
*
|
|
656 |
* @param wire Buffer containing the wireformat rr
|
|
657 |
* @param wire_sz On input the size of the wire buffer
|
|
658 |
* On output the length of the wireformat rr.
|
|
659 |
* @return rr_dict The returned rr_dict
|
|
660 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
661 |
*/
|
|
662 |
getdns_return_t
|
|
663 |
getdns_wire2rr_dict_buf(
|
|
664 |
const uint8_t *wire, size_t *wire_sz, getdns_dict **rr_dict);
|
|
665 |
|
|
666 |
/**
|
|
667 |
* Convert wireformat resource record in a getdns rr_dict representation.
|
|
668 |
*
|
|
669 |
* @param wire A pointer to the pointer of the wireformat buffer.
|
|
670 |
* On return this pointer is moved to after first read
|
|
671 |
* in resource record.
|
|
672 |
* @param wire_sz On input the size of the wire buffer
|
|
673 |
* On output the size is decreased with the length
|
|
674 |
* of the wireformat resource record.
|
|
675 |
* @return rr_dict The returned rr_dict
|
|
676 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
677 |
*/
|
|
678 |
getdns_return_t
|
|
679 |
getdns_wire2rr_dict_scan(
|
|
680 |
const uint8_t **wire, size_t *wire_sz, getdns_dict **rr_dict);
|
|
681 |
|
|
682 |
|
|
683 |
/**
|
|
684 |
* Convert rr_dict to the string representation of the resource record.
|
|
685 |
*
|
|
686 |
* @param rr_dict The getdns dict representation of the resource record
|
|
687 |
* @return str A newly allocated string representation of the rr
|
|
688 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
689 |
*/
|
|
690 |
getdns_return_t
|
|
691 |
getdns_rr_dict2str(
|
|
692 |
const getdns_dict *rr_dict, char **str);
|
|
693 |
|
|
694 |
/**
|
|
695 |
* Convert rr_dict to the string representation of the resource record.
|
|
696 |
*
|
|
697 |
* @param rr_dict The getdns dict representation of the resource record
|
|
698 |
* @param str The buffer in which the string will be written
|
|
699 |
* @param str_len On input the size of the text buffer,
|
|
700 |
* On output the amount of characters needed to write
|
|
701 |
* the string representation of the rr. Even if it does
|
|
702 |
* not fit.
|
|
703 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
704 |
* GETDNS_RETURN_NEED_MORE_SPACE will be returned when the buffer was too
|
|
705 |
* small. str_len will be set to the needed buffer space then.
|
|
706 |
*/
|
|
707 |
getdns_return_t
|
|
708 |
getdns_rr_dict2str_buf(
|
|
709 |
const getdns_dict *rr_dict, char *str, size_t *str_len);
|
|
710 |
|
|
711 |
/**
|
|
712 |
* Convert rr_dict to the string representation of the resource record.
|
|
713 |
*
|
|
714 |
* @param rr_dict The getdns dict representation of the resource record
|
|
715 |
* @param str A pointer to the buffer pointer in which the string
|
|
716 |
* will be written.
|
|
717 |
* On output the buffer pointer will have moved along
|
|
718 |
* the buffer and point right after the just written RR.
|
|
719 |
* @param str_len On input the size of the str buffer,
|
|
720 |
* On output the number of characters needed for the
|
|
721 |
* string will have been substracted from strlen.
|
|
722 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
723 |
* GETDNS_RETURN_NEED_MORE_SPACE will be returned when the buffer was too
|
|
724 |
* small. The function will pretend that it had written beyond the end
|
|
725 |
* of the buffer, and str will point past the buffer and str_len will
|
|
726 |
* contain a negative value.
|
|
727 |
*/
|
|
728 |
getdns_return_t
|
|
729 |
getdns_rr_dict2str_scan(
|
|
730 |
const getdns_dict *rr_dict, char **str, int *str_len);
|
|
731 |
|
|
732 |
|
|
733 |
/**
|
|
734 |
* Convert the string representation of the resource record to rr_dict format.
|
|
735 |
*
|
|
736 |
* @param str String representation of the resource record.
|
|
737 |
* @return rr_dict The result getdns dict representation of the resource record
|
|
738 |
* @param origin Default suffix for not fully qualified domain names
|
|
739 |
* @param default_ttl Default ttl
|
|
740 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
741 |
*/
|
|
742 |
getdns_return_t
|
|
743 |
getdns_str2rr_dict(
|
|
744 |
const char *str, getdns_dict **rr_dict,
|
|
745 |
const char *origin, uint32_t default_ttl);
|
|
746 |
|
|
747 |
/**
|
|
748 |
* Read the zonefile and convert to a list of rr_dict's.
|
|
749 |
*
|
|
750 |
* @param FILE An opened FILE pointer on the zone file.
|
|
751 |
* @return rr_list The result list of rr_dicts representing the zone file.
|
|
752 |
* @param origin Default suffix for not fully qualified domain names
|
|
753 |
* @param default_ttl Default ttl
|
|
754 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
755 |
*/
|
|
756 |
getdns_return_t
|
|
757 |
getdns_fp2rr_list(
|
|
758 |
FILE *in, getdns_list **rr_list,
|
|
759 |
const char *origin, uint32_t default_ttl);
|
|
760 |
|
|
761 |
/**
|
|
762 |
* Convert DNS message dict to wireformat representation.
|
|
763 |
*
|
|
764 |
* @param msg_dict The getdns dict representation of a DNS message
|
|
765 |
* @return wire A newly allocated buffer which will contain the wireformat.
|
|
766 |
* @return wire_sz The size of the allocated buffer and the wireformat.
|
|
767 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
768 |
*/
|
|
769 |
getdns_return_t
|
|
770 |
getdns_msg_dict2wire(
|
|
771 |
const getdns_dict *msg_dict, uint8_t **wire, size_t *wire_sz);
|
|
772 |
|
|
773 |
/**
|
|
774 |
* Convert DNS message dict to wireformat representation.
|
|
775 |
*
|
|
776 |
* @param msg_dict The getdns dict representation of a DNS message
|
|
777 |
* @param wire The buffer in which the wireformat will be written
|
|
778 |
* @param wire_sz On input the size of the wire buffer,
|
|
779 |
* On output the amount of wireformat needed for the
|
|
780 |
* wireformat representation of the DNS message;
|
|
781 |
* even if it did not fit.
|
|
782 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
783 |
* GETDNS_RETURN_NEED_MORE_SPACE will be returned when the buffer was too
|
|
784 |
* small. wire_sz will be set to the needed buffer space then.
|
|
785 |
*/
|
|
786 |
getdns_return_t
|
|
787 |
getdns_msg_dict2wire_buf(
|
|
788 |
const getdns_dict *msg_dict, uint8_t *wire, size_t *wire_sz);
|
|
789 |
|
|
790 |
/**
|
|
791 |
* Convert DNS message dict to wireformat representation.
|
|
792 |
*
|
|
793 |
* @param msg_dict The getdns dict representation of the DNS message
|
|
794 |
* @param wire A pointer to the buffer pointer in which the wireformat
|
|
795 |
* will be written.
|
|
796 |
* On output the buffer pointer will have moved along
|
|
797 |
* the buffer and point right after the just written RR.
|
|
798 |
* @param wire_sz On input the size of the wire buffer,
|
|
799 |
* On output the amount of wireformat needed for the
|
|
800 |
* wireformat will have been substracted from wire_sz.
|
|
801 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
802 |
* GETDNS_RETURN_NEED_MORE_SPACE will be returned when the buffer was too
|
|
803 |
* small. The function will pretend that it had written beyond the end
|
|
804 |
* of the buffer, and wire will point past the buffer and wire_sz will
|
|
805 |
* contain a negative value.
|
|
806 |
*/
|
|
807 |
getdns_return_t
|
|
808 |
getdns_msg_dict2wire_scan(
|
|
809 |
const getdns_dict *msg_dict, uint8_t **wire, int *wire_sz);
|
|
810 |
|
|
811 |
|
|
812 |
/**
|
|
813 |
* Convert wireformat DNS message in a getdns msg_dict representation.
|
|
814 |
*
|
|
815 |
* @param wire Buffer containing the wireformat rr
|
|
816 |
* @param wire_sz Size of the wire buffer
|
|
817 |
* @return msg_dict The returned DNS message
|
|
818 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
819 |
*/
|
|
820 |
getdns_return_t
|
|
821 |
getdns_wire2msg_dict(
|
|
822 |
const uint8_t *wire, size_t wire_sz, getdns_dict **msg_dict);
|
|
823 |
|
|
824 |
/**
|
|
825 |
* Convert wireformat DNS message in a getdns msg_dict representation.
|
|
826 |
*
|
|
827 |
* @param wire Buffer containing the wireformat rr
|
|
828 |
* @param wire_sz On input the size of the wire buffer
|
|
829 |
* On output the length of the wireformat rr.
|
|
830 |
* @return msg_dict The returned DNS message
|
|
831 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
832 |
*/
|
|
833 |
getdns_return_t
|
|
834 |
getdns_wire2msg_dict_buf(
|
|
835 |
const uint8_t *wire, size_t *wire_sz, getdns_dict **msg_dict);
|
|
836 |
|
|
837 |
/**
|
|
838 |
* Convert wireformat DNS message in a getdns msg_dic representation.
|
|
839 |
*
|
|
840 |
* @param wire A pointer to the pointer of the wireformat buffer.
|
|
841 |
* On return this pointer is moved to after first read
|
|
842 |
* in resource record.
|
|
843 |
* @param wire_sz On input the size of the wire buffer
|
|
844 |
* On output the size is decreased with the length
|
|
845 |
* of the wireformat DNS message.
|
|
846 |
* @return msg_dict The returned DNS message
|
|
847 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
848 |
*/
|
|
849 |
getdns_return_t
|
|
850 |
getdns_wire2msg_dict_scan(
|
|
851 |
const uint8_t **wire, size_t *wire_sz, getdns_dict **msg_dict);
|
|
852 |
|
|
853 |
|
|
854 |
/**
|
|
855 |
* Convert msg_dict to the string representation of the DNS message.
|
|
856 |
*
|
|
857 |
* @param msg_dict The getdns dict representation of the DNS message
|
|
858 |
* @return str A newly allocated string representation of the rr
|
|
859 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
860 |
*/
|
|
861 |
getdns_return_t
|
|
862 |
getdns_msg_dict2str(
|
|
863 |
const getdns_dict *msg_dict, char **str);
|
|
864 |
|
|
865 |
/**
|
|
866 |
* Convert msg_dict to the string representation of the DNS message.
|
|
867 |
*
|
|
868 |
* @param msg_dict The getdns dict representation of the resource record
|
|
869 |
* @param str The buffer in which the string will be written
|
|
870 |
* @param str_len On input the size of the text buffer,
|
|
871 |
* On output the amount of characters needed to write
|
|
872 |
* the string representation of the rr. Even if it does
|
|
873 |
* not fit.
|
|
874 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
875 |
* GETDNS_RETURN_NEED_MORE_SPACE will be returned when the buffer was too
|
|
876 |
* small. str_len will be set to the needed buffer space then.
|
|
877 |
*/
|
|
878 |
getdns_return_t
|
|
879 |
getdns_msg_dict2str_buf(
|
|
880 |
const getdns_dict *msg_dict, char *str, size_t *str_len);
|
|
881 |
|
|
882 |
/**
|
|
883 |
* Convert msg_dict to the string representation of the resource record.
|
|
884 |
*
|
|
885 |
* @param msg_dict The getdns dict representation of the resource record
|
|
886 |
* @param str A pointer to the buffer pointer in which the string
|
|
887 |
* will be written.
|
|
888 |
* On output the buffer pointer will have moved along
|
|
889 |
* the buffer and point right after the just written RR.
|
|
890 |
* @param str_len On input the size of the str buffer,
|
|
891 |
* On output the number of characters needed for the
|
|
892 |
* string will have been substracted from strlen.
|
|
893 |
* @return GETDNS_RETURN_GOOD on success or an error code on failure.
|
|
894 |
* GETDNS_RETURN_NEED_MORE_SPACE will be returned when the buffer was too
|
|
895 |
* small. The function will pretend that it had written beyond the end
|
|
896 |
* of the buffer, and str will point past the buffer and str_len will
|
|
897 |
* contain a negative value.
|
|
898 |
*/
|
|
899 |
getdns_return_t
|
|
900 |
getdns_msg_dict2str_scan(
|
|
901 |
const getdns_dict *msg_dict, char **str, int *str_len);
|
|
902 |
/** @}
|
|
903 |
*/
|
|
904 |
|
|
905 |
|
|
906 |
/**
|
|
907 |
* \defgroup Uutilityfunctionsdeprecated Additional utility functions (will be deprecated)
|
|
908 |
* @{
|
|
909 |
*/
|
|
910 |
/* WARNING! Function getdns_strerror is not in the API specification and
|
|
911 |
* is likely to be removed from future versions of our implementation, to be
|
|
912 |
* replaced by getdns_get_errorstr_by_id or something similar.
|
|
913 |
* Please use getdns_get_errorstr_by_id instead of getdns_strerror.
|
|
914 |
*/
|
|
915 |
getdns_return_t getdns_strerror(getdns_return_t err, char *buf, size_t buflen);
|
|
916 |
/** @}
|
|
917 |
*/
|
|
918 |
/** @}
|
|
919 |
*/
|
|
920 |
|
|
921 |
/** @}
|
|
922 |
*/
|
824 | 923 |
|
825 | 924 |
#ifdef __cplusplus
|
826 | 925 |
}
|