STRUCT NFT_OBJECT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct nft_object(9) πŸ’…

okay so real talk β€” welcome to the kernel API manual, bestie. this one is struct nft_object(9), straight out of the kernel API manual pages, and it's literally the blueprint for a nf_tables stateful object. no cap, it's a good one. πŸŽ€


✨ NAME ✨

struct nft_object β€” the nf_tables stateful object, fr fr. that's the whole vibe. πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole struct, copied exactly, no edits, we do not touch the code:

struct nft_object {
    struct list_head                list;
    struct rhlist_head              rhlhead;
    struct nft_object_hash_key      key;
    u32 genmask:2;
    u32 use;
    u64 handle;
    u16 udlen;
    u8 *udata;
    const struct nft_object_ops     *ops;
    unsigned char                   data[];
 };

look at that layout. the data[] at the end? iconic flex. πŸ’…


🌸 Members 🌸

breakdown time, one member at a time, main character energy only:

  • list β€” this is the table stateful object list node 🫢 it's how this object links up with the rest of the crew.
  • rhlhead β€” the nft_objname_ht node. yes, that's the whole description, it's giving minimal and mysterious.
  • key β€” the keys that identify this object πŸ”‘ like, its whole identity.
  • genmask β€” the generation mask ✨ (yes, it's a :2 bitfield, tiny but mighty).
  • use β€” number of references to this stateful object. every bestie that's holding onto it counts here 😭
  • handle β€” a unique object handle. one of a kind, lowkey a fingerprint.
  • udlen β€” length of user data πŸ“
  • udata β€” the user data itself πŸ“
  • ops β€” object operations, i.e. the actual behaviour.
  • data β€” object data, and the layout depends on type. so like, it's flexible. it's adaptable. it's whatever the type needs it to be πŸ¦‹

🌈 SEE ALSO 🌈

the whole extended friend group, all of them, in order, exactly as listed. the kernel file is ./include/net/netfilter/nf_tables.h and honestly there's a LOT of cross-references, so buckle up:

  • struct nft_verdict(9)
  • struct nft_regs(9)
  • struct nft_ctx(9)
  • struct nft_userdata(9)
  • struct nft_set_elem(9)
  • enum nft_iter_type(9)
  • struct nft_set_desc(9)
  • enum nft_set_class(9)
  • struct nft_set_estimate(9)
  • struct nft_expr(9)
  • struct nft_set_ops(9)
  • struct nft_set_type(9)
  • struct nft_set(9)
  • struct nft_set_binding(9)
  • enum nft_set_extensions(9)
  • struct nft_set_ext_type(9)
  • struct nft_set_ext_tmpl(9)
  • struct nft_set_ext(9)
  • struct nft_expr_type(9)
  • struct nft_expr_ops(9)
  • struct nft_rule(9)
  • struct nft_chain_validate_state(9)
  • struct nft_chain(9)
  • struct nft_chain_type(9)
  • struct nft_base_chain(9)
  • struct nft_table(9)
  • struct nft_object_hash_key(9)
  • struct nft_object_type(9)
  • struct nft_object_ops(9)
  • struct nft_flowtable(9)
  • struct nft_traceinfo(9)
  • struct nft_trans(9)
  • struct nft_trans_hook(9)
  • struct nft_trans_binding(9)

ngl bestie, if you're poking at nf_tables internals, read the whole list. iykyk. πŸ’€

and that's the whole page!! source is ./include/net/netfilter, dated October 2026, and the page itself signs off as struct nft_object(9) πŸŽ€βœ¨ go forth and slay your netfilter debugging session, you've got this πŸ’–πŸ«Ά

πŸ“¦ where this page comes from