diff options
author | Patrick McHardy <kaber@trash.net> | 2015-04-11 01:27:36 (GMT) |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-04-13 15:17:28 (GMT) |
commit | b1c96ed37ceeef5573402d4af202897edaf1e4b8 (patch) | |
tree | 8c3664e72dad22a859712a91a49d332cbd28801c /net/netfilter/nf_tables_api.c | |
parent | 8cd8937ac0d68435b4ca9bd3c987c3cfea269b4f (diff) | |
download | linux-b1c96ed37ceeef5573402d4af202897edaf1e4b8.tar.xz |
netfilter: nf_tables: add register parsing/dumping helpers
Add helper functions to parse and dump register values in netlink attributes.
These helpers will later be changed to take care of translation between the
old 128 bit and the new 32 bit register numbers.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nf_tables_api.c')
-rw-r--r-- | net/netfilter/nf_tables_api.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 0bb16a1..a25fd19 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -4122,6 +4122,18 @@ static int nf_tables_check_loops(const struct nft_ctx *ctx, return 0; } +unsigned int nft_parse_register(const struct nlattr *attr) +{ + return ntohl(nla_get_be32(attr)); +} +EXPORT_SYMBOL_GPL(nft_parse_register); + +int nft_dump_register(struct sk_buff *skb, unsigned int attr, unsigned int reg) +{ + return nla_put_be32(skb, attr, htonl(reg)); +} +EXPORT_SYMBOL_GPL(nft_dump_register); + /** * nft_validate_register_load - validate a load from a register * |