]> git.saurik.com Git - apple/xnu.git/blame - bsd/netinet/if_tun.h
xnu-792.6.56.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 *
ff6e181a
A
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
11 * file.
1c79356b 12 *
ff6e181a
A
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
1c79356b
A
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
ff6e181a
A
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.
1c79356b
A
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/* Copyright (c) 1997 Apple Computer, Inc. All Rights Reserved */
24/*
25 * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk>
26 * Nottingham University 1987.
27 *
28 * This source may be freely distributed, however I would be interested
29 * in any changes that are made.
30 *
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
35 * operation though.
36 *
37 */
38
39#ifndef _NET_IF_TUN_H_
40#define _NET_IF_TUN_H_
9bccf70c 41#include <sys/appleapiopts.h>
1c79356b 42
91447636 43#ifdef KERNEL_PRIVATE
1c79356b
A
44struct tun_softc {
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
54
55#define TUN_READY (TUN_OPEN | TUN_INITED | TUN_IASET)
56
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) */
61#if NBPFILTER > 0
62 caddr_t tun_bpf;
63#endif
64};
65
91447636 66#endif KERNEL_PRIVATE
1c79356b
A
67
68/* ioctl's for get/set debug */
69#define TUNSDEBUG _IOW('t', 90, int)
70#define TUNGDEBUG _IOR('t', 89, int)
71
91447636
A
72/* Maximum packet size */
73#define TUNMTU 1500
74
1c79356b 75#endif /* !_NET_IF_TUN_H_ */