4 #include <linux/skbuff.h>
5 #include <net/ip_tunnels.h>
7 #define GREPROTO_CISCO 0
8 #define GREPROTO_PPTP 1
12 int (*handler)(struct sk_buff *skb);
13 void (*err_handler)(struct sk_buff *skb, u32 info);
20 #define GRE_HEADER_SECTION 4
22 int gre_add_protocol(const struct gre_protocol *proto, u8 version);
23 int gre_del_protocol(const struct gre_protocol *proto, u8 version);
25 static inline __be16 gre_flags_to_tnl_flags(__be16 flags)
30 tflags |= TUNNEL_CSUM;
31 if (flags & GRE_ROUTING)
32 tflags |= TUNNEL_ROUTING;
37 if (flags & GRE_STRICT)
38 tflags |= TUNNEL_STRICT;
41 if (flags & GRE_VERSION)
42 tflags |= TUNNEL_VERSION;
47 static inline __be16 tnl_flags_to_gre_flags(__be16 tflags)
51 if (tflags & TUNNEL_CSUM)
53 if (tflags & TUNNEL_ROUTING)
55 if (tflags & TUNNEL_KEY)
57 if (tflags & TUNNEL_SEQ)
59 if (tflags & TUNNEL_STRICT)
61 if (tflags & TUNNEL_REC)
63 if (tflags & TUNNEL_VERSION)