srp_parse_in(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 srp_parse_in (9) β€” the kernel API manual, but make it make sense 🌸

okay bestie, gather round, because we're diving into section 9 of the kernel API manual and honestly? this one's a little cutie. it's srp_parse_in, it lives in the kernel, and it does exactly one thing but it does it well. no cap.


✨ NAME ✨

srp_parse_in β€” parse an IP address and port number combination 🫢

like, it takes a string that's got an address and a port squished together and it pulls them apart. that's the whole vibe. iconic behavior honestly.


✨ SYNOPSIS ✨

int srp_parse_in (struct net *net , struct sockaddr_storage *sa , const
char *addr_port_str , bool *has_port );

yes the spacing is like that, i don't make the rules, i just transcribe them πŸ’…


✨ ARGUMENTS ✨

  • net [in] β€” the network namespace, aka whose little internet world we're poking around in 🌈
  • sa [out] β€” where the address family, IP address and port number get written. it's an output, so this is where the good stuff lands, bestie πŸŽ€
  • addr_port_str [in] β€” the IP address and port number, as a string. the raw material. the main character ✨
  • has_port [out] β€” a little boolean truth-teller that says whether or not addr_port_str actually included a port number πŸ™ˆ

✨ DESCRIPTION ✨

so here's the deal. srp_parse_in parses the following address formats, and there are exactly two, and i need you to memorize both because there's gonna be a quiz (the quiz is production):

  • IPv4: <ip_address>:<port>, e.g. 1.2.3.4:5. classic. familiar. we love her πŸ’–
  • IPv6: :<port>, e.g. [1::2:34]:5. brackets involved, colons everywhere, lowkey a lot going on, but she slays πŸ¦‹

that's it. that's the parse. two formats, no drama, no surprises. periodt.


✨ SEE ALSO ✨

the source lives in the kernel file ./drivers/infiniband/ulp/srp/ib_srp.c β€” go read it if you want the director's commentary πŸ’œ

and here's the whole friend group, all of them getting their own manual pages:

ngl that's a lot of srp_ functions and yes i typed every single one of them, you're welcome 😭πŸ”₯


quick reminder bestie: this is kernel API territory, so net, sa and has_port are pointers and the function returns an int. also sa and has_port are [out] β€” meaning they get written to, so don't be passing in garbage and expecting magic πŸ’€

okay that's the page!! this one came from the ./drivers/infiniband/ulp/srp corner of the kernel tree, dated October 2026, and honestly? she's a little legend for that. mwah πŸ’‹ go parse something, bestie βœ¨πŸ‘‘πŸŒˆ

πŸ“¦ where this page comes from