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,32)
8 #include <linux/if_tunnel.h>
11 /* Keep error state on tunnel for 30 sec */
12 #define IPTUNNEL_ERR_TIMEO (30*HZ)
16 struct ip_tunnel *next;
17 struct net_device *dev;
18 #ifndef HAVE_NETDEV_STATS
19 struct net_device_stats stat;
22 int err_count; /* Number of arrived ICMP errors */
23 unsigned long err_time; /* Time when the last ICMP error arrived */
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 */
31 struct ip_tunnel_parm parms;
33 struct ip_tunnel_prl_entry *prl; /* potential router list */
34 unsigned int prl_count; /* # of entries in PRL */
37 /* ISATAP: default interval between RS in secondy */
38 #define IPTUNNEL_RS_DEFAULT_DELAY (900)
40 struct ip_tunnel_prl_entry
42 struct ip_tunnel_prl_entry *next;
45 unsigned long rs_delay;
46 struct timer_list rs_timer;
47 struct ip_tunnel *tunnel;
51 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
52 #define IPTUNNEL_XMIT() do { \
54 int pkt_len = skb->len - skb_transport_offset(skb); \
56 skb->ip_summed = CHECKSUM_NONE; \
57 iph->tot_len = htons(skb->len); \
58 ip_select_ident(iph, &rt->u.dst, NULL); \
61 err = NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, rt->u.dst.dev, dst_output);\
62 if (err == NET_XMIT_SUCCESS || err == NET_XMIT_CN) { \
63 stats->tx_bytes += pkt_len; \
64 stats->tx_packets++; \
67 stats->tx_aborted_errors++; \
71 #define IPTUNNEL_XMIT() do { \
73 int pkt_len = skb->len; \
75 skb->ip_summed = CHECKSUM_NONE; \
76 ip_select_ident(iph, &rt->u.dst, NULL); \
78 err = ip_local_out(skb); \
79 if (net_xmit_eval(err) == 0) { \
80 stats->tx_bytes += pkt_len; \
81 stats->tx_packets++; \
84 stats->tx_aborted_errors++; \
90 #include_next <net/ipip.h>
91 #endif /* kernel < 2.6.32 */
93 #endif /* net/ipip.h wrapper */