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) β€” Library Functions Manual πŸ’–

okay so bestie, welcome to the ares_dns_rr glow-up era ✨ this is the part of c-ares that lets you create, read, and write DNS Resource Records, and honestly? it's giving main character energy. we're talking ARES_DNS_RR(3), the manual page that's about to be your roman empire 🫢


✨ NAME ✨

DNS Resource Record creating, reading, and writing functions β€” that's the vibe. and here's the full squad, no one left behind:

  • 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

🌸 SYNOPSIS 🌸

first things first, you gotta bring in the header, periodt:

#include <ares.h>

now the whole roster of function signatures, exactly as they live, no edits bestie πŸ’…

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);

lowkey that's just the trailer bestie, the real lore is coming up next 🌈 stay tuned, there's more parts and we are NOT done slaying

🌈 ENUMERATIONS 🌈

okay bestie, this is the big one. this whole section is just ✨the lore✨ of every enum in this library β€” the section types, the record keys, and the TLSA value sets. nothing scary, it's basically a giant labeled drawer of constants. let's go πŸ’…


ares_dns_section_t β€” DNS RR section types πŸ’Œ

the three neighborhoods a record can live in:

  • ARES_SECTION_ANSWER β€” the Answer section 🎯
  • ARES_SECTION_AUTHORITY β€” the Authority section πŸ‘‘
  • ARES_SECTION_ADDITIONAL β€” the Additional Information section πŸ“

ares_dns_rr_key_t β€” Keys used for handling RR record parameters πŸ”‘

these are the keys you hand over when you're dealing with a record parameter. one per line, every single one, no skipping, we do not gatekeep here 🫢

  • 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 refresh 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
not me counting them all to make sure nobody got left out β€” they're all here, promise πŸ™ˆ

ares_tlsa_usage_t β€” TLSA Record ARES_RR_TLSA_CERT_USAGE known values 🌸

the certificate usage menu, zero through three, all iconic:

  • 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 πŸŽ€

pick your selector vibe:

  • 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 πŸ¦‹

and finally the matching types, from "just compare it" to "hash it with the big girls":

  • ARES_TLSA_MATCH_EXACT β€” Exact match
  • ARES_TLSA_MATCH_SHA256 β€” Sha256 match
  • ARES_TLSA_MATCH_SHA512 β€” Sha512 match

✨ DESCRIPTION ✨

okay bestie, so this is the whole resource-record side of the ares DNS API, and it's a LOT, but I promise it's just "make record, poke record, read record, yeet record" over and over. Stay with me. πŸ’–

πŸŽ€ Counting, adding, grabbing and yeeting records

  • ares_dns_record_rr_cnt(3) β€” hands you back the number of resource records living inside the DNS record you passed in dnsrec, but only for the section you named in sect. it's giving census energy fr. πŸ‘‘
  • ares_dns_record_rr_add(3) β€” adds a brand new resource record entry to the DNS record in dnsrec. the fresh record gets dropped into the variable that rr_out points at. which DNS section it belongs to? that's sect. the domain name for the record is name β€” and heads up, name can not be NULL, but it can be an empty string, or ".". the record type goes in type, the DNS record class goes in rclass, and the Time To Live (TTL) goes in ttl. 🫢
  • ares_dns_record_rr_get(3) and ares_dns_record_rr_get_const(3) β€” these two pull the resource record pointer out of the DNS record in dnsrec, from the section in sect, at the index in idx. ⚠️ that idx must be less than what ares_dns_record_rr_cnt(3) returns. the first one gives you a writable pointer, the second gives you a read-only pointer. pick your fighter. πŸ’…
  • ares_dns_record_rr_del(3) β€” deletes a resource record from the DNS record in dnsrec. its main character use case? removing an ARES_REC_TYPE_OPT record when you need to retry a query without EDNS support. the RR section comes in via sect, and the index to remove comes in via idx. and yeah β€” that idx must be less than ares_dns_record_rr_cnt(3). same rule, every time, no cap. πŸ—‘οΈ

πŸ¦‹ Reading the basics off a record

these all take the Resource Record pointer in rr and just tell you what's on it:


✨ SETTING values ✨

okay so every setter has the same little ritual: you point at the record with dns_rr, you name the key/parameter with key, and you hand over the value. the only thing that changes is which datatype it's allowed to touch. obsessed with the consistency honestly.

  • ares_dns_rr_set_addr(3) β€” sets an IPv4 address for the associated resource record key/parameter when the datatype is ARES_DATATYPE_INADDR. record to modify β†’ dns_rr, key/parameter β†’ key, value β†’ addr. 🌈
  • ares_dns_rr_set_addr6(3) β€” sets an IPv6 address for the associated resource record key/parameter when the datatype is ARES_DATATYPE_INADDR6. record to modify β†’ dns_rr, key/parameter β†’ key, value β†’ addr. 🌐
  • ares_dns_rr_set_str(3) β€” sets a string for the associated resource record key/parameter when the datatype is ARES_DATATYPE_STR or ARES_DATATYPE_NAME. πŸ“ most strings are limited to 255 bytes, however some records β€” like a TXT record β€” may allow longer, because they're output as multiple strings. record to modify β†’ dns_rr, key/parameter β†’ key, value β†’ val.
  • ares_dns_rr_set_u8(3) β€” sets an 8bit unsigned value for the associated resource record key/parameter when the datatype is ARES_DATATYPE_U8. record to modify β†’ dns_rr, key/parameter β†’ key, value β†’ val. πŸ“
  • ares_dns_rr_set_u16(3) β€” sets an 16bit unsigned value for the associated resource record key/parameter when the datatype is ARES_DATATYPE_U16. record to modify β†’ dns_rr, key/parameter β†’ key, value β†’ val. πŸ“
  • ares_dns_rr_set_u32(3) β€” sets an 32bit unsigned value for the associated resource record key/parameter when the datatype is ARES_DATATYPE_U32. record to modify β†’ dns_rr, key/parameter β†’ key, value β†’ val. πŸ“
  • ares_dns_rr_set_bin(3) β€” sets a binary value for the associated resource record key/parameter when the datatype is ARES_DATATYPE_BIN or ARES_DATATYPE_BINP. record to modify β†’ dns_rr, key/parameter β†’ key, value β†’ 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 resource record key/parameter when the datatype is ARES_DATATYPE_ABINP. record to modify β†’ dns_rr, key/parameter β†’ key, value β†’ val, and the associated value length goes in len. it's the "one more, bestie" of setters. βž•
  • ares_dns_rr_del_abin(3) β€” deletes a binary value from the array for the associated resource record key/parameter when the datatype is ARES_DATATYPE_ABINP. record to modify β†’ dns_rr, key/parameter β†’ key, and the index to remove goes in idx. βž–

