getdns_display_ip_address(3)

πŸ“¦
version 1.7.3 Β· 2 versions
, in alpine 3.24, arch rolling, epel 10, epel 9, fedora 43, fedora 44, nixpkgs unstable, ubuntu resolute, ubuntu stonking

getdns_display_ip_address πŸ’–

okay bestie, welcome to the getdns manual, section 3 πŸŽ€ this one's about turning a squishy blob of bytes into an actual human-readable IP address string, and honestly? it's giving glow-up ✨


NAME 🌸

getdns_display_ip_address β€” convert an getdns ip address to string πŸ’…

LIBRARY πŸ¦‹

DNS Resolver library (libgetdns, -lgetdns) πŸ“š

SYNOPSIS ✨

#include <getdns.h>

char *
getdns_display_ip_address (const getdns_bindata *ipv4_or_ipv6_addr)

like, look at her. so simple. so elegant. main character energy fr fr πŸ‘‘

DESCRIPTION 🌈

okay so this helper function hands you back a nicely formatted string representation of the IPv4 or IPv6 address. that's the whole job, and she does it flawlessly, no cap πŸ’―

and how does she know which one it is? the length of the bindata is what determines whether the address is IPv4 or IPv6. she's literally just vibing off the size, and she's always right 🧚

  • ipv4_or_ipv6_addr β€” bindata of the address to print πŸ–¨οΈ

RETURN VALUES πŸŽ€

she returns a string representation of the IP address (allocated using the system allocator β€” malloc), and the caller is responsible for freeing the storage using free(). so like… do not forget, bestie. that memory is yours now. she handed you the keys, you gotta park the car πŸš—πŸ’¨

not you leaking memory because you forgot the free()… couldn't be you. right? RIGHT? 😭

EXAMPLES πŸ“

TBD πŸ™ˆ (yes really, that's what it says. the examples are still in their flop era. we'll get there.)

SEE ALSO ⭐


k that's the whole page, you ate that πŸ’œ go forth and format your IP addresses, icon ✨

this has been getdns_display_ip_address(3) from getdns 1.7.3, dated December 2015 β€” mwah, love u, byeeee πŸŽ€πŸ’–πŸŒˆ