]>
git.proxmox.com Git - ovs.git/blob - datapath/linux/compat/include/net/gre.h
58fa97a8d23aeb0d73d92fe7deb22d234207a901
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 USE_UPSTREAM_TUNNEL
9 #include_next <net/gre.h>
11 static inline int rpl_ipgre_init(void)
15 static inline void rpl_ipgre_fini(void)
18 static inline int rpl_ip6gre_init(void)
23 static inline void rpl_ip6gre_fini(void)
26 static inline int rpl_ip6_tunnel_init(void)
31 static inline void rpl_ip6_tunnel_cleanup(void)
35 static inline int rpl_gre_init(void)
40 static inline void rpl_gre_exit(void)
44 #define gre_fb_xmit dev_queue_xmit
47 #ifndef HAVE_NAME_ASSIGN_TYPE
48 static inline struct net_device
*rpl_gretap_fb_dev_create(
49 struct net
*net
, const char *name
, u8 name_assign_type
) {
50 return gretap_fb_dev_create(net
, name
);
52 #define gretap_fb_dev_create rpl_gretap_fb_dev_create
57 #include_next <net/gre.h>
59 #define tnl_flags_to_gre_flags rpl_tnl_flags_to_gre_flags
60 static inline __be16
rpl_tnl_flags_to_gre_flags(__be16 tflags
)
64 if (tflags
& TUNNEL_CSUM
)
66 if (tflags
& TUNNEL_ROUTING
)
68 if (tflags
& TUNNEL_KEY
)
70 if (tflags
& TUNNEL_SEQ
)
72 if (tflags
& TUNNEL_STRICT
)
74 if (tflags
& TUNNEL_REC
)
76 if (tflags
& TUNNEL_VERSION
)
82 #define gre_flags_to_tnl_flags rpl_gre_flags_to_tnl_flags
83 static inline __be16
rpl_gre_flags_to_tnl_flags(__be16 flags
)
88 tflags
|= TUNNEL_CSUM
;
89 if (flags
& GRE_ROUTING
)
90 tflags
|= TUNNEL_ROUTING
;
95 if (flags
& GRE_STRICT
)
96 tflags
|= TUNNEL_STRICT
;
99 if (flags
& GRE_VERSION
)
100 tflags
|= TUNNEL_VERSION
;
104 #define gre_tnl_flags_to_gre_flags rpl_gre_tnl_flags_to_gre_flags
105 static inline __be16
rpl_gre_tnl_flags_to_gre_flags(__be16 tflags
)
109 if (tflags
& TUNNEL_CSUM
)
111 if (tflags
& TUNNEL_ROUTING
)
112 flags
|= GRE_ROUTING
;
113 if (tflags
& TUNNEL_KEY
)
115 if (tflags
& TUNNEL_SEQ
)
117 if (tflags
& TUNNEL_STRICT
)
119 if (tflags
& TUNNEL_REC
)
121 if (tflags
& TUNNEL_VERSION
)
122 flags
|= GRE_VERSION
;
127 #define gre_build_header rpl_gre_build_header
128 void rpl_gre_build_header(struct sk_buff
*skb
, const struct tnl_ptk_info
*tpi
,
131 int rpl_ipgre_init(void);
132 void rpl_ipgre_fini(void);
133 int rpl_ip6gre_init(void);
134 void rpl_ip6gre_fini(void);
135 int rpl_ip6_tunnel_init(void);
136 void rpl_ip6_tunnel_cleanup(void);
137 int rpl_gre_init(void);
138 void rpl_gre_exit(void);
140 #define gretap_fb_dev_create rpl_gretap_fb_dev_create
141 struct net_device
*rpl_gretap_fb_dev_create(struct net
*net
, const char *name
,
142 u8 name_assign_type
);
144 #define gre_parse_header rpl_gre_parse_header
145 int rpl_gre_parse_header(struct sk_buff
*skb
, struct tnl_ptk_info
*tpi
,
146 bool *csum_err
, __be16 proto
, int nhs
);
148 #define gre_fb_xmit rpl_gre_fb_xmit
149 netdev_tx_t
rpl_gre_fb_xmit(struct sk_buff
*skb
);
151 #define gre_add_protocol rpl_gre_add_protocol
152 int rpl_gre_add_protocol(const struct gre_protocol
*proto
, u8 version
);
153 #define gre_del_protocol rpl_gre_del_protocol
154 int rpl_gre_del_protocol(const struct gre_protocol
*proto
, u8 version
);
155 #endif /* USE_UPSTREAM_TUNNEL */
157 #define ipgre_init rpl_ipgre_init
158 #define ipgre_fini rpl_ipgre_fini
159 #define ip6gre_init rpl_ip6gre_init
160 #define ip6gre_fini rpl_ip6gre_fini
161 #define ip6_tunnel_init rpl_ip6_tunnel_init
162 #define ip6_tunnel_cleanup rpl_ip6_tunnel_cleanup
163 #define gre_init rpl_gre_init
164 #define gre_exit rpl_gre_exit
166 #define gre_fill_metadata_dst ovs_gre_fill_metadata_dst
167 int ovs_gre_fill_metadata_dst(struct net_device
*dev
, struct sk_buff
*skb
);