__rtnl_register_many(9)
π __rtnl_register_many(9) β the Kernel API Manual bestie π
okay so real talk, this one is a <pink>kernel</pink> page, not your usual command-line situation β it's a <purple>9</purple>-section man page, meaning it's documenting a function for people writing kernel code. and honestly? it's giving "register a whole squad at once" energy. slay π«Ά
β¨ NAME β¨
__rtnl_register_many β register <cyan>rtnetlink</cyan> message types, but like, many of them, at once π
πΈ SYNOPSIS πΈ
int __rtnl_register_many (const struct rtnl_msg_handler *handlers , int
n );
that's the whole vibe. it takes your array and a count, returns an int. no cap β¨
π¦ ARGUMENTS π¦
handlersβ the array ofstruct rtnl_msg_handlersyou're handing over. yes, the synopsis saysrtnl_msg_handlerand the argument description saysrtnl_msg_handlersβ that's how the page says it, so that's how we're saying it, periodt πnβ literally just the length ofhandlers. how many you got in there π
π₯ DESCRIPTION π₯
so what does it actually do? it registers the function pointers you specify so they get called whenever a <mint>request message</mint> for the specified <mint>protocol family</mint> and <mint>message type</mint> shows up. and heads up bestie: at least one of them has to be non-NULL π
the special protocol family PF_UNSPEC is your <yellow>fallback era</yellow> β you can use it to define fallback function pointers for the case when no entry for the specific protocol family exists. it's the understudy that actually goes on stage π
β οΈ now the serious part, and I need you to listen: when one element of handlers fails to register, things go different ways depending on what you are:
- built-in β it
<red>panics</red>. like, full stop, everything's over, no recovery arc π - modules β the previous successful registrations get unwinded and an error is returned. so it politely walks back what it already did and hands you the
error. cute of it honestly π
and the page's parting words of wisdom: use rtnl_register_many. that's the one you actually want, bestie. __rtnl_register_many is the under-the-hood one β iykyk π€«
π SEE ALSO π
kernel file ./net/core/rtnetlink.c plus the whole friend group:
rtnl_nets_add(9)rtnl_unregister(9)rtnl_unregister_all(9)rtnl_link_register(9)rtnl_link_unregister(9)rtnl_af_register(9)rtnl_af_unregister(9)rtnl_get_net_ns_capable(9)ndo_dflt_fdb_dump(9)
go read those too, they're all part of the same storyline π§π
and that's the whole page, bestie!! this one's sourced from ./net/core and dated October 2026 β so yeah, technically from the future, main character energy fr fr βπΈ go register some handlers and stay hydrated π
π¦ 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