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/rule.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/rule.c') diff --git a/src/rule.c b/src/rule.c index 5a4ae91..aa7aee8 100644 --- a/src/rule.c +++ b/src/rule.c @@ -867,6 +867,12 @@ void nft_rule_list_free(struct nft_rule_list *list) } EXPORT_SYMBOL(nft_rule_list_free); +int nft_rule_list_is_empty(struct nft_rule_list *list) +{ + return list_empty(&list->list); +} +EXPORT_SYMBOL(nft_rule_list_is_empty); + void nft_rule_list_add(struct nft_rule *r, struct nft_rule_list *list) { list_add_tail(&r->head, &list->list); -- cgit v1.2.3