]>
Commit | Line | Data |
---|---|---|
1c79356b A |
1 | /* |
2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
e5568f75 A |
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. | |
1c79356b | 11 | * |
e5568f75 A |
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 | |
1c79356b A |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
e5568f75 A |
16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the |
17 | * License for the specific language governing rights and limitations | |
18 | * under the License. | |
1c79356b A |
19 | * |
20 | * @APPLE_LICENSE_HEADER_END@ | |
21 | */ | |
22 | /* Copyright (c) 1997 Apple Computer, Inc. All Rights Reserved */ | |
23 | /* | |
24 | * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk> | |
25 | * Nottingham University 1987. | |
26 | * | |
27 | * This source may be freely distributed, however I would be interested | |
28 | * in any changes that are made. | |
29 | * | |
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 | |
34 | * operation though. | |
35 | * | |
36 | */ | |
37 | ||
38 | #ifndef _NET_IF_TUN_H_ | |
39 | #define _NET_IF_TUN_H_ | |
9bccf70c | 40 | #include <sys/appleapiopts.h> |
1c79356b | 41 | |
9bccf70c | 42 | #ifdef __APPLE_API_PRIVATE |
1c79356b A |
43 | struct tun_softc { |
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 | |
53 | ||
54 | #define TUN_READY (TUN_OPEN | TUN_INITED | TUN_IASET) | |
55 | ||
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) */ | |
60 | #if NBPFILTER > 0 | |
61 | caddr_t tun_bpf; | |
62 | #endif | |
63 | }; | |
9bccf70c | 64 | #endif /* __APPLE_API_PRIVATE */ |
1c79356b A |
65 | |
66 | /* Maximum packet size */ | |
67 | #define TUNMTU 1500 | |
68 | ||
69 | /* ioctl's for get/set debug */ | |
70 | #define TUNSDEBUG _IOW('t', 90, int) | |
71 | #define TUNGDEBUG _IOR('t', 89, int) | |
72 | ||
73 | #endif /* !_NET_IF_TUN_H_ */ |