1 1.1 deraadt /* 2 1.2 deraadt * Copyright (c) 1988, Julian Onions <jpo (at) cs.nott.ac.uk> 3 1.2 deraadt * Nottingham University 1987. 4 1.1 deraadt * 5 1.1 deraadt * This source may be freely distributed, however I would be interested 6 1.1 deraadt * in any changes that are made. 7 1.1 deraadt * 8 1.2 deraadt * This driver takes packets off the IP i/f and hands them up to a 9 1.2 deraadt * user process to have it's wicked way with. This driver has it's 10 1.2 deraadt * roots in a similar driver written by Phil Cockcroft (formerly) at 11 1.2 deraadt * UCL. This driver is based much more on read/write/select mode of 12 1.2 deraadt * operation though. 13 1.2 deraadt * 14 1.1 deraadt * from: $Header: if_tnreg.h,v 1.1.2.1 1992/07/16 22:39:16 friedl Exp 15 1.4 deraadt * $Id: if_tun.h,v 1.4 1994/05/03 23:02:09 deraadt Exp $ 16 1.1 deraadt */ 17 1.1 deraadt 18 1.1 deraadt #ifndef _NET_IF_TUN_H_ 19 1.1 deraadt #define _NET_IF_TUN_H_ 20 1.1 deraadt 21 1.1 deraadt struct tun_softc { 22 1.1 deraadt u_short tun_flags; /* misc flags */ 23 1.1 deraadt #define TUN_OPEN 0x0001 24 1.1 deraadt #define TUN_INITED 0x0002 25 1.1 deraadt #define TUN_RCOLL 0x0004 26 1.1 deraadt #define TUN_IASET 0x0008 27 1.1 deraadt #define TUN_DSTADDR 0x0010 28 1.1 deraadt #define TUN_RWAIT 0x0040 29 1.1 deraadt #define TUN_ASYNC 0x0080 30 1.1 deraadt #define TUN_NBIO 0x0100 31 1.4 deraadt 32 1.4 deraadt #define TUN_READY (TUN_OPEN | TUN_INITED | TUN_IASET) 33 1.4 deraadt 34 1.1 deraadt struct ifnet tun_if; /* the interface */ 35 1.1 deraadt int tun_pgrp; /* the process group - if any */ 36 1.1 deraadt struct selinfo tun_rsel; /* read select */ 37 1.1 deraadt struct selinfo tun_wsel; /* write select (not used) */ 38 1.2 deraadt #if NBPFILTER > 0 39 1.2 deraadt caddr_t tun_bpf; 40 1.2 deraadt #endif 41 1.1 deraadt }; 42 1.1 deraadt 43 1.1 deraadt /* Maximum packet size */ 44 1.3 deraadt #define TUNMTU 1500 45 1.1 deraadt 46 1.1 deraadt /* ioctl's for get/set debug */ 47 1.1 deraadt #define TUNSDEBUG _IOW('t', 90, int) 48 1.1 deraadt #define TUNGDEBUG _IOR('t', 89, int) 49 1.1 deraadt 50 1.1 deraadt #endif /* !_NET_IF_TUN_H_ */ 51