ARES_PARSE_NS_REPLY(3)
β¨ ARES_PARSE_NS_REPLY(3) β¨
okay so bestie, welcome to the Library Functions Manual π this one's about ares_parse_ns_reply, and honestly? it's giving "quiet little function that does one job and does it well." we love a focused queen. π
πΈ NAME πΈ
ares_parse_ns_reply β parse a reply to a DNS query of type NS into a hostent
π¦ SYNOPSIS π¦
#include <ares.h>
int ares_parse_ns_reply(const unsigned char *abuf, int alen,
struct hostent **host);
π DESCRIPTION π
so basically, ares_parse_ns_reply takes the response to a query of type NS and parses it into a struct hostent. that's the whole vibe. π
the parameters abuf and alen give the contents of the response β abuf is your raw bytes, alen is how many of them there are. iykyk. π
the result gets stored in allocated memory, and a pointer to it gets stored into the variable pointed to by host. so host is like, the address of your pointer. very demure, very pointer-to-pointer. π«Ά
and here's the cute part β the nameservers are stored into the aliases field of the host structure. yes, the aliases field. not a separate one. that's just how it is. π
β οΈ bestie, listen. it is the caller's responsibility to free the resultinghoststructure usingares_free_hostent(3)when it is no longer needed. don't forget. don't ghost it. that's a memory leak and we do NOT do those. π
β RETURN VALUES β
ares_parse_ns_reply can return any of the following values, so let's do a little vibe check on each one:
ARES_SUCCESSβ slay! the response was successfully parsed. πARES_EBADRESPβ the response was malformatted. it's giving corrupted. πARES_ENODATAβ the response did not contain an answer to the query. empty handed, no cap. πARES_ENOMEMβ memory was exhausted. we ran out. it's over. π
π₯ SEE ALSO π₯
that's the whole page, bestie, you ate it πβ¨ mwah π
this was ARES_PARSE_NS_REPLY(3) from the Library Functions Manual, dated 10 February 2007 β iconic since day one, no notes. ππΈπ¦
π¦ 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 1998 by the Massachusetts Institute of Technology
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms