in4_pton(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ in4_pton(9) πŸŽ€

okay so bestie, welcome to the Kernel API Manual β€” yes that's the manual name, we're fancy here πŸ’… β€” and today's main character is in4_pton, which is literally the glow-up from IPv4 literal to binary. no cap.


✨ NAME ✨

in4_pton β€” convert an IPv4 address from literal to binary representation πŸ¦‹


🌸 SYNOPSIS 🌸

int in4_pton (const char *src , int srclen , u8 *dst , int delim , const
char **end );

like, five arguments, all iconic, all doing their job πŸ‘‘


πŸ’– ARGUMENTS πŸ’–

  • src β€” the start of the IPv4 address string. this is where the vibe begins, fr fr.
  • srclen β€” the length of the string. and plot twist: -1 means strlen(src) β€” she'll figure it out herself, self-sufficient queen ✨
  • dst β€” the binary (u8[4] array) representation of the IPv4 address. yes, exactly u8[4], not "whatever", she counts 🌈
  • delim β€” the delimiter of the IPv4 address in src, and -1 means no delimiter. boundaries, we love to see them 🫢
  • end β€” A pointer to the end of the parsed string will be placed here. she leaves a little note for you, cute 😭

πŸ¦‹ DESCRIPTION πŸ¦‹

Return one on success πŸ’š β€” that's the win, that's the slay.

Return zero when any error occurs 😭 (yeah, zero is the bad ending) and end will point to the end of the parsed string.

that's it, that's the whole personality. simple, effective, no toxic complexity.

bestie heads up: zero is the error return here, so do not get it twisted β€” one means success, zero means something went wrong πŸ’€

🧚 SEE ALSO 🧚


and that's the whole page, bestie πŸ’œ β€” brought to you by the crew at ./net/core, stamped October 2026, and honestly? ate. periodt. πŸŽ€πŸŒΈπŸ’…

πŸ“¦ where this page comes from