datapath: compat: Block upstream ip_tunnels functions.
[cascardo/ovs.git] / datapath / linux / compat / include / net / gre.h
1 #ifndef __LINUX_GRE_WRAPPER_H
2 #define __LINUX_GRE_WRAPPER_H
3
4 #include <linux/version.h>
5 #include <linux/skbuff.h>
6 #include <net/ip_tunnels.h>
7
8 #ifdef HAVE_METADATA_DST
9 #include_next <net/gre.h>
10
11 static inline int rpl_ipgre_init(void)
12 {
13         return 0;
14 }
15 static inline void rpl_ipgre_fini(void)
16 {}
17
18 #define gre_fb_xmit dev_queue_xmit
19
20 #else
21
22 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) || \
23    defined(HAVE_GRE_CISCO_REGISTER)
24 #include_next <net/gre.h>
25 #endif
26
27 #ifndef HAVE_GRE_CISCO_REGISTER
28
29 /* GRE demux not available, implement our own demux. */
30 #define MAX_GRE_PROTO_PRIORITY 255
31
32 struct gre_cisco_protocol {
33         int (*handler)(struct sk_buff *skb, const struct tnl_ptk_info *tpi);
34         int (*err_handler)(struct sk_buff *skb, u32 info,
35                            const struct tnl_ptk_info *tpi);
36         u8 priority;
37 };
38
39 #define gre_cisco_register rpl_gre_cisco_register
40 int rpl_gre_cisco_register(struct gre_cisco_protocol *proto);
41
42 #define gre_cisco_unregister rpl_gre_cisco_unregister
43 int rpl_gre_cisco_unregister(struct gre_cisco_protocol *proto);
44
45 #ifndef GRE_HEADER_SECTION
46 struct gre_base_hdr {
47         __be16 flags;
48         __be16 protocol;
49 };
50 #define GRE_HEADER_SECTION 4
51 #endif
52
53 #endif /* HAVE_GRE_CISCO_REGISTER */
54
55 int rpl_ipgre_init(void);
56 void rpl_ipgre_fini(void);
57
58 #define gretap_fb_dev_create rpl_gretap_fb_dev_create
59 struct net_device *rpl_gretap_fb_dev_create(struct net *net, const char *name,
60                                         u8 name_assign_type);
61
62 #define gre_fb_xmit rpl_gre_fb_xmit
63 netdev_tx_t rpl_gre_fb_xmit(struct sk_buff *skb);
64 #endif /* HAVE_METADATA_DST */
65
66 #define ipgre_init rpl_ipgre_init
67 #define ipgre_fini rpl_ipgre_fini
68
69 #endif