aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/tun.c33
-rw-r--r--include/linux/Kbuild2
-rw-r--r--include/linux/if_tun.h39
3 files changed, 34 insertions, 40 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 7b816a032957..970ec4793442 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -67,9 +67,42 @@
67#include <asm/system.h> 67#include <asm/system.h>
68#include <asm/uaccess.h> 68#include <asm/uaccess.h>
69 69
70/* Uncomment to enable debugging */
71/* #define TUN_DEBUG 1 */
72
70#ifdef TUN_DEBUG 73#ifdef TUN_DEBUG
71static int debug; 74static int debug;
75
76#define DBG if(tun->debug)printk
77#define DBG1 if(debug==2)printk
78#else
79#define DBG( a... )
80#define DBG1( a... )
81#endif
82
83struct tun_struct {
84 struct list_head list;
85 unsigned long flags;
86 int attached;
87 uid_t owner;
88 gid_t group;
89
90 wait_queue_head_t read_wait;
91 struct sk_buff_head readq;
92
93 struct net_device *dev;
94
95 struct fasync_struct *fasync;
96
97 unsigned long if_flags;
98 u8 dev_addr[ETH_ALEN];
99 u32 chr_filter[2];
100 u32 net_filter[2];
101
102#ifdef TUN_DEBUG
103 int debug;
72#endif 104#endif
105};
73 106
74/* Network device part of the driver */ 107/* Network device part of the driver */
75 108
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 9cdd12a9e843..cedbbd806bf6 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -86,6 +86,7 @@ header-y += if_plip.h
86header-y += if_ppp.h 86header-y += if_ppp.h
87header-y += if_slip.h 87header-y += if_slip.h
88header-y += if_strip.h 88header-y += if_strip.h
89header-y += if_tun.h
89header-y += if_tunnel.h 90header-y += if_tunnel.h
90header-y += in6.h 91header-y += in6.h
91header-y += in_route.h 92header-y += in_route.h
@@ -229,7 +230,6 @@ unifdef-y += if_link.h
229unifdef-y += if_pppol2tp.h 230unifdef-y += if_pppol2tp.h
230unifdef-y += if_pppox.h 231unifdef-y += if_pppox.h
231unifdef-y += if_tr.h 232unifdef-y += if_tr.h
232unifdef-y += if_tun.h
233unifdef-y += if_vlan.h 233unifdef-y += if_vlan.h
234unifdef-y += if_wanpipe.h 234unifdef-y += if_wanpipe.h
235unifdef-y += igmp.h 235unifdef-y += igmp.h
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index 72f1c5f47be3..8c71fe2fb1f5 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -18,47 +18,8 @@
18#ifndef __IF_TUN_H 18#ifndef __IF_TUN_H
19#define __IF_TUN_H 19#define __IF_TUN_H
20 20
21/* Uncomment to enable debugging */
22/* #define TUN_DEBUG 1 */
23
24#include <linux/types.h> 21#include <linux/types.h>
25 22
26#ifdef __KERNEL__
27
28#ifdef TUN_DEBUG
29#define DBG if(tun->debug)printk
30#define DBG1 if(debug==2)printk
31#else
32#define DBG( a... )
33#define DBG1( a... )
34#endif
35
36struct tun_struct {
37 struct list_head list;
38 unsigned long flags;
39 int attached;
40 uid_t owner;
41 gid_t group;
42
43 wait_queue_head_t read_wait;
44 struct sk_buff_head readq;
45
46 struct net_device *dev;
47
48 struct fasync_struct *fasync;
49
50 unsigned long if_flags;
51 u8 dev_addr[ETH_ALEN];
52 u32 chr_filter[2];
53 u32 net_filter[2];
54
55#ifdef TUN_DEBUG
56 int debug;
57#endif
58};
59
60#endif /* __KERNEL__ */
61
62/* Read queue size */ 23/* Read queue size */
63#define TUN_READQ_SIZE 500 24#define TUN_READQ_SIZE 500
64 25