From ef23c5a37590d7b444d9d6bdfd764cf9fbd4c308 Mon Sep 17 00:00:00 2001 From: Arturo Borrero Date: Thu, 11 Jul 2013 10:44:13 +0200 Subject: 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 Signed-off-by: Pablo Neira Ayuso --- src/chain.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/chain.c') 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); -- cgit v1.2.3