ARES_DNS_RR(3)
๐ ARES_DNS_RR(3) โ the manual page, but make it make sense ๐
okay bestie, sit down, hydrate, and get comfy ๐ซถ this is the section-3 manual page for ARES_DNS_RR, and it is literally all about DNS Resource Records โ creating them, reading them, and writing to them. that's the whole vibe. no cap.
โจ NAME โจ
here's the entire cast list, exactly how the page serves it to you (yes I'm keeping the order, I'm a respectful queen):
ares_dns_record_rr_add, ares_dns_record_rr_cnt, ares_dns_record_rr_del,
ares_dns_record_rr_get, ares_dns_record_rr_get_const,
ares_dns_rr_get_addr, ares_dns_rr_get_addr6, ares_dns_rr_get_bin,
ares_dns_rr_get_abin_cnt, ares_dns_rr_get_abin, ares_dns_rr_get_class,
ares_dns_rr_get_name, ares_dns_rr_get_opt, ares_dns_rr_get_opt_byid,
ares_dns_rr_get_opt_cnt, ares_dns_rr_get_str, ares_dns_rr_get_ttl,
ares_dns_rr_get_type, ares_dns_rr_get_u16, ares_dns_rr_get_u32,
ares_dns_rr_get_u8, ares_dns_rr_key_t, ares_dns_rr_set_addr,
ares_dns_rr_set_addr6, ares_dns_rr_set_bin, ares_dns_rr_add_abin,
ares_dns_rr_del_abin, ares_dns_rr_set_opt, ares_dns_rr_set_str,
ares_dns_rr_set_u16, ares_dns_rr_set_u32, ares_dns_rr_set_u8,
ares_dns_section_t, ares_tlsa_match_t, ares_tlsa_selector_t,
ares_tlsa_usage_t - DNS Resource Record creating, reading, and writing
functions.
so real talk, it breaks down like this ๐
- the
ares_dns_record_rr_*girlies โ these work at the whole-record level, like adding, counting, grabbing and deleting records. - the
ares_dns_rr_*girlies โ the getters and setters, aka where the actual field-reading and field-writing happens. - and the types, which are giving main character:
ares_dns_rr_key_t,ares_dns_section_t,ares_tlsa_match_t,ares_tlsa_selector_t,ares_tlsa_usage_t๐
and what is all of this for, you ask? literally just: DNS Resource Record creating, reading, and writing functions. that's the mission statement, periodt.
๐ซถ tiny observation, bestie: ares_dns_rr_del_opt_byid shows up in the SYNOPSIS below but does not appear in the NAME roster up there. the page said what it said. I'm just the messenger ๐
๐ธ SYNOPSIS ๐ธ
first, the entrance, because you can't get in without it:
#include <ares.h>
and then here's the whole roster of signatures, character for character, no notes, don't touch anything ๐ฅ
size_t ares_dns_record_rr_cnt(const ares_dns_record_t *dnsrec,
ares_dns_section_t sect);
ares_status_t ares_dns_record_rr_add(ares_dns_rr_t **rr_out,
ares_dns_record_t *dnsrec,
ares_dns_section_t sect,
const char *name,
ares_dns_rec_type_t type,
ares_dns_class_t rclass,
unsigned int ttl);
ares_dns_rr_t *ares_dns_record_rr_get(ares_dns_record_t *dnsrec,
ares_dns_section_t sect,
size_t idx);
const ares_dns_rr_t *ares_dns_record_rr_get_const(const ares_dns_record_t *dnsrec,
ares_dns_section_t sect,
size_t idx);
ares_status_t ares_dns_record_rr_del(ares_dns_record_t *dnsrec,
ares_dns_section_t sect,
size_t idx);
const char *ares_dns_rr_get_name(const ares_dns_rr_t *rr);
ares_dns_rec_type_t ares_dns_rr_get_type(const ares_dns_rr_t *rr);
ares_dns_class_t ares_dns_rr_get_class(const ares_dns_rr_t *rr);
unsigned int ares_dns_rr_get_ttl(const ares_dns_rr_t *rr);
ares_status_t ares_dns_rr_set_addr(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
const struct in_addr *addr);
ares_status_t ares_dns_rr_set_addr6(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
const struct ares_in6_addr *addr);
ares_status_t ares_dns_rr_set_str(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
const char *val);
ares_status_t ares_dns_rr_set_u8(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
unsigned char val);
ares_status_t ares_dns_rr_set_u16(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
unsigned short val);
ares_status_t ares_dns_rr_set_u32(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
unsigned int val);
ares_status_t ares_dns_rr_set_bin(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
const unsigned char *val,
size_t len);
ares_status_t ares_dns_rr_add_abin(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
const unsigned char *val,
size_t len);
ares_status_t ares_dns_rr_del_abin(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
size_t idx);
ares_status_t ares_dns_rr_set_opt(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
unsigned short opt,
const unsigned char *val,
size_t val_len);
ares_status_t ares_dns_rr_del_opt_byid(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
unsigned short opt);
const struct in_addr *ares_dns_rr_get_addr(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key);
const struct ares_in6_addr *ares_dns_rr_get_addr6(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key);
const char *ares_dns_rr_get_str(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key);
unsigned char ares_dns_rr_get_u8(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key);
unsigned short ares_dns_rr_get_u16(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key);
unsigned int ares_dns_rr_get_u32(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key);
const unsigned char *ares_dns_rr_get_bin(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
size_t *len);
size_t ares_dns_rr_get_abin_cnt(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key);
const unsigned char *ares_dns_rr_get_abin(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key, size_t idx,
size_t *len);
size_t ares_dns_rr_get_opt_cnt(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key);
unsigned short ares_dns_rr_get_opt(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
size_t idx,
const unsigned char **val,
size_t *val_len);
ares_bool_t ares_dns_rr_get_opt_byid(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
unsigned short opt,
const unsigned char **val,
size_t *val_len);
okay that's a lot of signatures and honestly? iconic ๐ the pattern is lowkey simple once you clock it: there's a getter and a setter for every flavor of value โ addr, addr6, str, u8, u16, u32, bin โ plus the special multi-value ones like abin (that's the add/count/index family) and opt (the options family). and a few that just want the metadata: name, type, class, ttl ๐
that's NAME and SYNOPSIS handled, bestie. DESCRIPTION is where the real tea gets spilled ๐
โจ ENUMERATIONS โจ
okay so these are the enum vibes, bestie. every single one is here, no skips, no cap. ๐
ares_dns_section_t โ DNS RR section types
ARES_SECTION_ANSWERโ the Answer section. it's giving "the actual answer, periodt". ๐ARES_SECTION_AUTHORITYโ the Authority section. who's in charge? it's giving authority energy. ๐ARES_SECTION_ADDITIONALโ the Additional Information section. the little bonus info that slays. โจ
ares_dns_rr_key_t โ keys used for handling RR record parameters
ARES_RR_A_ADDRโ A Record. Address. Datatype:ARES_DATATYPE_INADDR๐ARES_RR_NS_NSDNAMEโ NS Record. Name. Datatype:ARES_DATATYPE_NAME๐ฆARES_RR_CNAME_CNAMEโ CNAME Record. CName. Datatype:ARES_DATATYPE_NAME๐ธARES_RR_SOA_MNAMEโ SOA Record. MNAME, Primary Source of Data. Datatype:ARES_DATATYPE_NAME๐ARES_RR_SOA_RNAMEโ SOA Record. RNAME, Mailbox of person responsible. Datatype:ARES_DATATYPE_NAME๐ARES_RR_SOA_SERIALโ SOA Record. Serial, version. Datatype:ARES_DATATYPE_U32๐ขARES_RR_SOA_REFRESHโ SOA Record. Refresh, zone refersh interval. Datatype:ARES_DATATYPE_U32๐ARES_RR_SOA_RETRYโ SOA Record. Retry, failed refresh retry interval. Datatype:ARES_DATATYPE_U32๐ARES_RR_SOA_EXPIREโ SOA Record. Expire, upper limit on authority. Datatype:ARES_DATATYPE_U32โณARES_RR_SOA_MINIMUMโ SOA Record. Minimum, RR TTL. Datatype:ARES_DATATYPE_U32โฑ๏ธARES_RR_PTR_DNAMEโ PTR Record. DNAME, pointer domain. Datatype:ARES_DATATYPE_NAME๐ARES_RR_HINFO_CPUโ HINFO Record. CPU. Datatype:ARES_DATATYPE_STR๐ปARES_RR_HINFO_OSโ HINFO Record. OS. Datatype:ARES_DATATYPE_STR๐ฅ๏ธARES_RR_MX_PREFERENCEโ MX Record. Preference. Datatype:ARES_DATATYPE_U16๐ฌARES_RR_MX_EXCHANGEโ MX Record. Exchange, domain. Datatype:ARES_DATATYPE_NAME๐งARES_RR_TXT_DATAโ TXT Record. Data. Datatype:ARES_DATATYPE_ABINP๐ARES_RR_SIG_TYPE_COVEREDโ SIG Record. Type Covered. Datatype:ARES_DATATYPE_U16๐ก๏ธARES_RR_SIG_ALGORITHMโ SIG Record. Algorithm. Datatype:ARES_DATATYPE_U8๐งฎARES_RR_SIG_LABELSโ SIG Record. Labels. Datatype:ARES_DATATYPE_U8๐ท๏ธARES_RR_SIG_ORIGINAL_TTLโ SIG Record. Original TTL. Datatype:ARES_DATATYPE_U32โฒ๏ธARES_RR_SIG_EXPIRATIONโ SIG Record. Signature Expiration. Datatype:ARES_DATATYPE_U32๐ARES_RR_SIG_INCEPTIONโ SIG Record. Signature Inception. Datatype:ARES_DATATYPE_U32๐๏ธARES_RR_SIG_KEY_TAGโ SIG Record. Key Tag. Datatype:ARES_DATATYPE_U16๐ARES_RR_SIG_SIGNERS_NAMEโ SIG Record. Signer's Name. Datatype:ARES_DATATYPE_NAMEโ๏ธARES_RR_SIG_SIGNATUREโ SIG Record. Signature. Datatype:ARES_DATATYPE_BIN๐ARES_RR_AAAA_ADDRโ AAAA Record. Address. Datatype:ARES_DATATYPE_INADDR6๐ARES_RR_SRV_PRIORITYโ SRV Record. Priority. Datatype:ARES_DATATYPE_U16๐ฅARES_RR_SRV_WEIGHTโ SRV Record. Weight. Datatype:ARES_DATATYPE_U16โ๏ธARES_RR_SRV_PORTโ SRV Record. Port. Datatype:ARES_DATATYPE_U16๐ชARES_RR_SRV_TARGETโ SRV Record. Target domain. Datatype:ARES_DATATYPE_NAME๐ฏARES_RR_NAPTR_ORDERโ NAPTR Record. Order. Datatype:ARES_DATATYPE_U16๐ขARES_RR_NAPTR_PREFERENCEโ NAPTR Record. Preference. Datatype:ARES_DATATYPE_U16๐ARES_RR_NAPTR_FLAGSโ NAPTR Record. Flags. Datatype:ARES_DATATYPE_STR๐ฉARES_RR_NAPTR_SERVICESโ NAPTR Record. Services. Datatype:ARES_DATATYPE_STR๐ ๏ธARES_RR_NAPTR_REGEXPโ NAPTR Record. Regexp. Datatype:ARES_DATATYPE_STR๐ARES_RR_NAPTR_REPLACEMENTโ NAPTR Record. Replacement. Datatype:ARES_DATATYPE_NAME๐ARES_RR_OPT_UDP_SIZEโ OPT Record. UDP Size. Datatype:ARES_DATATYPE_U16๐ฆARES_RR_OPT_VERSIONโ OPT Record. Version. Datatype:ARES_DATATYPE_U8๐ท๏ธARES_RR_OPT_FLAGSโ OPT Record. Flags. Datatype:ARES_DATATYPE_U16๐ฉARES_RR_OPT_OPTIONSโ OPT Record. Options. Seeares_opt_param_t. Datatype:ARES_DATATYPE_OPTโ๏ธARES_RR_TLSA_CERT_USAGEโ TLSA Record. Certificate Usage. Seeares_tlsa_usage_t. Datatype:ARES_DATATYPE_U8๐ARES_RR_TLSA_SELECTORโ TLSA Record. Selector. Seeares_tlsa_selector_t. Datatype:ARES_DATATYPE_U8๐๏ธARES_RR_TLSA_MATCHโ TLSA Record. Matching Type. Seeares_tlsa_match_t. Datatype:ARES_DATATYPE_U8๐งฉARES_RR_TLSA_DATAโ TLSA Record. Certificate Association Data. Datatype:ARES_DATATYPE_BIN๐ARES_RR_SVCB_PRIORITYโ SVCB Record. SvcPriority. Datatype:ARES_DATATYPE_U16๐ฅARES_RR_SVCB_TARGETโ SVCB Record. TargetName. Datatype:ARES_DATATYPE_NAME๐ฏARES_RR_SVCB_PARAMSโ SVCB Record. SvcParams. Seeares_svcb_param_t. Datatype:ARES_DATATYPE_OPTโ๏ธARES_RR_HTTPS_PRIORITYโ HTTPS Record. SvcPriority. Datatype:ARES_DATATYPE_U16๐ฅARES_RR_HTTPS_TARGETโ HTTPS Record. TargetName. Datatype:ARES_DATATYPE_NAME๐ฏARES_RR_HTTPS_PARAMSโ HTTPS Record. SvcParams. Seeares_svcb_param_t. Datatype:ARES_DATATYPE_OPTโ๏ธARES_RR_URI_PRIORITYโ URI Record. Priority. Datatype:ARES_DATATYPE_U16๐ฅARES_RR_URI_WEIGHTโ URI Record. Weight. Datatype:ARES_DATATYPE_U16โ๏ธARES_RR_URI_TARGETโ URI Record. Target domain. Datatype:ARES_DATATYPE_NAME๐ฏARES_RR_CAA_CRITICALโ CAA Record. Critical flag. Datatype:ARES_DATATYPE_U8๐จARES_RR_CAA_TAGโ CAA Record. Tag/Property. Datatype:ARES_DATATYPE_STR๐ท๏ธARES_RR_CAA_VALUEโ CAA Record. Value. Datatype:ARES_DATATYPE_BINP๐ARES_RR_RAW_RR_TYPEโ RAW Record. RR Type. Datatype:ARES_DATATYPE_U16๐งฌARES_RR_RAW_RR_DATAโ RAW Record. RR Data. Datatype:ARES_DATATYPE_BIN๐งฌ
ares_tlsa_usage_t โ TLSA Record ARES_RR_TLSA_CERT_USAGE known values
ARES_TLSA_USAGE_CAโ Certificate Usage 0. CA Constraint. ๐๏ธARES_TLSA_USAGE_SERVICEโ Certificate Usage 1. Service Certificate Constraint. ๐๏ธARES_TLSA_USAGE_TRUSTANCHORโ Certificate Usage 2. Trust Anchor Assertion. โARES_TLSA_USAGE_DOMAINโ Certificate Usage 3. Domain-issued certificate. ๐
ares_tlsa_selector_t โ TLSA Record ARES_RR_TLSA_SELECTOR known values
ARES_TLSA_SELECTOR_FULLโ Full Certificate. ๐ARES_TLSA_SELECTOR_SUBJPUBKEYINFOโ DER-encoded SubjectPublicKeyInfo. ๐
ares_tlsa_match_t โ TLSA Record ARES_RR_TLSA_MATCH known values
ARES_TLSA_MATCH_EXACTโ Exact match. ๐ฏARES_TLSA_MATCH_SHA256โ Sha256 match. ๐ARES_TLSA_MATCH_SHA512โ Sha512 match. ๐
โจ DESCRIPTION โจ
okay bestie, this is the main character section, so grab a snack ๐ โ every single function in this whole family lives here and we're going through ALL of them, no skimming, no cap.
๐ the record-level girlies
ares_dns_record_rr_cnt(3) โ returns the number of resource records chilling in the DNS record you hand it via the dnsrec parameter, for whichever section you point at with the sect parameter. it's giving headcount, fr.
ares_dns_record_rr_add(3) โ adds a brand new resource record entry to the DNS record in dnsrec. the resulting resource record gets stored into the variable pointed to by rr_out โจ. which DNS section it belongs to? that's the sect parameter, obviously. the domain name for the record goes in name โ heads up, it can not be NULL, but it may be an empty string, or ".". the resource record type is specified in the type parameter, the DNS record class in rclass, and the Time To Live (TTL) in ttl. iconic.
ares_dns_record_rr_get(3) and ares_dns_record_rr_get_const(3) โ these two retrieve the resource record pointer from the DNS record in dnsrec, for the resource record section in sect, at the index you give in idx. ๐ซถ quick vibe check: the index must be less than ares_dns_record_rr_cnt(3). the difference between the twins? the first one returns a writable pointer, the second returns a read-only pointer. one is main character energy, one is look-don't-touch. ๐
ares_dns_record_rr_del(3) โ deletes a resource record from the DNS record in dnsrec. its primary use case is removing an ARES_REC_TYPE_OPT record when you need to retry a query without EDNS support. the DNS RR section comes from sect, and the index to remove comes from idx. same rule as before: the index must be less than ares_dns_record_rr_cnt(3).
๐ getters on the rr pointer itself
these all take the Resource Record pointer in the rr parameter, and they're just here to spill the tea about what's inside:
ares_dns_rr_get_name(3)โ retrieves the resource record domain name. ๐ฆares_dns_rr_get_type(3)โ retrieves the resource record type.ares_dns_rr_get_class(3)โ retrieves the resource record class.ares_dns_rr_get_ttl(3)โ retrieves the resource record class Time to Live (TTL).
๐ธ the SETTERS (putting stuff in)
every single one of these modifies the resource record you pass in dns_rr, and the key/parameter you're targeting goes in key. the value parameter differs per function, so watch closely bestie ๐
ares_dns_rr_set_addr(3) โ sets an IPv4 address for the associated resource record key/parameter when the datatype is ARES_DATATYPE_INADDR. the value lives in the addr parameter.
ares_dns_rr_set_addr6(3) โ same deal but IPv6, for when the datatype is ARES_DATATYPE_INADDR6. value goes in addr.
ares_dns_rr_set_str(3) โ sets a string for the associated key/parameter when the datatype is ARES_DATATYPE_STR or ARES_DATATYPE_NAME. the value goes in val. โ ๏ธ important: most strings are limited to 255 bytes, however some records โ like a TXT record โ may allow longer, because they get output as multiple strings. so don't come for me when your giant string gets chopped, iykyk.
ares_dns_rr_set_u8(3) โ sets an 8bit unsigned value when the datatype is ARES_DATATYPE_U8. value in val.
ares_dns_rr_set_u16(3) โ sets an 16bit unsigned value when the datatype is ARES_DATATYPE_U16. value in val.
ares_dns_rr_set_u32(3) โ sets an 32bit unsigned value when the datatype is ARES_DATATYPE_U32. value in val.
ares_dns_rr_set_bin(3) โ sets a binary value when the datatype is ARES_DATATYPE_BIN or ARES_DATATYPE_BINP. the value goes in val, and the associated value length goes in len. ๐ง
ares_dns_rr_add_abin(3) โ appends a binary value into the array for the associated key/parameter when the datatype is ARES_DATATYPE_ABINP. value in val, length in len. it's the add-to-the-collection one, periodt.
ares_dns_rr_del_abin(3) โ deletes a binary value from that array for the associated key/parameter when the datatype is ARES_DATATYPE_ABINP. the index to remove goes in the idx parameter. bye bye ๐
ares_dns_rr_set_opt(3) โ sets option/parameter keys and values for the resource record when the datatype is ARES_DATATYPE_OPT. so: resource record in dns_rr, key/parameter in key, and the option/parameter value specific to the resource record goes in opt โ and figuring out the appropriate value to use there is left to the user. ๐ some known values may be provided by the ares_svcb_param_t and ares_opt_param_t enumerations. also, the value for the option is always provided in binary form in val, with its length in val_len.
ares_dns_rr_del_opt_byid(3) โ deletes option/parameter keys and values for the resource record when the datatype is ARES_DATATYPE_OPT. resource record in dns_rr, key/parameter in key, and the option/parameter value specific to the resource record in opt. ๐ซ this one reports back: it returns ARES_SUCCESS if the record is successfully removed, or ARES_ENOTFOUND if the record could not be found.
๐ฅ the GETTERS (getting stuff out)
again, resource record in dns_rr, key/parameter in key โ same energy, opposite direction.
ares_dns_rr_get_addr(3) โ retrieves the IPv4 address when the datatype is ARES_DATATYPE_INADDR.
ares_dns_rr_get_addr6(3) โ retrieves the IPv6 address when the datatype is ARES_DATATYPE_INADDR6.
ares_dns_rr_get_str(3) โ retrieves a string when the datatype is ARES_DATATYPE_STR or ARES_DATATYPE_NAME.
ares_dns_rr_get_u8(3) โ retrieves an 8bit integer when the datatype is ARES_DATATYPE_U8.
ares_dns_rr_get_u16(3) โ retrieves a 16bit integer when the datatype is ARES_DATATYPE_U16.
ares_dns_rr_get_u32(3) โ retrieves a 32bit integer when the datatype is ARES_DATATYPE_U32.
ares_dns_rr_get_bin(3) โ retrieves binary data when the datatype is ARES_DATATYPE_BIN or ARES_DATATYPE_BINP. and the length gets stored into the variable pointed to by len. ๐
ares_dns_rr_get_abin_cnt(3) โ retrieves the count of the array of stored binary values when the datatype is ARES_DATATYPE_ABINP. yes, it's the abin count. very on the nose, love that for us.
ares_dns_rr_get_abin(3) โ retrieves binary data from the resource record array when the datatype is ARES_DATATYPE_ABINP. the index to retrieve from the array goes in the idx parameter, and the length gets stored into the variable pointed to by len.
ares_dns_rr_get_opt_cnt(3) โ retrieves the count of options/parameters associated with the resource record when the datatype is ARES_DATATYPE_OPT. key/parameter to retrieve is in key. ๐
ares_dns_rr_get_opt(3) โ retrieves binary option data when the datatype is ARES_DATATYPE_OPT, for the specified index. key/parameter in key, the index to pull the option data from in idx. the value is stored into the variable pointed to by val, and the length is stored into the variable pointed to by val_len. โจ
ares_dns_rr_get_opt_byid(3) โ retrieves binary option data when the datatype is ARES_DATATYPE_OPT, for the specified option identifier โ if it exists. key/parameter in key, the identifier to retrieve the option data from in opt. value goes into the variable pointed to by val, length goes into the variable pointed to by val_len. ๐
and that's the whole DESCRIPTION bestie, every function accounted for, not one single one left behind ๐
๐ RETURN VALUES ๐
okay bestie, gather round, because return values are literally the receipts of this whole operation. ๐งพโจ
ares_dns_record_rr_cnt(3)andares_dns_rr_get_opt_cnt(3)โ they return the respective counts. no drama, just numbers. ๐- The whole make it happen squad โ
ares_dns_record_rr_add(3),ares_dns_record_rr_del(3),ares_dns_rr_set_addr(3),ares_dns_rr_set_addr6(3),ares_dns_rr_set_str(3),ares_dns_rr_set_u8(3),ares_dns_rr_set_u16(3),ares_dns_rr_set_u32(3),ares_dns_rr_set_bin(3),ares_dns_rr_add_abin(3),ares_dns_rr_del_abin(3), andares_dns_rr_set_opt(3)โ all return anares_status_terror code.ARES_SUCCESSmeans you ate and left no crumbs,ARES_ENOMEMmeans out of memory (the audacity ๐ญ), andARES_EFORMERRmeans misuse. periodt. - The getter girlies โ
ares_dns_rr_get_name(3),ares_dns_rr_get_type(3),ares_dns_rr_get_class(3),ares_dns_rr_get_ttl(3),ares_dns_rr_get_addr(3),ares_dns_rr_get_addr6(3),ares_dns_rr_get_str(3),ares_dns_rr_get_u8(3),ares_dns_rr_get_u16(3),ares_dns_rr_get_u32(3),ares_dns_rr_get_bin(3),ares_dns_rr_get_abin_cnt(3),ares_dns_rr_get_abin(3),ares_dns_rr_get_opt(3)โ all return their prescribed datatype values, and in general they can't fail except for misuse cases. In those misuse cases, a0(orNULL) may be returned, however0can also be a valid return value for most of these functions. so like, don't read too much into a zero, bestie. ๐ ares_dns_record_rr_get(3)andares_dns_record_rr_get_const(3)โ they return the requested resource record pointer, orNULLon failure (misuse). iconic when it works, tragic when it doesn't. ๐ares_dns_rr_get_opt_byid(3)โ returnsARES_TRUEif the option was found, otherwiseARES_FALSEif not found (or misuse). simple as that. โจ
๐ AVAILABILITY ๐
These functions were first introduced in c-ares version 1.22.0. so if you're on something older, that's why your fave is acting brand new. ๐ฆ
๐ SEE ALSO ๐
go read these next, bestie:
This page is ARES_DNS_RR(3), dated 12 November 2023 โ that's the footer's source/version and date, and that's the whole manpage. stay hydrated, stay slay, and may your ares_status_t always be ARES_SUCCESS ๐
๐โจ
๐ฆ where this page comes from
- alpine 3.22: c-ares-doc 1.34.9-r0 ยท MIT
- alpine 3.23: c-ares-doc 1.34.9-r0 ยท MIT
- alpine 3.24: c-ares-doc 1.34.9-r0 ยท MIT
- arch rolling: c-ares 1.34.9-1 ยท MIT
- centos-stream 10: c-ares-devel 1.34.9-1.el10 ยท MIT
- debian trixie: libc-ares-dev 1.34.5-1+deb13u1 ยท MIT
- fedora 43: c-ares-devel 1.34.5-2.fc43 ยท MIT
- fedora 43: c-ares-devel 1.34.5-2.fc43 ยท MIT
- fedora 43: c-ares-devel 1.34.8-1.fc43 ยท MIT
- fedora 43: c-ares-devel 1.34.8-1.fc43 ยท MIT
- fedora 44: c-ares-devel 1.34.6-3.fc44 ยท MIT
- fedora 44: c-ares-devel 1.34.6-3.fc44 ยท MIT
- fedora 44: c-ares-devel 1.34.8-1.fc44 ยท MIT
- fedora 44: c-ares-devel 1.34.8-1.fc44 ยท MIT
- nixos 26.05: c-ares 1.34.9
- nixpkgs unstable: c-ares 1.34.8
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 ยท MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 ยท MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 ยท MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 ยท MIT
- ubuntu questing: libc-ares-dev 1.34.5-1
- ubuntu questing: libc-ares-dev 1.34.5-1ubuntu0.1
- ubuntu resolute: libc-ares-dev 1.34.6-1 ยท MIT
- ubuntu resolute: libc-ares-dev 1.34.6-1ubuntu0.1
- ubuntu resolute: libc-ares-dev 1.34.6-1ubuntu0.2 ยท MIT
- ubuntu stonking: libc-ares-dev 1.34.8-1 ยท MIT
- ๐ the page's license: MIT
- Copyright (C) 2023 The c-ares project and its contributors
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms