in6_pton(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’– in6_pton(9) ๐Ÿ’–

okay so bestie, welcome to the in6_pton(9) page from the Kernel API Manual โ€” yes it's a section 9 kernel thing, and yes it is lowkey iconic. This is the one that takes your cute little IPv6 address as a string and turns it into the raw binary glow-up. โœจ


๐ŸŒธ NAME ๐ŸŒธ

in6_pton โ€” convert an IPv6 address from literal to binary representation

Like, string in, bytes out. That's the whole vibe. ๐Ÿฆ‹


โœจ SYNOPSIS โœจ

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

that's the whole signature, no cap โ€” copy it exactly, don't be out here renaming things ๐Ÿ’…


๐ŸŽ€ ARGUMENTS ๐ŸŽ€

  • src โ€” the start of the IPv6 address string. the beginning of the whole situation fr fr ๐Ÿ“
  • srclen โ€” the length of the string, and -1 means strlen(src). so like, if you're too lazy to count, just pass -1 and let it do the math for you ๐Ÿงฎ
  • dst โ€” the binary (u8[16] array) representation of the IPv6 address. this is where the parsed bytes get dropped off โ€” a 16-element u8 array, exactly that size, no thoughts head empty ๐ŸŒˆ
  • delim โ€” the delimiter of the IPv6 address in src, and -1 means no delimiter. so if your address is chillin' inside a bigger string, this tells it where to stop ๐Ÿ›‘
  • end โ€” A pointer to the end of the parsed string will be placed here. so afterwards, *end points at where parsing wrapped up ๐Ÿซถ

๐Ÿ‘‘ DESCRIPTION ๐Ÿ‘‘

Return one on success, return zero when any error occurs and end will point to the end of the parsed string. ๐Ÿ’€

that's it, that's the contract โ€” 1 = slay, 0 = something went wrong ๐Ÿ˜ญ. and either way, end gets set to the end of the parsed string, so you always know where you landed. main character behaviour honestly.


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

all of these are your friends, go say hi ๐Ÿซถ


and that's the page!! brought to you by ./net/core, version dated October 2026, page in6_pton(9) โ€” mwah, go parse some addresses, ily bye ๐Ÿ’œ๐Ÿงšโ€โ™€๏ธ

๐Ÿ“ฆ where this page comes from