πŸ’… OPT datatype things (the special ones)

  • ares_dns_rr_set_opt(3) β€” sets option/parameter keys and values for the resource record when the datatype is ARES_DATATYPE_OPT. the record to modify β†’ dns_rr. the key/parameter β†’ key. the option/parameter value specific to the resource record β†’ opt, and listen, it's left to the user to determine the appropriate value to use. some known values may be provided by ares_svcb_param_t and ares_opt_param_t enumerations. 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. the record to modify β†’ dns_rr. the key/parameter β†’ key. the option/parameter value specific to the resource record β†’ opt. πŸ—‘οΈ this one actually reports back: it returns ARES_SUCCESS if the record is successfully removed, or ARES_ENOTFOUND if the record could not be found.

πŸ” GETTING values πŸ”

same ritual as the setters but backwards: record in dns_rr, key/parameter in key, and you get a value out. every one of these only works when the datatype matches, so vibe check your datatype first, fr fr.

  • ares_dns_rr_get_addr(3) β€” retrieves the IPv4 address from the resource record when the datatype is ARES_DATATYPE_INADDR. record β†’ dns_rr, key/parameter to retrieve β†’ key. 🌈
  • ares_dns_rr_get_addr6(3) β€” retrieves the IPv6 address from the resource record when the datatype is ARES_DATATYPE_INADDR6. record β†’ dns_rr, key/parameter to retrieve β†’ key. 🌐
  • ares_dns_rr_get_str(3) β€” retrieves a string from the resource record when the datatype is ARES_DATATYPE_STR or ARES_DATATYPE_NAME. record β†’ dns_rr, key/parameter to retrieve β†’ key. πŸ“
  • ares_dns_rr_get_u8(3) β€” retrieves an 8bit integer from the resource record when the datatype is ARES_DATATYPE_U8. record β†’ dns_rr, key/parameter to retrieve β†’ key. πŸ”’
  • ares_dns_rr_get_u16(3) β€” retrieves a 16bit integer from the resource record when the datatype is ARES_DATATYPE_U16. record β†’ dns_rr, key/parameter to retrieve β†’ key. πŸ”’
  • ares_dns_rr_get_u32(3) β€” retrieves a 32bit integer from the resource record when the datatype is ARES_DATATYPE_U32. record β†’ dns_rr, key/parameter to retrieve β†’ key. πŸ”’
  • ares_dns_rr_get_bin(3) β€” retrieves binary data from the resource record when the datatype is ARES_DATATYPE_BIN or ARES_DATATYPE_BINP. record β†’ dns_rr, key/parameter to retrieve β†’ key, and the length gets stored into the variable that len points at. 🧚
  • ares_dns_rr_get_abin_cnt(3) β€” retrieves the count of the array of stored binary values from the resource record when the datatype is ARES_DATATYPE_ABINP. record β†’ dns_rr, key/parameter to retrieve β†’ key. πŸ”’
  • ares_dns_rr_get_abin(3) β€” retrieves binary data from the resource record array when the datatype is ARES_DATATYPE_ABINP. record β†’ dns_rr, key/parameter to retrieve β†’ key, the index to retrieve from the array β†’ idx, and the length gets stored into the variable that len points at. 🧚
  • 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. record β†’ dns_rr, key/parameter to retrieve β†’ key. πŸ”’
  • ares_dns_rr_get_opt(3) β€” retrieves binary option data from the resource record when the datatype is ARES_DATATYPE_OPT, for the specified index. record β†’ dns_rr, key/parameter to retrieve β†’ key, index to retrieve the option data from β†’ idx. the value gets stored into the variable that val points at, and the length gets stored into the variable that val_len points at. πŸ’–
  • ares_dns_rr_get_opt_byid(3) β€” retrieves binary option data from the resource record when the datatype is ARES_DATATYPE_OPT, for the specified option identifier β€” if it exists. record β†’ dns_rr, key/parameter to retrieve β†’ key, identifier to retrieve the option data from β†’ opt. the value gets stored into the variable that val points at, and the length gets stored into the variable that val_len points at. πŸ”₯

✨ RETURN VALUES ✨

okay bestie, gather round, here's what these babies hand back to you πŸ’–


🌈 AVAILABILITY 🌈

these functions were first introduced in c-ares version 1.22.0. so if you're on something older than that... bestie. no they're not there. upgrade. 🧚


πŸ¦‹ SEE ALSO πŸ¦‹


and that's the whole page, bestie!! πŸŽ€ source/version says we're rolling with ARES_DNS_RR(3) dated 12 November 2023 β€” go forth and parse some DNS records, you absolute icon πŸ‘‘πŸ’œβœ¨