diff options
author | Arturo Borrero <arturo.borrero.glez@gmail.com> | 2013-07-11 10:44:13 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-07-15 13:09:11 +0200 |
commit | ef23c5a37590d7b444d9d6bdfd764cf9fbd4c308 (patch) | |
tree | 35801a12918f1aa8cc474f0eba033ee12ce22f28 /src/chain.c | |
parent | ef8f2163fa30791c7561b958773d1aa6ebfb1469 (diff) |
src: add nft_*_list_is_empty() functions
This functions check if a given nft_*_list is empty or not.
I found this quite useful while working with a full ruleset.
Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/chain.c')
-rw-r--r-- | src/chain.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/chain.c b/src/chain.c index bdbaf60..3555829 100644 --- a/src/chain.c +++ b/src/chain.c @@ -862,6 +862,12 @@ void nft_chain_list_free(struct nft_chain_list *list) } EXPORT_SYMBOL(nft_chain_list_free); +int nft_chain_list_is_empty(struct nft_chain_list *list) +{ + return list_empty(&list->list); +} +EXPORT_SYMBOL(nft_chain_list_is_empty); + void nft_chain_list_add(struct nft_chain *r, struct nft_chain_list *list) { list_add_tail(&r->head, &list->list); |