STRUCT RTNL_MSG_HANDLER(9)
π¦ struct rtnl_msg_handler(9) β like, the whole kernel API manual vibe π¦
okay bestie, so this is struct rtnl_msg_handler(9) from the Kernel API Manual, and it's literally the lil registration table that tells rtnetlink "hey, when this kind of message shows up, run this handler." main character energy fr fr π
β¨ NAME β¨
struct rtnl_msg_handler β rtnetlink message type and handlers. that's it, that's the vibe π
πΈ SYNOPSIS πΈ
struct rtnl_msg_handler {
struct module *owner;
int protocol;
int msgtype;
rtnl_doit_func doit;
rtnl_dumpit_func dumpit;
int flags;
};
like, look at her. six fields. not one wasted. she ate. π₯
π Members π
okay so this is the part where we go field by field, and ngl every single one matters, so no skipping π
ownerβNULLfor built-in,THIS_MODULEfor module. yes literally that. built-in stuff passesNULL, modules passTHIS_MODULEso the kernel knows who to blame (affectionately) πprotocolβ the Protocol family, orPF_UNSPEC. that's the whole story, no cap π¦msgtypeβ the rtnetlink message type. this is the key that decides which handler gets picked, iykyk βdoitβ Function pointer called for each request message. so every time a request comes in, this gets called. main character function pointer energy πdumpitβ Function pointer called for each dump request (NLM_F_DUMP) message. notice theNLM_F_DUMPβ that's the tell that this is the dump path, not the plain request path πdumpit... no wait,flagsβrtnl_link_flagsto modify behaviour ofdoit/dumpitfunctions. cute lil behaviour knobs for the two function pointers above π
bestie reminder:ownerisNULLfor built-in andTHIS_MODULEfor module β get that backwards and things get weird. you've been warned π
π SEE ALSO π
- Kernel file
./include/net/rtnetlink.h struct rtnl_newlink_params(9)struct rtnl_link_ops(9)struct rtnl_af_ops(9)
go read those too, they're all in the same friend group π«Ά
okay that's the whole page!! source/version: this one lives under ./include/net and it's dated October 2026, filed under struct rtnl_msg_handler(9). slay, go register some handlers, mwah πβ¨
π¦ 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