Skip to contentSkip to conversation

: [XFRM]: Pull xfrm_state_bydst hash table knowledge out of afinfo.

PATCH In review David Miller 1 participant 1 message Aug 15, 2006

Subsystems (3)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 1/10 : [XFRM]: Pull xfrm_state_bydst hash table knowledge out of afinfo.

[XFRM]: Pull xfrm_state_bydst hash table knowledge out of afinfo.

---
 include/net/xfrm.h     |   34 -------------
 net/ipv4/xfrm4_state.c |   50 -------------------
 net/ipv6/xfrm6_state.c |   53 --------------------
 net/xfrm/xfrm_state.c  |  125 ++++++++++++++++++++++++++++++++++++++++++++----
 4 files changed, 115 insertions(+), 147 deletions(-)
include/net/xfrm.h +0 -34
index 9c5ee9f..e53819f 100644
@@ -235,16 +235,12 @@ extern int __xfrm_state_delete(struct xf
 
 struct xfrm_state_afinfo {
 	unsigned short		family;
-	struct list_head	*state_bydst;
 	struct list_head	*state_byspi;
 	int			(*init_flags)(struct xfrm_state *x);
 	void			(*init_tempsel)(struct xfrm_state *x, struct flowi *fl,
 						struct xfrm_tmpl *tmpl,
 						xfrm_address_t *daddr, xfrm_address_t *saddr);
 	struct xfrm_state	*(*state_lookup)(xfrm_address_t *daddr, u32 spi, u8 proto);
-	struct xfrm_state	*(*find_acq)(u8 mode, u32 reqid, u8 proto, 
-					     xfrm_address_t *daddr, xfrm_address_t *saddr, 
-					     int create);
 };
 
 extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo);
@@ -391,36 +387,6 @@ static inline void xfrm_pol_put(struct x
 #define XFRM_DST_HSIZE		1024
 
 static __inline__
-unsigned __xfrm4_dst_hash(xfrm_address_t *addr)
-{
-	unsigned h;
-	h = ntohl(addr->a4);
-	h = (h ^ (h>>16)) % XFRM_DST_HSIZE;
-	return h;
-}
-
-static __inline__
-unsigned __xfrm6_dst_hash(xfrm_address_t *addr)
-{
-	unsigned h;
-	h = ntohl(addr->a6[2]^addr->a6[3]);
-	h = (h ^ (h>>16)) % XFRM_DST_HSIZE;
-	return h;
-}
-
-static __inline__
-unsigned xfrm_dst_hash(xfrm_address_t *addr, unsigned short family)
-{
-	switch (family) {
-	case AF_INET:
-		return __xfrm4_dst_hash(addr);
-	case AF_INET6:
-		return __xfrm6_dst_hash(addr);
-	}
-	return 0;
-}
-
-static __inline__
 unsigned __xfrm4_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto)
 {
 	unsigned h;
net/ipv4/xfrm4_state.c +0 -50

61 lines not on this page · raw message

net/ipv6/xfrm6_state.c +0 -53

63 lines not on this page · raw message

net/xfrm/xfrm_state.c +115 -10

164 lines not on this page · raw message

Signature · 1 line
1.4.2.rc2.g3e042