2013-12-06 07:41:40 -06:00
/* Created at 2013-12-06-14-39-56*/
2013-11-05 10:28:10 -06:00
# ifndef GETDNS_H
# define GETDNS_H
# include <stdint.h>
# include <stdlib.h>
# include <netinet/in.h>
# define GETDNS_COMPILATION_COMMENT The API implementation should fill in something here, such as a compilation version string and date, and change it each time the API is compiled.
/* Return values */
# define GETDNS_RETURN_GOOD 0
2013-12-04 09:43:57 -06:00
# define GETDNS_RETURN_GOOD_TEXT "Good"
2013-11-05 10:28:10 -06:00
# define GETDNS_RETURN_GENERIC_ERROR 1
2013-12-04 09:43:57 -06:00
# define GETDNS_RETURN_GENERIC_ERROR_TEXT "Generic error"
2013-11-05 10:28:10 -06:00
# define GETDNS_RETURN_BAD_DOMAIN_NAME 300
2013-12-04 09:43:57 -06:00
# define GETDNS_RETURN_BAD_DOMAIN_NAME_TEXT "Badly-formed domain name in first argument"
2013-11-05 10:28:10 -06:00
# define GETDNS_RETURN_BAD_CONTEXT 301
2013-12-04 09:43:57 -06:00
# define GETDNS_RETURN_BAD_CONTEXT_TEXT "Bad value for a context type"
2013-11-05 10:28:10 -06:00
# define GETDNS_RETURN_CONTEXT_UPDATE_FAIL 302
2013-12-04 09:43:57 -06:00
# define GETDNS_RETURN_CONTEXT_UPDATE_FAIL_TEXT "Did not update the context"
2013-11-05 10:28:10 -06:00
# define GETDNS_RETURN_UNKNOWN_TRANSACTION 303
2013-12-04 09:43:57 -06:00
# define GETDNS_RETURN_UNKNOWN_TRANSACTION_TEXT "An attempt was made to cancel a callback with a transaction_id that is not recognized"
2013-11-05 10:28:10 -06:00
# define GETDNS_RETURN_NO_SUCH_LIST_ITEM 304
2013-12-04 09:43:57 -06:00
# define GETDNS_RETURN_NO_SUCH_LIST_ITEM_TEXT "A helper function for lists had an index argument that was too high."
2013-11-05 10:28:10 -06:00
# define GETDNS_RETURN_NO_SUCH_DICT_NAME 305
2013-12-04 09:43:57 -06:00
# 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."
2013-11-05 10:28:10 -06:00
# define GETDNS_RETURN_WRONG_TYPE_REQUESTED 306
2013-12-04 09:43:57 -06:00
# 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."
2013-11-05 10:28:10 -06:00
# define GETDNS_RETURN_NO_SUCH_EXTENSION 307
2013-12-04 09:43:57 -06:00
# define GETDNS_RETURN_NO_SUCH_EXTENSION_TEXT "A name in the extensions dict is not a valid extension."
2013-11-05 10:28:10 -06:00
# define GETDNS_RETURN_EXTENSION_MISFORMAT 308
2013-12-04 09:43:57 -06:00
# define GETDNS_RETURN_EXTENSION_MISFORMAT_TEXT "One or more of the extensions have a bad format."
2013-11-05 10:28:10 -06:00
# define GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED 309
2013-12-04 09:43:57 -06:00
# 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."
2013-12-04 09:45:17 -06:00
# define GETDNS_RETURN_MEMORY_ERROR 310
# define GETDNS_RETURN_MEMORY_ERROR_TEXT "Unable to allocate the memory required."
2013-11-05 10:28:10 -06:00
/* DNSSEC values */
# define GETDNS_DNSSEC_SECURE 400
2013-12-04 09:43:57 -06:00
# define GETDNS_DNSSEC_SECURE_TEXT "The record was determined to be secure in DNSSEC"
2013-11-05 10:28:10 -06:00
# define GETDNS_DNSSEC_BOGUS 401
2013-12-04 09:43:57 -06:00
# define GETDNS_DNSSEC_BOGUS_TEXT "The record was determined to be bogus in DNSSEC"
2013-11-05 10:28:10 -06:00
# define GETDNS_DNSSEC_INDETERMINATE 402
2013-12-04 09:43:57 -06:00
# define GETDNS_DNSSEC_INDETERMINATE_TEXT "The record was not determined to be any state in DNSSEC"
2013-11-05 10:28:10 -06:00
# define GETDNS_DNSSEC_INSECURE 403
2013-12-04 09:43:57 -06:00
# define GETDNS_DNSSEC_INSECURE_TEXT "The record was determined to be insecure in DNSSEC"
2013-11-05 10:28:10 -06:00
# define GETDNS_DNSSEC_NOT_PERFORMED 404
2013-12-04 09:43:57 -06:00
# define GETDNS_DNSSEC_NOT_PERFORMED_TEXT "DNSSEC validation was not performed (only used for debugging)"
2013-11-05 10:28:10 -06:00
/* Context Variables */
# define GETDNS_CONTEXT_NAMESPACE_DNS 500
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_NAMESPACE_DNS_TEXT "See getdns_context_set_namespaces()"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_NAMESPACE_LOCALNAMES 501
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_NAMESPACE_LOCALNAMES_TEXT "See getdns_context_set_namespaces()"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_NAMESPACE_NETBIOS 502
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_NAMESPACE_NETBIOS_TEXT "See getdns_context_set_namespaces()"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_NAMESPACE_MDNS 503
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_NAMESPACE_MDNS_TEXT "See getdns_context_set_namespaces()"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_NAMESPACE_NIS 504
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_NAMESPACE_NIS_TEXT "See getdns_context_set_namespaces()"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_STUB 505
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_STUB_TEXT "See getdns_context_set_resolution_type()"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_RECURSING 506
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_RECURSING_TEXT "See getdns_context_set_resolution_type()"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_FOLLOW_REDIRECTS 507
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_FOLLOW_REDIRECTS_TEXT "See getdns_context_set_follow_redirects()"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_DO_NOT_FOLLOW_REDIRECTS 508
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_DO_NOT_FOLLOW_REDIRECTS_TEXT "See getdns_context_set_follow_redirects()"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_UDP_FIRST_AND_FALL_BACK_TO_TCP 509
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_UDP_FIRST_AND_FALL_BACK_TO_TCP_TEXT "See getdns_context_set_dns_transport()"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_UDP_ONLY 510
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_UDP_ONLY_TEXT "See getdns_context_set_dns_transport()"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_TCP_ONLY 511
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_TCP_ONLY_TEXT "See getdns_context_set_dns_transport()"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_TCP_ONLY_KEEP_CONNECTIONS_OPEN 512
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_TCP_ONLY_KEEP_CONNECTIONS_OPEN_TEXT "See getdns_context_set_dns_transport()"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_APPEND_NAME_ALWAYS 513
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_APPEND_NAME_ALWAYS_TEXT "See getdns_context_set_append_name()"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE 514
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE_TEXT "See getdns_context_set_append_name()"
2013-11-13 08:02:09 -06:00
# define GETDNS_CONTEXT_APPEND_NAME_ONLY_TO_MULTIPLE_LABEL_NAME_AFTER_FAILURE 515
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_APPEND_NAME_ONLY_TO_MULTIPLE_LABEL_NAME_AFTER_FAILURE_TEXT "See getdns_context_set_append_name()"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_DO_NOT_APPEND_NAMES 516
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_DO_NOT_APPEND_NAMES_TEXT "See getdns_context_set_append_name()"
2013-11-05 10:28:10 -06:00
/* Context codes */
# define GETDNS_CONTEXT_CODE_NAMESPACES 600
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_NAMESPACES_TEXT "Change related to getdns_context_set_namespaces"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_CODE_RESOLUTION_TYPE 601
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_RESOLUTION_TYPE_TEXT "Change related to getdns_context_set_resolution_type"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_CODE_FOLLOW_REDIRECTS 602
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_FOLLOW_REDIRECTS_TEXT "Change related to getdns_context_set_follow_redirects"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS 603
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS_TEXT "Change related to getdns_context_set_upstream_recursive_servers"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_CODE_DNS_ROOT_SERVERS 604
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_DNS_ROOT_SERVERS_TEXT "Change related to getdns_context_set_dns_root_servers"
2013-11-13 08:00:45 -06:00
# define GETDNS_CONTEXT_CODE_DNS_TRANSPORT 605
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_DNS_TRANSPORT_TEXT "Change related to getdns_context_set_dns_transport"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_CODE_LIMIT_OUTSTANDING_QUERIES 606
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_LIMIT_OUTSTANDING_QUERIES_TEXT "Change related to getdns_context_set_limit_outstanding_queries"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_CODE_APPEND_NAME 607
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_APPEND_NAME_TEXT "Change related to getdns_context_set_append_name"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_CODE_SUFFIX 608
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_SUFFIX_TEXT "Change related to getdns_context_set_suffix"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_CODE_DNSSEC_TRUST_ANCHORS 609
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_DNSSEC_TRUST_ANCHORS_TEXT "Change related to getdns_context_set_dnssec_trust_anchors"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_CODE_EDNS_MAXIMUM_UDP_PAYLOAD_SIZE 610
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_EDNS_MAXIMUM_UDP_PAYLOAD_SIZE_TEXT "Change related to getdns_context_set_edns_maximum_udp_payload_size"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_CODE_EDNS_EXTENDED_RCODE 611
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_EDNS_EXTENDED_RCODE_TEXT "Change related to getdns_context_set_edns_extended_rcode"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_CODE_EDNS_VERSION 612
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_EDNS_VERSION_TEXT "Change related to getdns_context_set_edns_version"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_CODE_EDNS_DO_BIT 613
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_EDNS_DO_BIT_TEXT "Change related to getdns_context_set_edns_do_bit"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_CODE_DNSSEC_ALLOWED_SKEW 614
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_DNSSEC_ALLOWED_SKEW_TEXT "Change related to getdns_context_set_dnssec_allowed_skew"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_CODE_MEMORY_ALLOCATOR 615
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_MEMORY_ALLOCATOR_TEXT "Change related to getdns_context_set_memory_allocator"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_CODE_MEMORY_DEALLOCATOR 616
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_MEMORY_DEALLOCATOR_TEXT "Change related to getdns_context_set_memory_deallocator"
2013-11-05 10:28:10 -06:00
# define GETDNS_CONTEXT_CODE_MEMORY_REALLOCATOR 617
2013-12-04 09:43:57 -06:00
# define GETDNS_CONTEXT_CODE_MEMORY_REALLOCATOR_TEXT "Change related to getdns_context_set_memory_reallocator"
2013-11-05 10:28:10 -06:00
/* Callback Type Variables */
# define GETDNS_CALLBACK_COMPLETE 700
2013-12-04 09:43:57 -06:00
# define GETDNS_CALLBACK_COMPLETE_TEXT "The response has the requested data in it"
2013-11-05 10:28:10 -06:00
# define GETDNS_CALLBACK_CANCEL 701
2013-12-04 09:43:57 -06:00
# define GETDNS_CALLBACK_CANCEL_TEXT "The calling program cancelled the callback; response is NULL"
2013-11-05 10:28:10 -06:00
# define GETDNS_CALLBACK_TIMEOUT 702
2013-12-04 09:43:57 -06:00
# define GETDNS_CALLBACK_TIMEOUT_TEXT "The requested action timed out; response is NULL"
2013-11-05 10:28:10 -06:00
# define GETDNS_CALLBACK_ERROR 703
2013-12-04 09:43:57 -06:00
# define GETDNS_CALLBACK_ERROR_TEXT "The requested action had an error; response is NULL"
2013-11-05 10:28:10 -06:00
/* Type Of Name Services */
# define GETDNS_NAMETYPE_DNS 800
2013-12-04 09:43:57 -06:00
# define GETDNS_NAMETYPE_DNS_TEXT "Normal DNS (RFC 1035)"
2013-11-05 10:28:10 -06:00
# define GETDNS_NAMETYPE_WINS 801
2013-12-04 09:43:57 -06:00
# define GETDNS_NAMETYPE_WINS_TEXT "The WINS name service (some reference needed)"
2013-11-05 10:28:10 -06:00
/* Status Codes for Responses */
# define GETDNS_RESPSTATUS_GOOD 900
2013-12-04 09:43:57 -06:00
# define GETDNS_RESPSTATUS_GOOD_TEXT "At least one response was returned"
2013-11-05 10:28:10 -06:00
# define GETDNS_RESPSTATUS_NO_NAME 901
2013-12-04 09:43:57 -06:00
# define GETDNS_RESPSTATUS_NO_NAME_TEXT "Queries for the name yielded all negative responses"
2013-11-05 10:28:10 -06:00
# define GETDNS_RESPSTATUS_ALL_TIMEOUT 902
2013-12-04 09:43:57 -06:00
# define GETDNS_RESPSTATUS_ALL_TIMEOUT_TEXT "All queries for the name timed out"
2013-11-05 10:28:10 -06:00
# define GETDNS_RESPSTATUS_NO_SECURE_ANSWERS 903
2013-12-04 09:43:57 -06:00
# 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."
2013-11-05 10:28:10 -06:00
/* Values Associated With Extensions */
# define GETDNS_EXTENSION_TRUE 1000
2013-12-04 09:43:57 -06:00
# define GETDNS_EXTENSION_TRUE_TEXT "Turn on the extension"
2013-11-05 10:28:10 -06:00
# define GETDNS_EXTENSION_FALSE 1001
2013-12-04 09:43:57 -06:00
# define GETDNS_EXTENSION_FALSE_TEXT "Do not turn on the extension"
2013-11-05 10:28:10 -06:00
/* Values Associated With DNS Errors Found By The API */
# define GETDNS_BAD_DNS_CNAME_IN_TARGET 1100
2013-12-04 09:43:57 -06:00
# 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"
2013-11-05 10:28:10 -06:00
# define GETDNS_BAD_DNS_ALL_NUMERIC_LABEL 1101
2013-12-04 09:43:57 -06:00
# 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"
2013-11-05 10:28:10 -06:00
# define GETDNS_BAD_DNS_CNAME_RETURNED_FOR_OTHER_TYPE 1102
2013-12-04 09:43:57 -06:00
# define GETDNS_BAD_DNS_CNAME_RETURNED_FOR_OTHER_TYPE_TEXT "A DNS query for a type other than CNAME returned a CNAME response"
2013-11-05 10:28:10 -06:00
/* Defines for RRtypes (from 2012-12) */
# define GETDNS_RRTYPE_A 1
# define GETDNS_RRTYPE_NS 2
# define GETDNS_RRTYPE_MD 3
# define GETDNS_RRTYPE_MF 4
# define GETDNS_RRTYPE_CNAME 5
# define GETDNS_RRTYPE_SOA 6
# define GETDNS_RRTYPE_MB 7
# define GETDNS_RRTYPE_MG 8
# define GETDNS_RRTYPE_MR 9
# define GETDNS_RRTYPE_NULL 10
# define GETDNS_RRTYPE_WKS 11
# define GETDNS_RRTYPE_PTR 12
# define GETDNS_RRTYPE_HINFO 13
# define GETDNS_RRTYPE_MINFO 14
# define GETDNS_RRTYPE_MX 15
# define GETDNS_RRTYPE_TXT 16
# define GETDNS_RRTYPE_RP 17
# define GETDNS_RRTYPE_AFSDB 18
# define GETDNS_RRTYPE_X25 19
# define GETDNS_RRTYPE_ISDN 20
# define GETDNS_RRTYPE_RT 21
# define GETDNS_RRTYPE_NSAP 22
# define GETDNS_RRTYPE_SIG 24
# define GETDNS_RRTYPE_KEY 25
# define GETDNS_RRTYPE_PX 26
# define GETDNS_RRTYPE_GPOS 27
# define GETDNS_RRTYPE_AAAA 28
# define GETDNS_RRTYPE_LOC 29
# define GETDNS_RRTYPE_NXT 30
# define GETDNS_RRTYPE_EID 31
# define GETDNS_RRTYPE_NIMLOC 32
# define GETDNS_RRTYPE_SRV 33
# define GETDNS_RRTYPE_ATMA 34
# define GETDNS_RRTYPE_NAPTR 35
# define GETDNS_RRTYPE_KX 36
# define GETDNS_RRTYPE_CERT 37
# define GETDNS_RRTYPE_A6 38
# define GETDNS_RRTYPE_DNAME 39
# define GETDNS_RRTYPE_SINK 40
# define GETDNS_RRTYPE_OPT 41
# define GETDNS_RRTYPE_APL 42
# define GETDNS_RRTYPE_DS 43
# define GETDNS_RRTYPE_SSHFP 44
# define GETDNS_RRTYPE_IPSECKEY 45
# define GETDNS_RRTYPE_RRSIG 46
# define GETDNS_RRTYPE_NSEC 47
# define GETDNS_RRTYPE_DNSKEY 48
# define GETDNS_RRTYPE_DHCID 49
# define GETDNS_RRTYPE_NSEC3 50
# define GETDNS_RRTYPE_NSEC3PARAM 51
# define GETDNS_RRTYPE_TLSA 52
# define GETDNS_RRTYPE_HIP 55
# define GETDNS_RRTYPE_NINFO 56
# define GETDNS_RRTYPE_RKEY 57
# define GETDNS_RRTYPE_TALINK 58
# define GETDNS_RRTYPE_CDS 59
# define GETDNS_RRTYPE_SPF 99
# define GETDNS_RRTYPE_UINFO 100
# define GETDNS_RRTYPE_UID 101
# define GETDNS_RRTYPE_GID 102
# define GETDNS_RRTYPE_UNSPEC 103
# define GETDNS_RRTYPE_NID 104
# define GETDNS_RRTYPE_L32 105
# define GETDNS_RRTYPE_L64 106
# define GETDNS_RRTYPE_LP 107
2013-12-04 09:42:50 -06:00
# define GETDNS_RRTYPE_EUI48 108
# define GETDNS_RRTYPE_EUI64 109
2013-11-05 10:28:10 -06:00
# define GETDNS_RRTYPE_TKEY 249
# define GETDNS_RRTYPE_TSIG 250
# define GETDNS_RRTYPE_IXFR 251
# define GETDNS_RRTYPE_AXFR 252
# define GETDNS_RRTYPE_MAILB 253
# define GETDNS_RRTYPE_MAILA 254
# define GETDNS_RRTYPE_URI 256
# define GETDNS_RRTYPE_CAA 257
# define GETDNS_RRTYPE_TA 32768
# define GETDNS_RRTYPE_DLV 32769
/* Various typedefs */
2013-12-04 09:46:42 -06:00
struct getdns_context ;
2013-11-05 10:28:10 -06:00
typedef uint16_t getdns_return_t ;
typedef uint64_t getdns_transaction_t ;
2013-12-03 07:36:06 -06:00
typedef enum getdns_data_type {
2013-11-05 10:28:10 -06:00
t_dict , t_list , t_int , t_bindata
} getdns_data_type ;
2013-12-04 09:46:42 -06:00
struct getdns_bindata {
2013-11-05 10:28:10 -06:00
size_t size ;
2013-12-03 07:36:06 -06:00
uint8_t * data ;
2013-12-04 09:46:42 -06:00
} ;
struct getdns_dict ;
struct getdns_list ;
2013-11-05 10:28:10 -06:00
/* Helper functions for data structures */
/* Lists: get the length, get the data_type of the value at a given
position , and get the data at a given position */
getdns_return_t getdns_list_get_length ( struct getdns_list * this_list , size_t * answer ) ;
getdns_return_t getdns_list_get_data_type ( struct getdns_list * this_list , size_t index , getdns_data_type * answer ) ;
getdns_return_t getdns_list_get_dict ( struct getdns_list * this_list , size_t index , struct getdns_dict * * answer ) ;
getdns_return_t getdns_list_get_list ( struct getdns_list * this_list , size_t index , struct getdns_list * * answer ) ;
getdns_return_t getdns_list_get_bindata ( struct getdns_list * this_list , size_t index , struct getdns_bindata * * answer ) ;
getdns_return_t getdns_list_get_int ( struct getdns_list * this_list , size_t index , uint32_t * answer ) ;
/* Dicts: get the list of names, get the data_type of the
value at a given name , and get the data at a given name */
getdns_return_t getdns_dict_get_names ( struct getdns_dict * this_dict , struct getdns_list * * answer ) ;
getdns_return_t getdns_dict_get_data_type ( struct getdns_dict * this_dict , char * name , getdns_data_type * answer ) ;
getdns_return_t getdns_dict_get_dict ( struct getdns_dict * this_dict , char * name , struct getdns_dict * * answer ) ;
getdns_return_t getdns_dict_get_list ( struct getdns_dict * this_dict , char * name , struct getdns_list * * answer ) ;
getdns_return_t getdns_dict_get_bindata ( struct getdns_dict * this_dict , char * name , struct getdns_bindata * * answer ) ;
getdns_return_t getdns_dict_get_int ( struct getdns_dict * this_dict , char * name , uint32_t * answer ) ;
/* Lists: create, destroy, and set the data at a given position */
struct getdns_list * getdns_list_create ( ) ;
2013-12-04 09:47:46 -06:00
struct getdns_list * getdns_list_create_with_context (
struct getdns_context * context
) ;
struct getdns_list * getdns_list_create_with_memory_functions (
void * ( * malloc ) ( size_t ) ,
void * ( * realloc ) ( void * , size_t ) ,
void ( * free ) ( void * )
) ;
struct 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 * )
) ;
2013-11-05 10:28:10 -06:00
void getdns_list_destroy ( struct getdns_list * this_list ) ;
getdns_return_t getdns_list_set_dict ( struct getdns_list * this_list , size_t index , struct getdns_dict * child_dict ) ;
getdns_return_t getdns_list_set_list ( struct getdns_list * this_list , size_t index , struct getdns_list * child_list ) ;
getdns_return_t getdns_list_set_bindata ( struct getdns_list * this_list , size_t index , struct getdns_bindata * child_bindata ) ;
getdns_return_t getdns_list_set_int ( struct getdns_list * this_list , size_t index , uint32_t child_uint32 ) ;
/* Dicts: create, destroy, and set the data at a given name */
struct getdns_dict * getdns_dict_create ( ) ;
2013-12-04 09:47:46 -06:00
struct getdns_dict * getdns_dict_create_with_context (
struct getdns_context * context
) ;
struct getdns_dict * getdns_dict_create_with_memory_functions (
void * ( * malloc ) ( size_t ) ,
void * ( * realloc ) ( void * , size_t ) ,
void ( * free ) ( void * )
) ;
struct 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 * )
) ;
2013-11-05 10:28:10 -06:00
void getdns_dict_destroy ( struct getdns_dict * this_dict ) ;
getdns_return_t getdns_dict_set_dict ( struct getdns_dict * this_dict , char * name , struct getdns_dict * child_dict ) ;
getdns_return_t getdns_dict_set_list ( struct getdns_dict * this_dict , char * name , struct getdns_list * child_list ) ;
getdns_return_t getdns_dict_set_bindata ( struct getdns_dict * this_dict , char * name , struct getdns_bindata * child_bindata ) ;
getdns_return_t getdns_dict_set_int ( struct getdns_dict * this_dict , char * name , uint32_t child_uint32 ) ;
2013-12-06 07:41:40 -06:00
getdns_return_t getdns_dict_remove_name ( struct getdns_dict * this_dict , char * name ) ;
2013-11-05 10:28:10 -06:00
/* Callback arguments */
typedef void ( * getdns_callback_t ) (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
uint16_t callback_type ,
struct getdns_dict * response ,
void * userarg ,
getdns_transaction_t transaction_id ) ;
/* Function definitions */
getdns_return_t
getdns_general (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
const char * name ,
uint16_t request_type ,
struct getdns_dict * extensions ,
void * userarg ,
getdns_transaction_t * transaction_id ,
getdns_callback_t callbackfn
) ;
getdns_return_t
getdns_address (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
const char * name ,
struct getdns_dict * extensions ,
void * userarg ,
getdns_transaction_t * transaction_id ,
getdns_callback_t callbackfn
) ;
getdns_return_t
getdns_hostname (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
struct getdns_dict * address ,
struct getdns_dict * extensions ,
void * userarg ,
getdns_transaction_t * transaction_id ,
getdns_callback_t callbackfn
) ;
getdns_return_t
getdns_service (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
const char * name ,
struct getdns_dict * extensions ,
void * userarg ,
getdns_transaction_t * transaction_id ,
getdns_callback_t callbackfn
) ;
getdns_return_t
getdns_context_create (
2013-12-04 09:46:42 -06:00
struct getdns_context * * context ,
2013-12-04 09:36:28 -06:00
int set_from_os
2013-11-05 10:28:10 -06:00
) ;
2013-12-04 09:47:46 -06:00
getdns_return_t
getdns_context_create_with_memory_functions (
struct getdns_context * * context ,
int set_from_os ,
void * ( * malloc ) ( size_t ) ,
void * ( * realloc ) ( void * , size_t ) ,
void ( * free ) ( void * )
) ;
getdns_return_t
getdns_context_create_with_extended_memory_functions (
struct 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 * )
) ;
2013-11-05 10:28:10 -06:00
void
getdns_context_destroy (
2013-12-04 09:46:42 -06:00
struct getdns_context * context
2013-11-05 10:28:10 -06:00
) ;
getdns_return_t
getdns_cancel_callback (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
getdns_transaction_t transaction_id
) ;
getdns_return_t
getdns_general_sync (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
const char * name ,
uint16_t request_type ,
struct getdns_dict * extensions ,
2013-11-13 08:05:27 -06:00
struct getdns_dict * * response
2013-11-05 10:28:10 -06:00
) ;
getdns_return_t
getdns_address_sync (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
const char * name ,
struct getdns_dict * extensions ,
2013-11-13 08:05:27 -06:00
struct getdns_dict * * response
2013-11-05 10:28:10 -06:00
) ;
getdns_return_t
getdns_hostname_sync (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
struct getdns_dict * address ,
struct getdns_dict * extensions ,
2013-11-13 08:05:27 -06:00
struct getdns_dict * * response
2013-11-05 10:28:10 -06:00
) ;
getdns_return_t
getdns_service_sync (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
const char * name ,
struct getdns_dict * extensions ,
2013-11-13 08:05:27 -06:00
struct getdns_dict * * response
2013-11-05 10:28:10 -06:00
) ;
char *
getdns_convert_dns_name_to_fqdn (
char * name_from_dns_response
) ;
char *
getdns_convert_fqdn_to_dns_name (
char * fqdn_as_string
) ;
char *
getdns_convert_ulabel_to_alabel (
char * ulabel
) ;
char *
getdns_convert_alabel_to_ulabel (
char * alabel
) ;
getdns_return_t
getdns_validate_dnssec (
struct getdns_bindata * record_to_validate ,
struct getdns_list * bundle_of_support_records ,
struct getdns_list * trust_anchor_rdatas
) ;
char *
getdns_pretty_print_dict (
struct getdns_dict * some_dict
) ;
char *
getdns_display_ip_address (
struct getdns_bindata * bindata_of_ipv4_or_ipv6_address
) ;
getdns_return_t
getdns_context_set_context_update_callback (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
void ( * value ) ( struct getdns_context * context , uint16_t changed_item )
2013-11-05 10:28:10 -06:00
) ;
getdns_return_t
getdns_context_set_resolution_type (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
uint16_t value
) ;
getdns_return_t
getdns_context_set_namespaces (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
size_t namespace_count ,
uint16_t * namespaces
) ;
getdns_return_t
getdns_context_set_dns_transport (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
uint16_t value
) ;
getdns_return_t
getdns_context_set_limit_outstanding_queries (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
uint16_t limit
) ;
getdns_return_t
getdns_context_set_timeout (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
uint16_t timeout
) ;
getdns_return_t
getdns_context_set_follow_redirects (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
uint16_t value
) ;
getdns_return_t
getdns_context_set_dns_root_servers (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
struct getdns_list * addresses
) ;
getdns_return_t
getdns_context_set_append_name (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
uint16_t value
) ;
getdns_return_t
getdns_context_set_suffix (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
struct getdns_list * value
) ;
getdns_return_t
getdns_context_set_dnssec_trust_anchors (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
struct getdns_list * value
) ;
getdns_return_t
getdns_context_set_dnssec_allowed_skew (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
uint16_t value
) ;
getdns_return_t
getdns_context_set_stub_resolution (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
struct getdns_list * upstream_list
) ;
getdns_return_t
getdns_context_set_edns_maximum_udp_payload_size (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
uint16_t value
) ;
getdns_return_t
getdns_context_set_edns_extended_rcode (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
uint8_t value
) ;
getdns_return_t
getdns_context_set_edns_version (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
uint8_t value
) ;
getdns_return_t
getdns_context_set_edns_do_bit (
2013-12-04 09:46:42 -06:00
struct getdns_context * context ,
2013-11-05 10:28:10 -06:00
uint8_t value
) ;
getdns_return_t
2013-12-04 09:47:46 -06:00
getdns_context_set_memory_functions (
struct getdns_context * context ,
void * ( * malloc ) ( size_t ) ,
void * ( * realloc ) ( void * , size_t ) ,
void ( * free ) ( void * )
2013-11-05 10:28:10 -06:00
) ;
getdns_return_t
2013-12-04 09:47:46 -06:00
getdns_context_set_extended_memory_functions (
struct 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 )
2013-11-05 10:28:10 -06:00
) ;
# endif /* GETDNS_H */