diff options
author | Patrick McHardy <kaber@trash.net> | 2015-03-26 12:39:40 +0000 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-04-01 11:17:49 +0200 |
commit | 9d0982927e79049675cb6c6c04a0ebb3dad5a434 (patch) | |
tree | 8a0c0e2e7e930f83fcd1bce4a1b5630a21d58d94 /include/net | |
parent | 6908665826d56ddd024f3e131a9ee36f0d140943 (diff) | |
download | linux-9d0982927e79049675cb6c6c04a0ebb3dad5a434.tar.gz linux-9d0982927e79049675cb6c6c04a0ebb3dad5a434.tar.bz2 linux-9d0982927e79049675cb6c6c04a0ebb3dad5a434.zip |
netfilter: nft_hash: add support for timeouts
Add support for element timeouts to nft_hash. The lookup and walking
functions are changed to ignore timed out elements, a periodic garbage
collection task cleans out expired entries.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/netfilter/nf_tables.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index 1ea13fcd388e..a785699329c9 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h @@ -294,6 +294,11 @@ static inline void *nft_set_priv(const struct nft_set *set) return (void *)set->data; } +static inline struct nft_set *nft_set_container_of(const void *priv) +{ + return (void *)priv - offsetof(struct nft_set, data); +} + struct nft_set *nf_tables_set_lookup(const struct nft_table *table, const struct nlattr *nla); struct nft_set *nf_tables_set_lookup_byid(const struct net *net, |