STRUCT NLMSGHDR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct nlmsghdr(9) ✨

okay bestie, welcome to the Kernel API Manual entry for struct nlmsghdr πŸ’– this is a group-chat-level explainer, but every single fact is staying put, no cap.


🌸 NAME 🌸

struct nlmsghdr β€” the fixed-format metadata header of Netlink messages πŸ‘‘

like, it's the little name tag every Netlink message wears to the party. fixed format. always the same shape. iconic behavior honestly.

πŸ¦‹ SYNOPSIS πŸ¦‹

struct nlmsghdr {
    __u32 nlmsg_len;
    __u16 nlmsg_type;
    __u16 nlmsg_flags;
    __u32 nlmsg_seq;
    __u32 nlmsg_pid;
 };

that's it. that's the whole struct. five fields, zero drama ✨ (well, the fields themselves have drama, keep reading).


πŸŽ€ Members πŸŽ€

πŸ’… the fields, one by one

  • nlmsg_len β€” length of the message including the header 🫢 yes, including. the header counts itself. main character energy.
  • nlmsg_type β€” the message content type πŸ’Œ like, what kind of message is this even.
  • nlmsg_flags β€” additional flags 🚩 the extra little stickers on top.
  • nlmsg_seq β€” sequence number πŸ”’ so you can keep track of things, bestie.
  • nlmsg_pid β€” sending process port ID 🏷️ who sent it. the return address of the netlink world.

🌈 SEE ALSO 🌈

  • Kernel file ./include/uapi/linux/netlink.h
  • enum nlmsgerr_attrs(9)
  • enum netlink_attribute_type(9)
  • enum netlink_policy_type_attr(9)

go read those too, iykyk πŸ’œ they're literally right there in the same header file, no excuses.


🧚 the cute sign-off 🧚

that's the whole page, bestie πŸ’– this one lives in ./include/uapi/linux and it's dated October 2026 β€” so like, future-coded but make it kernel ⭐ mwah, slay, periodt πŸŽ€πŸŒ·βœ¨

πŸ“¦ where this page comes from