ipv6 sit: 6rd (IPv6 Rapid Deployment) Support.
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / net / ipip.h
CommitLineData
1da177e4
LT
1#ifndef __NET_IPIP_H
2#define __NET_IPIP_H 1
3
4#include <linux/if_tunnel.h>
c439cb2e 5#include <net/ip.h>
1da177e4
LT
6
7/* Keep error state on tunnel for 30 sec */
8#define IPTUNNEL_ERR_TIMEO (30*HZ)
9
fa857afc
YH
10/* 6rd prefix/relay information */
11struct ip_tunnel_6rd_parm
12{
13 struct in6_addr prefix;
14 __be32 relay_prefix;
15 u16 prefixlen;
16 u16 relay_prefixlen;
17};
18
1da177e4
LT
19struct ip_tunnel
20{
21 struct ip_tunnel *next;
22 struct net_device *dev;
1da177e4 23
1da177e4
LT
24 int err_count; /* Number of arrived ICMP errors */
25 unsigned long err_time; /* Time when the last ICMP error arrived */
26
27 /* These four fields used only by GRE */
28 __u32 i_seqno; /* The last seen seqno */
29 __u32 o_seqno; /* The last output seqno */
30 int hlen; /* Precalculated GRE header length */
31 int mlink;
32
33 struct ip_tunnel_parm parms;
300aaeea 34
fa857afc
YH
35 /* for SIT */
36#ifdef CONFIG_IPV6_SIT_6RD
37 struct ip_tunnel_6rd_parm ip6rd;
38#endif
fadf6bf0 39 struct ip_tunnel_prl_entry *prl; /* potential router list */
300aaeea 40 unsigned int prl_count; /* # of entries in PRL */
fadf6bf0
TF
41};
42
43struct ip_tunnel_prl_entry
44{
45 struct ip_tunnel_prl_entry *next;
300aaeea
YH
46 __be32 addr;
47 u16 flags;
1da177e4
LT
48};
49
50#define IPTUNNEL_XMIT() do { \
51 int err; \
64194c31 52 int pkt_len = skb->len - skb_transport_offset(skb); \
1da177e4
LT
53 \
54 skb->ip_summed = CHECKSUM_NONE; \
1da177e4 55 ip_select_ident(iph, &rt->u.dst, NULL); \
1da177e4 56 \
c439cb2e 57 err = ip_local_out(skb); \
0bfbedb1
ED
58 if (likely(net_xmit_eval(err) == 0)) { \
59 txq->tx_bytes += pkt_len; \
60 txq->tx_packets++; \
1da177e4
LT
61 } else { \
62 stats->tx_errors++; \
63 stats->tx_aborted_errors++; \
64 } \
65} while (0)
66
1da177e4 67#endif