Upgrade to OpenVPN 2.1.0
[tomato.git] / release / src / router / openvpn / tap-win32 / tmp / common.h
blobb7c115762ce35bcbe078b1095d1ea2a449cf4d69
1 /*
2 * TAP-Win32/TAP-Win64 -- A kernel driver to provide virtual tap
3 * device functionality on Windows.
5 * This code was inspired by the CIPE-Win32 driver by Damion K. Wilson.
7 * This source code is Copyright (C) 2002-2009 OpenVPN Technologies, Inc.,
8 * and is released under the GPL version 2 (see below), however due
9 * to the extra costs of supporting Windows Vista, OpenVPN Solutions
10 * LLC reserves the right to change the terms of the TAP-Win32/TAP-Win64
11 * license for versions 9.1 and higher prior to the official release of
12 * OpenVPN 2.1.
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.
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.
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
29 //===============================================
30 // This file is included both by OpenVPN and
31 // the TAP-Win32 driver and contains definitions
32 // common to both.
33 //===============================================
35 #if defined(HAVE_CONFIG_H)
36 #include "config.h"
37 #else
38 #if defined(_MSC_VER) && !defined(TAP_DRIVER_MAJOR_VERSION)
39 #include "config-win32.h"
40 #else
41 #include "../config.h"
42 #endif
43 #endif
45 //=============
46 // TAP IOCTLs
47 //=============
49 #define TAP_CONTROL_CODE(request,method) \
50 CTL_CODE (FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS)
52 // Present in 8.1
54 #define TAP_IOCTL_GET_MAC TAP_CONTROL_CODE (1, METHOD_BUFFERED)
55 #define TAP_IOCTL_GET_VERSION TAP_CONTROL_CODE (2, METHOD_BUFFERED)
56 #define TAP_IOCTL_GET_MTU TAP_CONTROL_CODE (3, METHOD_BUFFERED)
57 #define TAP_IOCTL_GET_INFO TAP_CONTROL_CODE (4, METHOD_BUFFERED)
58 #define TAP_IOCTL_CONFIG_POINT_TO_POINT TAP_CONTROL_CODE (5, METHOD_BUFFERED)
59 #define TAP_IOCTL_SET_MEDIA_STATUS TAP_CONTROL_CODE (6, METHOD_BUFFERED)
60 #define TAP_IOCTL_CONFIG_DHCP_MASQ TAP_CONTROL_CODE (7, METHOD_BUFFERED)
61 #define TAP_IOCTL_GET_LOG_LINE TAP_CONTROL_CODE (8, METHOD_BUFFERED)
62 #define TAP_IOCTL_CONFIG_DHCP_SET_OPT TAP_CONTROL_CODE (9, METHOD_BUFFERED)
64 // Added in 8.2
66 /* obsoletes TAP_IOCTL_CONFIG_POINT_TO_POINT */
67 #define TAP_IOCTL_CONFIG_TUN TAP_CONTROL_CODE (10, METHOD_BUFFERED)
69 //=================
70 // Registry keys
71 //=================
73 #define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
75 #define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
77 //======================
78 // Filesystem prefixes
79 //======================
81 #define USERMODEDEVICEDIR "\\\\.\\Global\\"
82 #define SYSDEVICEDIR "\\Device\\"
83 #define USERDEVICEDIR "\\DosDevices\\Global\\"
84 #define TAPSUFFIX ".tap"
86 //=========================================================
87 // TAP_COMPONENT_ID -- This string defines the TAP driver
88 // type -- different component IDs can reside in the system
89 // simultaneously.
90 //=========================================================
92 #define TAP_COMPONENT_ID TAP_ID