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.7.0-rc.1 configured on 2021-05-27T22:45:07Z 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."
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)"
124 typedef enum getdns_namespace_t {
131 
132 
133 #define GETDNS_NAMESPACE_DNS_TEXT "See getdns_context_set_namespaces()"
134 #define GETDNS_NAMESPACE_LOCALNAMES_TEXT "See getdns_context_set_namespaces()"
135 #define GETDNS_NAMESPACE_NETBIOS_TEXT "See getdns_context_set_namespaces()"
136 #define GETDNS_NAMESPACE_MDNS_TEXT "See getdns_context_set_namespaces()"
137 #define GETDNS_NAMESPACE_NIS_TEXT "See getdns_context_set_namespaces()"
146 typedef enum getdns_resolution_t {
150 
151 
152 #define GETDNS_RESOLUTION_STUB_TEXT "See getdns_context_set_resolution_type()"
153 #define GETDNS_RESOLUTION_RECURSING_TEXT "See getdns_context_set_resolution_type()"
162 typedef enum getdns_redirects_t {
166 
167 
168 #define GETDNS_REDIRECTS_FOLLOW_TEXT "See getdns_context_set_follow_redirects()"
169 #define GETDNS_REDIRECTS_DO_NOT_FOLLOW_TEXT "See getdns_context_set_follow_redirects()"
178 typedef enum getdns_transport_t {
184 
185 #define GETDNS_TRANSPORT_UDP_FIRST_AND_FALL_BACK_TO_TCP_TEXT "See getdns_context_set_dns_transport()"
186 #define GETDNS_TRANSPORT_UDP_ONLY_TEXT "See getdns_context_set_dns_transport()"
187 #define GETDNS_TRANSPORT_TCP_ONLY_TEXT "See getdns_context_set_dns_transport()"
188 #define GETDNS_TRANSPORT_TCP_ONLY_KEEP_CONNECTIONS_OPEN_TEXT "See getdns_context_set_dns_transport()"
197 /* Base transports for use in transport list */
203 
204 
205 #define GETDNS_TRANSPORT_UDP_TEXT "See getdns_context_set_dns_transport_list()"
206 #define GETDNS_TRANSPORT_TCP_TEXT "See getdns_context_set_dns_transport_list()"
207 #define GETDNS_TRANSPORT_TLS_TEXT "See getdns_context_set_dns_transport_list()"
216 typedef enum getdns_append_name_t {
222 
223 
224 #define GETDNS_APPEND_NAME_ALWAYS_TEXT "See getdns_context_set_append_name()"
225 #define GETDNS_APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE_TEXT "See getdns_context_set_append_name()"
226 #define GETDNS_APPEND_NAME_ONLY_TO_MULTIPLE_LABEL_NAME_AFTER_FAILURE_TEXT "See getdns_context_set_append_name()"
227 #define GETDNS_APPEND_NAME_NEVER_TEXT "See getdns_context_set_append_name()"
236 /* Context codes */
237 typedef enum getdns_context_code_t {
257 
258 
259 #define GETDNS_CONTEXT_CODE_NAMESPACES_TEXT "Change related to getdns_context_set_namespaces"
260 #define GETDNS_CONTEXT_CODE_RESOLUTION_TYPE_TEXT "Change related to getdns_context_set_resolution_type"
261 #define GETDNS_CONTEXT_CODE_FOLLOW_REDIRECTS_TEXT "Change related to getdns_context_set_follow_redirects"
262 #define GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS_TEXT "Change related to getdns_context_set_upstream_recursive_servers"
263 #define GETDNS_CONTEXT_CODE_DNS_ROOT_SERVERS_TEXT "Change related to getdns_context_set_dns_root_servers"
264 #define GETDNS_CONTEXT_CODE_DNS_TRANSPORT_TEXT "Change related to getdns_context_set_dns_transport"
265 #define GETDNS_CONTEXT_CODE_LIMIT_OUTSTANDING_QUERIES_TEXT "Change related to getdns_context_set_limit_outstanding_queries"
266 #define GETDNS_CONTEXT_CODE_APPEND_NAME_TEXT "Change related to getdns_context_set_append_name"
267 #define GETDNS_CONTEXT_CODE_SUFFIX_TEXT "Change related to getdns_context_set_suffix"
268 #define GETDNS_CONTEXT_CODE_DNSSEC_TRUST_ANCHORS_TEXT "Change related to getdns_context_set_dnssec_trust_anchors"
269 #define GETDNS_CONTEXT_CODE_EDNS_MAXIMUM_UDP_PAYLOAD_SIZE_TEXT "Change related to getdns_context_set_edns_maximum_udp_payload_size"
270 #define GETDNS_CONTEXT_CODE_EDNS_EXTENDED_RCODE_TEXT "Change related to getdns_context_set_edns_extended_rcode"
271 #define GETDNS_CONTEXT_CODE_EDNS_VERSION_TEXT "Change related to getdns_context_set_edns_version"
272 #define GETDNS_CONTEXT_CODE_EDNS_DO_BIT_TEXT "Change related to getdns_context_set_edns_do_bit"
273 #define GETDNS_CONTEXT_CODE_DNSSEC_ALLOWED_SKEW_TEXT "Change related to getdns_context_set_dnssec_allowed_skew"
274 #define GETDNS_CONTEXT_CODE_MEMORY_FUNCTIONS_TEXT "Change related to getdns_context_set_memory_functions"
275 #define GETDNS_CONTEXT_CODE_TIMEOUT_TEXT "Change related to getdns_context_set_timeout"
276 #define GETDNS_CONTEXT_CODE_IDLE_TIMEOUT_TEXT "Change related to getdns_context_set_idle_timeout"
291 
292 #define GETDNS_CALLBACK_COMPLETE_TEXT "The response has the requested data in it"
293 #define GETDNS_CALLBACK_CANCEL_TEXT "The calling program cancelled the callback; response is NULL"
294 #define GETDNS_CALLBACK_TIMEOUT_TEXT "The requested action timed out; response is filled in with empty structures"
295 #define GETDNS_CALLBACK_ERROR_TEXT "The requested action had an error; response is NULL"
304 #define GETDNS_NAMETYPE_DNS 800
305 #define GETDNS_NAMETYPE_DNS_TEXT "Normal DNS (RFC 1035)"
306 #define GETDNS_NAMETYPE_WINS 801
307 #define GETDNS_NAMETYPE_WINS_TEXT "The WINS name service (some reference needed)"
316 #define GETDNS_RESPSTATUS_GOOD 900
317 #define GETDNS_RESPSTATUS_GOOD_TEXT "At least one response was returned"
318 #define GETDNS_RESPSTATUS_NO_NAME 901
319 #define GETDNS_RESPSTATUS_NO_NAME_TEXT "Queries for the name yielded all negative responses"
320 #define GETDNS_RESPSTATUS_ALL_TIMEOUT 902
321 #define GETDNS_RESPSTATUS_ALL_TIMEOUT_TEXT "All queries for the name timed out"
322 #define GETDNS_RESPSTATUS_NO_SECURE_ANSWERS 903
323 #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."
324 #define GETDNS_RESPSTATUS_ALL_BOGUS_ANSWERS 904
325 #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."
333 #define GETDNS_EXTENSION_TRUE 1000
334 #define GETDNS_EXTENSION_TRUE_TEXT "Turn on the extension"
335 #define GETDNS_EXTENSION_FALSE 1001
336 #define GETDNS_EXTENSION_FALSE_TEXT "Do not turn on the extension"
344 #define GETDNS_BAD_DNS_CNAME_IN_TARGET 1100
345 #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"
346 #define GETDNS_BAD_DNS_ALL_NUMERIC_LABEL 1101
347 #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"
348 #define GETDNS_BAD_DNS_CNAME_RETURNED_FOR_OTHER_TYPE 1102
349 #define GETDNS_BAD_DNS_CNAME_RETURNED_FOR_OTHER_TYPE_TEXT "A DNS query for a type other than CNAME returned a CNAME response"
358 #define GETDNS_RRTYPE_A 1
359 #define GETDNS_RRTYPE_NS 2
360 #define GETDNS_RRTYPE_MD 3
361 #define GETDNS_RRTYPE_MF 4
362 #define GETDNS_RRTYPE_CNAME 5
363 #define GETDNS_RRTYPE_SOA 6
364 #define GETDNS_RRTYPE_MB 7
365 #define GETDNS_RRTYPE_MG 8
366 #define GETDNS_RRTYPE_MR 9
367 #define GETDNS_RRTYPE_NULL 10
368 #define GETDNS_RRTYPE_WKS 11
369 #define GETDNS_RRTYPE_PTR 12
370 #define GETDNS_RRTYPE_HINFO 13
371 #define GETDNS_RRTYPE_MINFO 14
372 #define GETDNS_RRTYPE_MX 15
373 #define GETDNS_RRTYPE_TXT 16
374 #define GETDNS_RRTYPE_RP 17
375 #define GETDNS_RRTYPE_AFSDB 18
376 #define GETDNS_RRTYPE_X25 19
377 #define GETDNS_RRTYPE_ISDN 20
378 #define GETDNS_RRTYPE_RT 21
379 #define GETDNS_RRTYPE_NSAP 22
380 #define GETDNS_RRTYPE_NSAP_PTR 23
381 #define GETDNS_RRTYPE_SIG 24
382 #define GETDNS_RRTYPE_KEY 25
383 #define GETDNS_RRTYPE_PX 26
384 #define GETDNS_RRTYPE_GPOS 27
385 #define GETDNS_RRTYPE_AAAA 28
386 #define GETDNS_RRTYPE_LOC 29
387 #define GETDNS_RRTYPE_NXT 30
388 #define GETDNS_RRTYPE_EID 31
389 #define GETDNS_RRTYPE_NIMLOC 32
390 #define GETDNS_RRTYPE_SRV 33
391 #define GETDNS_RRTYPE_ATMA 34
392 #define GETDNS_RRTYPE_NAPTR 35
393 #define GETDNS_RRTYPE_KX 36
394 #define GETDNS_RRTYPE_CERT 37
395 #define GETDNS_RRTYPE_A6 38
396 #define GETDNS_RRTYPE_DNAME 39
397 #define GETDNS_RRTYPE_SINK 40
398 #define GETDNS_RRTYPE_OPT 41
399 #define GETDNS_RRTYPE_APL 42
400 #define GETDNS_RRTYPE_DS 43
401 #define GETDNS_RRTYPE_SSHFP 44
402 #define GETDNS_RRTYPE_IPSECKEY 45
403 #define GETDNS_RRTYPE_RRSIG 46
404 #define GETDNS_RRTYPE_NSEC 47
405 #define GETDNS_RRTYPE_DNSKEY 48
406 #define GETDNS_RRTYPE_DHCID 49
407 #define GETDNS_RRTYPE_NSEC3 50
408 #define GETDNS_RRTYPE_NSEC3PARAM 51
409 #define GETDNS_RRTYPE_TLSA 52
410 #define GETDNS_RRTYPE_SMIMEA 53
411 #define GETDNS_RRTYPE_HIP 55
412 #define GETDNS_RRTYPE_NINFO 56
413 #define GETDNS_RRTYPE_RKEY 57
414 #define GETDNS_RRTYPE_TALINK 58
415 #define GETDNS_RRTYPE_CDS 59
416 #define GETDNS_RRTYPE_CDNSKEY 60
417 #define GETDNS_RRTYPE_OPENPGPKEY 61
418 #define GETDNS_RRTYPE_CSYNC 62
419 #define GETDNS_RRTYPE_ZONEMD 63
420 #define GETDNS_RRTYPE_SVCB 64
421 #define GETDNS_RRTYPE_HTTPS 65
422 #define GETDNS_RRTYPE_SPF 99
423 #define GETDNS_RRTYPE_UINFO 100
424 #define GETDNS_RRTYPE_UID 101
425 #define GETDNS_RRTYPE_GID 102
426 #define GETDNS_RRTYPE_UNSPEC 103
427 #define GETDNS_RRTYPE_NID 104
428 #define GETDNS_RRTYPE_L32 105
429 #define GETDNS_RRTYPE_L64 106
430 #define GETDNS_RRTYPE_LP 107
431 #define GETDNS_RRTYPE_EUI48 108
432 #define GETDNS_RRTYPE_EUI64 109
433 #define GETDNS_RRTYPE_TKEY 249
434 #define GETDNS_RRTYPE_TSIG 250
435 #define GETDNS_RRTYPE_IXFR 251
436 #define GETDNS_RRTYPE_AXFR 252
437 #define GETDNS_RRTYPE_MAILB 253
438 #define GETDNS_RRTYPE_MAILA 254
439 #define GETDNS_RRTYPE_ANY 255
440 #define GETDNS_RRTYPE_URI 256
441 #define GETDNS_RRTYPE_CAA 257
442 #define GETDNS_RRTYPE_AVC 258
443 #define GETDNS_RRTYPE_DOA 259
444 #define GETDNS_RRTYPE_AMTRELAY 260
445 #define GETDNS_RRTYPE_TA 32768
446 #define GETDNS_RRTYPE_DLV 32769
454 #define GETDNS_RRCLASS_IN 1
455 #define GETDNS_RRCLASS_CH 3
456 #define GETDNS_RRCLASS_HS 4
457 #define GETDNS_RRCLASS_NONE 254
458 #define GETDNS_RRCLASS_ANY 255
466 #define GETDNS_OPCODE_QUERY 0
467 #define GETDNS_OPCODE_IQUERY 1
468 #define GETDNS_OPCODE_STATUS 2
469 #define GETDNS_OPCODE_NOTIFY 4
470 #define GETDNS_OPCODE_UPDATE 5
478 #define GETDNS_RCODE_NOERROR 0
479 #define GETDNS_RCODE_FORMERR 1
480 #define GETDNS_RCODE_SERVFAIL 2
481 #define GETDNS_RCODE_NXDOMAIN 3
482 #define GETDNS_RCODE_NOTIMP 4
483 #define GETDNS_RCODE_REFUSED 5
484 #define GETDNS_RCODE_YXDOMAIN 6
485 #define GETDNS_RCODE_YXRRSET 7
486 #define GETDNS_RCODE_NXRRSET 8
487 #define GETDNS_RCODE_NOTAUTH 9
488 #define GETDNS_RCODE_NOTZONE 10
489 #define GETDNS_RCODE_BADVERS 16
490 #define GETDNS_RCODE_BADSIG 16
491 #define GETDNS_RCODE_BADKEY 17
492 #define GETDNS_RCODE_BADTIME 18
493 #define GETDNS_RCODE_BADMODE 19
494 #define GETDNS_RCODE_BADNAME 20
495 #define GETDNS_RCODE_BADALG 21
496 #define GETDNS_RCODE_BADTRUNC 22
497 #define GETDNS_RCODE_BADCOOKIE 23
512 typedef struct getdns_context getdns_context;
513 
520 typedef uint64_t getdns_transaction_t;
521 
522 
527 typedef enum getdns_data_type
528 {
531 
532 
536 typedef struct getdns_bindata
537 {
538  size_t size;
539  uint8_t *data;
541 
546 typedef struct getdns_dict getdns_dict;
547 
553 typedef struct getdns_list getdns_list;
561 /* Specify the order of the following groups manually here so they appear in
562  a better order in doxygen */
563 
590  size_t * answer);
600  size_t index, getdns_data_type * answer);
613  getdns_dict **answer);
614 
627  getdns_list **answer);
640  getdns_bindata **answer);
651  uint32_t * answer);
670  getdns_list **answer);
680  const char *name, getdns_data_type * answer);
692  const char *name, getdns_dict **answer);
704  const char *name, getdns_list **answer);
715  const char *name, getdns_bindata **answer);
725  const char *name, uint32_t * answer);
740 
751 
763  void *(*malloc) (size_t),
764  void *(*realloc) (void *, size_t),
765  void (*free) (void *)
766 );
767 
781  void *userarg,
782  void *(*malloc) (void *userarg, size_t),
783  void *(*realloc) (void *userarg, void *, size_t),
784  void (*free) (void *userarg, void *)
785 );
786 
787 
815  const getdns_dict *child_dict);
816 
827  const getdns_list *child_list);
838  const getdns_bindata *child_bindata);
845  uint32_t child_uint32);
860 
871 
883  void *(*malloc) (size_t),
884  void *(*realloc) (void *, size_t),
885  void (*free) (void *)
886 );
887 
901  void *userarg,
902  void *(*malloc) (void *userarg, size_t),
903  void *(*realloc) (void *userarg, void *, size_t),
904  void (*free) (void *userarg, void *)
905 );
906 
931  const char *name, const getdns_dict *child_dict);
932 
942  const char *name, const getdns_list *child_list);
952  const char *name, const getdns_bindata *child_bindata);
961  uint32_t child_uint32);
962 
969 char *getdns_pretty_print_dict(const getdns_dict *some_dict);
983 
1014 typedef void (*getdns_callback_t) (getdns_context *context,
1015  getdns_callback_type_t callback_type,
1016  getdns_dict * response,
1017  void *userarg, getdns_transaction_t transaction_id);
1018 
1019 
1035  const char *name,
1036  uint16_t request_type,
1037  const getdns_dict *extensions,
1038  void *userarg,
1039  getdns_transaction_t *transaction_id, getdns_callback_t callbackfn);
1040 
1054  const char *name,
1055  const getdns_dict *extensions,
1056  void *userarg,
1057  getdns_transaction_t *transaction_id, getdns_callback_t callbackfn);
1058 
1072  const getdns_dict *address,
1073  const getdns_dict *extensions,
1074  void *userarg,
1075  getdns_transaction_t *transaction_id, getdns_callback_t callbackfn);
1076 
1090  const char *name,
1091  const getdns_dict *extensions,
1092  void *userarg,
1093  getdns_transaction_t *transaction_id, getdns_callback_t callbackfn);
1112 getdns_context_create(getdns_context ** context, int set_from_os);
1113 
1114 
1128  getdns_context ** context,
1129  int set_from_os,
1130  void *(*malloc) (size_t),
1131  void *(*realloc) (void *, size_t),
1132  void (*free) (void *)
1133 );
1134 
1135 
1150  getdns_context **context,
1151  int set_from_os,
1152  void *userarg,
1153  void *(*malloc) (void *userarg, size_t),
1154  void *(*realloc) (void *userarg, void *, size_t),
1155  void (*free) (void *userarg, void *)
1156 );
1157 
1178  getdns_transaction_t transaction_id);
1206  const char *name,
1207  uint16_t request_type,
1208  const getdns_dict *extensions,
1209  getdns_dict **response);
1210 
1222  const char *name,
1223  const getdns_dict *extensions,
1224  getdns_dict **response);
1225 
1237  const getdns_dict *address,
1238  const getdns_dict *extensions,
1239  getdns_dict **response);
1240 
1252  const char *name,
1253  const getdns_dict *extensions,
1254  getdns_dict **response);
1255 
1277  const getdns_bindata *dns_name_wire_fmt,
1278  char **fqdn_as_string);
1279 
1292  const char *fqdn_as_string,
1293  getdns_bindata **dns_name_wire_fmt);
1294 
1302 char *getdns_convert_ulabel_to_alabel(const char *ulabel);
1303 
1311 char *getdns_convert_alabel_to_ulabel(const char *alabel);
1312 
1349  const getdns_list *support_records, const getdns_list *trust_anchors);
1350 
1359 getdns_list *getdns_root_trust_anchor(time_t *utc_date_of_anchor);
1360 
1377  *bindata_of_ipv4_or_ipv6_address);
1378 
1403  getdns_context *context,
1404  void (*value)(getdns_context *context,
1405  getdns_context_code_t changed_item)
1406 );
1407 
1423  getdns_resolution_t value);
1424 
1450  size_t namespace_count, const getdns_namespace_t *namespaces);
1451 
1473  getdns_transport_t value);
1474 
1498  size_t transport_count, getdns_transport_list_t *transports);
1499 
1518 
1535  uint32_t value);
1536 
1553  uint16_t limit);
1554 
1567 getdns_context_set_timeout(getdns_context *context, uint64_t timeout);
1568 
1590  getdns_redirects_t value);
1591 
1613  getdns_list *addresses);
1614 
1633  getdns_append_name_t value);
1634 
1649 
1663  getdns_list *value);
1664 
1677  uint32_t value);
1678 
1679 
1720  getdns_list *upstream_list);
1721 
1737  uint16_t value);
1738 
1749  uint8_t value);
1750 
1761 
1774 
1790  void *(*malloc) (size_t),
1791  void *(*realloc) (void *, size_t),
1792  void (*free) (void *)
1793  );
1794 
1813  void *userarg,
1814  void *(*malloc) (void *userarg, size_t sz),
1815  void *(*realloc) (void *userarg, void *ptr, size_t sz),
1816  void (*free) (void *userarg, void *ptr)
1817  );
1839 getdns_dict*
1841 
1845 #ifdef __cplusplus
1846 }
1847 #endif
1848 #endif /* GETDNS_H */
getdns_return_t getdns_general(getdns_context *context, const char *name, uint16_t request_type, const getdns_dict *extensions, void *userarg, getdns_transaction_t *transaction_id, getdns_callback_t callbackfn)
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:1014
getdns_return_t getdns_cancel_callback(getdns_context *context, getdns_transaction_t transaction_id)
getdns_return_t getdns_service(getdns_context *context, const char *name, const getdns_dict *extensions, void *userarg, getdns_transaction_t *transaction_id, getdns_callback_t callbackfn)
getdns_return_t getdns_hostname(getdns_context *context, const getdns_dict *address, const getdns_dict *extensions, void *userarg, getdns_transaction_t *transaction_id, getdns_callback_t callbackfn)
getdns_return_t getdns_address(getdns_context *context, const char *name, const getdns_dict *extensions, void *userarg, getdns_transaction_t *transaction_id, getdns_callback_t callbackfn)
getdns_callback_type_t
Definition: getdns.h:285
@ GETDNS_CALLBACK_ERROR
Definition: getdns.h:289
@ GETDNS_CALLBACK_TIMEOUT
Definition: getdns.h:288
@ GETDNS_CALLBACK_CANCEL
Definition: getdns.h:287
@ GETDNS_CALLBACK_COMPLETE
Definition: getdns.h:286
getdns_context_code_t
Definition: getdns.h:237
@ GETDNS_CONTEXT_CODE_LIMIT_OUTSTANDING_QUERIES
Definition: getdns.h:244
@ GETDNS_CONTEXT_CODE_EDNS_VERSION
Definition: getdns.h:250
@ GETDNS_CONTEXT_CODE_DNSSEC_ALLOWED_SKEW
Definition: getdns.h:252
@ GETDNS_CONTEXT_CODE_SUFFIX
Definition: getdns.h:246
@ GETDNS_CONTEXT_CODE_EDNS_EXTENDED_RCODE
Definition: getdns.h:249
@ GETDNS_CONTEXT_CODE_DNS_ROOT_SERVERS
Definition: getdns.h:242
@ GETDNS_CONTEXT_CODE_EDNS_MAXIMUM_UDP_PAYLOAD_SIZE
Definition: getdns.h:248
@ GETDNS_CONTEXT_CODE_APPEND_NAME
Definition: getdns.h:245
@ GETDNS_CONTEXT_CODE_RESOLUTION_TYPE
Definition: getdns.h:239
@ GETDNS_CONTEXT_CODE_DNSSEC_TRUST_ANCHORS
Definition: getdns.h:247
@ GETDNS_CONTEXT_CODE_MEMORY_FUNCTIONS
Definition: getdns.h:253
@ GETDNS_CONTEXT_CODE_NAMESPACES
Definition: getdns.h:238
@ GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS
Definition: getdns.h:241
@ GETDNS_CONTEXT_CODE_TIMEOUT
Definition: getdns.h:254
@ GETDNS_CONTEXT_CODE_IDLE_TIMEOUT
Definition: getdns.h:255
@ GETDNS_CONTEXT_CODE_FOLLOW_REDIRECTS
Definition: getdns.h:240
@ GETDNS_CONTEXT_CODE_EDNS_DO_BIT
Definition: getdns.h:251
@ GETDNS_CONTEXT_CODE_DNS_TRANSPORT
Definition: getdns.h:243
getdns_list * getdns_root_trust_anchor(time_t *utc_date_of_anchor)
getdns_return_t getdns_validate_dnssec(const getdns_list *to_validate, const getdns_list *support_records, const getdns_list *trust_anchors)
getdns_dict * getdns_context_get_api_information(const getdns_context *context)
getdns_return_t getdns_dict_remove_name(getdns_dict *dict, const char *name)
getdns_return_t getdns_context_set_follow_redirects(getdns_context *context, getdns_redirects_t value)
getdns_return_t getdns_context_set_upstream_recursive_servers(getdns_context *context, getdns_list *upstream_list)
getdns_return_t getdns_context_set_edns_maximum_udp_payload_size(getdns_context *context, uint16_t value)
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_dns_transport_list(getdns_context *context, size_t transport_count, getdns_transport_list_t *transports)
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_context_set_dns_root_servers(getdns_context *context, getdns_list *addresses)
getdns_return_t getdns_context_set_context_update_callback(getdns_context *context, void(*value)(getdns_context *context, getdns_context_code_t changed_item))
getdns_return_t getdns_context_set_namespaces(getdns_context *context, size_t namespace_count, const getdns_namespace_t *namespaces)
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_context_set_suffix(getdns_context *context, getdns_list *value)
getdns_return_t getdns_context_set_edns_version(getdns_context *context, uint8_t value)
getdns_return_t getdns_context_set_dnssec_allowed_skew(getdns_context *context, uint32_t value)
getdns_return_t getdns_context_set_resolution_type(getdns_context *context, getdns_resolution_t value)
getdns_return_t getdns_context_set_edns_do_bit(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_dns_transport(getdns_context *context, getdns_transport_t value)
void getdns_context_destroy(getdns_context *context)
getdns_return_t getdns_context_set_limit_outstanding_queries(getdns_context *context, uint16_t limit)
getdns_return_t getdns_context_set_append_name(getdns_context *context, getdns_append_name_t value)
getdns_return_t getdns_context_set_timeout(getdns_context *context, uint64_t timeout)
getdns_return_t getdns_context_set_dnssec_trust_anchors(getdns_context *context, getdns_list *value)
getdns_return_t getdns_context_set_tcp_send_timeout(getdns_context *context, uint32_t value)
getdns_return_t getdns_context_set_edns_extended_rcode(getdns_context *context, uint8_t value)
getdns_return_t getdns_context_create(getdns_context **context, int set_from_os)
getdns_return_t getdns_context_set_idle_timeout(getdns_context *context, uint64_t timeout)
getdns_dict * getdns_dict_create_with_memory_functions(void *(*malloc)(size_t), void *(*realloc)(void *, size_t), void(*free)(void *))
getdns_return_t getdns_dict_get_dict(const getdns_dict *dict, const char *name, getdns_dict **answer)
getdns_return_t getdns_dict_get_bindata(const getdns_dict *dict, const char *name, getdns_bindata **answer)
char * getdns_pretty_print_dict(const getdns_dict *some_dict)
void getdns_dict_destroy(getdns_dict *dict)
getdns_return_t getdns_dict_set_dict(getdns_dict *dict, const char *name, const getdns_dict *child_dict)
getdns_return_t getdns_dict_get_data_type(const getdns_dict *dict, const char *name, getdns_data_type *answer)
getdns_return_t getdns_dict_set_bindata(getdns_dict *dict, const char *name, const getdns_bindata *child_bindata)
getdns_return_t getdns_dict_get_list(const getdns_dict *dict, const char *name, getdns_list **answer)
getdns_return_t getdns_dict_set_int(getdns_dict *dict, const char *name, uint32_t child_uint32)
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_return_t getdns_dict_get_int(const getdns_dict *dict, const char *name, uint32_t *answer)
getdns_return_t getdns_dict_get_names(const getdns_dict *dict, getdns_list **answer)
getdns_dict * getdns_dict_create_with_context(const getdns_context *context)
getdns_dict * getdns_dict_create()
getdns_return_t getdns_dict_set_list(getdns_dict *dict, const char *name, const getdns_list *child_list)
getdns_return_t getdns_list_get_list(const getdns_list *list, size_t index, getdns_list **answer)
getdns_list * getdns_list_create_with_context(const 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 *))
getdns_return_t getdns_list_set_bindata(getdns_list *list, size_t index, const getdns_bindata *child_bindata)
getdns_return_t getdns_list_get_bindata(const getdns_list *list, size_t index, getdns_bindata **answer)
getdns_return_t getdns_list_set_dict(getdns_list *list, size_t index, const getdns_dict *child_dict)
getdns_return_t getdns_list_get_length(const getdns_list *list, size_t *answer)
getdns_list * getdns_list_create()
getdns_return_t getdns_list_set_list(getdns_list *list, size_t index, const getdns_list *child_list)
getdns_return_t getdns_list_get_dict(const getdns_list *list, size_t index, getdns_dict **answer)
void getdns_list_destroy(getdns_list *list)
getdns_return_t getdns_list_set_int(getdns_list *list, size_t index, uint32_t child_uint32)
getdns_return_t getdns_list_get_int(const getdns_list *list, size_t index, uint32_t *answer)
getdns_return_t getdns_list_get_data_type(const getdns_list *list, size_t index, getdns_data_type *answer)
getdns_list * getdns_list_create_with_memory_functions(void *(*malloc)(size_t), void *(*realloc)(void *, size_t), void(*free)(void *))
getdns_namespace_t
Definition: getdns.h:124
@ GETDNS_NAMESPACE_DNS
Definition: getdns.h:125
@ GETDNS_NAMESPACE_NIS
Definition: getdns.h:129
@ GETDNS_NAMESPACE_NETBIOS
Definition: getdns.h:127
@ GETDNS_NAMESPACE_LOCALNAMES
Definition: getdns.h:126
@ GETDNS_NAMESPACE_MDNS
Definition: getdns.h:128
getdns_redirects_t
Definition: getdns.h:162
@ GETDNS_REDIRECTS_FOLLOW
Definition: getdns.h:163
@ GETDNS_REDIRECTS_DO_NOT_FOLLOW
Definition: getdns.h:164
getdns_resolution_t
Definition: getdns.h:146
@ GETDNS_RESOLUTION_RECURSING
Definition: getdns.h:148
@ GETDNS_RESOLUTION_STUB
Definition: getdns.h:147
getdns_return_t
Definition: getdns.h:63
@ GETDNS_RETURN_NO_SUCH_LIST_ITEM
Definition: getdns.h:70
@ GETDNS_RETURN_INVALID_PARAMETER
Definition: getdns.h:77
@ GETDNS_RETURN_BAD_DOMAIN_NAME
Definition: getdns.h:66
@ GETDNS_RETURN_UNKNOWN_TRANSACTION
Definition: getdns.h:69
@ GETDNS_RETURN_EXTENSION_MISFORMAT
Definition: getdns.h:74
@ GETDNS_RETURN_NOT_IMPLEMENTED
Definition: getdns.h:78
@ GETDNS_RETURN_NO_SUCH_EXTENSION
Definition: getdns.h:73
@ GETDNS_RETURN_BAD_CONTEXT
Definition: getdns.h:67
@ GETDNS_RETURN_MEMORY_ERROR
Definition: getdns.h:76
@ GETDNS_RETURN_CONTEXT_UPDATE_FAIL
Definition: getdns.h:68
@ GETDNS_RETURN_GENERIC_ERROR
Definition: getdns.h:65
@ GETDNS_RETURN_NO_SUCH_DICT_NAME
Definition: getdns.h:71
@ GETDNS_RETURN_GOOD
Definition: getdns.h:64
@ GETDNS_RETURN_WRONG_TYPE_REQUESTED
Definition: getdns.h:72
@ GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED
Definition: getdns.h:75
getdns_append_name_t
Definition: getdns.h:216
@ GETDNS_APPEND_NAME_ONLY_TO_MULTIPLE_LABEL_NAME_AFTER_FAILURE
Definition: getdns.h:219
@ GETDNS_APPEND_NAME_NEVER
Definition: getdns.h:220
@ GETDNS_APPEND_NAME_ALWAYS
Definition: getdns.h:217
@ GETDNS_APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE
Definition: getdns.h:218
getdns_return_t getdns_service_sync(getdns_context *context, const char *name, const getdns_dict *extensions, getdns_dict **response)
getdns_return_t getdns_address_sync(getdns_context *context, const char *name, const getdns_dict *extensions, getdns_dict **response)
getdns_return_t getdns_hostname_sync(getdns_context *context, const getdns_dict *address, const getdns_dict *extensions, getdns_dict **response)
getdns_return_t getdns_general_sync(getdns_context *context, const char *name, uint16_t request_type, const getdns_dict *extensions, getdns_dict **response)
getdns_transport_list_t
Definition: getdns.h:198
@ GETDNS_TRANSPORT_TCP
Definition: getdns.h:200
@ GETDNS_TRANSPORT_UDP
Definition: getdns.h:199
@ GETDNS_TRANSPORT_TLS
Definition: getdns.h:201
getdns_transport_t
Definition: getdns.h:178
@ GETDNS_TRANSPORT_TCP_ONLY
Definition: getdns.h:181
@ GETDNS_TRANSPORT_TCP_ONLY_KEEP_CONNECTIONS_OPEN
Definition: getdns.h:182
@ GETDNS_TRANSPORT_UDP_FIRST_AND_FALL_BACK_TO_TCP
Definition: getdns.h:179
@ GETDNS_TRANSPORT_UDP_ONLY
Definition: getdns.h:180
char * getdns_convert_ulabel_to_alabel(const char *ulabel)
char * getdns_convert_alabel_to_ulabel(const char *alabel)
getdns_return_t getdns_convert_fqdn_to_dns_name(const char *fqdn_as_string, getdns_bindata **dns_name_wire_fmt)
char * getdns_display_ip_address(const getdns_bindata *bindata_of_ipv4_or_ipv6_address)
getdns_return_t getdns_convert_dns_name_to_fqdn(const getdns_bindata *dns_name_wire_fmt, char **fqdn_as_string)
struct getdns_list getdns_list
Definition: getdns.h:553
struct getdns_context getdns_context
Definition: getdns.h:512
struct getdns_dict getdns_dict
Definition: getdns.h:546
struct getdns_bindata getdns_bindata
uint64_t getdns_transaction_t
Definition: getdns.h:520
getdns_data_type
Definition: getdns.h:528
@ t_list
Definition: getdns.h:529
@ t_int
Definition: getdns.h:529
@ t_bindata
Definition: getdns.h:529
@ t_dict
Definition: getdns.h:529
uint8_t * data
Definition: getdns.h:539
size_t size
Definition: getdns.h:538