ARES_DNS_RR(3)

๐Ÿ“ฆ
version 1.34.9 ยท 2 versions
  • 1.34.9 ยท alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.27.0 ยท ubuntu noble
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’– 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. See ares_opt_param_t. Datatype: ARES_DATATYPE_OPT โš™๏ธ
  • ARES_RR_TLSA_CERT_USAGE โ€” TLSA Record. Certificate Usage. See ares_tlsa_usage_t. Datatype: ARES_DATATYPE_U8 ๐Ÿ”
  • ARES_RR_TLSA_SELECTOR โ€” TLSA Record. Selector. See ares_tlsa_selector_t. Datatype: ARES_DATATYPE_U8 ๐ŸŽš๏ธ
  • ARES_RR_TLSA_MATCH โ€” TLSA Record. Matching Type. See ares_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. See ares_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. See ares_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:


๐ŸŒธ 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. ๐Ÿงพโœจ

๐ŸŒˆ 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