1 #ifndef __LINUX_GRE_WRAPPER_H
2 #define __LINUX_GRE_WRAPPER_H
4 #include <linux/version.h>
5 #include <linux/skbuff.h>
6 #include <net/ip_tunnels.h>
8 #ifdef HAVE_METADATA_DST
9 #include_next <net/gre.h>
11 static inline int rpl_ipgre_init(void)
15 static inline void rpl_ipgre_fini(void)
18 #define gre_fb_xmit dev_queue_xmit
22 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) || \
23 defined(HAVE_GRE_CISCO_REGISTER)
24 #include_next <net/gre.h>
27 #ifndef HAVE_GRE_CISCO_REGISTER
29 /* GRE demux not available, implement our own demux. */
30 #define MAX_GRE_PROTO_PRIORITY 255
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);
39 #define gre_cisco_register rpl_gre_cisco_register
40 int rpl_gre_cisco_register(struct gre_cisco_protocol *proto);
42 #define gre_cisco_unregister rpl_gre_cisco_unregister
43 int rpl_gre_cisco_unregister(struct gre_cisco_protocol *proto);
45 #ifndef GRE_HEADER_SECTION
50 #define GRE_HEADER_SECTION 4
53 #endif /* HAVE_GRE_CISCO_REGISTER */
55 int rpl_ipgre_init(void);
56 void rpl_ipgre_fini(void);
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,
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 */
66 #define ipgre_init rpl_ipgre_init
67 #define ipgre_fini rpl_ipgre_fini