1 #ifndef __NET_IP_TUNNELS_WRAPPER_H
2 #define __NET_IP_TUNNELS_WRAPPER_H 1
4 #include <linux/version.h>
5 #if defined(HAVE_GRE_HANDLE_OFFLOADS) && \
6 LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
7 /* RHEL6 and RHEL7 both has backported tunnel API but RHEL6 has
8 * older version, so avoid using RHEL6 backports.
10 #define GRE_USE_KERNEL_GRE_HANDLE_OFFLOADS
13 #ifdef GRE_USE_KERNEL_GRE_HANDLE_OFFLOADS
14 #include_next <net/ip_tunnels.h>
15 static inline int rpl_iptunnel_xmit(struct rtable *rt,
16 struct sk_buff *skb, __be32 src,
17 __be32 dst, __u8 proto, __u8 tos,
18 __u8 ttl, __be16 df, bool xnet)
20 #ifdef HAVE_IPTUNNEL_XMIT_NET
21 return iptunnel_xmit(NULL, rt, skb, src, dst, proto, tos, ttl, df);
23 return iptunnel_xmit(rt, skb, src, dst, proto, tos, ttl, df, xnet);
26 #define iptunnel_xmit rpl_iptunnel_xmit
30 #include <linux/if_tunnel.h>
31 #include <linux/netdevice.h>
32 #include <linux/skbuff.h>
33 #include <linux/types.h>
34 #include <net/dsfield.h>
36 #include <net/inet_ecn.h>
38 #include <net/rtnetlink.h>
40 #define TUNNEL_CSUM __cpu_to_be16(0x01)
41 #define TUNNEL_ROUTING __cpu_to_be16(0x02)
42 #define TUNNEL_KEY __cpu_to_be16(0x04)
43 #define TUNNEL_SEQ __cpu_to_be16(0x08)
44 #define TUNNEL_STRICT __cpu_to_be16(0x10)
45 #define TUNNEL_REC __cpu_to_be16(0x20)
46 #define TUNNEL_VERSION __cpu_to_be16(0x40)
47 #define TUNNEL_NO_KEY __cpu_to_be16(0x80)
48 #define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100)
58 #define PACKET_REJECT 1
60 int iptunnel_xmit(struct rtable *rt,
62 __be32 src, __be32 dst, __u8 proto,
63 __u8 tos, __u8 ttl, __be16 df, bool xnet);
65 int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto);
68 #endif /* __NET_IP_TUNNELS_H */