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