STRUCT NFT_RULE(9)
π struct nft_rule(9) β like, the nf_tables rule struct, bestie π
okay so you found the struct nft_rule(9) page in the Kernel API Manual and you're like "what even is this" β don't worry, I got you π«Ά this is the little guy that represents one single rule inside nf_tables, and honestly? iconic. let's get into it β¨
πΈ NAME πΈ
struct nft_rule β the nf_tables rule. that's it, that's the vibe π
β¨ SYNOPSIS β¨
here's the shape of it, copy-paste exact because we do not freestyle struct definitions in this house π
struct nft_rule {
struct list_head list;
u64 handle:42, genmask:2, dlen:12, udata:1;
unsigned char data[];
};
π¦ Members π¦
okay so each field, one by one, no skipping, we're thorough here π
listβ used internally. that's it, that's all the manpage says, it's giving mysterious main character energy πhandleβ the rule handle. your lil ID for the rule itself π«genmaskβ the generation mask πdlenβ length of expression data. yes,dlen, and yes it's a bitfield, we love a packed little guy πudataβ user data is appended to the rule. note this one's literally a 1-bit flag in thatu64up there, so it's just saying "yo, is there user data tacked on" πdataβ expression data. the flexible array member at the end doing its thing β¨
side note bestie: look at thatu64line βhandle:42,genmask:2,dlen:12,udata:1. that's 42 + 2 + 12 + 1 = 57 bits crammed into au64. bitfields ate, no cap π₯
π SEE ALSO π
this list is long and I refuse to drop a single one of these, so buckle up, we're going through the whole family tree π§ it's all in the kernel file ./include/net/netfilter/nf_tables.h:
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_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(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)
that's the whole squad, all 34 of them, iykyk π
kay that's the whole page bestie, you ate that π«Ά this came out of the ./include/net/netfilter corner of the kernel, and it's dated October 2026 β so go forth, read your struct nft_rule(9), and slay β¨ππ
π¦ 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