Expand description
Low-level bindings for the c-ares library.
In most cases this crate should not be used directly. The c-ares crate provides a safe wrapper and should be preferred wherever possible.
Structs§
- apattern
- ares_
addr - ares_
addr6ttl - ares_
addr_ node - ares_
addr_ port_ node - ares_
addrinfo - ares_
addrinfo_ cname - ares_
addrinfo_ hints - ares_
addrinfo_ node - ares_
addrttl - ares_
caa_ reply - ares_
channeldata - ares_
dns_ qd - Opaque data type representing a DNS Query Data QD Packet
- ares_
dns_ record - Opaque data type representing a DNS Packet
- ares_
dns_ rr - Opaque data type representing a DNS RR (Resource Record)
- ares_
fd_ events_ t - Type holding a file descriptor and mask of events, used by ares_process_fds()
- ares_
in6_ addr - ares_
mx_ reply - ares_
naptr_ reply - ares_
options - ares_
server_ failover_ options - ares_
soa_ reply - ares_
socket_ functions - ares_
socket_ functions_ ex - Socket functions to call rather than using OS-native functions
- ares_
srv_ reply - ares_
txt_ ext - ares_
txt_ reply - ares_
uri_ reply
Enums§
- ares_
bool_ t - ares_
dns_ class_ t - DNS Classes for requests and responses.
- ares_
dns_ datatype_ t - Data types used
- ares_
dns_ flags_ t - DNS Header flags
- ares_
dns_ opcode_ t - DNS Header opcodes
- ares_
dns_ opt_ datatype_ t - Data type for option records for keys like ARES_RR_OPT_OPTIONS and ARES_RR_HTTPS_PARAMS returned by ares_dns_opt_get_datatype()
- ares_
dns_ parse_ flags_ t - Data type for flags to ares_dns_parse()
- ares_
dns_ rcode_ t - DNS Response Codes from server
- ares_
dns_ rec_ type_ t - DNS Record types handled by c-ares. Some record types may only be valid on requests (e.g. ARES_REC_TYPE_ANY), and some may only be valid on responses
- ares_
dns_ rr_ key_ t - Keys used for all RR Types. We take the record type and multiply by 100 to ensure we have a proper offset between keys so we can keep these sorted
- ares_
dns_ section_ t - DNS RR Section type
- ares_
evsys_ t - Values for ARES_OPT_EVENT_THREAD
- ares_
fd_ eventflag_ t - Events used by ares_fd_events_t
- ares_
opt_ param_ t - OPT RR known parameters
- ares_
process_ flag_ t - Flags used by ares_process_fds()
- ares_
socket_ bind_ flags_ t - Flags for behavior during bind
- ares_
socket_ connect_ flags_ t - Flags for behavior during connect
- ares_
socket_ opt_ t - Socket options in request to asetsockopt() in struct ares_socket_functions_ex
- ares_
sockfunc_ flags_ t - Flags defining behavior of socket functions
- ares_
status_ t - ares_
svcb_ param_ t - SVCB (and HTTPS) RR known parameters
- ares_
tlsa_ match_ t - TLSA Record ARES_RR_TLSA_MATCH known values
- ares_
tlsa_ selector_ t - TLSA Record ARES_RR_TLSA_SELECTOR known values
- ares_
tlsa_ usage_ t - TLSA Record ARES_RR_TLSA_CERT_USAGE known values
Constants§
- ARES_
FLAG_ DNS0x20 - ARES_
FLAG_ EDNS - ARES_
FLAG_ IGNTC - ARES_
FLAG_ NOALIASES - ARES_
FLAG_ NOCHECKRESP - ARES_
FLAG_ NORECURSE - ARES_
FLAG_ NOSEARCH - ARES_
FLAG_ NO_ DFLT_ SVR - ARES_
FLAG_ PRIMARY - ARES_
FLAG_ STAYOPEN - ARES_
FLAG_ USEVC - ARES_
GETSOCK_ MAXNUM - ARES_
LIB_ INIT_ ALL - ARES_
LIB_ INIT_ NONE - ARES_
LIB_ INIT_ WIN32 - ARES_
NI_ DCCP - ARES_
NI_ DGRAM - ARES_
NI_ IDN - ARES_
NI_ IDN_ ALLOW_ UNASSIGNED - ARES_
NI_ IDN_ USE_ STD3_ ASCII_ RULES - ARES_
NI_ LOOKUPHOST - ARES_
NI_ LOOKUPSERVICE - ARES_
NI_ NAMEREQD - ARES_
NI_ NOFQDN - ARES_
NI_ NUMERICHOST - ARES_
NI_ NUMERICSCOPE - ARES_
NI_ NUMERICSERV - ARES_
NI_ SCTP - ARES_
NI_ TCP - ARES_
NI_ UDP - ARES_
OPT_ DOMAINS - ARES_
OPT_ EDNSPSZ - ARES_
OPT_ EVENT_ THREAD - ARES_
OPT_ FLAGS - ARES_
OPT_ HOSTS_ FILE - ARES_
OPT_ LOOKUPS - ARES_
OPT_ MAXTIMEOUTMS - ARES_
OPT_ NDOTS - ARES_
OPT_ NOROTATE - ARES_
OPT_ QUERY_ CACHE - ARES_
OPT_ RESOLVCONF - ARES_
OPT_ ROTATE - ARES_
OPT_ SERVERS - ARES_
OPT_ SERVER_ FAILOVER - ARES_
OPT_ SOCK_ RCVBUF - ARES_
OPT_ SOCK_ SNDBUF - ARES_
OPT_ SOCK_ STATE_ CB - ARES_
OPT_ SORTLIST - ARES_
OPT_ TCP_ PORT - ARES_
OPT_ TIMEOUT - ARES_
OPT_ TIMEOUTMS - ARES_
OPT_ TRIES - ARES_
OPT_ UDP_ MAX_ QUERIES - ARES_
OPT_ UDP_ PORT - ARES_
SERV_ STATE_ TCP - ARES_
SERV_ STATE_ UDP - ARES_
SOCKET_ BAD
Functions§
- ares_
cancel ⚠ - ares_
create_ ⚠query - ares_
destroy ⚠ - ares_
destroy_ ⚠options - ares_
dns_ ⚠addr_ to_ ptr - Convert an ip address into the PTR format for in-addr.arpa or in6.arpa
- ares_
dns_ ⚠class_ fromstr - Convert DNS class name as string to ares_dns_class_t
- ares_
dns_ ⚠class_ tostr - String representation of DNS Class
- ares_
dns_ ⚠opcode_ tostr - String representation of DNS OpCode
- ares_
dns_ ⚠opt_ get_ datatype - The options/parameters extensions to some RRs can be somewhat opaque, this is a helper to return the best match for a datatype for interpreting the option record.
- ares_
dns_ ⚠opt_ get_ name - The options/parameters extensions to some RRs can be somewhat opaque, this is a helper to return the name if the option is known.
- ares_
dns_ ⚠parse - Parse a complete DNS message.
- ares_
dns_ ⚠pton - Convert any valid ip address (ipv4 or ipv6) into struct ares_addr and return the starting pointer of the network byte order address and the length of the address (4 or 16).
- ares_
dns_ ⚠rcode_ tostr - Convert DNS response code as string to from ares_dns_rcode_t
- ares_
dns_ ⚠rec_ type_ fromstr - Convert DNS record type as string to ares_dns_rec_type_t
- ares_
dns_ ⚠rec_ type_ tostr - String representation of DNS Record Type
- ares_
dns_ ⚠record_ create - Create a new DNS record object
- ares_
dns_ ⚠record_ destroy - Destroy a DNS record object
- ares_
dns_ ⚠record_ duplicate - Duplicate a complete DNS message. This does not copy internal members (such as the ttl decrement capability).
- ares_
dns_ ⚠record_ get_ flags - Get the DNS Record Flags
- ares_
dns_ ⚠record_ get_ id - Get the DNS Query ID
- ares_
dns_ ⚠record_ get_ opcode - Get the DNS Record OpCode
- ares_
dns_ ⚠record_ get_ rcode - Get the DNS Record RCode
- ares_
dns_ ⚠record_ query_ add - Add a query to the DNS Record. Typically a record will have only 1 query. Most DNS servers will reject queries with more than 1 question.
- ares_
dns_ ⚠record_ query_ cnt - Get the count of queries in the DNS Record
- ares_
dns_ ⚠record_ query_ get - Get the data about the query at the provided index.
- ares_
dns_ ⚠record_ query_ set_ name - Replace the question name with a new name. This may be used when performing a search with aliases.
- ares_
dns_ ⚠record_ query_ set_ type - Replace the question type with a different type. This may be used when needing to query more than one address class (e.g. A and AAAA)
- ares_
dns_ ⚠record_ rr_ add - Add a Resource Record to the DNS Record.
- ares_
dns_ ⚠record_ rr_ cnt - Get the count of Resource Records in the provided section
- ares_
dns_ ⚠record_ rr_ del - Remove the resource record based on the section and index
- ares_
dns_ ⚠record_ rr_ get - Fetch a writable resource record based on the section and index.
- ares_
dns_ ⚠record_ rr_ get_ const - Fetch a non-writeable resource record based on the section and index.
- ares_
dns_ ⚠record_ set_ id - Overwrite the DNS query id
- ares_
dns_ ⚠rr_ add_ abin - Add binary array value (ABINP) data for specified resource record and key. Can only be used on keys with datatype ARES_DATATYPE_ABINP. The value will Be added as the last element in the array.
- ares_
dns_ ⚠rr_ del_ abin - Delete binary array value (ABINP) data for specified resource record and key by specified index. Can only be used on keys with datatype ARES_DATATYPE_ABINP. The value at the index will be deleted.
- ares_
dns_ ⚠rr_ del_ opt_ byid - Delete the option for the RR by id
- ares_
dns_ ⚠rr_ get_ abin - Retrieve a pointer to the binary array data from the specified index. Can only be used on keys with datatype ARES_DATATYPE_ABINP. If ABINP, the data is guaranteed to have a NULL terminator which is NOT included in the length. If want all array membersconcatenated, may use ares_dns_rr_get_bin() instead.
- ares_
dns_ ⚠rr_ get_ abin_ cnt - Retrieve the count of the array of stored binary values. Can only be used on keys with datatype ARES_DATATYPE_ABINP.
- ares_
dns_ ⚠rr_ get_ addr - Retrieve a pointer to the ipv4 address. Can only be used on keys with datatype ARES_DATATYPE_INADDR.
- ares_
dns_ ⚠rr_ get_ addr6 - Retrieve a pointer to the ipv6 address. Can only be used on keys with datatype ARES_DATATYPE_INADDR6.
- ares_
dns_ ⚠rr_ get_ bin - Retrieve a pointer to the binary data. Can only be used on keys with datatype ARES_DATATYPE_BIN, ARES_DATATYPE_BINP, or ARES_DATATYPE_ABINP. If BINP or ABINP, the data is guaranteed to have a NULL terminator which is NOT included in the length.
- ares_
dns_ ⚠rr_ get_ class - Retrieve the resource record class
- ares_
dns_ ⚠rr_ get_ keys - Retrieve a list of Resource Record keys that can be set or retrieved for the Resource record type.
- ares_
dns_ ⚠rr_ get_ name - Retrieve the resource record Name/Hostname
- ares_
dns_ ⚠rr_ get_ opt - Retrieve the option for the RR by index.
- ares_
dns_ ⚠rr_ get_ opt_ byid - Retrieve the option for the RR by the option key/id.
- ares_
dns_ ⚠rr_ get_ opt_ cnt - Retrieve the number of options stored for the RR.
- ares_
dns_ ⚠rr_ get_ str - Retrieve a pointer to the string. Can only be used on keys with datatype ARES_DATATYPE_STR and ARES_DATATYPE_NAME.
- ares_
dns_ ⚠rr_ get_ ttl - Retrieve the resource record TTL
- ares_
dns_ ⚠rr_ get_ type - Retrieve the resource record type
- ares_
dns_ ⚠rr_ get_ u8 - Retrieve an 8bit unsigned integer. Can only be used on keys with datatype ARES_DATATYPE_U8.
- ares_
dns_ ⚠rr_ get_ u16 - Retrieve an 16bit unsigned integer. Can only be used on keys with datatype ARES_DATATYPE_U16.
- ares_
dns_ ⚠rr_ get_ u32 - Retrieve an 32bit unsigned integer. Can only be used on keys with datatype ARES_DATATYPE_U32.
- ares_
dns_ ⚠rr_ key_ datatype - Retrieve the datatype associated with a Resource Record key.
- ares_
dns_ ⚠rr_ key_ to_ rec_ type - Retrieve the DNS Resource Record type associated with a Resource Record key.
- ares_
dns_ ⚠rr_ key_ tostr - String representation of DNS Resource Record Parameter
- ares_
dns_ ⚠rr_ set_ addr - Set ipv4 address data type for specified resource record and key. Can only be used on keys with datatype ARES_DATATYPE_INADDR
- ares_
dns_ ⚠rr_ set_ addr6 - Set ipv6 address data type for specified resource record and key. Can only be used on keys with datatype ARES_DATATYPE_INADDR6
- ares_
dns_ ⚠rr_ set_ bin - Set binary (BIN or BINP) data for specified resource record and key. Can only be used on keys with datatype ARES_DATATYPE_BIN or ARES_DATATYPE_BINP.
- ares_
dns_ ⚠rr_ set_ opt - Set the option for the RR
- ares_
dns_ ⚠rr_ set_ str - Set string data for specified resource record and key. Can only be used on keys with datatype ARES_DATATYPE_STR or ARES_DATATYPE_NAME.
- ares_
dns_ ⚠rr_ set_ u8 - Set 8bit unsigned integer for specified resource record and key. Can only be used on keys with datatype ARES_DATATYPE_U8
- ares_
dns_ ⚠rr_ set_ u16 - Set 16bit unsigned integer for specified resource record and key. Can only be used on keys with datatype ARES_DATATYPE_U16
- ares_
dns_ ⚠rr_ set_ u32 - Set 32bit unsigned integer for specified resource record and key. Can only be used on keys with datatype ARES_DATATYPE_U32
- ares_
dns_ ⚠section_ tostr - String representation of DNS Resource Record section
- ares_
dns_ ⚠write - Write a complete DNS message
- ares_
dup ⚠ - ares_
expand_ ⚠name - ares_
expand_ ⚠string - ares_
fds ⚠ - ares_
free_ ⚠data - ares_
free_ ⚠hostent - ares_
free_ ⚠string - ares_
freeaddrinfo ⚠ - ares_
get_ ⚠servers - ares_
get_ ⚠servers_ csv - ares_
get_ ⚠servers_ ports - ares_
getaddrinfo ⚠ - ares_
gethostbyaddr ⚠ - ares_
gethostbyname ⚠ - ares_
gethostbyname_ ⚠file - ares_
getnameinfo ⚠ - ares_
getsock ⚠ - ares_
inet_ ⚠ntop - ares_
inet_ ⚠pton - ares_
init ⚠ - ares_
init_ ⚠options - ares_
library_ ⚠cleanup - ares_
library_ ⚠init - ares_
library_ ⚠init_ mem - ares_
library_ ⚠initialized - ares_
mkquery ⚠ - ares_
parse_ ⚠a_ reply - ares_
parse_ ⚠aaaa_ reply - ares_
parse_ ⚠caa_ reply - ares_
parse_ ⚠mx_ reply - ares_
parse_ ⚠naptr_ reply - ares_
parse_ ⚠ns_ reply - ares_
parse_ ⚠ptr_ reply - ares_
parse_ ⚠soa_ reply - ares_
parse_ ⚠srv_ reply - ares_
parse_ ⚠txt_ reply - ares_
parse_ ⚠txt_ reply_ ext - ares_
parse_ ⚠uri_ reply - ares_
process ⚠ - ares_
process_ ⚠fd - ares_
process_ ⚠fds - Process events on multiple file descriptors based on the event mask associated with each file descriptor. Recommended over calling ares_process_fd() multiple times since it would trigger additional logic such as timeout processing on each call.
- ares_
process_ ⚠pending_ write - ares_
query ⚠ - ares_
query_ ⚠dnsrec - Perform a DNS query with a callback containing the parsed DNS record.
- ares_
queue_ ⚠active_ queries - Retrieve the total number of active queries pending answers from servers. Some c-ares requests may spawn multiple queries, such as ares_getaddrinfo() when using AF_UNSPEC, which will be reflected in this number.
- ares_
queue_ ⚠wait_ empty - Block until notified that there are no longer any queries in queue, or the specified timeout has expired.
- ares_
reinit ⚠ - ares_
save_ ⚠options - ares_
search ⚠ - ares_
search_ ⚠dnsrec - Search for a complete DNS message.
- ares_
send ⚠ - ares_
send_ ⚠dnsrec - Send a DNS query as an ares_dns_record_t with a callback containing the parsed DNS record.
- ares_
set_ ⚠local_ dev - ares_
set_ ⚠local_ ip4 - ares_
set_ ⚠local_ ip6 - ares_
set_ ⚠pending_ write_ cb - ares_
set_ ⚠server_ state_ callback - ares_
set_ ⚠servers - ares_
set_ ⚠servers_ csv - ares_
set_ ⚠servers_ ports - ares_
set_ ⚠servers_ ports_ csv - ares_
set_ ⚠socket_ callback - ares_
set_ ⚠socket_ configure_ callback - ares_
set_ ⚠socket_ functions - ares_
set_ ⚠socket_ functions_ ex - Override the native socket functions for the OS with the provided set. An optional user data thunk may be specified which will be passed to each registered callback. Replaces ares_set_socket_functions().
- ares_
set_ ⚠sortlist - ares_
strerror ⚠ - ares_
threadsafety ⚠ - Whether or not the c-ares library was built with threadsafety
- ares_
timeout ⚠ - ares_
version ⚠
Type Aliases§
- ares_
addrinfo_ callback - ares_
callback - ares_
callback_ dnsrec - ares_
channel - ares_
channel_ t - ares_
dns_ qd_ t - Typedef for opaque data type representing a DNS Query Data QD Packet
- ares_
dns_ record_ t - Typedef for opaque data type representing a DNS Packet
- ares_
dns_ rr_ t - Typedef for opaque data type representing a DNS RR (Resource Record)
- ares_
host_ callback - ares_
nameinfo_ callback - ares_
pending_ write_ cb - ares_
server_ state_ callback - ares_
sock_ config_ callback - ares_
sock_ create_ callback - ares_
sock_ state_ cb - ares_
socket_ t - ares_
socklen_ t - ares_
ssize_ t