summaryrefslogtreecommitdiffstats
path: root/include/net/netfilter/nf_tables.h
diff options
context:
space:
mode:
authorPablo Neira Ayuso2014-04-04 01:24:07 +0200
committerPablo Neira Ayuso2014-05-19 12:06:10 +0200
commit1081d11b086afb73e1d8f52f9047d661d8770b82 (patch)
tree35912d1927792f2f2d2c0f9e61d573a444abebfa /include/net/netfilter/nf_tables.h
parentnetfilter: nf_tables: deconstify table and chain in context structure (diff)
downloadkernel-qcow2-linux-1081d11b086afb73e1d8f52f9047d661d8770b82.tar.gz
kernel-qcow2-linux-1081d11b086afb73e1d8f52f9047d661d8770b82.tar.xz
kernel-qcow2-linux-1081d11b086afb73e1d8f52f9047d661d8770b82.zip
netfilter: nf_tables: generalise transaction infrastructure
This patch generalises the existing rule transaction infrastructure so it can be used to handle set, table and chain object transactions as well. The transaction provides a data area that stores private information depending on the transaction type. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/net/netfilter/nf_tables.h')
-rw-r--r--include/net/netfilter/nf_tables.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 91505231a105..246dbd48825f 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -387,18 +387,25 @@ struct nft_rule {
};
/**
- * struct nft_rule_trans - nf_tables rule update in transaction
+ * struct nft_trans - nf_tables object update in transaction
*
* @list: used internally
- * @ctx: rule context
- * @rule: rule that needs to be updated
+ * @ctx: transaction context
+ * @data: internal information related to the transaction
*/
-struct nft_rule_trans {
+struct nft_trans {
struct list_head list;
struct nft_ctx ctx;
+ char data[0];
+};
+
+struct nft_trans_rule {
struct nft_rule *rule;
};
+#define nft_trans_rule(trans) \
+ (((struct nft_trans_rule *)trans->data)->rule)
+
static inline struct nft_expr *nft_expr_first(const struct nft_rule *rule)
{
return (struct nft_expr *)&rule->data[0];