On Thursday 15 July 2004 14:07, so usp wrote: > > I would like to use the macro list_for_each() (defined > into linux/list.h) with the struct ip_vs_conn (defined > into linux/ip_vs.h) and struct socket (defined into > linux/socket.h) to walk through the lists defined > there. The macro uses the head for these lists, but I > still don't know how to get it in my programs. Does > anybody know how do I do to get the headers for these > lists described above? Looks like the struct ip_vs_conn lists are in the hash table ip_vs_conn_tab which is IP_VS_CONN_TAB_SIZE entries long. static struct list_head *ip_vs_conn_tab; So for the first hash bucket it should (untested) be something like: struct list_head *node; struct ip_vs_conn *ivc; list_for_each(node, &ip_vs_conn_tab[0]) { ivc = list_entry(node, struct ip_vs_conn, c_list); // do something with ivc } 'struct socket' doesn't have any such member (in the trees I just looked at) so I don't see how list_for_each() can be used with it. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/