diff options
| author | Patrick McHardy <kaber@trash.net> | 2015-04-11 05:46:38 -0400 |
|---|---|---|
| committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-04-13 14:12:31 -0400 |
| commit | 0b2d8a7b638b5034d2d68f6add8af94daaa1d4cd (patch) | |
| tree | 0e10c271d522dd144f22e474af5f73a7c4214091 /include | |
| parent | 24477e57412a7a7dea62637ac990bc5c1cff0665 (diff) | |
netfilter: nf_tables: add helper functions for expression handling
Add helper functions for initializing, cloning, dumping and destroying
a single expression that is not part of a rule.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/netfilter/nf_tables.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index cb42da1011ef..e21623cb7b20 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef _NET_NF_TABLES_H | 1 | #ifndef _NET_NF_TABLES_H |
| 2 | #define _NET_NF_TABLES_H | 2 | #define _NET_NF_TABLES_H |
| 3 | 3 | ||
| 4 | #include <linux/module.h> | ||
| 4 | #include <linux/list.h> | 5 | #include <linux/list.h> |
| 5 | #include <linux/netfilter.h> | 6 | #include <linux/netfilter.h> |
| 6 | #include <linux/netfilter/nfnetlink.h> | 7 | #include <linux/netfilter/nfnetlink.h> |
| @@ -641,6 +642,18 @@ static inline void *nft_expr_priv(const struct nft_expr *expr) | |||
| 641 | return (void *)expr->data; | 642 | return (void *)expr->data; |
| 642 | } | 643 | } |
| 643 | 644 | ||
| 645 | struct nft_expr *nft_expr_init(const struct nft_ctx *ctx, | ||
| 646 | const struct nlattr *nla); | ||
| 647 | void nft_expr_destroy(const struct nft_ctx *ctx, struct nft_expr *expr); | ||
| 648 | int nft_expr_dump(struct sk_buff *skb, unsigned int attr, | ||
| 649 | const struct nft_expr *expr); | ||
| 650 | |||
| 651 | static inline void nft_expr_clone(struct nft_expr *dst, struct nft_expr *src) | ||
| 652 | { | ||
| 653 | __module_get(src->ops->type->owner); | ||
| 654 | memcpy(dst, src, src->ops->size); | ||
| 655 | } | ||
| 656 | |||
| 644 | /** | 657 | /** |
| 645 | * struct nft_rule - nf_tables rule | 658 | * struct nft_rule - nf_tables rule |
| 646 | * | 659 | * |
