[IPV4/6]: Add ip{6}_local_out
[tomato.git] / release / src-rt / linux / linux-2.6 / include / net / ipip.h
bloba7519544e71099e06613c5f4a79269443a29e64b
1 #ifndef __NET_IPIP_H
2 #define __NET_IPIP_H 1
4 #include <linux/if_tunnel.h>
5 #include <net/ip.h>
7 /* Keep error state on tunnel for 30 sec */
8 #define IPTUNNEL_ERR_TIMEO (30*HZ)
10 /* 6rd prefix/relay information */
11 struct ip_tunnel_6rd_parm
13 struct in6_addr prefix;
14 __be32 relay_prefix;
15 u16 prefixlen;
16 u16 relay_prefixlen;
19 struct ip_tunnel
21 struct ip_tunnel *next;
22 struct net_device *dev;
23 struct net_device_stats stat;
25 int recursion; /* Depth of hard_start_xmit recursion */
26 int err_count; /* Number of arrived ICMP errors */
27 unsigned long err_time; /* Time when the last ICMP error arrived */
29 /* These four fields used only by GRE */
30 __u32 i_seqno; /* The last seen seqno */
31 __u32 o_seqno; /* The last output seqno */
32 int hlen; /* Precalculated GRE header length */
33 int mlink;
35 struct ip_tunnel_parm parms;
37 /* for SIT */
38 #ifdef CONFIG_IPV6_SIT_6RD
39 struct ip_tunnel_6rd_parm ip6rd;
40 #endif
43 #define IPTUNNEL_XMIT() do { \
44 int err; \
45 int pkt_len = skb->len; \
47 skb->ip_summed = CHECKSUM_NONE; \
48 ip_select_ident(iph, &rt->u.dst, NULL); \
50 err = ip_local_out(skb); \
51 if (net_xmit_eval(err) == 0) { \
52 stats->tx_bytes += pkt_len; \
53 stats->tx_packets++; \
54 } else { \
55 stats->tx_errors++; \
56 stats->tx_aborted_errors++; \
57 } \
58 } while (0)
60 #endif