srp_parse_in(9)
πΈ 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 notaddr_port_stractually 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:
srp_destroy_fr_pool(9)srp_create_fr_pool(9)srp_fr_pool_get(9)srp_fr_pool_put(9)srp_destroy_qp(9)srp_del_scsi_host_attr(9)srp_connected_ch(9)srp_claim_req(9)srp_free_req(9)srp_map_data(9)srp_post_send(9)srp_tl_err_work(9)srp_change_queue_depth(9)srp_conn_unique(9)
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, sonet,saandhas_portare pointers and the function returns anint. alsosaandhas_portare[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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms