From b673e4dfc8f29e5bfe4d342029b793e9d504f6dd Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Mon, 19 Nov 2007 22:36:45 -0800 Subject: [RAW]: Introduce raw_hashinfo structure The ipv4/raw.c and ipv6/raw.c contain many common code (most of which is proc interface) which can be consolidated. Most of the places to consolidate deal with the raw sockets hashtable, so introduce a struct raw_hashinfo which describes the raw sockets hash. Signed-off-by: Pavel Emelyanov Signed-off-by: David S. Miller --- include/net/raw.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/net/raw.h b/include/net/raw.h index 7fc3c770f170..70b27c7c8167 100644 --- a/include/net/raw.h +++ b/include/net/raw.h @@ -27,6 +27,13 @@ int raw_local_deliver(struct sk_buff *, int); extern int raw_rcv(struct sock *, struct sk_buff *); +#define RAW_HTABLE_SIZE MAX_INET_PROTOS + +struct raw_hashinfo { + rwlock_t lock; + struct hlist_head ht[RAW_HTABLE_SIZE]; +}; + #ifdef CONFIG_PROC_FS extern int raw_proc_init(void); extern void raw_proc_exit(void); -- cgit v1.2.3-59-g8ed1b