[nftables libnl] libnl: add nl_list_for_each_entry_continue()

Patrick McHardy netfilter-cvslog-bounces at lists.netfilter.org
Wed Apr 8 06:17:42 CEST 2009


Gitweb:		http://git.netfilter.org/cgi-bin/gitweb.cgi?p=libnl-nft.git;a=commit;h=873298f4f89c74247dd35c1b66b0888a2f3c0984
commit 873298f4f89c74247dd35c1b66b0888a2f3c0984
Author:     Patrick McHardy <kaber at trash.net>
AuthorDate: Wed Apr 1 07:43:39 2009 +0200
Commit:     Patrick McHardy <kaber at trash.net>
CommitDate: Wed Apr 1 07:43:39 2009 +0200

    libnl: add nl_list_for_each_entry_continue()
    
    Signed-off-by: Patrick McHardy <kaber at trash.net>
       via  873298f4f89c74247dd35c1b66b0888a2f3c0984 (commit)
      from  81e66d96860f7c6d280754b29954d9b4dca8d2a6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 873298f4f89c74247dd35c1b66b0888a2f3c0984
Author: Patrick McHardy <kaber at trash.net>
Date:   Wed Apr 1 07:43:39 2009 +0200

    libnl: add nl_list_for_each_entry_continue()
    
    Signed-off-by: Patrick McHardy <kaber at trash.net>

-----------------------------------------------------------------------

 include/netlink/list.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
Signed-off-by: Patrick McHardy <kaber at trash.net>

diff --git a/include/netlink/list.h b/include/netlink/list.h
index c6876a7..b4cb910 100644
--- a/include/netlink/list.h
+++ b/include/netlink/list.h
@@ -82,6 +82,14 @@ static inline int nl_list_empty(struct nl_list_head *head)
 	     &(pos)->member != (head); 					\
 	     pos = n, n = nl_list_entry(n->member.next, typeof(*n), member))
 
+#define nl_list_prepare_entry(pos, head, member) \
+	((pos) ? : nl_list_entry(head, typeof(*pos), member))
+
+#define nl_list_for_each_entry_continue(pos, head, member) 		\
+	for (pos = nl_list_entry(pos->member.next, typeof(*pos), member);	\
+	     &(pos)->member != (head);	\
+	     pos = nl_list_entry(pos->member.next, typeof(*pos), member))
+
 #define nl_init_list_head(head) \
 	do { (head)->next = (head); (head)->prev = (head); } while (0)
 



More information about the netfilter-cvslog mailing list