STRUCT GENL_INFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct genl_info(9) β€” the kernel API manual, bestie edition πŸ’–

okay so this is struct genl_info(9) from the Kernel API Manual, and it's literally the struct that handles receiving information in generic netlink πŸŽ€. She's the main character of "a message just came in, here's everything about it" energy, and we're gonna go through her field by field, no skipping, periodt ✨


🌸 SYNOPSIS 🌸

struct genl_info {
    u32 snd_seq;
    u32 snd_portid;
    const struct genl_family *family;
    const struct nlmsghdr * nlhdr;
    struct genlmsghdr *     genlhdr;
    struct nlattr **        attrs;
    possible_net_t _net;
    union {
      u8 ctx[NETLINK_CTX_SIZE];
      void *          user_ptr[2];
    };
    struct netlink_ext_ack *extack;
 };

like, look at her. every single field stays exactly as written, don't touch a character πŸ’…


πŸ¦‹ Members πŸ¦‹

so this is the part where we meet everyone in the group chat:

  • snd_seq β€” the sending sequence number, iykyk 🌈
  • snd_portid β€” the netlink portid of the sender, so you know who's texting you fr πŸ’Œ
  • family β€” the generic netlink family, aka which squad this message belongs to πŸ‘‘
  • nlhdr β€” the netlink message header πŸŽ€
  • genlhdr β€” the generic netlink message header ✨
  • attrs β€” the netlink attributes, the little extras riding along πŸ“
  • _net β€” the network namespace 🌐
  • {unnamed_union} β€” anonymous, she has no name and she doesn't need one πŸ’€
  • ctx β€” storage space for use by the family, this is the spot the family gets to stash stuff in 🧚
  • user_ptr β€” user pointers, and ngl this one is deprecated, so use ctx instead bestie, no cap 🫢
  • extack β€” the extended ACK report struct, for when the kernel needs to say more than just "no" 😭

⭐ SEE ALSO ⭐

all the siblings and cousins, linked from the kernel file ./include/net/genetlink.h β€” go say hi: struct genl_multicast_group(9), struct genl_family(9), struct genl_small_ops(9), struct genl_ops(9), struct genl_split_ops(9), struct genl_dumpit_info(9), genl_info_init_ntf(9), genlmsg_iput(9), genlmsg_nlhdr(9), genlmsg_parse_deprecated(9), genlmsg_parse(9), genl_dump_check_consistent(9), genlmsg_put_reply(9), genlmsg_end(9), genlmsg_cancel(9), genlmsg_multicast_netns_filtered(9), genlmsg_multicast_netns(9), genlmsg_multicast(9), genlmsg_multicast_allns(9), genlmsg_unicast(9), genlmsg_reply(9), genlmsg_data(9), genlmsg_len(9), genlmsg_msg_size(9), genlmsg_total_size(9), genlmsg_new(9), genl_set_err(9) πŸ’œ


and that's the whole page, bestie πŸ¦‹ β€” sourced from ./include/net, dated October 2026, and she's struct genl_info(9) through and through. slay, stay hydrated, and always check your extack πŸ’–βœ¨

πŸ“¦ where this page comes from