Crate c_ares_sys
source ·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§
- Opaque data type representing a DNS Query Data QD Packet
- Opaque data type representing a DNS Packet
- Opaque data type representing a DNS RR (Resource Record)
Enums§
- DNS Classes for requests and responses.
- Data types used
- DNS Header flags
- DNS Header opcodes
- Data type for option records for keys like ARES_RR_OPT_OPTIONS and ARES_RR_HTTPS_PARAMS returned by ares_dns_opt_get_datatype()
- Data type for flags to ares_dns_parse()
- DNS Response Codes from server
- 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
- 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
- DNS RR Section type
- Values for ARES_OPT_EVENT_THREAD
- OPT RR known parameters
- SVCB (and HTTPS) RR known parameters
- TLSA Record ARES_RR_TLSA_MATCH known values
- TLSA Record ARES_RR_TLSA_SELECTOR known values
- TLSA Record ARES_RR_TLSA_CERT_USAGE known values
Constants§
Functions§
- Convert an ip address into the PTR format for in-addr.arpa or in6.arpa
- Convert DNS class name as string to ares_dns_class_t
- String representation of DNS Class
- String representation of DNS OpCode
- 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.
- The options/parameters extensions to some RRs can be somewhat opaque, this is a helper to return the name if the option is known.
- Parse a complete DNS message.
- 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).
- Convert DNS response code as string to from ares_dns_rcode_t
- Convert DNS record type as string to ares_dns_rec_type_t
- String representation of DNS Record Type
- Create a new DNS record object
- Destroy a DNS record object
- Duplicate a complete DNS message. This does not copy internal members (such as the ttl decrement capability).
- Get the DNS Record Flags
- Get the DNS Query ID
- Get the DNS Record OpCode
- Get the DNS Record RCode
- 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.
- Get the count of queries in the DNS Record
- Get the data about the query at the provided index.
- Replace the question name with a new name. This may be used when performing a search with aliases.
- 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)
- Add a Resource Record to the DNS Record.
- Get the count of Resource Records in the provided section
- Remove the resource record based on the section and index
- Fetch a writable resource record based on the section and index.
- Fetch a non-writeable resource record based on the section and index.
- Retrieve a pointer to the ipv4 address. Can only be used on keys with datatype ARES_DATATYPE_INADDR.
- Retrieve a pointer to the ipv6 address. Can only be used on keys with datatype ARES_DATATYPE_INADDR6.
- Retrieve a pointer to the binary data. Can only be used on keys with datatype ARES_DATATYPE_BIN or ARES_DATATYPE_BINP. If BINP, the data is guaranteed to have a NULL terminator which is NOT included in the length.
- Retrieve the resource record class
- Retrieve a list of Resource Record keys that can be set or retrieved for the Resource record type.
- Retrieve the resource record Name/Hostname
- Retrieve the option for the RR by index.
- Retrieve the option for the RR by the option key/id.
- Retrieve the number of options stored for the RR.
- Retrieve a pointer to the string. Can only be used on keys with datatype ARES_DATATYPE_STR and ARES_DATATYPE_NAME.
- Retrieve the resource record TTL
- Retrieve the resource record type
- Retrieve an 8bit unsigned integer. Can only be used on keys with datatype ARES_DATATYPE_U8.
- Retrieve an 16bit unsigned integer. Can only be used on keys with datatype ARES_DATATYPE_U16.
- Retrieve an 32bit unsigned integer. Can only be used on keys with datatype ARES_DATATYPE_U32.
- Retrieve the datatype associated with a Resource Record key.
- Retrieve the DNS Resource Record type associated with a Resource Record key.
- String representation of DNS Resource Record Parameter
- Set ipv4 address data type for specified resource record and key. Can only be used on keys with datatype ARES_DATATYPE_INADDR
- Set ipv6 address data type for specified resource record and key. Can only be used on keys with datatype ARES_DATATYPE_INADDR6
- 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.
- Set the option for the RR
- Set string data for specified resource record and key. Can only be used on keys with datatype ARES_DATATYPE_STR or ARES_DATATYPE_NAME.
- Set 8bit unsigned integer for specified resource record and key. Can only be used on keys with datatype ARES_DATATYPE_U8
- Set 16bit unsigned integer for specified resource record and key. Can only be used on keys with datatype ARES_DATATYPE_U16
- Set 32bit unsigned integer for specified resource record and key. Can only be used on keys with datatype ARES_DATATYPE_U32
- String representation of DNS Resource Record section
- Write a complete DNS message
- Perform a DNS query with a callback containing the parsed DNS record.
- 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.
- Block until notified that there are no longer any queries in queue, or the specified timeout has expired.
- Search for a complete DNS message.
- Send a DNS query as an ares_dns_record_t with a callback containing the parsed DNS record.
- Whether or not the c-ares library was built with threadsafety
Type Aliases§
- Typedef for opaque data type representing a DNS Query Data QD Packet
- Typedef for opaque data type representing a DNS Packet
- Typedef for opaque data type representing a DNS RR (Resource Record)