A C library for asynchronous DNS requests (grpc依赖)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

148 lines
4.0 KiB

# Copyright (C) The c-ares project and its contributors
# SPDX-License-Identifier: MIT
MANPAGES = ares_cancel.3 \
ares_create_query.3 \
ares_destroy.3 \
ares_destroy_options.3 \
ares_dns_class_fromstr.3 \
ares_dns_class_t.3 \
ares_dns_class_tostr.3 \
ares_dns_datatype_t.3 \
ares_dns_flags_t.3 \
ares_dns_mapping.3 \
ares_dns_opcode_tostr.3 \
ares_dns_opt_datatype_t.3 \
ares_dns_opt_get_datatype.3 \
ares_dns_opt_get_name.3 \
ares_dns_opcode_t.3 \
ares_dns_parse.3 \
ares_dns_rcode_t.3 \
ares_dns_rcode_tostr.3 \
ares_dns_record.3 \
ares_dns_record_create.3 \
ares_dns_record_duplicate.3 \
ares_dns_record_get_flags.3 \
ares_dns_record_get_id.3 \
ares_dns_record_get_opcode.3 \
ares_dns_record_get_rcode.3 \
ares_dns_record_destroy.3 \
ares_dns_record_query_add.3 \
ares_dns_record_query_set_name.3 \
ares_dns_record_query_set_type.3 \
ares_dns_record_query_cnt.3 \
ares_dns_record_query_get.3 \
ares_dns_record_rr_add.3 \
ares_dns_record_rr_cnt.3 \
ares_dns_record_rr_del.3 \
ares_dns_record_rr_get.3 \
Add function ares_search_dnrec() to search for records using the new DNS record parser (#719) This PR adds a new function `ares_search_dnsrec()` to search for records using the new DNS record parser. The function takes an arbitrary DNS record object to search (that must represent a query for a single name). The function takes a new callback type, `ares_callback_dnsrec`, that is invoked with a parsed DNS record object rather than the raw buffer(+length). The original motivation for this change is to provide support for [draft-kaplan-enum-sip-routing-04](https://datatracker.ietf.org/doc/html/draft-kaplan-enum-sip-routing-04); when routing phone calls using an ENUM server, it can be useful to include identifying source information in an OPT RR options value, to help select the appropriate route for the call. The new function allows for more customisable searches like this. **Summary of code changes** A new function `ares_search_dnsrec()` has been added and exposed. Moreover, the entire `ares_search_int()` internal code flow has been refactored to use parsed DNS record objects and the new DNS record parser. The DNS record object is passed through the `search_query` structure by encoding/decoding to/from a buffer (if multiple search domains are used). A helper function `ares_dns_write_query_altname()` is used to re-write the DNS record object with a new query name (used to append search domains). `ares_search()` is now a wrapper around the new internal code, where the DNS record object is created based on the name, class and type parameters. The new function uses a new callback type, `ares_callback_dnsrec`. This is invoked with a parsed DNS record object. For now, we convert from `ares_callback` to this new type using `ares__dnsrec_convert_cb()`. Some functions that are common to both `ares_query()` and `ares_search()` have been refactored using the new DNS record parser. See `ares_dns_record_create_query()` and `ares_dns_query_reply_tostatus()`. **Testing** A new FV has been added to test the new function, which searches for a DNS record containing an OPT RR with custom options value. As part of this, I needed to enhance the mock DNS server to expect request text (and assert that it matches actual request text). This is because the FV needs to check that the request contains the correct OPT RR. **Documentation** The man page docs have been updated to describe the new feature. **Futures** In the future, a new variant of `ares_send()` could be introduced in the same vein (`ares_send_dnsrec()`). This could be used by `ares_search_dnsrec()`. Moreover, we could migrate internal code to use `ares_callback_dnsrec` as the default callback. This will help to make the new DNS record parser the norm in C-Ares. --------- Co-authored-by: Oliver Welsh (@oliverwelsh)
8 months ago
ares_dns_record_rr_get_const.3 \
ares_dns_record_set_id.3 \
ares_dns_rec_type_fromstr.3 \
ares_dns_rec_type_tostr.3 \
ares_dns_rec_type_t.3 \
ares_dns_rr.3 \
ares_dns_rr_add_abin.3 \
ares_dns_rr_del_abin.3 \
ares_dns_rr_get_abin.3 \
ares_dns_rr_get_abin_cnt.3 \
ares_dns_rr_get_addr.3 \
ares_dns_rr_get_addr6.3 \
ares_dns_rr_get_bin.3 \
ares_dns_rr_get_class.3 \
ares_dns_rr_get_keys.3 \
ares_dns_rr_get_name.3 \
ares_dns_rr_get_opt.3 \
ares_dns_rr_get_opt_byid.3 \
ares_dns_rr_get_opt_cnt.3 \
ares_dns_rr_get_str.3 \
ares_dns_rr_get_type.3 \
ares_dns_rr_get_ttl.3 \
ares_dns_rr_get_u16.3 \
ares_dns_rr_get_u32.3 \
ares_dns_rr_get_u8.3 \
ares_dns_rr_key_datatype.3 \
ares_dns_rr_key_t.3 \
ares_dns_rr_key_to_rec_type.3 \
ares_dns_rr_key_tostr.3 \
ares_dns_rr_set_addr.3 \
ares_dns_rr_set_addr6.3 \
ares_dns_rr_set_bin.3 \
ares_dns_rr_set_opt.3 \
ares_dns_rr_set_str.3 \
ares_dns_rr_set_u16.3 \
ares_dns_rr_set_u32.3 \
ares_dns_rr_set_u8.3 \
ares_dns_section_t.3 \
ares_dns_section_tostr.3 \
ares_dns_write.3 \
ares_dup.3 \
ares_expand_name.3 \
ares_expand_string.3 \
ares_fds.3 \
ares_free_data.3 \
ares_free_hostent.3 \
ares_free_string.3 \
ares_freeaddrinfo.3 \
ares_get_servers.3 \
ares_get_servers_csv.3 \
ares_get_servers_ports.3 \
ares_getaddrinfo.3 \
ares_gethostbyaddr.3 \
ares_gethostbyname.3 \
ares_gethostbyname_file.3 \
ares_getnameinfo.3 \
ares_getsock.3 \
ares_inet_ntop.3 \
ares_inet_pton.3 \
ares_init.3 \
ares_init_options.3 \
ares_library_cleanup.3 \
ares_library_init.3 \
ares_library_init_android.3 \
ares_library_initialized.3 \
ares_mkquery.3 \
ares_opt_param_t.3 \
ares_parse_a_reply.3 \
ares_parse_aaaa_reply.3 \
ares_parse_caa_reply.3 \
ares_parse_mx_reply.3 \
ares_parse_naptr_reply.3 \
ares_parse_ns_reply.3 \
ares_parse_ptr_reply.3 \
ares_parse_soa_reply.3 \
ares_parse_srv_reply.3 \
ares_parse_txt_reply.3 \
ares_parse_uri_reply.3 \
ares_process.3 \
ares_query.3 \
8 months ago
ares_query_dnsrec.3 \
ares_queue.3 \
ares_queue_active_queries.3 \
ares_queue_wait_empty.3 \
ares_reinit.3 \
ares_save_options.3 \
ares_search.3 \
Add function ares_search_dnrec() to search for records using the new DNS record parser (#719) This PR adds a new function `ares_search_dnsrec()` to search for records using the new DNS record parser. The function takes an arbitrary DNS record object to search (that must represent a query for a single name). The function takes a new callback type, `ares_callback_dnsrec`, that is invoked with a parsed DNS record object rather than the raw buffer(+length). The original motivation for this change is to provide support for [draft-kaplan-enum-sip-routing-04](https://datatracker.ietf.org/doc/html/draft-kaplan-enum-sip-routing-04); when routing phone calls using an ENUM server, it can be useful to include identifying source information in an OPT RR options value, to help select the appropriate route for the call. The new function allows for more customisable searches like this. **Summary of code changes** A new function `ares_search_dnsrec()` has been added and exposed. Moreover, the entire `ares_search_int()` internal code flow has been refactored to use parsed DNS record objects and the new DNS record parser. The DNS record object is passed through the `search_query` structure by encoding/decoding to/from a buffer (if multiple search domains are used). A helper function `ares_dns_write_query_altname()` is used to re-write the DNS record object with a new query name (used to append search domains). `ares_search()` is now a wrapper around the new internal code, where the DNS record object is created based on the name, class and type parameters. The new function uses a new callback type, `ares_callback_dnsrec`. This is invoked with a parsed DNS record object. For now, we convert from `ares_callback` to this new type using `ares__dnsrec_convert_cb()`. Some functions that are common to both `ares_query()` and `ares_search()` have been refactored using the new DNS record parser. See `ares_dns_record_create_query()` and `ares_dns_query_reply_tostatus()`. **Testing** A new FV has been added to test the new function, which searches for a DNS record containing an OPT RR with custom options value. As part of this, I needed to enhance the mock DNS server to expect request text (and assert that it matches actual request text). This is because the FV needs to check that the request contains the correct OPT RR. **Documentation** The man page docs have been updated to describe the new feature. **Futures** In the future, a new variant of `ares_send()` could be introduced in the same vein (`ares_send_dnsrec()`). This could be used by `ares_search_dnsrec()`. Moreover, we could migrate internal code to use `ares_callback_dnsrec` as the default callback. This will help to make the new DNS record parser the norm in C-Ares. --------- Co-authored-by: Oliver Welsh (@oliverwelsh)
8 months ago
ares_search_dnsrec.3 \
ares_send.3 \
ares_send_dnsrec.3 \
ares_set_local_dev.3 \
ares_set_local_ip4.3 \
ares_set_local_ip6.3 \
ares_set_server_state_callback.3 \
ares_set_servers.3 \
ares_set_servers_csv.3 \
ares_set_servers_ports.3 \
ares_set_servers_ports_csv.3 \
ares_set_socket_callback.3 \
ares_set_socket_configure_callback.3 \
ares_set_socket_functions.3 \
ares_set_sortlist.3 \
ares_strerror.3 \
ares_svcb_param_t.3 \
ares_threadsafety.3 \
ares_timeout.3 \
ares_tlsa_match_t.3 \
ares_tlsa_selector_t.3 \
ares_tlsa_usage_t.3 \
ares_version.3