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