1 #ifndef __NET_IP_TUNNELS_WRAPPER_H
2 #define __NET_IP_TUNNELS_WRAPPER_H 1
4 #include <linux/version.h>
6 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
7 #include_next <net/ip_tunnels.h>
10 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
12 #include <linux/if_tunnel.h>
13 #include <linux/netdevice.h>
14 #include <linux/skbuff.h>
15 #include <linux/types.h>
16 #include <net/dsfield.h>
18 #include <net/inet_ecn.h>
20 #include <net/rtnetlink.h>
22 struct sk_buff *ovs_iptunnel_handle_offloads(struct sk_buff *skb,
23 bool csum_help, int gso_type_mask,
24 void (*fix_segment)(struct sk_buff *));
26 #define iptunnel_xmit rpl_iptunnel_xmit
27 int rpl_iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb,
28 __be32 src, __be32 dst, __u8 proto, __u8 tos, __u8 ttl,
29 __be16 df, bool xnet);
31 #define iptunnel_pull_header rpl_iptunnel_pull_header
32 int rpl_iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto);
36 #define ovs_iptunnel_handle_offloads(skb, csum_help, gso_type_mask, fix_segment) \
37 iptunnel_handle_offloads(skb, csum_help, gso_type_mask)
42 #define TUNNEL_CSUM __cpu_to_be16(0x01)
43 #define TUNNEL_ROUTING __cpu_to_be16(0x02)
44 #define TUNNEL_KEY __cpu_to_be16(0x04)
45 #define TUNNEL_SEQ __cpu_to_be16(0x08)
46 #define TUNNEL_STRICT __cpu_to_be16(0x10)
47 #define TUNNEL_REC __cpu_to_be16(0x20)
48 #define TUNNEL_VERSION __cpu_to_be16(0x40)
49 #define TUNNEL_NO_KEY __cpu_to_be16(0x80)
59 #define PACKET_REJECT 1
62 #ifndef TUNNEL_DONT_FRAGMENT
63 #define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100)
67 #define TUNNEL_OAM __cpu_to_be16(0x0200)
68 #define TUNNEL_CRIT_OPT __cpu_to_be16(0x0400)
71 #ifndef TUNNEL_GENEVE_OPT
72 #define TUNNEL_GENEVE_OPT __cpu_to_be16(0x0800)
75 #ifndef TUNNEL_VXLAN_OPT
76 #define TUNNEL_VXLAN_OPT __cpu_to_be16(0x1000)
79 /* Older kernels defined TUNNEL_OPTIONS_PRESENT to GENEVE only */
80 #undef TUNNEL_OPTIONS_PRESENT
81 #define TUNNEL_OPTIONS_PRESENT (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT)
83 #define skb_is_encapsulated ovs_skb_is_encapsulated
84 bool ovs_skb_is_encapsulated(struct sk_buff *skb);
86 #endif /* __NET_IP_TUNNELS_H */