ARES_DNS_MAPPINGS(3) | Library Functions Manual | ARES_DNS_MAPPINGS(3) |
ares_dns_class_fromstr, ares_dns_class_tostr, ares_dns_datatype_t, ares_dns_opcode_tostr, ares_dns_opt_datatype_t, ares_dns_opt_get_datatype, ares_dns_opt_get_name, ares_dns_rcode_tostr, ares_dns_rec_type_fromstr, ares_dns_rr_get_keys, ares_dns_rr_key_datatype, ares_dns_rr_key_to_rec_type, ares_dns_rr_key_tostr, ares_dns_section_tostr, ares_opt_param_t, ares_svcb_param_t - Helper functions for converting dns record identifiers to and from their respective types, as well identifying datatypes for various records.
#include <ares.h> const char *ares_dns_rec_type_tostr(ares_dns_rec_type_t type); const char *ares_dns_class_tostr(ares_dns_class_t qclass); const char *ares_dns_opcode_tostr(ares_dns_opcode_t opcode); const char *ares_dns_rr_key_tostr(ares_dns_rr_key_t key); const char *ares_dns_section_tostr(ares_dns_section_t section); const char *ares_dns_rcode_tostr(ares_dns_rcode_t rcode); ares_bool_t ares_dns_class_fromstr(ares_dns_class_t *qclass, const char *str); ares_bool_t ares_dns_rec_type_fromstr(ares_dns_rec_type_t *qtype, const char *str); const ares_dns_rr_key_t *ares_dns_rr_get_keys(ares_dns_rec_type_t type, size_t *cnt); ares_dns_datatype_t ares_dns_rr_key_datatype(ares_dns_rr_key_t key); ares_dns_rec_type_t ares_dns_rr_key_to_rec_type(ares_dns_rr_key_t key); ares_dns_opt_datatype_t ares_dns_opt_get_datatype(ares_dns_rr_key_t key, unsigned short opt); const char *ares_dns_opt_get_name(ares_dns_rr_key_t key, unsigned short opt);
ares_dns_datatype_t - Data types associated with ares_dns_rr_key_t:
ares_dns_opt_datatype_t - Data types associated with ARES_DATATYPE_OPT parameters if known as returned by ares_dns_opt_get_datatype(3):
ares_svcb_param_t - SVCB (and HTTPS) RR known parameters as returned by ares_dns_opt_get_datatype(3) with ARES_RR_SVCB_PARAMS or ARES_RR_HTTPS_PARAMS:
ares_opt_param_t - OPT RR known parameters as returned by ares_dns_opt_get_datatype(3) with ARES_RR_OPT_OPTIONS:
The ares_dns_rec_type_tostr(3) function outputs a human readable DNS record type from its numeric form passed in type.
The ares_dns_class_tostr(3) function outputs a human readable DNS class from its numeric form passed in qclass.
The ares_dns_opcode_tostr(3) function outputs a human readable DNS opcode from its numeric form in opcode.
The ares_dns_rr_key_tostr(3) function outputs a human readable DNS Resource Record parameter name from its numeric form in key.
The ares_dns_section_tostr(3) function outputs a human readable DNS message section from its numeric form in section.
The ares_dns_rcode_tostr(3) function outputs a human readable DNS response code from its numeric form in rcode.
The ares_dns_class_fromstr(3) function outputs the DNS class in numeric from from its string representation in str. The result is stored into the variable pointed to by qclass.
The ares_dns_rec_type_fromstr(3) function outputs the DNS record type in numeric from from its string representation in str. The result is stored into the variable pointed to by qtype.
The ares_dns_rr_get_keys(3) function retrieves a list of parameters that may be set or retrieved for the provided type. The count of returned keys is stored into the variable pointed to by cnt.
The ares_dns_rr_key_datatype(3) function retrieves the associated datatype for an RR parameter specified by key.
The ares_dns_rr_key_to_rec_type(3) function dereferences the provided RR parameter specified by key to the DNS Record Type it belongs.
The ares_dns_opt_get_datatype(3) function is used in association with ares_dns_rr_set_opt(3) and ares_dns_rr_get_opt(3) to retrieve the datatype of an option record contained within an RR as specified in key if it is known. The raw option record identifier is provided by opt.
The ares_dns_opt_get_name(3) function is used in association with ares_dns_rr_set_opt(3) and ares_dns_rr_get_opt(3) to retrieve human readable parameter name of an option record contained within an RR as specified in key if it is known. The raw option record identifier is provided by opt.
ares_dns_rec_type_tostr(3), ares_dns_class_tostr(3), ares_dns_opcode_tostr(3), ares_dns_rr_key_tostr(3), ares_dns_section_tostr(3), ares_dns_rcode_tostr(3), and ares_dns_opt_get_name(3) all return a human printable ASCII string, or NULL on error.
ares_dns_class_fromstr(3) and ares_dns_rec_type_fromstr(3) return ARES_TRUE on successful conversion, otherwise ARES_FALSE.
ares_dns_rr_get_keys(3) returns an array of keys or NULL on failure.
ares_dns_rr_key_datatype(3), ares_dns_rr_key_to_rec_type(3), and ares_dns_opt_get_datatype(3) return their respective integer values, or 0 on failure.
These functions were first introduced in c-ares version 1.22.0.
ares_dns_record(3), ares_dns_rr(3), ares_init(3)
Copyright (C) 2023 The c-ares project and its members.
12 November 2023 |