STRUCT NFT_EXPR_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

omg hi bestie πŸ’– this is struct nft_expr_ops from the Kernel API Manual, and its NAME energy is nf_tables expression operations. That’s the official title, no cap β€” it’s the operations struct for nf_tables expressions, and we’re gonna go through every single member like it’s a group-chat rollout. 🫢


🌸 SYNOPSIS 🌸

okay so here’s the full struct, copied exactly because we do not touch the code πŸ’…:

       struct nft_expr_ops {
           void (*eval)(const struct nft_expr *expr, struct nft_regs *regs,
       const struct nft_pktinfo *pkt);
           int (*clone)(struct nft_expr *dst, const struct nft_expr *src, gfp_t
       gfp);
           unsigned int                    size;
           int (*init)(const struct nft_ctx *ctx, const struct nft_expr *expr,
       const struct nlattr * const tb[]);
           void (*activate)(const struct nft_ctx *ctx, const struct nft_expr
       *expr);
           void (*deactivate)(const struct nft_ctx *ctx, const struct nft_expr
       *expr, enum nft_trans_phase phase);
           void (*destroy)(const struct nft_ctx *ctx, const struct nft_expr
       *expr);
           void (*destroy_clone)(const struct nft_ctx *ctx, const struct
       nft_expr *expr);
           int (*dump)(struct sk_buff *skb, const struct nft_expr *expr, bool
       reset);
           int (*validate)(const struct nft_ctx *ctx, const struct nft_expr
       *expr);
           bool (*gc)(struct net *net, const struct nft_expr *expr);
           int (*offload)(struct nft_offload_ctx *ctx, struct nft_flow_rule
       *flow, const struct nft_expr *expr);
           bool (*offload_action)(const struct nft_expr *expr);
           void (*offload_stats)(struct nft_expr *expr, const struct flow_stats
       *stats);
           const struct nft_expr_type      *type;
           void *data;
        };

πŸ’– Members πŸ’–

okay bestie, member-by-member vibes, let’s go πŸŽ€:

  • eval β€” Expression evaluation function. The main character who actually evaluates, periodt. ✨
  • clone β€” Expression clone function. Copying the vibe, fr fr. 🧬
  • size β€” full expression size, including private data size. Numbers bestie, we respect them. πŸ“
  • init β€” initialization function. Setup era πŸ› οΈ
  • activate β€” activate expression in the next generation. Next-gen slay πŸ”₯
  • deactivate β€” deactivate expression in next generation. Bye-bye era πŸ‘‹
  • destroy β€” destruction function, called after synchronize_rcu. Cleanup after the RCU moment, no cap. πŸ’€
  • destroy_clone β€” destruction clone function. The clone’s cleanup arc 🫧
  • dump β€” function to dump parameters. Spill the params πŸ“
  • validate β€” validate expression, called during loop detection. Loop-check bestie πŸ”
  • gc β€” garbage collection expression. Trash pickup era πŸ—‘οΈ
  • offload β€” hardware offload expression. Hardware main character πŸš€
  • offload_action β€” function to report true/false to allocate one slot or not in the flow offload array. Slot allocation tea 🎟️
  • offload_stats β€” function to synchronize hardware stats via updating the counter expression. Stats sync via the counter expression, iykyk πŸ“Š
  • type β€” expression type. Type check, always 🏷️
  • data β€” extra data to attach to this expression operation. The little extra data bag πŸŽ’

🌈 SEE ALSO 🌈

the whole squad is linked here, and yes every single one is invited 🫢:

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

mwah πŸ’‹ that’s the whole struct nft_expr_ops(9) page, bestie. Cute sign-off from source ./include/net/netfilter, dated October 2026, page struct nft_expr_ops(9). Stay iconic πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from