ENUM NFT_ITER_TYPE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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