Imported Upstream version 0.3.2
[anytun.git] / src / win32 / common.h
1 /*
2  *  TAP-Win32 -- A kernel driver to provide virtual tap device functionality
3  *               on Windows.  Originally derived from the CIPE-Win32
4  *               project by Damion K. Wilson, with extensive modifications by
5  *               James Yonan.
6  *
7  *  All source code which derives from the CIPE-Win32 project is
8  *  Copyright (C) Damion K. Wilson, 2003, and is released under the
9  *  GPL version 2 (see below).
10  *
11  *  All other source code is Copyright (C) 2002-2005 OpenVPN Solutions LLC,
12  *  and is released under the GPL version 2 (see below).
13  *
14  *  This program is free software; you can redistribute it and/or modify
15  *  it under the terms of the GNU General Public License version 2
16  *  as published by the Free Software Foundation.
17  *
18  *  This program is distributed in the hope that it will be useful,
19  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  *  GNU General Public License for more details.
22  *
23  *  You should have received a copy of the GNU General Public License
24  *  along with this program (see the file COPYING included with this
25  *  distribution); if not, write to the Free Software Foundation, Inc.,
26  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27  */
28 #ifndef ANYTUN_win32_common_h_INCLUDED
29 #define ANYTUN_win32_common_h_INCLUDED
30
31 //===============================================
32 // This file is included both by OpenVPN and
33 // the TAP-Win32 driver and contains definitions
34 // common to both.
35 //===============================================
36
37 //=============
38 // TAP IOCTLs
39 //=============
40
41 #define TAP_CONTROL_CODE(request,method) \
42   CTL_CODE (FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS)
43
44 // Present in 8.1
45
46 #define TAP_IOCTL_GET_MAC               TAP_CONTROL_CODE (1, METHOD_BUFFERED)
47 #define TAP_IOCTL_GET_VERSION           TAP_CONTROL_CODE (2, METHOD_BUFFERED)
48 #define TAP_IOCTL_GET_MTU               TAP_CONTROL_CODE (3, METHOD_BUFFERED)
49 #define TAP_IOCTL_GET_INFO              TAP_CONTROL_CODE (4, METHOD_BUFFERED)
50 #define TAP_IOCTL_CONFIG_POINT_TO_POINT TAP_CONTROL_CODE (5, METHOD_BUFFERED)
51 #define TAP_IOCTL_SET_MEDIA_STATUS      TAP_CONTROL_CODE (6, METHOD_BUFFERED)
52 #define TAP_IOCTL_CONFIG_DHCP_MASQ      TAP_CONTROL_CODE (7, METHOD_BUFFERED)
53 #define TAP_IOCTL_GET_LOG_LINE          TAP_CONTROL_CODE (8, METHOD_BUFFERED)
54 #define TAP_IOCTL_CONFIG_DHCP_SET_OPT   TAP_CONTROL_CODE (9, METHOD_BUFFERED)
55
56 // Added in 8.2
57
58 /* obsoletes TAP_IOCTL_CONFIG_POINT_TO_POINT */
59 #define TAP_IOCTL_CONFIG_TUN            TAP_CONTROL_CODE (10, METHOD_BUFFERED)
60
61 //=================
62 // Registry keys
63 //=================
64
65 #define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
66
67 #define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
68
69 //======================
70 // Filesystem prefixes
71 //======================
72
73 #define USERMODEDEVICEDIR "\\\\.\\Global\\"
74 #define SYSDEVICEDIR      "\\Device\\"
75 #define USERDEVICEDIR     "\\DosDevices\\Global\\"
76 #define TAPSUFFIX         ".tap"
77
78 //=========================================================
79 // TAP_COMPONENT_ID -- This string defines the TAP driver
80 // type -- different component IDs can reside in the system
81 // simultaneously.
82 //=========================================================
83
84 #define TAP_COMPONENT_ID "tap0901"
85
86 #endif