ARES_PARSE_AAAA_REPLY(3)
β¨ NAME β¨
okay so this is ares_parse_aaaa_reply β it parses a reply to a DNS query of type AAAA π
(that's the IPv6 one bestie, not the IPv4 A record, keep up π«Ά). It lives in the manual as ARES_PARSE_AAAA_REPLY(3), third section, library functions, iconic behavior only π
πΈ SYNOPSIS πΈ
#include <ares.h>
int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
struct hostent **host,
struct ares_addr6ttl *addrttls, int *naddrttls);
likeβ¦ that's the whole signature. look at her. she's perfect π
π« DESCRIPTION π«
So ares_parse_aaaa_reply takes the response to a query of type AAAA and parses it into a struct hostent and/or an array of struct ares_addr6ttl. Choose your fighter, or honestly, take both β¨
The parameters abuf and alen give the contents of the response. fr fr, that's the raw bytes and how long they are.
The result is stored in allocated memory and a pointer to it stored into the variable pointed to by host, if host is nonnull. so like, if you passed NULL there, no host struct for you, no biggie, still valid π
π¨ bestie LISTEN: it is the caller's responsibility to free the resultinghoststructure usingares_free_hostent(3)when it is no longer needed. That's you. You are the caller. Free your memory. The way that leaking is not the vibe π
Now for the second thing β if addrttls and naddrttls are both nonnull, then up to *naddrttls struct ares_addr6ttl records are stored in the array pointed to by addrttls, and then *naddrttls is set to the number of records so stored. Note that the memory for these records is supplied by the caller β that's you again, queen, you're providing the buffer π
π₯ RETURN VALUES π₯
ares_parse_aaaa_reply can return any of the following values:
ARES_SUCCESSβ slay π the response was successfully parsed.ARES_EBADRESPβ the response was malformatted π it's giving broken.ARES_ENODATAβ the response did not contain an answer to the query. so valid packet, justβ¦ nothing in it. the audacity honestly π«ARES_ENOMEMβ memory was exhausted π out of RAM, out of luck.
π SEE ALSO π
that's the whole page bestie, no notes, go forth and parse your AAAA records π
this one's from the Library Functions Manual, dated 20 Nov 2009 β yeah she's vintage, she's a classic, she aged like fine wine π
π¦ 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 2005 by Dominick Meglio
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms