| 1 | #ifndef __NET_IPIP_H
|
| 2 | #define __NET_IPIP_H 1
|
| 3 |
|
| 4 | #include <linux/if_tunnel.h>
|
| 5 |
|
| 6 |
|
| 7 | #define IPTUNNEL_ERR_TIMEO (30*HZ)
|
| 8 |
|
| 9 | struct ip_tunnel
|
| 10 | {
|
| 11 | struct ip_tunnel *next;
|
| 12 | struct net_device *dev;
|
| 13 | struct net_device_stats stat;
|
| 14 |
|
| 15 | int recursion;
|
| 16 | int err_count;
|
| 17 | unsigned long err_time;
|
| 18 |
|
| 19 |
|
| 20 | __u32 i_seqno;
|
| 21 | __u32 o_seqno;
|
| 22 | int hlen;
|
| 23 | int mlink;
|
| 24 |
|
| 25 | struct ip_tunnel_parm parms;
|
| 26 | };
|
| 27 |
|
| 28 | #define IPTUNNEL_XMIT() do { \
|
| 29 | int err; \
|
| 30 | int pkt_len = skb->len; \
|
| 31 | \
|
| 32 | skb->ip_summed = CHECKSUM_NONE; \
|
| 33 | iph->tot_len = htons(skb->len); \
|
| 34 | ip_select_ident(iph, &rt->u.dst, NULL); \
|
| 35 | ip_send_check(iph); \
|
| 36 | \
|
| 37 | err = NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, rt->u.dst.dev, dst_output);\
|
| 38 | if (net_xmit_eval(err) == 0) { \
|
| 39 | stats->tx_bytes += pkt_len; \
|
| 40 | stats->tx_packets++; \
|
| 41 | } else { \
|
| 42 | stats->tx_errors++; \
|
| 43 | stats->tx_aborted_errors++; \
|
| 44 | } \
|
| 45 | } while (0)
|
| 46 |
|
| 47 | #endif
|