aboutsummaryrefslogtreecommitdiff
path: root/include/net/xfrm.h
diff options
context:
space:
mode:
authorMasahide NAKAMURA <nakam@linux-ipv6.org>2006-09-22 15:06:24 -0700
committerDavid S. Miller <davem@davemloft.net>2006-09-22 15:06:24 -0700
commit5794708f11551b6d19b10673abf4b0202f66b44d (patch)
tree60d954e185dd80af7e6c08608fd0528cf21a5d41 /include/net/xfrm.h
parent7e49e6de30efa716614e280d97963c570f3acf29 (diff)
[XFRM]: Introduce a helper to compare id protocol.
Put the helper to header for future use. 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.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 762795624b1..5b364b0a6a2 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -9,6 +9,7 @@
#include <linux/skbuff.h>
#include <linux/socket.h>
#include <linux/pfkeyv2.h>
+#include <linux/ipsec.h>
#include <linux/in6.h>
#include <linux/mutex.h>
@@ -835,6 +836,11 @@ static inline int xfrm_state_kern(struct xfrm_state *x)
return atomic_read(&x->tunnel_users);
}
+static inline int xfrm_id_proto_match(u8 proto, u8 userproto)
+{
+ return (userproto == IPSEC_PROTO_ANY || proto == userproto);
+}
+
/*
* xfrm algorithm information
*/