dns_ip6_packet(3)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.30 Β· fedora 43, fedora 44, ubuntu jammy
, in alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ dns_ip6_packet ✨ β€” it's giving Library Functions Manual energy, bestie

okay so real talk, this is dns_ip6_packet(3), and she is a whole vibe. let's get into it 🫢


πŸ’– NAME πŸ’–

dns_ip6_packet β€” extract IPv6 address from DNS answer packet

yes she says IPv6 in the name and then talks about IPv4 too in a sec. that's just how she is. no cap. πŸ™ˆ

πŸŽ€ SYNTAX πŸŽ€

#include <libowfat/dns.h>

int dns_ip6_packet(stralloc* out,const char* buf,
                   unsigned int len);

like, that's the whole signature. three args. she's lowkey minimalist. πŸ’…


🌸 DESCRIPTION 🌸

so dns_ip6_packet is a low-level component of dns_ip6, and the reason she exists at all is to support asynchronous DNS lookups. queen of doing one job really well. πŸ‘‘

here's what she actually does:

  • reads a DNS packet of length len from buf πŸ“¦
  • extracts IPv4 and IPv6 addresses from the answer section of the packet πŸ”
  • puts the addresses into out πŸ’Œ
  • returns 0 or -1 the same way as dns_ip6 🎯

and that's it. that's the whole thing. she's not out here doing extra. no drama, just packets. ✨


πŸ¦‹ SEE ALSO πŸ¦‹

go read those too bestie, they're literally her family πŸ₯Ή


mwah πŸ’‹ that's the page β€” dns_ip6_packet(3), from the Library Functions Manual, living her best life at the bottom of the page as always.