]> bbs.cooldavid.org Git - net-next-2.6.git/blame - include/net/ipip.h
8139cp: fix checksum broken
[net-next-2.6.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 10/* 6rd prefix/relay information */
fd2c3ef7 11struct ip_tunnel_6rd_parm {
fa857afc
YH
12 struct in6_addr prefix;
13 __be32 relay_prefix;
14 u16 prefixlen;
15 u16 relay_prefixlen;
16};
17
fd2c3ef7 18struct ip_tunnel {
6f0bcf15 19 struct ip_tunnel __rcu *next;
1da177e4 20 struct net_device *dev;
1da177e4 21
1da177e4
LT
22 int err_count; /* Number of arrived ICMP errors */
23 unsigned long err_time; /* Time when the last ICMP error arrived */
24
25 /* These four fields used only by GRE */
26 __u32 i_seqno; /* The last seen seqno */
27 __u32 o_seqno; /* The last output seqno */
28 int hlen; /* Precalculated GRE header length */
29 int mlink;
30
31 struct ip_tunnel_parm parms;
300aaeea 32
fa857afc
YH
33 /* for SIT */
34#ifdef CONFIG_IPV6_SIT_6RD
35 struct ip_tunnel_6rd_parm ip6rd;
36#endif
b33eab08 37 struct ip_tunnel_prl_entry __rcu *prl; /* potential router list */
300aaeea 38 unsigned int prl_count; /* # of entries in PRL */
fadf6bf0
TF
39};
40
fd2c3ef7 41struct ip_tunnel_prl_entry {
b33eab08 42 struct ip_tunnel_prl_entry __rcu *next;
300aaeea
YH
43 __be32 addr;
44 u16 flags;
ef9a9d11 45 struct rcu_head rcu_head;
1da177e4
LT
46};
47
290b895e 48#define __IPTUNNEL_XMIT(stats1, stats2) do { \
1da177e4 49 int err; \
64194c31 50 int pkt_len = skb->len - skb_transport_offset(skb); \
1da177e4
LT
51 \
52 skb->ip_summed = CHECKSUM_NONE; \
d8d1f30b 53 ip_select_ident(iph, &rt->dst, NULL); \
1da177e4 54 \
c439cb2e 55 err = ip_local_out(skb); \
0bfbedb1 56 if (likely(net_xmit_eval(err) == 0)) { \
290b895e
ED
57 (stats1)->tx_bytes += pkt_len; \
58 (stats1)->tx_packets++; \
1da177e4 59 } else { \
290b895e
ED
60 (stats2)->tx_errors++; \
61 (stats2)->tx_aborted_errors++; \
1da177e4
LT
62 } \
63} while (0)
64
290b895e
ED
65#define IPTUNNEL_XMIT() __IPTUNNEL_XMIT(txq, stats)
66
1da177e4 67#endif