1 #ifndef __NET_IPIP_WRAPPER_H
2 #define __NET_IPIP_WRAPPER_H 1
4 #include <linux/version.h>
6 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
7 #define HAVE_NETDEV_QUEUE_STATS
10 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
12 #include <linux/if_tunnel.h>
15 /* Keep error state on tunnel for 30 sec */
16 #define IPTUNNEL_ERR_TIMEO (30*HZ)
20 struct ip_tunnel *next;
21 struct net_device *dev;
22 #ifndef HAVE_NETDEV_STATS
23 struct net_device_stats stat;
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 */
35 struct ip_tunnel_parm parms;
37 struct ip_tunnel_prl_entry *prl; /* potential router list */
38 unsigned int prl_count; /* # of entries in PRL */
41 /* ISATAP: default interval between RS in secondy */
42 #define IPTUNNEL_RS_DEFAULT_DELAY (900)
44 struct ip_tunnel_prl_entry
46 struct ip_tunnel_prl_entry *next;
49 unsigned long rs_delay;
50 struct timer_list rs_timer;
51 struct ip_tunnel *tunnel;
55 #ifdef HAVE_NETDEV_QUEUE_STATS
56 #define UPDATE_TX_STATS() \
57 txq->tx_bytes += pkt_len; \
60 #define UPDATE_TX_STATS() \
61 stats->tx_bytes += pkt_len; \
65 #define IPTUNNEL_XMIT() do { \
67 int pkt_len = skb->len - skb_transport_offset(skb); \
69 skb->ip_summed = CHECKSUM_NONE; \
70 ip_select_ident(iph, &rt->u.dst, NULL); \
72 err = ip_local_out(skb); \
73 if (likely(net_xmit_eval(err) == 0)) { \
77 stats->tx_aborted_errors++; \
82 #include_next <net/ipip.h>
83 #endif /* kernel < 2.6.32 */
85 #endif /* net/ipip.h wrapper */