├── README.en.md ├── TunHelperAPI ├── .keep ├── TunHandler.cpp ├── Win32Helper.cpp ├── TunhelperAPI.def ├── stdafx.cpp ├── targetver.h ├── Win32Helper.h ├── stdafx.h ├── dllmain.cpp ├── TunHandler.h ├── TunHelperAPI.vcxproj.filters ├── ReadMe.txt ├── tap-windows.h └── TunHelperAPI.vcxproj ├── TunHelperAPITest ├── .keep ├── Proto.h ├── TunHelperAPI.lib ├── TunHelperAPITest.cpp ├── stdafx.cpp ├── targetver.h ├── stdafx.h ├── TunHelperAPITest.vcxproj.filters ├── ReadMe.txt └── TunHelperAPITest.vcxproj ├── tap-windows-9.9.2 ├── amd64 │ ├── tap0901.cat │ ├── tap0901.sys │ ├── tapinstall.exe │ └── OemWin2k.inf ├── i386 │ ├── tap0901.cat │ ├── tap0901.sys │ ├── tapinstall.exe │ └── OemWin2k.inf ├── include │ └── tap-windows.h └── license.txt ├── README.md ├── .gitignore ├── Public ├── Log.cpp └── Log.h ├── LICENSE └── TunHelperAPI.sln /README.en.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /TunHelperAPI/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /TunHelperAPITest/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /TunHelperAPITest/Proto.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pingbu/TunHelpAPI/HEAD/TunHelperAPITest/Proto.h -------------------------------------------------------------------------------- /TunHelperAPI/TunHandler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pingbu/TunHelpAPI/HEAD/TunHelperAPI/TunHandler.cpp -------------------------------------------------------------------------------- /TunHelperAPI/Win32Helper.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pingbu/TunHelpAPI/HEAD/TunHelperAPI/Win32Helper.cpp -------------------------------------------------------------------------------- /TunHelperAPITest/TunHelperAPI.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pingbu/TunHelpAPI/HEAD/TunHelperAPITest/TunHelperAPI.lib -------------------------------------------------------------------------------- /tap-windows-9.9.2/amd64/tap0901.cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pingbu/TunHelpAPI/HEAD/tap-windows-9.9.2/amd64/tap0901.cat -------------------------------------------------------------------------------- /tap-windows-9.9.2/amd64/tap0901.sys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pingbu/TunHelpAPI/HEAD/tap-windows-9.9.2/amd64/tap0901.sys -------------------------------------------------------------------------------- /tap-windows-9.9.2/i386/tap0901.cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pingbu/TunHelpAPI/HEAD/tap-windows-9.9.2/i386/tap0901.cat -------------------------------------------------------------------------------- /tap-windows-9.9.2/i386/tap0901.sys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pingbu/TunHelpAPI/HEAD/tap-windows-9.9.2/i386/tap0901.sys -------------------------------------------------------------------------------- /TunHelperAPITest/TunHelperAPITest.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pingbu/TunHelpAPI/HEAD/TunHelperAPITest/TunHelperAPITest.cpp -------------------------------------------------------------------------------- /tap-windows-9.9.2/i386/tapinstall.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pingbu/TunHelpAPI/HEAD/tap-windows-9.9.2/i386/tapinstall.exe -------------------------------------------------------------------------------- /tap-windows-9.9.2/amd64/tapinstall.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pingbu/TunHelpAPI/HEAD/tap-windows-9.9.2/amd64/tapinstall.exe -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TunHelperAPI 2 | 3 | ## 项目简介 4 | 在Windows环境下封装了对虚拟网卡TUN/TAP驱动程序的操作函数,可实现虚拟网卡的激活、设置IP、设置路由、读写数据等操作。 5 | 6 | ## 运行环境 7 | Windows平台运行,通过VS2012编译。代码中包含linux环境的实现,通过编译选项控制,简单修改应该就可以在linux下编译。 8 | 9 | ## 项目文档 10 | 11 | 请移步wiki页面查看: -------------------------------------------------------------------------------- /TunHelperAPI/TunhelperAPI.def: -------------------------------------------------------------------------------- 1 | LIBRARY "TunHelperAPI.DLL" 2 | 3 | EXPORTS 4 | OpenTun 5 | CloseTun 6 | GetTunMTU 7 | GetTunFD 8 | ClearIP 9 | AddTunIpaddr 10 | AddTunRoute 11 | DelTunRoute 12 | DelTunRouteAll 13 | ConfigDHCP 14 | ConfigTun 15 | WinCreateEvent 16 | ReadTun 17 | WriteTun -------------------------------------------------------------------------------- /TunHelperAPI/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // TunHelperAPI.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /TunHelperAPITest/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // TunHelperAPITest.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /TunHelperAPI/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /TunHelperAPITest/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /TunHelperAPITest/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | -------------------------------------------------------------------------------- /TunHelperAPI/Win32Helper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C"{ 5 | #endif 6 | 7 | int GetAdapterGUID(const char *AdapterName, char *pBuf, int nLen); 8 | int MyGetAdapterIndex(const char *AdapterName); 9 | unsigned long GetMetric1(int Index); 10 | int ClearIP(const char* AdapterName); 11 | int CmdSetTun(const char* ip, const char* mask, const char* gate); 12 | bool RenewAddress(int Index); 13 | #ifdef __cplusplus 14 | } 15 | #endif -------------------------------------------------------------------------------- /TunHelperAPI/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | 15 | 16 | // TODO: reference additional headers your program requires here 17 | -------------------------------------------------------------------------------- /TunHelperAPI/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /Public/Log.cpp: -------------------------------------------------------------------------------- 1 | #include "Log.h" 2 | 3 | ErrorTypeDesc ErrorTypeTable[] = 4 | { 5 | {LOG_FORCE, "FORCE"}, 6 | {LOG_ERROR, "ERROR"}, 7 | {LOG_WARNING, "WARNING"}, 8 | {LOG_NOTICE, "NOTICE"}, 9 | {LOG_INFO, "INFO"}, 10 | {LOG_DEBUG, "DEBUG"}, 11 | }; 12 | 13 | void debugLog(const char *mess,...) 14 | { 15 | va_list args; 16 | char szMessage[1024] = {}; 17 | 18 | va_start(args,mess); 19 | //int nMsgLen = _scprintf(mess, args); 20 | strncat_s(szMessage, sizeof(szMessage), "[GMClient] ", sizeof(szMessage) - 1); 21 | vsprintf_s(szMessage + 11, sizeof(szMessage) - 12, mess, args); 22 | va_end(args); 23 | 24 | //fprintf(stdout, szMessage); 25 | //OutputDebugStringA(szMessage); 26 | 27 | #ifdef _WIN32 28 | //fflush(stderr); 29 | #endif 30 | } 31 | -------------------------------------------------------------------------------- /Public/Log.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #define FORMAT_NORMAL 1 8 | 9 | #define LOG_FORCE 0 10 | #define LOG_ERROR 1 11 | #define LOG_WARNING 2 12 | #define LOG_NOTICE 3 13 | #define LOG_INFO 4 14 | #define LOG_DEBUG 5 15 | 16 | #define LOG_LEVEL 2 17 | 18 | typedef struct _ERROR_TYPE_DESC 19 | { 20 | unsigned int type; 21 | const char *desc; 22 | }ErrorTypeDesc, *PErrorTypeDesc; 23 | 24 | extern ErrorTypeDesc ErrorTypeTable[]; 25 | 26 | void debugLog(const char *mess,...); 27 | 28 | #if !FORMAT_NORMAL 29 | #define LogEx(f, l, e, ...) \ 30 | { \ 31 | fprintf(stdout, "[%s] %s:%d: ", ErrorTypeTable[e].desc, strrchr(f, '\\') + 1, l); \ 32 | fprintf(stdout, __VA_ARGS__); \ 33 | } 34 | #else 35 | #define LogEx(f, l, e, ...) \ 36 | debugLog(__VA_ARGS__) 37 | #endif 38 | 39 | #define Log(dwErrType, ...) \ 40 | if(dwErrType <= LOG_LEVEL) \ 41 | LogEx(__FILE__, __LINE__, dwErrType, __VA_ARGS__); 42 | -------------------------------------------------------------------------------- /TunHelperAPI/TunHandler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef _WIN32 4 | #define ADAPTER_NAME "TAP-Windows Adapter V9" 5 | #endif 6 | 7 | #ifdef _WIN32 8 | #ifdef __cplusplus 9 | extern "C"{ 10 | #endif 11 | #endif 12 | 13 | #ifdef _WIN32 14 | 15 | int DelTunRoute(const char *ip, const char *mask, const char *gateway); 16 | int DelTunRouteAll(); 17 | int ConfigDHCP(const char *ip, const char *mask, const char *DHCPServer); 18 | int ConfigTun(); 19 | void WinCreateEvent(); 20 | #endif 21 | 22 | void* OpenTun(const char *ip, const char *mask, const char *dhcpservice); 23 | int ReadTun(unsigned char* buffer, int size); 24 | int WriteTun(unsigned char* buffer, int size); 25 | int GetTunMTU(void *pHandle, unsigned short &uMTU); 26 | void *GetTunFD(void *pHandle); 27 | void CloseTun(void **pHandle); 28 | int AddTunIpaddr(const char *ip, const char *mask); 29 | int AddTunRoute(const char *ip, const char *mask, const char *gateway); 30 | 31 | #ifdef _WIN32 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 非常具体的丑 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /TunHelperAPITest/TunHelperAPITest.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | -------------------------------------------------------------------------------- /TunHelperAPI.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TunHelperAPI", "TunHelperAPI\TunHelperAPI.vcxproj", "{123FF8F2-0F70-4730-8B92-6EAF946AF713}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TunHelperAPITest", "TunHelperAPITest\TunHelperAPITest.vcxproj", "{A647E442-F7CC-45EF-8602-F599BEC09AB3}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {123FF8F2-0F70-4730-8B92-6EAF946AF713} = {123FF8F2-0F70-4730-8B92-6EAF946AF713} 9 | EndProjectSection 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | Debug|Win32 = Debug|Win32 14 | Release|Win32 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {123FF8F2-0F70-4730-8B92-6EAF946AF713}.Debug|Win32.ActiveCfg = Debug|Win32 18 | {123FF8F2-0F70-4730-8B92-6EAF946AF713}.Debug|Win32.Build.0 = Debug|Win32 19 | {123FF8F2-0F70-4730-8B92-6EAF946AF713}.Release|Win32.ActiveCfg = Release|Win32 20 | {123FF8F2-0F70-4730-8B92-6EAF946AF713}.Release|Win32.Build.0 = Release|Win32 21 | {A647E442-F7CC-45EF-8602-F599BEC09AB3}.Debug|Win32.ActiveCfg = Debug|Win32 22 | {A647E442-F7CC-45EF-8602-F599BEC09AB3}.Debug|Win32.Build.0 = Debug|Win32 23 | {A647E442-F7CC-45EF-8602-F599BEC09AB3}.Release|Win32.ActiveCfg = Release|Win32 24 | {A647E442-F7CC-45EF-8602-F599BEC09AB3}.Release|Win32.Build.0 = Release|Win32 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | EndGlobal 30 | -------------------------------------------------------------------------------- /TunHelperAPITest/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | CONSOLE APPLICATION : TunHelperAPITest Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this TunHelperAPITest application for you. 6 | 7 | This file contains a summary of what you will find in each of the files that 8 | make up your TunHelperAPITest application. 9 | 10 | 11 | TunHelperAPITest.vcxproj 12 | This is the main project file for VC++ projects generated using an Application Wizard. 13 | It contains information about the version of Visual C++ that generated the file, and 14 | information about the platforms, configurations, and project features selected with the 15 | Application Wizard. 16 | 17 | TunHelperAPITest.vcxproj.filters 18 | This is the filters file for VC++ projects generated using an Application Wizard. 19 | It contains information about the association between the files in your project 20 | and the filters. This association is used in the IDE to show grouping of files with 21 | similar extensions under a specific node (for e.g. ".cpp" files are associated with the 22 | "Source Files" filter). 23 | 24 | TunHelperAPITest.cpp 25 | This is the main application source file. 26 | 27 | ///////////////////////////////////////////////////////////////////////////// 28 | Other standard files: 29 | 30 | StdAfx.h, StdAfx.cpp 31 | These files are used to build a precompiled header (PCH) file 32 | named TunHelperAPITest.pch and a precompiled types file named StdAfx.obj. 33 | 34 | ///////////////////////////////////////////////////////////////////////////// 35 | Other notes: 36 | 37 | AppWizard uses "TODO:" comments to indicate parts of the source code you 38 | should add to or customize. 39 | 40 | ///////////////////////////////////////////////////////////////////////////// 41 | -------------------------------------------------------------------------------- /TunHelperAPI/TunHelperAPI.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | 49 | 50 | Resource Files 51 | 52 | 53 | -------------------------------------------------------------------------------- /TunHelperAPI/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | DYNAMIC LINK LIBRARY : TunHelperAPI Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this TunHelperAPI DLL for you. 6 | 7 | This file contains a summary of what you will find in each of the files that 8 | make up your TunHelperAPI application. 9 | 10 | 11 | TunHelperAPI.vcxproj 12 | This is the main project file for VC++ projects generated using an Application Wizard. 13 | It contains information about the version of Visual C++ that generated the file, and 14 | information about the platforms, configurations, and project features selected with the 15 | Application Wizard. 16 | 17 | TunHelperAPI.vcxproj.filters 18 | This is the filters file for VC++ projects generated using an Application Wizard. 19 | It contains information about the association between the files in your project 20 | and the filters. This association is used in the IDE to show grouping of files with 21 | similar extensions under a specific node (for e.g. ".cpp" files are associated with the 22 | "Source Files" filter). 23 | 24 | TunHelperAPI.cpp 25 | This is the main DLL source file. 26 | 27 | When created, this DLL does not export any symbols. As a result, it 28 | will not produce a .lib file when it is built. If you wish this project 29 | to be a project dependency of some other project, you will either need to 30 | add code to export some symbols from the DLL so that an export library 31 | will be produced, or you can set the Ignore Input Library property to Yes 32 | on the General propert page of the Linker folder in the project's Property 33 | Pages dialog box. 34 | 35 | ///////////////////////////////////////////////////////////////////////////// 36 | Other standard files: 37 | 38 | StdAfx.h, StdAfx.cpp 39 | These files are used to build a precompiled header (PCH) file 40 | named TunHelperAPI.pch and a precompiled types file named StdAfx.obj. 41 | 42 | ///////////////////////////////////////////////////////////////////////////// 43 | Other notes: 44 | 45 | AppWizard uses "TODO:" comments to indicate parts of the source code you 46 | should add to or customize. 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | -------------------------------------------------------------------------------- /tap-windows-9.9.2/include/tap-windows.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TAP-Windows -- A kernel driver to provide virtual tap 3 | * device functionality on Windows. 4 | * 5 | * This code was inspired by the CIPE-Win32 driver by Damion K. Wilson. 6 | * 7 | * This source code is Copyright (C) 2002-2010 OpenVPN Technologies, Inc., 8 | * and is released under the GPL version 2 (see below). 9 | * 10 | * This program is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License version 2 12 | * as published by the Free Software Foundation. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program (see the file COPYING included with this 21 | * distribution); if not, write to the Free Software Foundation, Inc., 22 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | */ 24 | #ifndef __TAP_WIN_H 25 | #define __TAP_WIN_H 26 | 27 | /* 28 | * ============= 29 | * TAP IOCTLs 30 | * ============= 31 | */ 32 | 33 | #define TAP_WIN_CONTROL_CODE(request,method) \ 34 | CTL_CODE (FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS) 35 | 36 | /* Present in 8.1 */ 37 | 38 | #define TAP_WIN_IOCTL_GET_MAC TAP_WIN_CONTROL_CODE (1, METHOD_BUFFERED) 39 | #define TAP_WIN_IOCTL_GET_VERSION TAP_WIN_CONTROL_CODE (2, METHOD_BUFFERED) 40 | #define TAP_WIN_IOCTL_GET_MTU TAP_WIN_CONTROL_CODE (3, METHOD_BUFFERED) 41 | #define TAP_WIN_IOCTL_GET_INFO TAP_WIN_CONTROL_CODE (4, METHOD_BUFFERED) 42 | #define TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT TAP_WIN_CONTROL_CODE (5, METHOD_BUFFERED) 43 | #define TAP_WIN_IOCTL_SET_MEDIA_STATUS TAP_WIN_CONTROL_CODE (6, METHOD_BUFFERED) 44 | #define TAP_WIN_IOCTL_CONFIG_DHCP_MASQ TAP_WIN_CONTROL_CODE (7, METHOD_BUFFERED) 45 | #define TAP_WIN_IOCTL_GET_LOG_LINE TAP_WIN_CONTROL_CODE (8, METHOD_BUFFERED) 46 | #define TAP_WIN_IOCTL_CONFIG_DHCP_SET_OPT TAP_WIN_CONTROL_CODE (9, METHOD_BUFFERED) 47 | 48 | /* Added in 8.2 */ 49 | 50 | /* obsoletes TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT */ 51 | #define TAP_WIN_IOCTL_CONFIG_TUN TAP_WIN_CONTROL_CODE (10, METHOD_BUFFERED) 52 | 53 | /* 54 | * ================= 55 | * Registry keys 56 | * ================= 57 | */ 58 | 59 | #define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}" 60 | 61 | #define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}" 62 | 63 | /* 64 | * ====================== 65 | * Filesystem prefixes 66 | * ====================== 67 | */ 68 | 69 | #define USERMODEDEVICEDIR "\\\\.\\Global\\" 70 | #define SYSDEVICEDIR "\\Device\\" 71 | #define USERDEVICEDIR "\\DosDevices\\Global\\" 72 | #define TAP_WIN_SUFFIX ".tap" 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /TunHelperAPI/tap-windows.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TAP-Windows -- A kernel driver to provide virtual tap 3 | * device functionality on Windows. 4 | * 5 | * This code was inspired by the CIPE-Win32 driver by Damion K. Wilson. 6 | * 7 | * This source code is Copyright (C) 2002-2014 OpenVPN Technologies, Inc., 8 | * and is released under the GPL version 2 (see below). This particular file 9 | * (tap-windows.h) is also licensed using the MIT license (see COPYRIGHT.MIT). 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License version 2 13 | * as published by the Free Software Foundation. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program (see the file COPYING included with this 22 | * distribution); if not, write to the Free Software Foundation, Inc., 23 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 | */ 25 | #ifndef __TAP_WIN_H 26 | #define __TAP_WIN_H 27 | 28 | /* 29 | * ============= 30 | * TAP IOCTLs 31 | * ============= 32 | */ 33 | 34 | #define TAP_WIN_CONTROL_CODE(request,method) \ 35 | CTL_CODE (FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS) 36 | 37 | /* Present in 8.1 */ 38 | 39 | #define TAP_WIN_IOCTL_GET_MAC TAP_WIN_CONTROL_CODE (1, METHOD_BUFFERED) 40 | #define TAP_WIN_IOCTL_GET_VERSION TAP_WIN_CONTROL_CODE (2, METHOD_BUFFERED) 41 | #define TAP_WIN_IOCTL_GET_MTU TAP_WIN_CONTROL_CODE (3, METHOD_BUFFERED) 42 | #define TAP_WIN_IOCTL_GET_INFO TAP_WIN_CONTROL_CODE (4, METHOD_BUFFERED) 43 | #define TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT TAP_WIN_CONTROL_CODE (5, METHOD_BUFFERED) 44 | #define TAP_WIN_IOCTL_SET_MEDIA_STATUS TAP_WIN_CONTROL_CODE (6, METHOD_BUFFERED) 45 | #define TAP_WIN_IOCTL_CONFIG_DHCP_MASQ TAP_WIN_CONTROL_CODE (7, METHOD_BUFFERED) 46 | #define TAP_WIN_IOCTL_GET_LOG_LINE TAP_WIN_CONTROL_CODE (8, METHOD_BUFFERED) 47 | #define TAP_WIN_IOCTL_CONFIG_DHCP_SET_OPT TAP_WIN_CONTROL_CODE (9, METHOD_BUFFERED) 48 | 49 | /* Added in 8.2 */ 50 | 51 | /* obsoletes TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT */ 52 | #define TAP_WIN_IOCTL_CONFIG_TUN TAP_WIN_CONTROL_CODE (10, METHOD_BUFFERED) 53 | 54 | /* 55 | * ================= 56 | * Registry keys 57 | * ================= 58 | */ 59 | 60 | #define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}" 61 | 62 | #define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}" 63 | 64 | /* 65 | * ====================== 66 | * Filesystem prefixes 67 | * ====================== 68 | */ 69 | 70 | #define USERMODEDEVICEDIR "\\\\.\\Global\\" 71 | #define SYSDEVICEDIR "\\Device\\" 72 | #define USERDEVICEDIR "\\DosDevices\\Global\\" 73 | #define TAP_WIN_SUFFIX ".tap" 74 | 75 | #endif // __TAP_WIN_H 76 | -------------------------------------------------------------------------------- /TunHelperAPITest/TunHelperAPITest.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {A647E442-F7CC-45EF-8602-F599BEC09AB3} 15 | Win32Proj 16 | TunHelperAPITest 17 | 18 | 19 | 20 | Application 21 | true 22 | v110 23 | MultiByte 24 | 25 | 26 | Application 27 | false 28 | v110 29 | true 30 | Unicode 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | true 44 | 45 | 46 | false 47 | 48 | 49 | 50 | Use 51 | Level3 52 | Disabled 53 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 54 | true 55 | 56 | 57 | Console 58 | true 59 | RequireAdministrator 60 | 61 | 62 | 63 | 64 | Level3 65 | Use 66 | MaxSpeed 67 | true 68 | true 69 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 70 | true 71 | 72 | 73 | Console 74 | true 75 | true 76 | true 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | Create 89 | Create 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /TunHelperAPI/TunHelperAPI.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {123FF8F2-0F70-4730-8B92-6EAF946AF713} 15 | Win32Proj 16 | TunHelperAPI 17 | 18 | 19 | 20 | DynamicLibrary 21 | true 22 | v110 23 | Unicode 24 | 25 | 26 | DynamicLibrary 27 | false 28 | v110 29 | true 30 | Unicode 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | true 44 | 45 | 46 | false 47 | 48 | 49 | 50 | Use 51 | Level3 52 | Disabled 53 | WIN32;_DEBUG;_WINDOWS;_USRDLL;TUNHELPERAPI_EXPORTS;%(PreprocessorDefinitions) 54 | true 55 | 56 | 57 | Windows 58 | true 59 | TunhelperAPI.def 60 | 61 | 62 | 63 | 64 | Level3 65 | Use 66 | MaxSpeed 67 | true 68 | true 69 | WIN32;NDEBUG;_WINDOWS;_USRDLL;TUNHELPERAPI_EXPORTS;%(PreprocessorDefinitions) 70 | true 71 | 72 | 73 | Windows 74 | true 75 | true 76 | true 77 | TunhelperAPI.def 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | false 92 | 93 | 94 | false 95 | 96 | 97 | 98 | 99 | Create 100 | Create 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /tap-windows-9.9.2/i386/OemWin2k.inf: -------------------------------------------------------------------------------- 1 | ; **************************************************************************** 2 | ; * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. * 3 | ; * This program is free software; you can redistribute it and/or modify * 4 | ; * it under the terms of the GNU General Public License version 2 * 5 | ; * as published by the Free Software Foundation. * 6 | ; **************************************************************************** 7 | 8 | ; SYNTAX CHECKER 9 | ; cd \WINDDK\3790\tools\chkinf 10 | ; chkinf c:\src\openvpn\tap-win32\i386\oemwin2k.inf 11 | ; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm 12 | 13 | ; INSTALL/REMOVE DRIVER 14 | ; tapinstall install OemWin2k.inf TAP0901 15 | ; tapinstall update OemWin2k.inf TAP0901 16 | ; tapinstall remove TAP0901 17 | 18 | ;********************************************************* 19 | ; Note to Developers: 20 | ; 21 | ; If you are bundling the TAP-Windows driver with your app, 22 | ; you should try to rename it in such a way that it will 23 | ; not collide with other instances of TAP-Windows defined 24 | ; by other apps. Multiple versions of the TAP-Windows 25 | ; driver, each installed by different apps, can coexist 26 | ; on the same machine if you follow these guidelines. 27 | ; NOTE: these instructions assume you are editing the 28 | ; generated OemWin2k.inf file, not the source 29 | ; OemWin2k.inf.in file which is preprocessed by winconfig 30 | ; and uses macro definitions from settings.in. 31 | ; 32 | ; (1) Rename all tapXXXX instances in this file to 33 | ; something different (use at least 5 characters 34 | ; for this name!) 35 | ; (2) Change the "!define TAP" definition in openvpn.nsi 36 | ; to match what you changed tapXXXX to. 37 | ; (3) Change TARGETNAME in SOURCES to match what you 38 | ; changed tapXXXX to. 39 | ; (4) Change TAP_COMPONENT_ID in common.h to match what 40 | ; you changed tapXXXX to. 41 | ; (5) Change SZDEPENDENCIES in service.h to match what 42 | ; you changed tapXXXX to. 43 | ; (6) Change DeviceDescription and Provider strings. 44 | ; (7) Change PRODUCT_TAP_WIN_DEVICE_DESCRIPTION in constants.h to what you 45 | ; set DeviceDescription to. 46 | ; 47 | ;********************************************************* 48 | 49 | [Version] 50 | Signature = "$Windows NT$" 51 | CatalogFile = tap0901.cat 52 | ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} 53 | Provider = %Provider% 54 | Class = Net 55 | 56 | ; This version number should match the version 57 | ; number given in SOURCES. 58 | DriverVer=07/02/2012,9.00.00.9 59 | 60 | [Strings] 61 | DeviceDescription = "TAP-Windows Adapter V9" 62 | Provider = "TAP-Windows Provider V9" 63 | 64 | ;---------------------------------------------------------------- 65 | ; Manufacturer + Product Section (Done) 66 | ;---------------------------------------------------------------- 67 | [Manufacturer] 68 | %Provider% = tap0901 69 | 70 | [tap0901] 71 | %DeviceDescription% = tap0901.ndi, tap0901 72 | 73 | ;--------------------------------------------------------------- 74 | ; Driver Section (Done) 75 | ;--------------------------------------------------------------- 76 | 77 | ;----------------- Characteristics ------------ 78 | ; NCF_PHYSICAL = 0x04 79 | ; NCF_VIRTUAL = 0x01 80 | ; NCF_SOFTWARE_ENUMERATED = 0x02 81 | ; NCF_HIDDEN = 0x08 82 | ; NCF_NO_SERVICE = 0x10 83 | ; NCF_HAS_UI = 0x80 84 | ;----------------- Characteristics ------------ 85 | 86 | [tap0901.ndi] 87 | CopyFiles = tap0901.driver, tap0901.files 88 | AddReg = tap0901.reg 89 | AddReg = tap0901.params.reg 90 | Characteristics = 0x81 91 | 92 | [tap0901.ndi.Services] 93 | AddService = tap0901, 2, tap0901.service 94 | 95 | [tap0901.reg] 96 | HKR, Ndi, Service, 0, "tap0901" 97 | HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" 98 | HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" 99 | HKR, , Manufacturer, 0, "%Provider%" 100 | HKR, , ProductName, 0, "%DeviceDescription%" 101 | 102 | [tap0901.params.reg] 103 | HKR, Ndi\params\MTU, ParamDesc, 0, "MTU" 104 | HKR, Ndi\params\MTU, Type, 0, "int" 105 | HKR, Ndi\params\MTU, Default, 0, "1500" 106 | HKR, Ndi\params\MTU, Optional, 0, "0" 107 | HKR, Ndi\params\MTU, Min, 0, "100" 108 | HKR, Ndi\params\MTU, Max, 0, "1500" 109 | HKR, Ndi\params\MTU, Step, 0, "1" 110 | HKR, Ndi\params\MediaStatus, ParamDesc, 0, "Media Status" 111 | HKR, Ndi\params\MediaStatus, Type, 0, "enum" 112 | HKR, Ndi\params\MediaStatus, Default, 0, "0" 113 | HKR, Ndi\params\MediaStatus, Optional, 0, "0" 114 | HKR, Ndi\params\MediaStatus\enum, "0", 0, "Application Controlled" 115 | HKR, Ndi\params\MediaStatus\enum, "1", 0, "Always Connected" 116 | HKR, Ndi\params\MAC, ParamDesc, 0, "MAC Address" 117 | HKR, Ndi\params\MAC, Type, 0, "edit" 118 | HKR, Ndi\params\MAC, Optional, 0, "1" 119 | HKR, Ndi\params\AllowNonAdmin, ParamDesc, 0, "Non-Admin Access" 120 | HKR, Ndi\params\AllowNonAdmin, Type, 0, "enum" 121 | HKR, Ndi\params\AllowNonAdmin, Default, 0, "1" 122 | HKR, Ndi\params\AllowNonAdmin, Optional, 0, "0" 123 | HKR, Ndi\params\AllowNonAdmin\enum, "0", 0, "Not Allowed" 124 | HKR, Ndi\params\AllowNonAdmin\enum, "1", 0, "Allowed" 125 | 126 | ;---------------------------------------------------------------- 127 | ; Service Section 128 | ;---------------------------------------------------------------- 129 | 130 | ;---------- Service Type ------------- 131 | ; SERVICE_KERNEL_DRIVER = 0x01 132 | ; SERVICE_WIN32_OWN_PROCESS = 0x10 133 | ;---------- Service Type ------------- 134 | 135 | ;---------- Start Mode --------------- 136 | ; SERVICE_BOOT_START = 0x0 137 | ; SERVICE_SYSTEM_START = 0x1 138 | ; SERVICE_AUTO_START = 0x2 139 | ; SERVICE_DEMAND_START = 0x3 140 | ; SERVICE_DISABLED = 0x4 141 | ;---------- Start Mode --------------- 142 | 143 | [tap0901.service] 144 | DisplayName = %DeviceDescription% 145 | ServiceType = 1 146 | StartType = 3 147 | ErrorControl = 1 148 | LoadOrderGroup = NDIS 149 | ServiceBinary = %12%\tap0901.sys 150 | 151 | ;----------------------------------------------------------------- 152 | ; File Installation 153 | ;----------------------------------------------------------------- 154 | 155 | ;----------------- Copy Flags ------------ 156 | ; COPYFLG_NOSKIP = 0x02 157 | ; COPYFLG_NOVERSIONCHECK = 0x04 158 | ;----------------- Copy Flags ------------ 159 | 160 | ; SourceDisksNames 161 | ; diskid = description[, [tagfile] [, , subdir]] 162 | ; 1 = "Intel Driver Disk 1",e100bex.sys,, 163 | 164 | [SourceDisksNames] 165 | 1 = %DeviceDescription%, tap0901.sys 166 | 167 | ; SourceDisksFiles 168 | ; filename_on_source = diskID[, [subdir][, size]] 169 | ; e100bex.sys = 1,, ; on distribution disk 1 170 | 171 | [SourceDisksFiles] 172 | tap0901.sys = 1 173 | 174 | [DestinationDirs] 175 | tap0901.files = 11 176 | tap0901.driver = 12 177 | 178 | [tap0901.files] 179 | ; TapPanel.cpl,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK 180 | ; cipsrvr.exe,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK 181 | 182 | [tap0901.driver] 183 | tap0901.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK 184 | 185 | ;--------------------------------------------------------------- 186 | ; End 187 | ;--------------------------------------------------------------- 188 | -------------------------------------------------------------------------------- /tap-windows-9.9.2/amd64/OemWin2k.inf: -------------------------------------------------------------------------------- 1 | ; **************************************************************************** 2 | ; * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. * 3 | ; * This program is free software; you can redistribute it and/or modify * 4 | ; * it under the terms of the GNU General Public License version 2 * 5 | ; * as published by the Free Software Foundation. * 6 | ; **************************************************************************** 7 | 8 | ; SYNTAX CHECKER 9 | ; cd \WINDDK\3790\tools\chkinf 10 | ; chkinf c:\src\openvpn\tap-win32\i386\oemwin2k.inf 11 | ; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm 12 | 13 | ; INSTALL/REMOVE DRIVER 14 | ; tapinstall install OemWin2k.inf TAP0901 15 | ; tapinstall update OemWin2k.inf TAP0901 16 | ; tapinstall remove TAP0901 17 | 18 | ;********************************************************* 19 | ; Note to Developers: 20 | ; 21 | ; If you are bundling the TAP-Windows driver with your app, 22 | ; you should try to rename it in such a way that it will 23 | ; not collide with other instances of TAP-Windows defined 24 | ; by other apps. Multiple versions of the TAP-Windows 25 | ; driver, each installed by different apps, can coexist 26 | ; on the same machine if you follow these guidelines. 27 | ; NOTE: these instructions assume you are editing the 28 | ; generated OemWin2k.inf file, not the source 29 | ; OemWin2k.inf.in file which is preprocessed by winconfig 30 | ; and uses macro definitions from settings.in. 31 | ; 32 | ; (1) Rename all tapXXXX instances in this file to 33 | ; something different (use at least 5 characters 34 | ; for this name!) 35 | ; (2) Change the "!define TAP" definition in openvpn.nsi 36 | ; to match what you changed tapXXXX to. 37 | ; (3) Change TARGETNAME in SOURCES to match what you 38 | ; changed tapXXXX to. 39 | ; (4) Change TAP_COMPONENT_ID in common.h to match what 40 | ; you changed tapXXXX to. 41 | ; (5) Change SZDEPENDENCIES in service.h to match what 42 | ; you changed tapXXXX to. 43 | ; (6) Change DeviceDescription and Provider strings. 44 | ; (7) Change PRODUCT_TAP_WIN_DEVICE_DESCRIPTION in constants.h to what you 45 | ; set DeviceDescription to. 46 | ; 47 | ;********************************************************* 48 | 49 | [Version] 50 | Signature = "$Windows NT$" 51 | CatalogFile = tap0901.cat 52 | ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} 53 | Provider = %Provider% 54 | Class = Net 55 | 56 | ; This version number should match the version 57 | ; number given in SOURCES. 58 | DriverVer=07/02/2012,9.00.00.9 59 | 60 | [Strings] 61 | DeviceDescription = "TAP-Windows Adapter V9" 62 | Provider = "TAP-Windows Provider V9" 63 | 64 | ;---------------------------------------------------------------- 65 | ; Manufacturer + Product Section (Done) 66 | ;---------------------------------------------------------------- 67 | [Manufacturer] 68 | %Provider% = tap0901, NTamd64 69 | 70 | [tap0901.NTamd64] 71 | %DeviceDescription% = tap0901.ndi, tap0901 72 | 73 | ;--------------------------------------------------------------- 74 | ; Driver Section (Done) 75 | ;--------------------------------------------------------------- 76 | 77 | ;----------------- Characteristics ------------ 78 | ; NCF_PHYSICAL = 0x04 79 | ; NCF_VIRTUAL = 0x01 80 | ; NCF_SOFTWARE_ENUMERATED = 0x02 81 | ; NCF_HIDDEN = 0x08 82 | ; NCF_NO_SERVICE = 0x10 83 | ; NCF_HAS_UI = 0x80 84 | ;----------------- Characteristics ------------ 85 | 86 | [tap0901.ndi] 87 | CopyFiles = tap0901.driver, tap0901.files 88 | AddReg = tap0901.reg 89 | AddReg = tap0901.params.reg 90 | Characteristics = 0x81 91 | 92 | [tap0901.ndi.Services] 93 | AddService = tap0901, 2, tap0901.service 94 | 95 | [tap0901.reg] 96 | HKR, Ndi, Service, 0, "tap0901" 97 | HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" 98 | HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" 99 | HKR, , Manufacturer, 0, "%Provider%" 100 | HKR, , ProductName, 0, "%DeviceDescription%" 101 | 102 | [tap0901.params.reg] 103 | HKR, Ndi\params\MTU, ParamDesc, 0, "MTU" 104 | HKR, Ndi\params\MTU, Type, 0, "int" 105 | HKR, Ndi\params\MTU, Default, 0, "1500" 106 | HKR, Ndi\params\MTU, Optional, 0, "0" 107 | HKR, Ndi\params\MTU, Min, 0, "100" 108 | HKR, Ndi\params\MTU, Max, 0, "1500" 109 | HKR, Ndi\params\MTU, Step, 0, "1" 110 | HKR, Ndi\params\MediaStatus, ParamDesc, 0, "Media Status" 111 | HKR, Ndi\params\MediaStatus, Type, 0, "enum" 112 | HKR, Ndi\params\MediaStatus, Default, 0, "0" 113 | HKR, Ndi\params\MediaStatus, Optional, 0, "0" 114 | HKR, Ndi\params\MediaStatus\enum, "0", 0, "Application Controlled" 115 | HKR, Ndi\params\MediaStatus\enum, "1", 0, "Always Connected" 116 | HKR, Ndi\params\MAC, ParamDesc, 0, "MAC Address" 117 | HKR, Ndi\params\MAC, Type, 0, "edit" 118 | HKR, Ndi\params\MAC, Optional, 0, "1" 119 | HKR, Ndi\params\AllowNonAdmin, ParamDesc, 0, "Non-Admin Access" 120 | HKR, Ndi\params\AllowNonAdmin, Type, 0, "enum" 121 | HKR, Ndi\params\AllowNonAdmin, Default, 0, "1" 122 | HKR, Ndi\params\AllowNonAdmin, Optional, 0, "0" 123 | HKR, Ndi\params\AllowNonAdmin\enum, "0", 0, "Not Allowed" 124 | HKR, Ndi\params\AllowNonAdmin\enum, "1", 0, "Allowed" 125 | 126 | ;---------------------------------------------------------------- 127 | ; Service Section 128 | ;---------------------------------------------------------------- 129 | 130 | ;---------- Service Type ------------- 131 | ; SERVICE_KERNEL_DRIVER = 0x01 132 | ; SERVICE_WIN32_OWN_PROCESS = 0x10 133 | ;---------- Service Type ------------- 134 | 135 | ;---------- Start Mode --------------- 136 | ; SERVICE_BOOT_START = 0x0 137 | ; SERVICE_SYSTEM_START = 0x1 138 | ; SERVICE_AUTO_START = 0x2 139 | ; SERVICE_DEMAND_START = 0x3 140 | ; SERVICE_DISABLED = 0x4 141 | ;---------- Start Mode --------------- 142 | 143 | [tap0901.service] 144 | DisplayName = %DeviceDescription% 145 | ServiceType = 1 146 | StartType = 3 147 | ErrorControl = 1 148 | LoadOrderGroup = NDIS 149 | ServiceBinary = %12%\tap0901.sys 150 | 151 | ;----------------------------------------------------------------- 152 | ; File Installation 153 | ;----------------------------------------------------------------- 154 | 155 | ;----------------- Copy Flags ------------ 156 | ; COPYFLG_NOSKIP = 0x02 157 | ; COPYFLG_NOVERSIONCHECK = 0x04 158 | ;----------------- Copy Flags ------------ 159 | 160 | ; SourceDisksNames 161 | ; diskid = description[, [tagfile] [, , subdir]] 162 | ; 1 = "Intel Driver Disk 1",e100bex.sys,, 163 | 164 | [SourceDisksNames] 165 | 1 = %DeviceDescription%, tap0901.sys 166 | 167 | ; SourceDisksFiles 168 | ; filename_on_source = diskID[, [subdir][, size]] 169 | ; e100bex.sys = 1,, ; on distribution disk 1 170 | 171 | [SourceDisksFiles] 172 | tap0901.sys = 1 173 | 174 | [DestinationDirs] 175 | tap0901.files = 11 176 | tap0901.driver = 12 177 | 178 | [tap0901.files] 179 | ; TapPanel.cpl,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK 180 | ; cipsrvr.exe,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK 181 | 182 | [tap0901.driver] 183 | tap0901.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK 184 | 185 | ;--------------------------------------------------------------- 186 | ; End 187 | ;--------------------------------------------------------------- 188 | -------------------------------------------------------------------------------- /tap-windows-9.9.2/license.txt: -------------------------------------------------------------------------------- 1 | TAP-Win32/TAP-Win64 Driver license: 2 | ----------------------------------- 3 | 4 | This device driver was inspired by the CIPE-Win32 driver by 5 | Damion K. Wilson. 6 | 7 | The source and object code of the TAP-Win32/TAP-Win64 driver 8 | is Copyright (C) 2002-2010 OpenVPN Technologies, Inc., and is released under 9 | the GPL version 2. 10 | 11 | NSIS License: 12 | ------------- 13 | 14 | Copyright (C) 2002-2003 Joost Verburg 15 | 16 | This software is provided 'as-is', without any express or implied 17 | warranty. In no event will the authors be held liable for any damages 18 | arising from the use of this software. 19 | 20 | Permission is granted to anyone to use this software for any purpose, 21 | including commercial applications, and to alter it and redistribute 22 | it freely, subject to the following restrictions: 23 | 24 | 1. The origin of this software must not be misrepresented; 25 | you must not claim that you wrote the original software. 26 | If you use this software in a product, an acknowledgment in the 27 | product documentation would be appreciated but is not required. 28 | 2. Altered versions must be plainly marked as such, 29 | and must not be misrepresented as being the original software. 30 | 3. This notice may not be removed or altered from any distribution. 31 | 32 | GNU Public License (GPL) 33 | ------------------------ 34 | 35 | TAP-Win32 distributions are licensed under the GPL version 2 (see 36 | COPYRIGHT.GPL). 37 | 38 | In the Windows binary distribution of OpenVPN, the 39 | GPL is reproduced below. 40 | 41 | GNU GENERAL PUBLIC LICENSE 42 | Version 2, June 1991 43 | 44 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 45 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 46 | Everyone is permitted to copy and distribute verbatim copies 47 | of this license document, but changing it is not allowed. 48 | 49 | Preamble 50 | 51 | The licenses for most software are designed to take away your 52 | freedom to share and change it. By contrast, the GNU General Public 53 | License is intended to guarantee your freedom to share and change free 54 | software--to make sure the software is free for all its users. This 55 | General Public License applies to most of the Free Software 56 | Foundation's software and to any other program whose authors commit to 57 | using it. (Some other Free Software Foundation software is covered by 58 | the GNU Library General Public License instead.) You can apply it to 59 | your programs, too. 60 | 61 | When we speak of free software, we are referring to freedom, not 62 | price. Our General Public Licenses are designed to make sure that you 63 | have the freedom to distribute copies of free software (and charge for 64 | this service if you wish), that you receive source code or can get it 65 | if you want it, that you can change the software or use pieces of it 66 | in new free programs; and that you know you can do these things. 67 | 68 | To protect your rights, we need to make restrictions that forbid 69 | anyone to deny you these rights or to ask you to surrender the rights. 70 | These restrictions translate to certain responsibilities for you if you 71 | distribute copies of the software, or if you modify it. 72 | 73 | For example, if you distribute copies of such a program, whether 74 | gratis or for a fee, you must give the recipients all the rights that 75 | you have. You must make sure that they, too, receive or can get the 76 | source code. And you must show them these terms so they know their 77 | rights. 78 | 79 | We protect your rights with two steps: (1) copyright the software, and 80 | (2) offer you this license which gives you legal permission to copy, 81 | distribute and/or modify the software. 82 | 83 | Also, for each author's protection and ours, we want to make certain 84 | that everyone understands that there is no warranty for this free 85 | software. If the software is modified by someone else and passed on, we 86 | want its recipients to know that what they have is not the original, so 87 | that any problems introduced by others will not reflect on the original 88 | authors' reputations. 89 | 90 | Finally, any free program is threatened constantly by software 91 | patents. We wish to avoid the danger that redistributors of a free 92 | program will individually obtain patent licenses, in effect making the 93 | program proprietary. To prevent this, we have made it clear that any 94 | patent must be licensed for everyone's free use or not licensed at all. 95 | 96 | The precise terms and conditions for copying, distribution and 97 | modification follow. 98 | 99 | GNU GENERAL PUBLIC LICENSE 100 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 101 | 102 | 0. This License applies to any program or other work which contains 103 | a notice placed by the copyright holder saying it may be distributed 104 | under the terms of this General Public License. The "Program", below, 105 | refers to any such program or work, and a "work based on the Program" 106 | means either the Program or any derivative work under copyright law: 107 | that is to say, a work containing the Program or a portion of it, 108 | either verbatim or with modifications and/or translated into another 109 | language. (Hereinafter, translation is included without limitation in 110 | the term "modification".) Each licensee is addressed as "you". 111 | 112 | Activities other than copying, distribution and modification are not 113 | covered by this License; they are outside its scope. The act of 114 | running the Program is not restricted, and the output from the Program 115 | is covered only if its contents constitute a work based on the 116 | Program (independent of having been made by running the Program). 117 | Whether that is true depends on what the Program does. 118 | 119 | 1. You may copy and distribute verbatim copies of the Program's 120 | source code as you receive it, in any medium, provided that you 121 | conspicuously and appropriately publish on each copy an appropriate 122 | copyright notice and disclaimer of warranty; keep intact all the 123 | notices that refer to this License and to the absence of any warranty; 124 | and give any other recipients of the Program a copy of this License 125 | along with the Program. 126 | 127 | You may charge a fee for the physical act of transferring a copy, and 128 | you may at your option offer warranty protection in exchange for a fee. 129 | 130 | 2. You may modify your copy or copies of the Program or any portion 131 | of it, thus forming a work based on the Program, and copy and 132 | distribute such modifications or work under the terms of Section 1 133 | above, provided that you also meet all of these conditions: 134 | 135 | a) You must cause the modified files to carry prominent notices 136 | stating that you changed the files and the date of any change. 137 | 138 | b) You must cause any work that you distribute or publish, that in 139 | whole or in part contains or is derived from the Program or any 140 | part thereof, to be licensed as a whole at no charge to all third 141 | parties under the terms of this License. 142 | 143 | c) If the modified program normally reads commands interactively 144 | when run, you must cause it, when started running for such 145 | interactive use in the most ordinary way, to print or display an 146 | announcement including an appropriate copyright notice and a 147 | notice that there is no warranty (or else, saying that you provide 148 | a warranty) and that users may redistribute the program under 149 | these conditions, and telling the user how to view a copy of this 150 | License. (Exception: if the Program itself is interactive but 151 | does not normally print such an announcement, your work based on 152 | the Program is not required to print an announcement.) 153 | 154 | These requirements apply to the modified work as a whole. If 155 | identifiable sections of that work are not derived from the Program, 156 | and can be reasonably considered independent and separate works in 157 | themselves, then this License, and its terms, do not apply to those 158 | sections when you distribute them as separate works. But when you 159 | distribute the same sections as part of a whole which is a work based 160 | on the Program, the distribution of the whole must be on the terms of 161 | this License, whose permissions for other licensees extend to the 162 | entire whole, and thus to each and every part regardless of who wrote it. 163 | 164 | Thus, it is not the intent of this section to claim rights or contest 165 | your rights to work written entirely by you; rather, the intent is to 166 | exercise the right to control the distribution of derivative or 167 | collective works based on the Program. 168 | 169 | In addition, mere aggregation of another work not based on the Program 170 | with the Program (or with a work based on the Program) on a volume of 171 | a storage or distribution medium does not bring the other work under 172 | the scope of this License. 173 | 174 | 3. You may copy and distribute the Program (or a work based on it, 175 | under Section 2) in object code or executable form under the terms of 176 | Sections 1 and 2 above provided that you also do one of the following: 177 | 178 | a) Accompany it with the complete corresponding machine-readable 179 | source code, which must be distributed under the terms of Sections 180 | 1 and 2 above on a medium customarily used for software interchange; or, 181 | 182 | b) Accompany it with a written offer, valid for at least three 183 | years, to give any third party, for a charge no more than your 184 | cost of physically performing source distribution, a complete 185 | machine-readable copy of the corresponding source code, to be 186 | distributed under the terms of Sections 1 and 2 above on a medium 187 | customarily used for software interchange; or, 188 | 189 | c) Accompany it with the information you received as to the offer 190 | to distribute corresponding source code. (This alternative is 191 | allowed only for noncommercial distribution and only if you 192 | received the program in object code or executable form with such 193 | an offer, in accord with Subsection b above.) 194 | 195 | The source code for a work means the preferred form of the work for 196 | making modifications to it. For an executable work, complete source 197 | code means all the source code for all modules it contains, plus any 198 | associated interface definition files, plus the scripts used to 199 | control compilation and installation of the executable. However, as a 200 | special exception, the source code distributed need not include 201 | anything that is normally distributed (in either source or binary 202 | form) with the major components (compiler, kernel, and so on) of the 203 | operating system on which the executable runs, unless that component 204 | itself accompanies the executable. 205 | 206 | If distribution of executable or object code is made by offering 207 | access to copy from a designated place, then offering equivalent 208 | access to copy the source code from the same place counts as 209 | distribution of the source code, even though third parties are not 210 | compelled to copy the source along with the object code. 211 | 212 | 4. You may not copy, modify, sublicense, or distribute the Program 213 | except as expressly provided under this License. Any attempt 214 | otherwise to copy, modify, sublicense or distribute the Program is 215 | void, and will automatically terminate your rights under this License. 216 | However, parties who have received copies, or rights, from you under 217 | this License will not have their licenses terminated so long as such 218 | parties remain in full compliance. 219 | 220 | 5. You are not required to accept this License, since you have not 221 | signed it. However, nothing else grants you permission to modify or 222 | distribute the Program or its derivative works. These actions are 223 | prohibited by law if you do not accept this License. Therefore, by 224 | modifying or distributing the Program (or any work based on the 225 | Program), you indicate your acceptance of this License to do so, and 226 | all its terms and conditions for copying, distributing or modifying 227 | the Program or works based on it. 228 | 229 | 6. Each time you redistribute the Program (or any work based on the 230 | Program), the recipient automatically receives a license from the 231 | original licensor to copy, distribute or modify the Program subject to 232 | these terms and conditions. You may not impose any further 233 | restrictions on the recipients' exercise of the rights granted herein. 234 | You are not responsible for enforcing compliance by third parties to 235 | this License. 236 | 237 | 7. If, as a consequence of a court judgment or allegation of patent 238 | infringement or for any other reason (not limited to patent issues), 239 | conditions are imposed on you (whether by court order, agreement or 240 | otherwise) that contradict the conditions of this License, they do not 241 | excuse you from the conditions of this License. If you cannot 242 | distribute so as to satisfy simultaneously your obligations under this 243 | License and any other pertinent obligations, then as a consequence you 244 | may not distribute the Program at all. For example, if a patent 245 | license would not permit royalty-free redistribution of the Program by 246 | all those who receive copies directly or indirectly through you, then 247 | the only way you could satisfy both it and this License would be to 248 | refrain entirely from distribution of the Program. 249 | 250 | If any portion of this section is held invalid or unenforceable under 251 | any particular circumstance, the balance of the section is intended to 252 | apply and the section as a whole is intended to apply in other 253 | circumstances. 254 | 255 | It is not the purpose of this section to induce you to infringe any 256 | patents or other property right claims or to contest validity of any 257 | such claims; this section has the sole purpose of protecting the 258 | integrity of the free software distribution system, which is 259 | implemented by public license practices. Many people have made 260 | generous contributions to the wide range of software distributed 261 | through that system in reliance on consistent application of that 262 | system; it is up to the author/donor to decide if he or she is willing 263 | to distribute software through any other system and a licensee cannot 264 | impose that choice. 265 | 266 | This section is intended to make thoroughly clear what is believed to 267 | be a consequence of the rest of this License. 268 | 269 | 8. If the distribution and/or use of the Program is restricted in 270 | certain countries either by patents or by copyrighted interfaces, the 271 | original copyright holder who places the Program under this License 272 | may add an explicit geographical distribution limitation excluding 273 | those countries, so that distribution is permitted only in or among 274 | countries not thus excluded. In such case, this License incorporates 275 | the limitation as if written in the body of this License. 276 | 277 | 9. The Free Software Foundation may publish revised and/or new versions 278 | of the General Public License from time to time. Such new versions will 279 | be similar in spirit to the present version, but may differ in detail to 280 | address new problems or concerns. 281 | 282 | Each version is given a distinguishing version number. If the Program 283 | specifies a version number of this License which applies to it and "any 284 | later version", you have the option of following the terms and conditions 285 | either of that version or of any later version published by the Free 286 | Software Foundation. If the Program does not specify a version number of 287 | this License, you may choose any version ever published by the Free Software 288 | Foundation. 289 | 290 | 10. If you wish to incorporate parts of the Program into other free 291 | programs whose distribution conditions are different, write to the author 292 | to ask for permission. For software which is copyrighted by the Free 293 | Software Foundation, write to the Free Software Foundation; we sometimes 294 | make exceptions for this. Our decision will be guided by the two goals 295 | of preserving the free status of all derivatives of our free software and 296 | of promoting the sharing and reuse of software generally. 297 | 298 | NO WARRANTY 299 | 300 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 301 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 302 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 303 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 304 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 305 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 306 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 307 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 308 | REPAIR OR CORRECTION. 309 | 310 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 311 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 312 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 313 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 314 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 315 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 316 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 317 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 318 | POSSIBILITY OF SUCH DAMAGES. 319 | 320 | END OF TERMS AND CONDITIONS 321 | 322 | How to Apply These Terms to Your New Programs 323 | 324 | If you develop a new program, and you want it to be of the greatest 325 | possible use to the public, the best way to achieve this is to make it 326 | free software which everyone can redistribute and change under these terms. 327 | 328 | To do so, attach the following notices to the program. It is safest 329 | to attach them to the start of each source file to most effectively 330 | convey the exclusion of warranty; and each file should have at least 331 | the "copyright" line and a pointer to where the full notice is found. 332 | 333 | 334 | Copyright (C) 335 | 336 | This program is free software; you can redistribute it and/or modify 337 | it under the terms of the GNU General Public License version 2 338 | as published by the Free Software Foundation. 339 | 340 | This program is distributed in the hope that it will be useful, 341 | but WITHOUT ANY WARRANTY; without even the implied warranty of 342 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 343 | GNU General Public License for more details. 344 | 345 | You should have received a copy of the GNU General Public License 346 | along with this program; if not, write to the Free Software 347 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 348 | 349 | 350 | Also add information on how to contact you by electronic and paper mail. 351 | 352 | If the program is interactive, make it output a short notice like this 353 | when it starts in an interactive mode: 354 | 355 | Gnomovision version 69, Copyright (C) year name of author 356 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 357 | This is free software, and you are welcome to redistribute it 358 | under certain conditions; type `show c' for details. 359 | 360 | The hypothetical commands `show w' and `show c' should show the appropriate 361 | parts of the General Public License. Of course, the commands you use may 362 | be called something other than `show w' and `show c'; they could even be 363 | mouse-clicks or menu items--whatever suits your program. 364 | 365 | You should also get your employer (if you work as a programmer) or your 366 | school, if any, to sign a "copyright disclaimer" for the program, if 367 | necessary. Here is a sample; alter the names: 368 | 369 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 370 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 371 | 372 | , 1 April 1989 373 | Ty Coon, President of Vice 374 | 375 | This General Public License does not permit incorporating your program into 376 | proprietary programs. If your program is a subroutine library, you may 377 | consider it more useful to permit linking proprietary applications with the 378 | library. If this is what you want to do, use the GNU Library General 379 | Public License instead of this License. 380 | --------------------------------------------------------------------------------