aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/gre.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/gre.h')
-rw-r--r--include/net/gre.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/net/gre.h b/include/net/gre.h
index 9f03a390c826..57e4afdf7879 100644
--- a/include/net/gre.h
+++ b/include/net/gre.h
@@ -7,6 +7,7 @@
7#define GREPROTO_CISCO 0 7#define GREPROTO_CISCO 0
8#define GREPROTO_PPTP 1 8#define GREPROTO_PPTP 1
9#define GREPROTO_MAX 2 9#define GREPROTO_MAX 2
10#define GRE_IP_PROTO_MAX 2
10 11
11struct gre_protocol { 12struct gre_protocol {
12 int (*handler)(struct sk_buff *skb); 13 int (*handler)(struct sk_buff *skb);
@@ -22,6 +23,36 @@ struct gre_base_hdr {
22int gre_add_protocol(const struct gre_protocol *proto, u8 version); 23int gre_add_protocol(const struct gre_protocol *proto, u8 version);
23int gre_del_protocol(const struct gre_protocol *proto, u8 version); 24int gre_del_protocol(const struct gre_protocol *proto, u8 version);
24 25
26struct gre_cisco_protocol {
27 int (*handler)(struct sk_buff *skb, const struct tnl_ptk_info *tpi);
28 int (*err_handler)(struct sk_buff *skb, u32 info,
29 const struct tnl_ptk_info *tpi);
30 u8 priority;
31};
32
33int gre_cisco_register(struct gre_cisco_protocol *proto);
34int gre_cisco_unregister(struct gre_cisco_protocol *proto);
35
36int gre_offload_init(void);
37void gre_offload_exit(void);
38
39void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi,
40 int hdr_len);
41struct sk_buff *gre_handle_offloads(struct sk_buff *skb, bool gre_csum);
42
43static inline int ip_gre_calc_hlen(__be16 o_flags)
44{
45 int addend = 4;
46
47 if (o_flags&TUNNEL_CSUM)
48 addend += 4;
49 if (o_flags&TUNNEL_KEY)
50 addend += 4;
51 if (o_flags&TUNNEL_SEQ)
52 addend += 4;
53 return addend;
54}
55
25static inline __be16 gre_flags_to_tnl_flags(__be16 flags) 56static inline __be16 gre_flags_to_tnl_flags(__be16 flags)
26{ 57{
27 __be16 tflags = 0; 58 __be16 tflags = 0;