00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __IF_TUN_H
00018 #define __IF_TUN_H
00019
00020
00021
00022
00023 #ifdef __KERNEL__
00024
00025 #ifdef TUN_DEBUG
00026 #define DBG if(tun->debug)printk
00027 #define DBG1 if(debug==2)printk
00028 #else
00029 #define DBG( a... )
00030 #define DBG1( a... )
00031 #endif
00032
00033 struct tun_struct {
00034 char *name;
00035 unsigned long flags;
00036 int attached;
00037 uid_t owner;
00038
00039 wait_queue_head_t read_wait;
00040 struct sk_buff_head readq;
00041
00042 struct net_device dev;
00043 struct net_device_stats stats;
00044
00045 struct fasync_struct *fasync;
00046
00047 #ifdef TUN_DEBUG
00048 int debug;
00049 #endif
00050 };
00051
00052 #ifndef MIN
00053 #define MIN(a,b) ( (a)<(b) ? (a):(b) )
00054 #endif
00055
00056 #endif
00057
00058
00059 #define TUN_READQ_SIZE 10
00060
00061
00062 #define TUN_TUN_DEV 0x0001
00063 #define TUN_TAP_DEV 0x0002
00064 #define TUN_TYPE_MASK 0x000f
00065
00066 #define TUN_FASYNC 0x0010
00067 #define TUN_NOCHECKSUM 0x0020
00068 #define TUN_NO_PI 0x0040
00069 #define TUN_ONE_QUEUE 0x0080
00070 #define TUN_PERSIST 0x0100
00071
00072
00073 #define TUNSETNOCSUM _IOW('T', 200, int)
00074 #define TUNSETDEBUG _IOW('T', 201, int)
00075 #define TUNSETIFF _IOW('T', 202, int)
00076 #define TUNSETPERSIST _IOW('T', 203, int)
00077 #define TUNSETOWNER _IOW('T', 204, int)
00078
00079
00080 #define IFF_TUN 0x0001
00081 #define IFF_TAP 0x0002
00082 #define IFF_NO_PI 0x1000
00083 #define IFF_ONE_QUEUE 0x2000
00084
00085 struct tun_pi {
00086 unsigned short flags;
00087 unsigned short proto;
00088 };
00089 #define TUN_PKT_STRIP 0x0001
00090
00091 #endif