]> git.proxmox.com Git - mirror_ovs.git/blame - datapath/linux/compat/include/net/ip_tunnels.h
datapath: Remove linux/compat/include/linux/log2.h.
[mirror_ovs.git] / datapath / linux / compat / include / net / ip_tunnels.h
CommitLineData
5ebaf571
PS
1#ifndef __NET_IP_TUNNELS_WRAPPER_H
2#define __NET_IP_TUNNELS_WRAPPER_H 1
3
29c71cfa 4#include <linux/version.h>
705e9260 5
9ffdbf41 6#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
29c71cfa 7#include_next <net/ip_tunnels.h>
f6a0c895
TG
8#endif
9
9ffdbf41 10#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
29c71cfa 11
5ebaf571
PS
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>
17#include <net/flow.h>
18#include <net/inet_ecn.h>
19#include <net/ip.h>
20#include <net/rtnetlink.h>
21
9ffdbf41
JG
22struct 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 *));
25
26#define iptunnel_xmit rpl_iptunnel_xmit
27int 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);
30
31#define iptunnel_pull_header rpl_iptunnel_pull_header
32int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto);
33
34#else
35
36#define ovs_iptunnel_handle_offloads(skb, csum_help, gso_type_mask, fix_segment) \
37 iptunnel_handle_offloads(skb, csum_help, gso_type_mask)
38
39#endif /* 3.18 */
40
41#ifndef TUNNEL_CSUM
5ebaf571
PS
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)
5ebaf571
PS
50
51struct tnl_ptk_info {
52 __be16 flags;
53 __be16 proto;
54 __be32 key;
55 __be32 seq;
56};
57
58#define PACKET_RCVD 0
59#define PACKET_REJECT 1
9ffdbf41 60#endif
5ebaf571 61
9ffdbf41
JG
62#ifndef TUNNEL_DONT_FRAGMENT
63#define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100)
29c71cfa 64#endif
94872594 65
0c7930a3 66#ifndef TUNNEL_OAM
94872594 67#define TUNNEL_OAM __cpu_to_be16(0x0200)
c1fc1411 68#define TUNNEL_CRIT_OPT __cpu_to_be16(0x0400)
0c7930a3
TG
69#endif
70
71#ifndef TUNNEL_GENEVE_OPT
72#define TUNNEL_GENEVE_OPT __cpu_to_be16(0x0800)
73#endif
74
75#ifndef TUNNEL_VXLAN_OPT
76#define TUNNEL_VXLAN_OPT __cpu_to_be16(0x1000)
77#endif
78
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)
94872594 82
15281870
PS
83bool skb_is_encapsulated(struct sk_buff *skb);
84
5ebaf571 85#endif /* __NET_IP_TUNNELS_H */