aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/gre.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/net/gre.h b/include/net/gre.h
index 9f03a390c826..c6ea0c72c605 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,29 @@ 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
36static inline int ip_gre_calc_hlen(__be16 o_flags)
37{
38 int addend = 4;
39
40 if (o_flags&TUNNEL_CSUM)
41 addend += 4;
42 if (o_flags&TUNNEL_KEY)
43 addend += 4;
44 if (o_flags&TUNNEL_SEQ)
45 addend += 4;
46 return addend;
47}
48
25static inline __be16 gre_flags_to_tnl_flags(__be16 flags) 49static inline __be16 gre_flags_to_tnl_flags(__be16 flags)
26{ 50{
27 __be16 tflags = 0; 51 __be16 tflags = 0;