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