1 #ifndef __LINUX_GRE_WRAPPER_H
2 #define __LINUX_GRE_WRAPPER_H
4 #include <linux/skbuff.h>
5 #include <net/ip_tunnels.h>
6 #ifdef HAVE_METADATA_DST
7 #include_next <net/gre.h>
9 static inline int rpl_ipgre_init(void)
13 static inline void rpl_ipgre_fini(void)
16 #define gre_fb_xmit dev_queue_xmit
20 #include <linux/version.h>
21 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) || \
22 defined(HAVE_GRE_CISCO_REGISTER)
23 #include_next <net/gre.h>
26 #ifndef HAVE_GRE_CISCO_REGISTER
28 /* GRE demux not available, implement our own demux. */
29 #define MAX_GRE_PROTO_PRIORITY 255
31 struct gre_cisco_protocol {
32 int (*handler)(struct sk_buff *skb, const struct tnl_ptk_info *tpi);
33 int (*err_handler)(struct sk_buff *skb, u32 info,
34 const struct tnl_ptk_info *tpi);
38 #define gre_cisco_register rpl_gre_cisco_register
39 int rpl_gre_cisco_register(struct gre_cisco_protocol *proto);
41 #define gre_cisco_unregister rpl_gre_cisco_unregister
42 int rpl_gre_cisco_unregister(struct gre_cisco_protocol *proto);
44 #ifndef GRE_HEADER_SECTION
49 #define GRE_HEADER_SECTION 4
52 #endif /* HAVE_GRE_CISCO_REGISTER */
54 int rpl_ipgre_init(void);
55 void rpl_ipgre_fini(void);
57 #define gretap_fb_dev_create rpl_gretap_fb_dev_create
58 struct net_device *rpl_gretap_fb_dev_create(struct net *net, const char *name,
61 #define gre_fb_xmit rpl_gre_fb_xmit
62 netdev_tx_t rpl_gre_fb_xmit(struct sk_buff *skb);
63 #endif /* HAVE_METADATA_DST */
65 #define ipgre_init rpl_ipgre_init
66 #define ipgre_fini rpl_ipgre_fini