getdns.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright (c) 2013, NLNet Labs, Verisign, Inc.
11  * All rights reserved.
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions are met:
15  * * Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  * * Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in the
19  * documentation and/or other materials provided with the distribution.
20  * * Neither the names of the copyright holders nor the
21  * names of its contributors may be used to endorse or promote products
22  * derived from this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
25  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27  * DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
28  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 
37 #ifndef GETDNS_H
38 #define GETDNS_H
39 
40 #include <stdint.h>
41 #include <stdlib.h>
42 #include <time.h>
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 #define GETDNS_COMPILATION_COMMENT "getdns 1.1.0-rc1 configured on 2017-03-23T15:59:37Z for the December 2015 version of the API"
49 
63 typedef enum getdns_return_t {
80 
81 
82 #define GETDNS_RETURN_GOOD_TEXT "Good"
83 #define GETDNS_RETURN_GENERIC_ERROR_TEXT "Generic error"
84 #define GETDNS_RETURN_BAD_DOMAIN_NAME_TEXT "Badly-formed domain name in first argument"
85 #define GETDNS_RETURN_BAD_CONTEXT_TEXT "The context has internal deficiencies"
86 #define GETDNS_RETURN_CONTEXT_UPDATE_FAIL_TEXT "Did not update the context"
87 #define GETDNS_RETURN_UNKNOWN_TRANSACTION_TEXT "An attempt was made to cancel a callback with a transaction_id that is not recognized"
88 #define GETDNS_RETURN_NO_SUCH_LIST_ITEM_TEXT "A helper function for lists had an index argument that was too high."
89 #define GETDNS_RETURN_NO_SUCH_DICT_NAME_TEXT "A helper function for dicts had a name argument that for a name that is not in the dict."
90 #define GETDNS_RETURN_WRONG_TYPE_REQUESTED_TEXT "A helper function was supposed to return a certain type for an item, but the wrong type was given."
91 #define GETDNS_RETURN_NO_SUCH_EXTENSION_TEXT "A name in the extensions dict is not a valid extension."
92 #define GETDNS_RETURN_EXTENSION_MISFORMAT_TEXT "One or more of the extensions have a bad format."
93 #define GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED_TEXT "A query was made with a context that is using stub resolution and a DNSSEC extension specified."
94 #define GETDNS_RETURN_MEMORY_ERROR_TEXT "Unable to allocate the memory required."
95 #define GETDNS_RETURN_INVALID_PARAMETER_TEXT "A required parameter had an invalid value."
96 #define GETDNS_RETURN_NOT_IMPLEMENTED_TEXT "The library did not have the requested API feature implemented."
97 
105 #define GETDNS_DNSSEC_SECURE 400
106 #define GETDNS_DNSSEC_SECURE_TEXT "The record was determined to be secure in DNSSEC"
107 #define GETDNS_DNSSEC_BOGUS 401
108 #define GETDNS_DNSSEC_BOGUS_TEXT "The record was determined to be bogus in DNSSEC"
109 #define GETDNS_DNSSEC_INDETERMINATE 402
110 #define GETDNS_DNSSEC_INDETERMINATE_TEXT "The record was not determined to be any state in DNSSEC"
111 #define GETDNS_DNSSEC_INSECURE 403
112 #define GETDNS_DNSSEC_INSECURE_TEXT "The record was determined to be insecure in DNSSEC"
113 #define GETDNS_DNSSEC_NOT_PERFORMED 404
114 #define GETDNS_DNSSEC_NOT_PERFORMED_TEXT "DNSSEC validation was not performed (only used for debugging)"
115 
123 typedef enum getdns_namespace_t {
127  GETDNS_NAMESPACE_MDNS = 503,
132 #define GETDNS_NAMESPACE_DNS_TEXT "See getdns_context_set_namespaces()"
133 #define GETDNS_NAMESPACE_LOCALNAMES_TEXT "See getdns_context_set_namespaces()"
134 #define GETDNS_NAMESPACE_NETBIOS_TEXT "See getdns_context_set_namespaces()"
135 #define GETDNS_NAMESPACE_MDNS_TEXT "See getdns_context_set_namespaces()"
136 #define GETDNS_NAMESPACE_NIS_TEXT "See getdns_context_set_namespaces()"
137 
145 typedef enum getdns_resolution_t {
150 
151 #define GETDNS_RESOLUTION_STUB_TEXT "See getdns_context_set_resolution_type()"
152 #define GETDNS_RESOLUTION_RECURSING_TEXT "See getdns_context_set_resolution_type()"
153 
161 typedef enum getdns_redirects_t {
165 
166 
167 #define GETDNS_REDIRECTS_FOLLOW_TEXT "See getdns_context_set_follow_redirects()"
168 #define GETDNS_REDIRECTS_DO_NOT_FOLLOW_TEXT "See getdns_context_set_follow_redirects()"
169 
177 typedef enum getdns_transport_t {
183 
184 #define GETDNS_TRANSPORT_UDP_FIRST_AND_FALL_BACK_TO_TCP_TEXT "See getdns_context_set_dns_transport()"
185 #define GETDNS_TRANSPORT_UDP_ONLY_TEXT "See getdns_context_set_dns_transport()"
186 #define GETDNS_TRANSPORT_TCP_ONLY_TEXT "See getdns_context_set_dns_transport()"
187 #define GETDNS_TRANSPORT_TCP_ONLY_KEEP_CONNECTIONS_OPEN_TEXT "See getdns_context_set_dns_transport()"
188 
196 /* Base transports for use in transport list */
197 typedef enum getdns_transport_list_t {
202 
203 
204 #define GETDNS_TRANSPORT_UDP_TEXT "See getdns_context_set_dns_transport_list()"
205 #define GETDNS_TRANSPORT_TCP_TEXT "See getdns_context_set_dns_transport_list()"
206 #define GETDNS_TRANSPORT_TLS_TEXT "See getdns_context_set_dns_transport_list()"
207 
215 typedef enum getdns_append_name_t {
221 
222 
223 #define GETDNS_APPEND_NAME_ALWAYS_TEXT "See getdns_context_set_append_name()"
224 #define GETDNS_APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE_TEXT "See getdns_context_set_append_name()"
225 #define GETDNS_APPEND_NAME_ONLY_TO_MULTIPLE_LABEL_NAME_AFTER_FAILURE_TEXT "See getdns_context_set_append_name()"
226 #define GETDNS_APPEND_NAME_NEVER_TEXT "See getdns_context_set_append_name()"
227 
235 /* Context codes */
236 typedef enum getdns_context_code_t {
258 #define GETDNS_CONTEXT_CODE_NAMESPACES_TEXT "Change related to getdns_context_set_namespaces"
259 #define GETDNS_CONTEXT_CODE_RESOLUTION_TYPE_TEXT "Change related to getdns_context_set_resolution_type"
260 #define GETDNS_CONTEXT_CODE_FOLLOW_REDIRECTS_TEXT "Change related to getdns_context_set_follow_redirects"
261 #define GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS_TEXT "Change related to getdns_context_set_upstream_recursive_servers"
262 #define GETDNS_CONTEXT_CODE_DNS_ROOT_SERVERS_TEXT "Change related to getdns_context_set_dns_root_servers"
263 #define GETDNS_CONTEXT_CODE_DNS_TRANSPORT_TEXT "Change related to getdns_context_set_dns_transport"
264 #define GETDNS_CONTEXT_CODE_LIMIT_OUTSTANDING_QUERIES_TEXT "Change related to getdns_context_set_limit_outstanding_queries"
265 #define GETDNS_CONTEXT_CODE_APPEND_NAME_TEXT "Change related to getdns_context_set_append_name"
266 #define GETDNS_CONTEXT_CODE_SUFFIX_TEXT "Change related to getdns_context_set_suffix"
267 #define GETDNS_CONTEXT_CODE_DNSSEC_TRUST_ANCHORS_TEXT "Change related to getdns_context_set_dnssec_trust_anchors"
268 #define GETDNS_CONTEXT_CODE_EDNS_MAXIMUM_UDP_PAYLOAD_SIZE_TEXT "Change related to getdns_context_set_edns_maximum_udp_payload_size"
269 #define GETDNS_CONTEXT_CODE_EDNS_EXTENDED_RCODE_TEXT "Change related to getdns_context_set_edns_extended_rcode"
270 #define GETDNS_CONTEXT_CODE_EDNS_VERSION_TEXT "Change related to getdns_context_set_edns_version"
271 #define GETDNS_CONTEXT_CODE_EDNS_DO_BIT_TEXT "Change related to getdns_context_set_edns_do_bit"
272 #define GETDNS_CONTEXT_CODE_DNSSEC_ALLOWED_SKEW_TEXT "Change related to getdns_context_set_dnssec_allowed_skew"
273 #define GETDNS_CONTEXT_CODE_MEMORY_FUNCTIONS_TEXT "Change related to getdns_context_set_memory_functions"
274 #define GETDNS_CONTEXT_CODE_TIMEOUT_TEXT "Change related to getdns_context_set_timeout"
275 #define GETDNS_CONTEXT_CODE_IDLE_TIMEOUT_TEXT "Change related to getdns_context_set_idle_timeout"
290 
291 #define GETDNS_CALLBACK_COMPLETE_TEXT "The response has the requested data in it"
292 #define GETDNS_CALLBACK_CANCEL_TEXT "The calling program cancelled the callback; response is NULL"
293 #define GETDNS_CALLBACK_TIMEOUT_TEXT "The requested action timed out; response is filled in with empty structures"
294 #define GETDNS_CALLBACK_ERROR_TEXT "The requested action had an error; response is NULL"
303 #define GETDNS_NAMETYPE_DNS 800
304 #define GETDNS_NAMETYPE_DNS_TEXT "Normal DNS (RFC 1035)"
305 #define GETDNS_NAMETYPE_WINS 801
306 #define GETDNS_NAMETYPE_WINS_TEXT "The WINS name service (some reference needed)"
315 #define GETDNS_RESPSTATUS_GOOD 900
316 #define GETDNS_RESPSTATUS_GOOD_TEXT "At least one response was returned"
317 #define GETDNS_RESPSTATUS_NO_NAME 901
318 #define GETDNS_RESPSTATUS_NO_NAME_TEXT "Queries for the name yielded all negative responses"
319 #define GETDNS_RESPSTATUS_ALL_TIMEOUT 902
320 #define GETDNS_RESPSTATUS_ALL_TIMEOUT_TEXT "All queries for the name timed out"
321 #define GETDNS_RESPSTATUS_NO_SECURE_ANSWERS 903
322 #define GETDNS_RESPSTATUS_NO_SECURE_ANSWERS_TEXT "The context setting for getting only secure responses was specified, and at least one DNS response was received, but no DNS response was determined to be secure through DNSSEC."
323 #define GETDNS_RESPSTATUS_ALL_BOGUS_ANSWERS 904
324 #define GETDNS_RESPSTATUS_ALL_BOGUS_ANSWERS_TEXT "The context setting for getting only secure responses was specified, and at least one DNS response was received, but all received responses for the requested name were bogus."
325 
332 #define GETDNS_EXTENSION_TRUE 1000
333 #define GETDNS_EXTENSION_TRUE_TEXT "Turn on the extension"
334 #define GETDNS_EXTENSION_FALSE 1001
335 #define GETDNS_EXTENSION_FALSE_TEXT "Do not turn on the extension"
336 
343 #define GETDNS_BAD_DNS_CNAME_IN_TARGET 1100
344 #define GETDNS_BAD_DNS_CNAME_IN_TARGET_TEXT "A DNS query type that does not allow a target to be a CNAME pointed to a CNAME"
345 #define GETDNS_BAD_DNS_ALL_NUMERIC_LABEL 1101
346 #define GETDNS_BAD_DNS_ALL_NUMERIC_LABEL_TEXT "One or more labels in a returned domain name is all-numeric; this is not legal for a hostname"
347 #define GETDNS_BAD_DNS_CNAME_RETURNED_FOR_OTHER_TYPE 1102
348 #define GETDNS_BAD_DNS_CNAME_RETURNED_FOR_OTHER_TYPE_TEXT "A DNS query for a type other than CNAME returned a CNAME response"
357 #define GETDNS_RRTYPE_A 1
358 #define GETDNS_RRTYPE_NS 2
359 #define GETDNS_RRTYPE_MD 3
360 #define GETDNS_RRTYPE_MF 4
361 #define GETDNS_RRTYPE_CNAME 5
362 #define GETDNS_RRTYPE_SOA 6
363 #define GETDNS_RRTYPE_MB 7
364 #define GETDNS_RRTYPE_MG 8
365 #define GETDNS_RRTYPE_MR 9
366 #define GETDNS_RRTYPE_NULL 10
367 #define GETDNS_RRTYPE_WKS 11
368 #define GETDNS_RRTYPE_PTR 12
369 #define GETDNS_RRTYPE_HINFO 13
370 #define GETDNS_RRTYPE_MINFO 14
371 #define GETDNS_RRTYPE_MX 15
372 #define GETDNS_RRTYPE_TXT 16
373 #define GETDNS_RRTYPE_RP 17
374 #define GETDNS_RRTYPE_AFSDB 18
375 #define GETDNS_RRTYPE_X25 19
376 #define GETDNS_RRTYPE_ISDN 20
377 #define GETDNS_RRTYPE_RT 21
378 #define GETDNS_RRTYPE_NSAP 22
379 #define GETDNS_RRTYPE_SIG 24
380 #define GETDNS_RRTYPE_KEY 25
381 #define GETDNS_RRTYPE_PX 26
382 #define GETDNS_RRTYPE_GPOS 27
383 #define GETDNS_RRTYPE_AAAA 28
384 #define GETDNS_RRTYPE_LOC 29
385 #define GETDNS_RRTYPE_NXT 30
386 #define GETDNS_RRTYPE_EID 31
387 #define GETDNS_RRTYPE_NIMLOC 32
388 #define GETDNS_RRTYPE_SRV 33
389 #define GETDNS_RRTYPE_ATMA 34
390 #define GETDNS_RRTYPE_NAPTR 35
391 #define GETDNS_RRTYPE_KX 36
392 #define GETDNS_RRTYPE_CERT 37
393 #define GETDNS_RRTYPE_A6 38
394 #define GETDNS_RRTYPE_DNAME 39
395 #define GETDNS_RRTYPE_SINK 40
396 #define GETDNS_RRTYPE_OPT 41
397 #define GETDNS_RRTYPE_APL 42
398 #define GETDNS_RRTYPE_DS 43
399 #define GETDNS_RRTYPE_SSHFP 44
400 #define GETDNS_RRTYPE_IPSECKEY 45
401 #define GETDNS_RRTYPE_RRSIG 46
402 #define GETDNS_RRTYPE_NSEC 47
403 #define GETDNS_RRTYPE_DNSKEY 48
404 #define GETDNS_RRTYPE_DHCID 49
405 #define GETDNS_RRTYPE_NSEC3 50
406 #define GETDNS_RRTYPE_NSEC3PARAM 51
407 #define GETDNS_RRTYPE_TLSA 52
408 #define GETDNS_RRTYPE_HIP 55
409 #define GETDNS_RRTYPE_NINFO 56
410 #define GETDNS_RRTYPE_RKEY 57
411 #define GETDNS_RRTYPE_TALINK 58
412 #define GETDNS_RRTYPE_CDS 59
413 #define GETDNS_RRTYPE_CDNSKEY 60
414 #define GETDNS_RRTYPE_OPENPGPKEY 61
415 #define GETDNS_RRTYPE_CSYNC 62
416 #define GETDNS_RRTYPE_SPF 99
417 #define GETDNS_RRTYPE_UINFO 100
418 #define GETDNS_RRTYPE_UID 101
419 #define GETDNS_RRTYPE_GID 102
420 #define GETDNS_RRTYPE_UNSPEC 103
421 #define GETDNS_RRTYPE_NID 104
422 #define GETDNS_RRTYPE_L32 105
423 #define GETDNS_RRTYPE_L64 106
424 #define GETDNS_RRTYPE_LP 107
425 #define GETDNS_RRTYPE_EUI48 108
426 #define GETDNS_RRTYPE_EUI64 109
427 #define GETDNS_RRTYPE_TKEY 249
428 #define GETDNS_RRTYPE_TSIG 250
429 #define GETDNS_RRTYPE_IXFR 251
430 #define GETDNS_RRTYPE_AXFR 252
431 #define GETDNS_RRTYPE_MAILB 253
432 #define GETDNS_RRTYPE_MAILA 254
433 #define GETDNS_RRTYPE_ANY 255
434 #define GETDNS_RRTYPE_URI 256
435 #define GETDNS_RRTYPE_CAA 257
436 #define GETDNS_RRTYPE_TA 32768
437 #define GETDNS_RRTYPE_DLV 32769
438 
445 #define GETDNS_RRCLASS_IN 1
446 #define GETDNS_RRCLASS_CH 3
447 #define GETDNS_RRCLASS_HS 4
448 #define GETDNS_RRCLASS_NONE 254
449 #define GETDNS_RRCLASS_ANY 255
450 
457 #define GETDNS_OPCODE_QUERY 0
458 #define GETDNS_OPCODE_IQUERY 1
459 #define GETDNS_OPCODE_STATUS 2
460 #define GETDNS_OPCODE_NOTIFY 4
461 #define GETDNS_OPCODE_UPDATE 5
469 #define GETDNS_RCODE_NOERROR 0
470 #define GETDNS_RCODE_FORMERR 1
471 #define GETDNS_RCODE_SERVFAIL 2
472 #define GETDNS_RCODE_NXDOMAIN 3
473 #define GETDNS_RCODE_NOTIMP 4
474 #define GETDNS_RCODE_REFUSED 5
475 #define GETDNS_RCODE_YXDOMAIN 6
476 #define GETDNS_RCODE_YXRRSET 7
477 #define GETDNS_RCODE_NXRRSET 8
478 #define GETDNS_RCODE_NOTAUTH 9
479 #define GETDNS_RCODE_NOTZONE 10
480 #define GETDNS_RCODE_BADVERS 16
481 #define GETDNS_RCODE_BADSIG 16
482 #define GETDNS_RCODE_BADKEY 17
483 #define GETDNS_RCODE_BADTIME 18
484 #define GETDNS_RCODE_BADMODE 19
485 #define GETDNS_RCODE_BADNAME 20
486 #define GETDNS_RCODE_BADALG 21
487 #define GETDNS_RCODE_BADTRUNC 22
488 #define GETDNS_RCODE_COOKIE 23
493 typedef struct getdns_context getdns_context;
494 typedef uint64_t getdns_transaction_t;
495 
500 typedef enum getdns_data_type
501 {
504 typedef struct getdns_bindata
505 {
506  size_t size;
507  uint8_t *data;
509 
514 typedef struct getdns_dict getdns_dict;
515 
521 typedef struct getdns_list getdns_list;
529 /* Specify the order of the following groups manually here so they appear in
530  a better order in doxygen */
531 
561 getdns_return_t getdns_list_get_length(const getdns_list *list,
562  size_t * answer);
571 getdns_return_t getdns_list_get_data_type(const getdns_list *list,
572  size_t index, getdns_data_type * answer);
584 getdns_return_t getdns_list_get_dict(const getdns_list *list, size_t index,
585  getdns_dict **answer);
586 
598 getdns_return_t getdns_list_get_list(const getdns_list *list, size_t index,
599  getdns_list **answer);
611 getdns_return_t getdns_list_get_bindata(const getdns_list *list, size_t index,
612  getdns_bindata **answer);
622 getdns_return_t getdns_list_get_int(const getdns_list *list, size_t index,
623  uint32_t * answer);
641 getdns_return_t getdns_dict_get_names(const getdns_dict *dict,
642  getdns_list **answer);
651 getdns_return_t getdns_dict_get_data_type(const getdns_dict *dict,
652  const char *name, getdns_data_type * answer);
663 getdns_return_t getdns_dict_get_dict(const getdns_dict *dict,
664  const char *name, getdns_dict **answer);
675 getdns_return_t getdns_dict_get_list(const getdns_dict *dict,
676  const char *name, getdns_list **answer);
686 getdns_return_t getdns_dict_get_bindata(const getdns_dict *dict,
687  const char *name, getdns_bindata **answer);
696 getdns_return_t getdns_dict_get_int(const getdns_dict *dict,
697  const char *name, uint32_t * answer);
711 getdns_list *getdns_list_create();
712 getdns_list *getdns_list_create_with_context(getdns_context *context);
714  void *(*malloc) (size_t),
715  void *(*realloc) (void *, size_t),
716  void (*free) (void *)
717 );
719  void *userarg,
720  void *(*malloc) (void *userarg, size_t),
721  void *(*realloc) (void *userarg, void *, size_t),
722  void (*free) (void *userarg, void *)
723 );
724 
725 
733 void getdns_list_destroy(getdns_list *list);
752 getdns_return_t getdns_list_set_dict(getdns_list *list, size_t index,
753  const getdns_dict *child_dict);
754 
764 getdns_return_t getdns_list_set_list(getdns_list *list, size_t index,
765  const getdns_list *child_list);
775 getdns_return_t getdns_list_set_bindata(getdns_list *list, size_t index,
776  const getdns_bindata *child_bindata);
782 getdns_return_t getdns_list_set_int(getdns_list *list, size_t index,
783  uint32_t child_uint32);
797 getdns_dict *getdns_dict_create();
798 getdns_dict *getdns_dict_create_with_context(getdns_context *context);
800  void *(*malloc) (size_t),
801  void *(*realloc) (void *, size_t),
802  void (*free) (void *)
803 );
805  void *userarg,
806  void *(*malloc) (void *userarg, size_t),
807  void *(*realloc) (void *userarg, void *, size_t),
808  void (*free) (void *userarg, void *)
809 );
810 
816 void getdns_dict_destroy(getdns_dict *dict);
826 getdns_return_t getdns_dict_set_dict(getdns_dict *dict,
827  const char *name, const getdns_dict *child_dict);
836 getdns_return_t getdns_dict_set_list(getdns_dict *dict,
837  const char *name, const getdns_list *child_list);
846 getdns_return_t getdns_dict_set_bindata(getdns_dict *dict,
847  const char *name, const getdns_bindata *child_bindata);
855 getdns_return_t getdns_dict_set_int(getdns_dict *dict, const char *name,
856  uint32_t child_uint32);
869 getdns_return_t getdns_dict_remove_name(getdns_dict *dict, const char *name);
870 
871 
875 /* Callback arguments */
876 typedef void (*getdns_callback_t) (getdns_context *context,
877  getdns_callback_type_t callback_type,
878  getdns_dict * response,
879  void *userarg, getdns_transaction_t transaction_id);
880 
899  const char *name,
900  uint16_t request_type,
901  getdns_dict *extensions,
902  void *userarg,
903  getdns_transaction_t * transaction_id, getdns_callback_t callbackfn);
904 
917  const char *name,
918  getdns_dict *extensions,
919  void *userarg,
920  getdns_transaction_t * transaction_id, getdns_callback_t callbackfn);
921 
934  getdns_dict *address,
935  getdns_dict *extensions,
936  void *userarg,
937  getdns_transaction_t * transaction_id, getdns_callback_t callbackfn);
938 
951  const char *name,
952  getdns_dict *extensions,
953  void *userarg,
954  getdns_transaction_t * transaction_id, getdns_callback_t callbackfn);
974 getdns_context_create(getdns_context ** context, int set_from_os);
975 
976 
991  getdns_context ** context,
992  int set_from_os,
993  void *(*malloc) (size_t),
994  void *(*realloc) (void *, size_t),
995  void (*free) (void *)
996 );
997 
998 
1014  getdns_context **context,
1015  int set_from_os,
1016  void *userarg,
1017  void *(*malloc) (void *userarg, size_t),
1018  void *(*realloc) (void *userarg, void *, size_t),
1019  void (*free) (void *userarg, void *)
1020 );
1021 
1022 void getdns_context_destroy(getdns_context *context);
1033  getdns_transaction_t transaction_id);
1059  const char *name,
1060  uint16_t request_type,
1061  getdns_dict *extensions,
1062  getdns_dict **response);
1063 
1074  const char *name,
1075  getdns_dict *extensions,
1076  getdns_dict **response);
1077 
1088  getdns_dict *address,
1089  getdns_dict *extensions,
1090  getdns_dict **response);
1091 
1102  const char *name,
1103  getdns_dict *extensions,
1104  getdns_dict **response);
1105 
1116  const getdns_bindata *dns_name_wire_fmt,
1117  char **fqdn_as_string);
1118 
1121  const char *fqdn_as_string,
1122  getdns_bindata **dns_name_wire_fmt);
1123 
1124 char *getdns_convert_ulabel_to_alabel(const char *ulabel);
1125 
1126 char *getdns_convert_alabel_to_ulabel(const char *alabel);
1127 
1129 getdns_validate_dnssec(getdns_list *to_validate,
1130  getdns_list *support_records,
1131  getdns_list *trust_anchors);
1132 
1133 /* Get root trust anchor */
1134 getdns_list *getdns_root_trust_anchor(time_t *utc_date_of_anchor);
1135 
1142 char *getdns_pretty_print_dict(const getdns_dict *some_dict);
1143 
1145  *bindata_of_ipv4_or_ipv6_address);
1146 
1157  getdns_context *context,
1158  void (*value)(getdns_context *context,
1159  getdns_context_code_t changed_item)
1160 );
1161 
1164  getdns_resolution_t value);
1165 
1168  size_t namespace_count, getdns_namespace_t *namespaces);
1169 
1172  getdns_transport_t value);
1173 
1176  size_t transport_count, getdns_transport_list_t *transports);
1177 
1179 getdns_context_set_idle_timeout(getdns_context *context, uint64_t timeout);
1180 
1183  uint16_t limit);
1184 
1186 getdns_context_set_timeout(getdns_context *context, uint64_t timeout);
1187 
1190  getdns_redirects_t value);
1191 
1194  getdns_list *addresses);
1195 
1198  getdns_append_name_t value);
1199 
1201 getdns_context_set_suffix(getdns_context *context, getdns_list *value);
1202 
1205  getdns_list *value);
1206 
1209  uint32_t value);
1210 
1213  getdns_list *upstream_list);
1214 
1217  uint16_t value);
1218 
1221  uint8_t value);
1222 
1224 getdns_context_set_edns_version(getdns_context *context, uint8_t value);
1225 
1227 getdns_context_set_edns_do_bit(getdns_context *context, uint8_t value);
1228 
1231  void *(*malloc) (size_t),
1232  void *(*realloc) (void *, size_t),
1233  void (*free) (void *)
1234  );
1235 
1238  void *userarg,
1239  void *(*malloc) (void *userarg, size_t sz),
1240  void *(*realloc) (void *userarg, void *ptr, size_t sz),
1241  void (*free) (void *userarg, void *ptr)
1242  );
1246 /* api information support */
1247 getdns_dict*
1249 
1256 #ifdef __cplusplus
1257 }
1258 #endif
1259 #endif /* GETDNS_H */
getdns_data_type
Definition: getdns.h:482
getdns_return_t getdns_context_set_memory_functions(getdns_context *context, void *(*malloc)(size_t), void *(*realloc)(void *, size_t), void(*free)(void *))
getdns_return_t getdns_address(getdns_context *context, const char *name, getdns_dict *extensions, void *userarg, getdns_transaction_t *transaction_id, getdns_callback_t callbackfn)
getdns_resolution_t
Definition: getdns.h:142
getdns_return_t getdns_dict_set_dict(getdns_dict *dict, const char *name, const getdns_dict *child_dict)
getdns_return_t getdns_context_set_dns_transport(getdns_context *context, getdns_transport_t value)
getdns_redirects_t
Definition: getdns.h:157
getdns_return_t getdns_list_get_dict(const getdns_list *list, size_t index, getdns_dict **answer)
getdns_dict * getdns_dict_create_with_extended_memory_functions(void *userarg, void *(*malloc)(void *userarg, size_t), void *(*realloc)(void *userarg, void *, size_t), void(*free)(void *userarg, void *))
getdns_list * getdns_list_create_with_context(getdns_context *context)
getdns_return_t getdns_context_create(getdns_context **context, int set_from_os)
getdns_return_t getdns_context_create_with_memory_functions(getdns_context **context, int set_from_os, void *(*malloc)(size_t), void *(*realloc)(void *, size_t), void(*free)(void *))
getdns_return_t getdns_service(getdns_context *context, const char *name, getdns_dict *extensions, void *userarg, getdns_transaction_t *transaction_id, getdns_callback_t callbackfn)
getdns_return_t getdns_list_get_data_type(const getdns_list *list, size_t index, getdns_data_type *answer)
getdns_namespace_t
Definition: getdns.h:121
getdns_dict * getdns_context_get_api_information(getdns_context *context)
getdns_return_t getdns_dict_get_int(const getdns_dict *dict, const char *name, uint32_t *answer)
getdns_return_t getdns_context_set_idle_timeout(getdns_context *context, uint64_t timeout)
void getdns_list_destroy(getdns_list *list)
getdns_return_t getdns_dict_get_dict(const getdns_dict *dict, const char *name, getdns_dict **answer)
getdns_return_t getdns_dict_get_names(const getdns_dict *dict, getdns_list **answer)
getdns_return_t getdns_cancel_callback(getdns_context *context, getdns_transaction_t transaction_id)
getdns_return_t getdns_context_set_append_name(getdns_context *context, getdns_append_name_t value)
getdns_return_t getdns_context_set_upstream_recursive_servers(getdns_context *context, getdns_list *upstream_list)
uint64_t getdns_transaction_t
Definition: getdns.h:476
getdns_return_t getdns_list_set_list(getdns_list *list, size_t index, const getdns_list *child_list)
getdns_return_t getdns_list_get_bindata(const getdns_list *list, size_t index, getdns_bindata **answer)
getdns_return_t getdns_address_sync(getdns_context *context, const char *name, getdns_dict *extensions, getdns_dict **response)
size_t size
Definition: getdns.h:488
Definition: getdns.h:484
getdns_list * getdns_list_create_with_memory_functions(void *(*malloc)(size_t), void *(*realloc)(void *, size_t), void(*free)(void *))
getdns_return_t getdns_context_set_edns_version(getdns_context *context, uint8_t value)
getdns_transport_list_t
Definition: getdns.h:191
getdns_return_t getdns_dict_set_int(getdns_dict *dict, const char *name, uint32_t child_uint32)
struct getdns_bindata getdns_bindata
getdns_return_t getdns_list_get_length(const getdns_list *list, size_t *answer)
void getdns_context_destroy(getdns_context *context)
getdns_return_t getdns_dict_set_list(getdns_dict *dict, const char *name, const getdns_list *child_list)
getdns_return_t getdns_context_set_dns_transport_list(getdns_context *context, size_t transport_count, getdns_transport_list_t *transports)
getdns_return_t getdns_dict_remove_name(getdns_dict *dict, const char *name)
getdns_return_t getdns_convert_dns_name_to_fqdn(const getdns_bindata *dns_name_wire_fmt, char **fqdn_as_string)
getdns_return_t getdns_hostname_sync(getdns_context *context, getdns_dict *address, getdns_dict *extensions, getdns_dict **response)
Definition: getdns.h:484
getdns_return_t getdns_general(getdns_context *context, const char *name, uint16_t request_type, getdns_dict *extensions, void *userarg, getdns_transaction_t *transaction_id, getdns_callback_t callbackfn)
getdns_dict * getdns_dict_create()
getdns_return_t getdns_context_create_with_extended_memory_functions(getdns_context **context, int set_from_os, void *userarg, void *(*malloc)(void *userarg, size_t), void *(*realloc)(void *userarg, void *, size_t), void(*free)(void *userarg, void *))
getdns_return_t getdns_context_set_limit_outstanding_queries(getdns_context *context, uint16_t limit)
getdns_return_t getdns_list_get_list(const getdns_list *list, size_t index, getdns_list **answer)
getdns_return_t getdns_context_set_resolution_type(getdns_context *context, getdns_resolution_t value)
getdns_list * getdns_root_trust_anchor(time_t *utc_date_of_anchor)
struct getdns_list getdns_list
Definition: getdns.h:503
void getdns_dict_destroy(getdns_dict *dict)
getdns_callback_type_t
Definition: getdns.h:275
getdns_return_t getdns_dict_get_data_type(const getdns_dict *dict, const char *name, getdns_data_type *answer)
getdns_context_code_t
Definition: getdns.h:228
getdns_return_t getdns_dict_get_list(const getdns_dict *dict, const char *name, getdns_list **answer)
getdns_return_t getdns_context_set_namespaces(getdns_context *context, size_t namespace_count, getdns_namespace_t *namespaces)
getdns_return_t getdns_context_set_edns_maximum_udp_payload_size(getdns_context *context, uint16_t value)
getdns_dict * getdns_dict_create_with_context(getdns_context *context)
getdns_list * getdns_list_create_with_extended_memory_functions(void *userarg, void *(*malloc)(void *userarg, size_t), void *(*realloc)(void *userarg, void *, size_t), void(*free)(void *userarg, void *))
uint8_t * data
Definition: getdns.h:489
getdns_return_t getdns_list_set_int(getdns_list *list, size_t index, uint32_t child_uint32)
getdns_return_t getdns_context_set_edns_do_bit(getdns_context *context, uint8_t value)
struct getdns_context getdns_context
Definition: getdns.h:475
getdns_return_t getdns_list_set_dict(getdns_list *list, size_t index, const getdns_dict *child_dict)
Definition: getdns.h:484
char * getdns_convert_ulabel_to_alabel(const char *ulabel)
getdns_return_t getdns_dict_get_bindata(const getdns_dict *dict, const char *name, getdns_bindata **answer)
getdns_return_t getdns_context_set_follow_redirects(getdns_context *context, getdns_redirects_t value)
getdns_append_name_t
Definition: getdns.h:208
getdns_return_t getdns_validate_dnssec(getdns_list *to_validate, getdns_list *support_records, getdns_list *trust_anchors)
getdns_return_t getdns_context_set_dnssec_allowed_skew(getdns_context *context, uint32_t value)
getdns_return_t getdns_context_set_suffix(getdns_context *context, getdns_list *value)
getdns_return_t
Definition: getdns.h:63
char * getdns_display_ip_address(const getdns_bindata *bindata_of_ipv4_or_ipv6_address)
char * getdns_pretty_print_dict(const getdns_dict *some_dict)
getdns_dict * getdns_dict_create_with_memory_functions(void *(*malloc)(size_t), void *(*realloc)(void *, size_t), void(*free)(void *))
char * getdns_convert_alabel_to_ulabel(const char *alabel)
getdns_return_t getdns_context_set_dns_root_servers(getdns_context *context, getdns_list *addresses)
getdns_return_t getdns_general_sync(getdns_context *context, const char *name, uint16_t request_type, getdns_dict *extensions, getdns_dict **response)
struct getdns_dict getdns_dict
Definition: getdns.h:496
getdns_return_t getdns_convert_fqdn_to_dns_name(const char *fqdn_as_string, getdns_bindata **dns_name_wire_fmt)
getdns_list * getdns_list_create()
void(* getdns_callback_t)(getdns_context *context, getdns_callback_type_t callback_type, getdns_dict *response, void *userarg, getdns_transaction_t transaction_id)
Definition: getdns.h:851
getdns_return_t getdns_context_set_dnssec_trust_anchors(getdns_context *context, getdns_list *value)
getdns_return_t getdns_context_set_edns_extended_rcode(getdns_context *context, uint8_t value)
getdns_return_t getdns_context_set_extended_memory_functions(getdns_context *context, void *userarg, void *(*malloc)(void *userarg, size_t sz), void *(*realloc)(void *userarg, void *ptr, size_t sz), void(*free)(void *userarg, void *ptr))
getdns_return_t getdns_context_set_timeout(getdns_context *context, uint64_t timeout)
getdns_return_t getdns_service_sync(getdns_context *context, const char *name, getdns_dict *extensions, getdns_dict **response)
getdns_return_t getdns_list_set_bindata(getdns_list *list, size_t index, const getdns_bindata *child_bindata)
getdns_transport_t
Definition: getdns.h:172
getdns_return_t getdns_hostname(getdns_context *context, getdns_dict *address, getdns_dict *extensions, void *userarg, getdns_transaction_t *transaction_id, getdns_callback_t callbackfn)
getdns_return_t getdns_list_get_int(const getdns_list *list, size_t index, uint32_t *answer)
getdns_return_t getdns_dict_set_bindata(getdns_dict *dict, const char *name, const getdns_bindata *child_bindata)
getdns_return_t getdns_context_set_context_update_callback(getdns_context *context, void(*value)(getdns_context *context, getdns_context_code_t changed_item))