inet_pton_with_scope(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

okay so bestie, this is inet_pton_with_scope(9) from the Kernel API Manual, and it is literally here to convert an IPv4/IPv6 and port to socket address. iconic behavior, no cap ✨


πŸŽ€ SYNOPSIS πŸŽ€

int inet_pton_with_scope (struct net *net , __kernel_sa_family_t af ,
const char *src , const char *port , struct sockaddr_storage *addr );

🌸 ARGUMENTS 🌸

  • net β€” the net namespace, and yes it's used for scope handling 🫢
  • af β€” address family: AF_INET, AF_INET6, or AF_UNSPEC for either πŸ‘‘
  • src β€” the start of the address string ⭐
  • port β€” the start of the port string, or NULL for none πŸ™ˆ
  • addr β€” output socket address πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

bestie, the whole vibe check is this: return zero on success, and return errno when any error occurs πŸ’€βœ¨

like, that's the contract. zero = slay, errno = something went sideways. periodt πŸ’…


🌈 SEE ALSO 🌈

Kernel file ./net/core/utils.c, plus in4_pton(9), in6_pton(9), and inet_proto_csum_replace16(9) β€” go read those too, iykyk πŸ“šπŸ’œ


mwah πŸ’‹ signing off from ./net/core β€” October 2026 β€” inet_pton_with_scope(9), and that's the whole cute little manual page, bestie πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from