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§

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

Unions§

ares_addr__bindgen_ty_1
ares_addr_node__bindgen_ty_1
ares_addr_port_node__bindgen_ty_1
ares_in6_addr__bindgen_ty_1