datapath: Add support for Linux 3.12
[sliver-openvswitch.git] / datapath / linux / compat / include / net / ip_tunnels.h
1 #ifndef __NET_IP_TUNNELS_WRAPPER_H
2 #define __NET_IP_TUNNELS_WRAPPER_H 1
3
4 #include <linux/version.h>
5 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)
6 #include_next <net/ip_tunnels.h>
7 #else
8
9 #include <linux/if_tunnel.h>
10 #include <linux/netdevice.h>
11 #include <linux/skbuff.h>
12 #include <linux/types.h>
13 #include <net/dsfield.h>
14 #include <net/flow.h>
15 #include <net/inet_ecn.h>
16 #include <net/ip.h>
17 #include <net/rtnetlink.h>
18
19 #define TUNNEL_CSUM     __cpu_to_be16(0x01)
20 #define TUNNEL_ROUTING  __cpu_to_be16(0x02)
21 #define TUNNEL_KEY      __cpu_to_be16(0x04)
22 #define TUNNEL_SEQ      __cpu_to_be16(0x08)
23 #define TUNNEL_STRICT   __cpu_to_be16(0x10)
24 #define TUNNEL_REC      __cpu_to_be16(0x20)
25 #define TUNNEL_VERSION  __cpu_to_be16(0x40)
26 #define TUNNEL_NO_KEY   __cpu_to_be16(0x80)
27 #define TUNNEL_DONT_FRAGMENT    __cpu_to_be16(0x0100)
28
29 struct tnl_ptk_info {
30         __be16 flags;
31         __be16 proto;
32         __be32 key;
33         __be32 seq;
34 };
35
36 #define PACKET_RCVD     0
37 #define PACKET_REJECT   1
38
39 int iptunnel_xmit(struct rtable *rt,
40                   struct sk_buff *skb,
41                   __be32 src, __be32 dst, __u8 proto,
42                   __u8 tos, __u8 ttl, __be16 df, bool xnet);
43
44 int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto);
45
46 #endif
47 #endif /* __NET_IP_TUNNELS_H */