]>
git.saurik.com Git - apple/xnu.git/blob - bsd/netinet/if_tun.h
567e9cb39812717eb55d6b11014db8d281644e3c
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
23 /* Copyright (c) 1997 Apple Computer, Inc. All Rights Reserved */
25 * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk>
26 * Nottingham University 1987.
28 * This source may be freely distributed, however I would be interested
29 * in any changes that are made.
31 * This driver takes packets off the IP i/f and hands them up to a
32 * user process to have it's wicked way with. This driver has it's
33 * roots in a similar driver written by Phil Cockcroft (formerly) at
34 * UCL. This driver is based much more on read/write/select mode of
39 #ifndef _NET_IF_TUN_H_
40 #define _NET_IF_TUN_H_
41 #include <sys/appleapiopts.h>
45 u_short tun_flags
; /* misc flags */
46 #define TUN_OPEN 0x0001
47 #define TUN_INITED 0x0002
48 #define TUN_RCOLL 0x0004
49 #define TUN_IASET 0x0008
50 #define TUN_DSTADDR 0x0010
51 #define TUN_RWAIT 0x0040
52 #define TUN_ASYNC 0x0080
53 #define TUN_NBIO 0x0100
55 #define TUN_READY (TUN_OPEN | TUN_INITED | TUN_IASET)
57 struct ifnet tun_if
; /* the interface */
58 int tun_pgrp
; /* the process group - if any */
59 struct selinfo tun_rsel
; /* read select */
60 struct selinfo tun_wsel
; /* write select (not used) */
68 /* ioctl's for get/set debug */
69 #define TUNSDEBUG _IOW('t', 90, int)
70 #define TUNGDEBUG _IOR('t', 89, int)
72 /* Maximum packet size */
75 #endif /* !_NET_IF_TUN_H_ */