aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMasahide NAKAMURA <nakam@linux-ipv6.org>2006-08-23 20:53:57 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 18:06:34 -0400
commit6c44e6b7ab500d7e3e3f406c83325671be51a752 (patch)
treed68b6347f4e437cd4aac9444ed9ee323f73eb06c /include
parent622dc8281a80374873686514e46f852093d91106 (diff)
[XFRM] STATE: Add source address list.
Support source address based searching. Mobile IPv6 will use it. Based on MIPL2 kernel patch. Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/xfrm.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index aa3be68041be..88145e3348d0 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -95,6 +95,7 @@ struct xfrm_state
95{ 95{
96 /* Note: bydst is re-used during gc */ 96 /* Note: bydst is re-used during gc */
97 struct list_head bydst; 97 struct list_head bydst;
98 struct list_head bysrc;
98 struct list_head byspi; 99 struct list_head byspi;
99 100
100 atomic_t refcnt; 101 atomic_t refcnt;
@@ -236,6 +237,7 @@ extern int __xfrm_state_delete(struct xfrm_state *x);
236struct xfrm_state_afinfo { 237struct xfrm_state_afinfo {
237 unsigned short family; 238 unsigned short family;
238 struct list_head *state_bydst; 239 struct list_head *state_bydst;
240 struct list_head *state_bysrc;
239 struct list_head *state_byspi; 241 struct list_head *state_byspi;
240 int (*init_flags)(struct xfrm_state *x); 242 int (*init_flags)(struct xfrm_state *x);
241 void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl, 243 void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl,
@@ -421,6 +423,30 @@ unsigned xfrm_dst_hash(xfrm_address_t *addr, unsigned short family)
421} 423}
422 424
423static __inline__ 425static __inline__
426unsigned __xfrm4_src_hash(xfrm_address_t *addr)
427{
428 return __xfrm4_dst_hash(addr);
429}
430
431static __inline__
432unsigned __xfrm6_src_hash(xfrm_address_t *addr)
433{
434 return __xfrm6_dst_hash(addr);
435}
436
437static __inline__
438unsigned xfrm_src_hash(xfrm_address_t *addr, unsigned short family)
439{
440 switch (family) {
441 case AF_INET:
442 return __xfrm4_src_hash(addr);
443 case AF_INET6:
444 return __xfrm6_src_hash(addr);
445 }
446 return 0;
447}
448
449static __inline__
424unsigned __xfrm4_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto) 450unsigned __xfrm4_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto)
425{ 451{
426 unsigned h; 452 unsigned h;