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