summaryrefslogtreecommitdiffstats
path: root/include/net/xfrm.h
diff options
context:
space:
mode:
authorMasahide NAKAMURA2006-08-24 02:53:57 +0200
committerDavid S. Miller2006-09-23 00:06:34 +0200
commit6c44e6b7ab500d7e3e3f406c83325671be51a752 (patch)
treed68b6347f4e437cd4aac9444ed9ee323f73eb06c /include/net/xfrm.h
parent[XFRM]: Expand XFRM_MAX_DEPTH for route optimization. (diff)
downloadkernel-qcow2-linux-6c44e6b7ab500d7e3e3f406c83325671be51a752.tar.gz
kernel-qcow2-linux-6c44e6b7ab500d7e3e3f406c83325671be51a752.tar.xz
kernel-qcow2-linux-6c44e6b7ab500d7e3e3f406c83325671be51a752.zip
[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/net/xfrm.h')
-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
{
/* Note: bydst is re-used during gc */
struct list_head bydst;
+ struct list_head bysrc;
struct list_head byspi;
atomic_t refcnt;
@@ -236,6 +237,7 @@ extern int __xfrm_state_delete(struct xfrm_state *x);
struct xfrm_state_afinfo {
unsigned short family;
struct list_head *state_bydst;
+ struct list_head *state_bysrc;
struct list_head *state_byspi;
int (*init_flags)(struct xfrm_state *x);
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)
}
static __inline__
+unsigned __xfrm4_src_hash(xfrm_address_t *addr)
+{
+ return __xfrm4_dst_hash(addr);
+}
+
+static __inline__
+unsigned __xfrm6_src_hash(xfrm_address_t *addr)
+{
+ return __xfrm6_dst_hash(addr);
+}
+
+static __inline__
+unsigned xfrm_src_hash(xfrm_address_t *addr, unsigned short family)
+{
+ switch (family) {
+ case AF_INET:
+ return __xfrm4_src_hash(addr);
+ case AF_INET6:
+ return __xfrm6_src_hash(addr);
+ }
+ return 0;
+}
+
+static __inline__
unsigned __xfrm4_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto)
{
unsigned h;