STRUCT NFT_CHAIN(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct nft_chain(9) β€” the Kernel API Manual glow-up πŸŽ€

okay so bestie, we're in the struct nft_chain(9) page rn β€” a whole kernel API manual page, and honestly? it's giving main character energy. this is the nf_tables chain, and i'm gonna walk you through every single field like we're doing a vibe check on each one. no skipping, no cap. ✨


πŸ¦‹ NAME πŸ¦‹

struct nft_chain β€” literally the nf_tables chain, that's her, that's the whole thing πŸ’–


✨ SYNOPSIS ✨

like, here's her whole personality laid out, character for character, don't @ me:

struct nft_chain {
    struct nft_rule_blob            *blob_gen_0;
    struct nft_rule_blob            *blob_gen_1;
    struct list_head                rules;
    struct list_head                list;
    struct rhlist_head              rhlhead;
    struct nft_table                *table;
    u64 handle;
    u32 use;
    u8 flags:5, bound:1, genmask:2;
    char *name;
    u16 udlen;
    u8 *udata;
    struct nft_rule_blob            *blob_next;
    struct nft_chain_validate_state vstate;
 };

🌸 Members 🌸

okay this is the fun part, let's meet the cast 🫢

  • blob_gen_0 β€” rule blob pointer to the current generation. she's the present, she's now, she's living her truth πŸ”₯
  • blob_gen_1 β€” rule blob pointer to the future generation. manifesting ✨
  • rules β€” list of rules in the chain. the whole squad, in order πŸ’…
  • list β€” used internally. not your business bestie, it's giving backstage πŸŽ€
  • rhlhead β€” used internally. also backstage, also not your business πŸ™ˆ
  • table β€” table that this chain belongs to. found family πŸ’œ
  • handle β€” chain handle. her little ID badge πŸͺͺ
  • use β€” number of jump references to this chain. how many people are jumping to her, iconic behavior πŸ‘‘
  • flags β€” bitmask of enum NFTA_CHAIN_FLAGS. tiny bitmask, huge personality 🌈
  • bound β€” bind or not. binary queen, she either is or she isn't πŸ’€
  • genmask β€” generation mask. time-travel makeup 🧚
  • name β€” name of the chain. yes she has a name, say it with your chest ⭐
  • udlen β€” user data length. how much user data, numerically speaking πŸ“
  • udata β€” user data in the chain. her personal lore πŸ¦‹
  • blob_next β€” rule blob pointer to the next in the chain. linked-list slay, periodt πŸ’–
  • vstate β€” validation state. she's getting checked and she's passing, obviously βœ…

πŸ”₯ SEE ALSO πŸ”₯

okay so like, the whole friend group, no gatekeeping. Kernel file ./include/net/netfilter/nf_tables.h, plus every one of these icons:

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_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)


ngl, that's a lot of structs. read them all, bestie, they're all connected iykyk 😭

and that's the whole page, no crumbs left πŸ’€ this baby lives under ./include/net/netfilter, it's from October 2026, and it's filed under struct nft_chain(9). slay, go read nf_tables.h now, mwah πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from