STRUCT NFT_BASE_CHAIN(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct nft_base_chain(9) β€” the nf_tables base chain, bestie

okay so real talk, this is a page from the Kernel API Manual and it's all about struct nft_base_chain, which is literally the nf_tables base chain. it's giving kernel-internals main character energy and honestly? we're obsessed. let's get into it 🫢


✨ NAME ✨

struct nft_base_chain β€” the nf_tables base chain. that's it, that's the vibe. πŸ’–


🌸 SYNOPSIS 🌸

here's the whole struct, copied exactly because we do not mess with kernel source in this house:

struct nft_base_chain {
    struct nf_hook_ops              ops;
    struct list_head                hook_list;
    const struct nft_chain_type     *type;
    u8 policy;
    u8 flags;
    struct nft_stats __percpu       *stats;
    struct nft_chain                chain;
    struct flow_block               flow_block;
 };

look at her. eight members. iconic. ✨


πŸŽ€ Members πŸŽ€

okay so let's meet the cast, one by one:

  • ops β€” netfilter hook ops. yes bestie, the actual hook operations πŸ’…
  • hook_list β€” a list of netfilter hooks (for the NFPROTO_NETDEV family β€” iykyk) πŸ”₯
  • type β€” the chain type. literally what kind of chain she is 🌈
  • policy β€” the default policy. the default!! the blueprint!! πŸ‘‘
  • flags β€” these indicate whether the base chain is disabled or not. vibe check, basically πŸ’€
  • stats β€” per-cpu chain stats. per. cpu. she's tracking everything fr fr πŸ“
  • chain β€” the chain. yes the chain inside the base chain, it's chains all the way down 🧚
  • flow_block β€” flow block (for hardware offload). offloading to the hardware, slay ⭐

πŸ¦‹ SEE ALSO πŸ¦‹

bestie, this section is LONG and we are NOT skipping a single one of these, so buckle up. all of these live 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_rule(9)
  • struct nft_chain_validate_state(9)
  • struct nft_chain(9)
  • struct nft_chain_type(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)

like I said. a whole friend group. go read all of them, no cap 😭


ngl this page is just the struct and its members β€” no options, no exit statuses, no bugs section. so if you made it this far you've literally absorbed 100% of the content. ate and left no crumbs πŸ’…

and that's the page!! this one ships from ./include/net/netfilter, dated October 2026, and yeah β€” the manual name on the tin is struct nft_base_chain(9). mwah πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from