diff options
author | xeb@mail.ru <xeb@mail.ru> | 2012-08-09 20:51:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-14 17:28:32 -0400 |
commit | c12b395a46646bab69089ce7016ac78177f6001f (patch) | |
tree | ec3bbef6602f42853b3dad5ae36c7d3872fa56eb /include/net/ip6_tunnel.h | |
parent | b7bc2a5b5bd99b216c3e5fe68c7f45c684ab5745 (diff) |
gre: Support GRE over IPv6
GRE over IPv6 implementation.
Signed-off-by: Dmitry Kozlov <xeb@mail.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip6_tunnel.h')
-rw-r--r-- | include/net/ip6_tunnel.h | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h index 358fb86f57eb..e03047f7090b 100644 --- a/include/net/ip6_tunnel.h +++ b/include/net/ip6_tunnel.h | |||
@@ -5,6 +5,8 @@ | |||
5 | #include <linux/netdevice.h> | 5 | #include <linux/netdevice.h> |
6 | #include <linux/ip6_tunnel.h> | 6 | #include <linux/ip6_tunnel.h> |
7 | 7 | ||
8 | #define IP6TUNNEL_ERR_TIMEO (30*HZ) | ||
9 | |||
8 | /* capable of sending packets */ | 10 | /* capable of sending packets */ |
9 | #define IP6_TNL_F_CAP_XMIT 0x10000 | 11 | #define IP6_TNL_F_CAP_XMIT 0x10000 |
10 | /* capable of receiving packets */ | 12 | /* capable of receiving packets */ |
@@ -12,15 +14,40 @@ | |||
12 | /* determine capability on a per-packet basis */ | 14 | /* determine capability on a per-packet basis */ |
13 | #define IP6_TNL_F_CAP_PER_PACKET 0x40000 | 15 | #define IP6_TNL_F_CAP_PER_PACKET 0x40000 |
14 | 16 | ||
15 | /* IPv6 tunnel */ | 17 | struct __ip6_tnl_parm { |
18 | char name[IFNAMSIZ]; /* name of tunnel device */ | ||
19 | int link; /* ifindex of underlying L2 interface */ | ||
20 | __u8 proto; /* tunnel protocol */ | ||
21 | __u8 encap_limit; /* encapsulation limit for tunnel */ | ||
22 | __u8 hop_limit; /* hop limit for tunnel */ | ||
23 | __be32 flowinfo; /* traffic class and flowlabel for tunnel */ | ||
24 | __u32 flags; /* tunnel flags */ | ||
25 | struct in6_addr laddr; /* local tunnel end-point address */ | ||
26 | struct in6_addr raddr; /* remote tunnel end-point address */ | ||
27 | |||
28 | __be16 i_flags; | ||
29 | __be16 o_flags; | ||
30 | __be32 i_key; | ||
31 | __be32 o_key; | ||
32 | }; | ||
16 | 33 | ||
34 | /* IPv6 tunnel */ | ||
17 | struct ip6_tnl { | 35 | struct ip6_tnl { |
18 | struct ip6_tnl __rcu *next; /* next tunnel in list */ | 36 | struct ip6_tnl __rcu *next; /* next tunnel in list */ |
19 | struct net_device *dev; /* virtual device associated with tunnel */ | 37 | struct net_device *dev; /* virtual device associated with tunnel */ |
20 | struct ip6_tnl_parm parms; /* tunnel configuration parameters */ | 38 | struct __ip6_tnl_parm parms; /* tunnel configuration parameters */ |
21 | struct flowi fl; /* flowi template for xmit */ | 39 | struct flowi fl; /* flowi template for xmit */ |
22 | struct dst_entry *dst_cache; /* cached dst */ | 40 | struct dst_entry *dst_cache; /* cached dst */ |
23 | u32 dst_cookie; | 41 | u32 dst_cookie; |
42 | |||
43 | int err_count; | ||
44 | unsigned long err_time; | ||
45 | |||
46 | /* These fields used only by GRE */ | ||
47 | __u32 i_seqno; /* The last seen seqno */ | ||
48 | __u32 o_seqno; /* The last output seqno */ | ||
49 | int hlen; /* Precalculated GRE header length */ | ||
50 | int mlink; | ||
24 | }; | 51 | }; |
25 | 52 | ||
26 | /* Tunnel encapsulation limit destination sub-option */ | 53 | /* Tunnel encapsulation limit destination sub-option */ |
@@ -31,4 +58,14 @@ struct ipv6_tlv_tnl_enc_lim { | |||
31 | __u8 encap_limit; /* tunnel encapsulation limit */ | 58 | __u8 encap_limit; /* tunnel encapsulation limit */ |
32 | } __packed; | 59 | } __packed; |
33 | 60 | ||
61 | struct dst_entry *ip6_tnl_dst_check(struct ip6_tnl *t); | ||
62 | void ip6_tnl_dst_reset(struct ip6_tnl *t); | ||
63 | void ip6_tnl_dst_store(struct ip6_tnl *t, struct dst_entry *dst); | ||
64 | int ip6_tnl_rcv_ctl(struct ip6_tnl *t, const struct in6_addr *laddr, | ||
65 | const struct in6_addr *raddr); | ||
66 | int ip6_tnl_xmit_ctl(struct ip6_tnl *t); | ||
67 | __u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw); | ||
68 | __u32 ip6_tnl_get_cap(struct ip6_tnl *t, const struct in6_addr *laddr, | ||
69 | const struct in6_addr *raddr); | ||
70 | |||
34 | #endif | 71 | #endif |