#ifndef _NET_IF_TUN_H_
#define _NET_IF_TUN_H_
#include <sys/ioccom.h>
#ifdef _KERNEL
#include <sys/types.h>
#include <sys/condvar.h>
#include <sys/mutex.h>
#include <sys/queue.h>
#include <sys/select.h>
#include <net/if.h>
struct tun_softc {
struct ifnet tun_if;
u_short tun_flags;
#define TUN_OPEN 0x0001
#define TUN_INITED 0x0002
#define TUN_RCOLL 0x0004
#define TUN_IASET 0x0008
#define TUN_DSTADDR 0x0010
#define TUN_UNUSED0 0x0040
#define TUN_ASYNC 0x0080
#define TUN_NBIO 0x0100
#define TUN_PREPADDR 0x0200
#define TUN_IFHEAD 0x0400
#define TUN_READY (TUN_OPEN | TUN_INITED | TUN_IASET)
pid_t tun_pgid;
struct selinfo tun_rsel;
struct selinfo tun_wsel;
int tun_unit;
kmutex_t tun_lock;
kcondvar_t tun_cv;
LIST_ENTRY(tun_softc) tun_list;
void *tun_osih;
void *tun_isih;
};
#endif
#define TUNMTU 1500
#define TUNSDEBUG _IOW('t', 90, int)
#define TUNGDEBUG _IOR('t', 89, int)
#define TUNSIFMODE _IOW('t', 88, int)
#define TUNSLMODE _IOW('t', 87, int)
#define TUNSIFHEAD _IOW('t', 66, int)
#define TUNGIFHEAD _IOR('t', 65, int)
#endif