STRUCT NFT_EXPR_OPS(9)
β¨ 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 aftersynchronize_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
- 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