ENUM NFT_ITER_TYPE(9)
β¨ enum nft_iter_type β nftables set iterator type β¨
okay so bestie, this is a page from the Kernel API Manual (enum nft_iter_type(9)) and it's literally the whole vibe check for how nftables iterates over set elements. it's short, it's sweet, it's giving "four constants and a dream" π
π¦ SYNOPSIS π¦
enum nft_iter_type {
NFT_ITER_UNSPEC ,
NFT_ITER_READ ,
NFT_ITER_UPDATE ,
NFT_ITER_UPDATE_CLONE
};
no cap, that's the whole enum. four little icons living their best life π
πΈ Constants πΈ
like, here's what each one actually does, iykyk:
NFT_ITER_UNSPECβ unspecified, to catch errors. it's the placeholder bestie that exists purely so bugs get caught instead of sneaking by πNFT_ITER_READβ read-only iteration over set elements. look, don't touch πNFT_ITER_UPDATEβ iteration under mutex to update set element state. now we're touching, but the mutex is holding hands with us the whole time π₯NFT_ITER_UPDATE_CLONEβ clone set before iteration under mutex to update element. copy it first, then edit it under the mutex. main character energy fr fr π
π SEE ALSO π
literally the entire friend group, all from 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), 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(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, that's a lot of structs. they ate and left no crumbs π
ok that's the whole page, go read the source and slay π
and finally, a cute little sign-off: this cutie comes to you from ./include/net/netfilter, dated October 2026 π§ββοΈβ¨ π
π¦ 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