From 728e645d14b0d367b3ce094ff50fe9a0384ba6aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=98=95?= Date: Thu, 3 Aug 2023 17:13:03 +0800 Subject: [PATCH] =?UTF-8?q?OCT=201.=20=E5=A2=9E=E5=8A=A0=E4=BA=91=E7=94=B5?= =?UTF-8?q?=E8=84=91=E4=B8=BB=E6=9C=BA=E5=86=85=E6=9C=8D=E5=8A=A1=E7=AB=AF?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=A8=8B=E5=BA=8F=E4=BB=A5=E5=8F=8A=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E7=A8=8B=E5=BA=8F=202.=20=E5=A2=9E=E5=8A=A0SDK?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E7=A8=8B=E5=BA=8F=203.=20=E5=A2=9E=E5=8A=A0U?= =?UTF-8?q?DP=20SCG=E5=B0=81=E5=8C=85=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- InstallerSDK_amd64/InstallerSDK_amd64.vdproj | 216 ++-- .../InstallerServerApp_amd64.vdproj | 1133 +++++++++++++++++ NetTunnelApp/MainForm.cs | 69 +- NetTunnelApp/NetTunnelLib.cs | 31 +- NetTunnelSDK/NetTunnelSDK.vcxproj | 11 +- NetTunnelSDK/NetTunnelSDK.vcxproj.filters | 9 +- NetTunnelSDK/include/common.h | 48 +- NetTunnelSDK/include/globalcfg.h | 36 +- NetTunnelSDK/include/network.h | 95 +- NetTunnelSDK/include/sccsdk.h | 266 ++++ NetTunnelSDK/include/tunnel.h | 146 +-- NetTunnelSDK/include/user.h | 126 +- NetTunnelSDK/misc/misc.cpp | 31 +- NetTunnelSDK/network/ControlService.cpp | 2 +- NetTunnelSDK/network/ProxyService.cpp | 43 +- NetTunnelSDK/network/network.cpp | 4 +- NetTunnelSDK/protocol/protocol.cpp | 27 +- NetTunnelSDK/scripts/cleansdk.bat | 6 + NetTunnelSDK/scripts/gensdk.bat | 8 + NetTunnelSDK/sdk/common.h | 109 ++ NetTunnelSDK/sdk/sccsdk.h | 266 ++++ NetTunnelSDK/sdk/usrerr.h | 69 + NetTunnelSDKTestApp/WireGurad.cpp | 2 +- NetTunnelServerApp/NetTunnelServerApp.cpp | 45 + NetTunnelServerApp/NetTunnelServerApp.vcxproj | 142 +++ .../NetTunnelServerApp.vcxproj.filters | 22 + .../NetTunnelServerApp.vcxproj.user | 4 + TestNetTunnelSDK/TestNetTunnelSDK.cpp | 70 +- TestNetTunnelSDK/TestNetTunnelSDK.vcxproj | 2 +- tunnel_windows.sln | 130 +- 30 files changed, 2523 insertions(+), 645 deletions(-) create mode 100644 InstallerServerApp_amd64/InstallerServerApp_amd64.vdproj create mode 100644 NetTunnelSDK/include/sccsdk.h create mode 100644 NetTunnelSDK/scripts/cleansdk.bat create mode 100644 NetTunnelSDK/scripts/gensdk.bat create mode 100644 NetTunnelSDK/sdk/common.h create mode 100644 NetTunnelSDK/sdk/sccsdk.h create mode 100644 NetTunnelSDK/sdk/usrerr.h create mode 100644 NetTunnelServerApp/NetTunnelServerApp.cpp create mode 100644 NetTunnelServerApp/NetTunnelServerApp.vcxproj create mode 100644 NetTunnelServerApp/NetTunnelServerApp.vcxproj.filters create mode 100644 NetTunnelServerApp/NetTunnelServerApp.vcxproj.user diff --git a/InstallerSDK_amd64/InstallerSDK_amd64.vdproj b/InstallerSDK_amd64/InstallerSDK_amd64.vdproj index b8072a6..e5aec64 100644 --- a/InstallerSDK_amd64/InstallerSDK_amd64.vdproj +++ b/InstallerSDK_amd64/InstallerSDK_amd64.vdproj @@ -15,7 +15,13 @@ { "Entry" { - "MsmKey" = "8:_1088767113B8403E8BE21AD23BA4BC83" + "MsmKey" = "8:_05E3D3DB8ED74303B88C11D734ADDD5F" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_15F150AA6A114094B3D9478E75C68515" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } @@ -39,14 +45,14 @@ } "Entry" { - "MsmKey" = "8:_456DEFC31623264EA44622E8655F880A" - "OwnerKey" = "8:_536090BAB697484B8E206852993F24BA" + "MsmKey" = "8:_439F89D229B94FBEB6A222A3A5E26D35" + "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_4A508E196A404A3BB2442C22B49FC535" - "OwnerKey" = "8:_UNDEFINED" + "MsmKey" = "8:_456DEFC31623264EA44622E8655F880A" + "OwnerKey" = "8:_536090BAB697484B8E206852993F24BA" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -69,12 +75,6 @@ } "Entry" { - "MsmKey" = "8:_87A737265FFE4B3580E3E3333ECA6422" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { "MsmKey" = "8:_CAF1EAED19FEB8585EE0E5550C6CD814" "OwnerKey" = "8:_536090BAB697484B8E206852993F24BA" "MsmSig" = "8:_UNDEFINED" @@ -93,12 +93,6 @@ } "Entry" { - "MsmKey" = "8:_DC612CCB7F3243B1AA3A8955C4DC32B1" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { "MsmKey" = "8:_E299DFE7D43447328C1278A1D50ADA09" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -117,14 +111,14 @@ } "Entry" { - "MsmKey" = "8:_F181CC29E34695D364707CC04EABB928" - "OwnerKey" = "8:_536090BAB697484B8E206852993F24BA" + "MsmKey" = "8:_F14192995A0E485090DF99D1F3C3F9ED" + "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_FAC0BD08058C4DA1978C753F8DBB269D" - "OwnerKey" = "8:_UNDEFINED" + "MsmKey" = "8:_F181CC29E34695D364707CC04EABB928" + "OwnerKey" = "8:_536090BAB697484B8E206852993F24BA" "MsmSig" = "8:_UNDEFINED" } } @@ -135,7 +129,7 @@ "DisplayName" = "8:Debug" "IsDebugOnly" = "11:TRUE" "IsReleaseOnly" = "11:FALSE" - "OutputFilename" = "8:Debug\\InstallerSDK_amd64.msi" + "OutputFilename" = "8:Debug\\scc_sdk_win32_amd64.msi" "PackageFilesAs" = "3:2" "PackageFileSize" = "3:-2147483648" "CabType" = "3:1" @@ -145,6 +139,22 @@ "PrivateKeyFile" = "8:" "TimeStampServer" = "8:" "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + "Items" + { + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.7.2" + { + "Name" = "8:Microsoft .NET Framework 4.7.2 (x86 and x64)" + "ProductCode" = "8:.NETFramework,Version=v4.7.2" + } + } + } } "Release" { @@ -161,6 +171,22 @@ "PrivateKeyFile" = "8:" "TimeStampServer" = "8:" "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + "Items" + { + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.7.2" + { + "Name" = "8:Microsoft .NET Framework 4.7.2 (x86 and x64)" + "ProductCode" = "8:.NETFramework,Version=v4.7.2" + } + } + } } } "Deployable" @@ -182,9 +208,9 @@ } "File" { - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_1088767113B8403E8BE21AD23BA4BC83" + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_05E3D3DB8ED74303B88C11D734ADDD5F" { - "SourcePath" = "8:..\\NetTunnelSDK\\include\\usrerr.h" + "SourcePath" = "8:..\\NetTunnelSDK\\sdk\\usrerr.h" "TargetName" = "8:usrerr.h" "Tag" = "8:" "Folder" = "8:_A3EAAC7681BD4ED6BA6917BD105454CC" @@ -202,6 +228,26 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_15F150AA6A114094B3D9478E75C68515" + { + "SourcePath" = "8:..\\NetTunnelSDK\\sdk\\sccsdk.h" + "TargetName" = "8:sccsdk.h" + "Tag" = "8:" + "Folder" = "8:_A3EAAC7681BD4ED6BA6917BD105454CC" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_28B239B3603041EDBD444930636B2080" { "SourcePath" = "8:..\\NetTunnelSDK\\depends\\WireGuardNT\\amd64\\wireguard.dll" @@ -262,6 +308,26 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_439F89D229B94FBEB6A222A3A5E26D35" + { + "SourcePath" = "8:..\\x64\\Debug\\NetTunnelSDK.lib" + "TargetName" = "8:NetTunnelSDK.lib" + "Tag" = "8:" + "Folder" = "8:_11B6E97F977B4EE4ACBB201BA1EA1604" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_456DEFC31623264EA44622E8655F880A" { "SourcePath" = "8:bcrypt.dll" @@ -282,26 +348,6 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_4A508E196A404A3BB2442C22B49FC535" - { - "SourcePath" = "8:..\\NetTunnelSDK\\include\\globalcfg.h" - "TargetName" = "8:globalcfg.h" - "Tag" = "8:" - "Folder" = "8:_A3EAAC7681BD4ED6BA6917BD105454CC" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_529782AAA27F039161AE9DC1FC81E5C3" { "SourcePath" = "8:fmtd.dll" @@ -342,26 +388,6 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_87A737265FFE4B3580E3E3333ECA6422" - { - "SourcePath" = "8:..\\NetTunnelSDK\\include\\user.h" - "TargetName" = "8:user.h" - "Tag" = "8:" - "Folder" = "8:_A3EAAC7681BD4ED6BA6917BD105454CC" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_CAF1EAED19FEB8585EE0E5550C6CD814" { "SourcePath" = "8:VCRUNTIME140D.dll" @@ -402,26 +428,6 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_DC612CCB7F3243B1AA3A8955C4DC32B1" - { - "SourcePath" = "8:..\\NetTunnelSDK\\include\\network.h" - "TargetName" = "8:network.h" - "Tag" = "8:" - "Folder" = "8:_A3EAAC7681BD4ED6BA6917BD105454CC" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_E2F78996F3155186FEC01C5D190F5798" { "SourcePath" = "8:ucrtbased.dll" @@ -442,6 +448,26 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_F14192995A0E485090DF99D1F3C3F9ED" + { + "SourcePath" = "8:..\\NetTunnelSDK\\sdk\\common.h" + "TargetName" = "8:common.h" + "Tag" = "8:" + "Folder" = "8:_A3EAAC7681BD4ED6BA6917BD105454CC" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_F181CC29E34695D364707CC04EABB928" { "SourcePath" = "8:VCRUNTIME140_1D.dll" @@ -462,26 +488,6 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_FAC0BD08058C4DA1978C753F8DBB269D" - { - "SourcePath" = "8:..\\NetTunnelSDK\\include\\tunnel.h" - "TargetName" = "8:tunnel.h" - "Tag" = "8:" - "Folder" = "8:_A3EAAC7681BD4ED6BA6917BD105454CC" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } } "FileType" { @@ -561,7 +567,7 @@ "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:SCCSDK" "ProductCode" = "8:{0F21F61E-F559-45D3-9390-20D2563CC2F8}" - "PackageCode" = "8:{92A5014D-0CE3-4A20-B130-1EF8C458390D}" + "PackageCode" = "8:{2724017F-EDD5-418B-98CD-97213E2613E4}" "UpgradeCode" = "8:{30151F2E-31C5-44AC-82C4-5FCF9D54BCF3}" "AspNetVersion" = "8:2.0.50727.0" "RestartWWWService" = "11:FALSE" diff --git a/InstallerServerApp_amd64/InstallerServerApp_amd64.vdproj b/InstallerServerApp_amd64/InstallerServerApp_amd64.vdproj new file mode 100644 index 0000000..4769edf --- /dev/null +++ b/InstallerServerApp_amd64/InstallerServerApp_amd64.vdproj @@ -0,0 +1,1133 @@ +"DeployProject" +{ +"VSVersion" = "3:800" +"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}" +"IsWebType" = "8:FALSE" +"ProjectName" = "8:InstallerServerApp_amd64" +"LanguageId" = "3:2052" +"CodePage" = "3:936" +"UILanguageId" = "3:2052" +"SccProjectName" = "8:" +"SccLocalPath" = "8:" +"SccAuxPath" = "8:" +"SccProvider" = "8:" + "Hierarchy" + { + "Entry" + { + "MsmKey" = "8:_051B58ED18044668A8D8F5D293AEFB1B" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_46B8B1030CA1CE029D8E8B6E4C7339CA" + "OwnerKey" = "8:_051B58ED18044668A8D8F5D293AEFB1B" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_5099850BCD0C0D555A51D120281856F2" + "OwnerKey" = "8:_051B58ED18044668A8D8F5D293AEFB1B" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_6B33B9880105403AB07A0250E9FE451D" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_6CF03975B9984DEC6A06EDA335983B3E" + "OwnerKey" = "8:_051B58ED18044668A8D8F5D293AEFB1B" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_7C78CA97FC174EFB9848D1EB1A82FAE3" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_84C9DA99D639FD9EDD2D013C982A3B77" + "OwnerKey" = "8:_051B58ED18044668A8D8F5D293AEFB1B" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_90BE21105F00EF4D08BFAC163FC2C578" + "OwnerKey" = "8:_051B58ED18044668A8D8F5D293AEFB1B" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_A47C28C8E77E647F8BC5B209A3A0CBAF" + "OwnerKey" = "8:_6B33B9880105403AB07A0250E9FE451D" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_D64BF7F7A4C54240763CB0C07962C5D9" + "OwnerKey" = "8:_051B58ED18044668A8D8F5D293AEFB1B" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_D64BF7F7A4C54240763CB0C07962C5D9" + "OwnerKey" = "8:_FAAF7BAED61247E3A64EB83CA52A3EF3" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_E42C46DD524A1F15E4C053C79430527B" + "OwnerKey" = "8:_051B58ED18044668A8D8F5D293AEFB1B" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_E42C46DD524A1F15E4C053C79430527B" + "OwnerKey" = "8:_FAAF7BAED61247E3A64EB83CA52A3EF3" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_E679D3D1CCAF4E6FAC2E8BF9C6706128" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_EA7054C5B4964DB2B269B3E7E3744CB9" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_FAAF7BAED61247E3A64EB83CA52A3EF3" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + } + "Configurations" + { + "Debug" + { + "DisplayName" = "8:Debug" + "IsDebugOnly" = "11:TRUE" + "IsReleaseOnly" = "11:FALSE" + "OutputFilename" = "8:Debug\\InstallerServerApp_amd64.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + } + "Release" + { + "DisplayName" = "8:Release" + "IsDebugOnly" = "11:FALSE" + "IsReleaseOnly" = "11:TRUE" + "OutputFilename" = "8:Release\\InstallerServerApp_amd64.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + } + } + "Deployable" + { + "CustomAction" + { + } + "DefaultFeature" + { + "Name" = "8:DefaultFeature" + "Title" = "8:" + "Description" = "8:" + } + "ExternalPersistence" + { + "LaunchCondition" + { + } + } + "File" + { + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_46B8B1030CA1CE029D8E8B6E4C7339CA" + { + "SourcePath" = "8:VCRUNTIME140_1D.dll" + "TargetName" = "8:VCRUNTIME140_1D.dll" + "Tag" = "8:" + "Folder" = "8:_0777490231CD48A0970C1FCD623EA32A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_5099850BCD0C0D555A51D120281856F2" + { + "SourcePath" = "8:fmtd.dll" + "TargetName" = "8:fmtd.dll" + "Tag" = "8:" + "Folder" = "8:_0777490231CD48A0970C1FCD623EA32A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_6CF03975B9984DEC6A06EDA335983B3E" + { + "SourcePath" = "8:IPHLPAPI.DLL" + "TargetName" = "8:IPHLPAPI.DLL" + "Tag" = "8:" + "Folder" = "8:_0777490231CD48A0970C1FCD623EA32A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:TRUE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_7C78CA97FC174EFB9848D1EB1A82FAE3" + { + "SourcePath" = "8:..\\NetTunnelSDK\\depends\\WireGuardNT\\amd64\\wireguard.dll" + "TargetName" = "8:wireguard.dll" + "Tag" = "8:" + "Folder" = "8:_0777490231CD48A0970C1FCD623EA32A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_84C9DA99D639FD9EDD2D013C982A3B77" + { + "SourcePath" = "8:MSVCP140D.dll" + "TargetName" = "8:MSVCP140D.dll" + "Tag" = "8:" + "Folder" = "8:_0777490231CD48A0970C1FCD623EA32A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_90BE21105F00EF4D08BFAC163FC2C578" + { + "SourcePath" = "8:bcrypt.dll" + "TargetName" = "8:bcrypt.dll" + "Tag" = "8:" + "Folder" = "8:_0777490231CD48A0970C1FCD623EA32A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:TRUE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_A47C28C8E77E647F8BC5B209A3A0CBAF" + { + "SourcePath" = "8:NetTunnelSDK.dll" + "TargetName" = "8:NetTunnelSDK.dll" + "Tag" = "8:" + "Folder" = "8:_0777490231CD48A0970C1FCD623EA32A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:TRUE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_D64BF7F7A4C54240763CB0C07962C5D9" + { + "SourcePath" = "8:ucrtbased.dll" + "TargetName" = "8:ucrtbased.dll" + "Tag" = "8:" + "Folder" = "8:_0777490231CD48A0970C1FCD623EA32A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_E42C46DD524A1F15E4C053C79430527B" + { + "SourcePath" = "8:VCRUNTIME140D.dll" + "TargetName" = "8:VCRUNTIME140D.dll" + "Tag" = "8:" + "Folder" = "8:_0777490231CD48A0970C1FCD623EA32A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_E679D3D1CCAF4E6FAC2E8BF9C6706128" + { + "SourcePath" = "8:..\\NetTunnelSDK\\depends\\tunnel\\amd64\\tunnel.dll" + "TargetName" = "8:tunnel.dll" + "Tag" = "8:" + "Folder" = "8:_0777490231CD48A0970C1FCD623EA32A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_EA7054C5B4964DB2B269B3E7E3744CB9" + { + "SourcePath" = "8:..\\NetTunnelSDK\\resource\\iconsTray.ico" + "TargetName" = "8:iconsTray.ico" + "Tag" = "8:" + "Folder" = "8:_0777490231CD48A0970C1FCD623EA32A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + } + "FileType" + { + } + "Folder" + { + "{3C67513D-01DD-4637-8A68-80971EB9504F}:_0777490231CD48A0970C1FCD623EA32A" + { + "DefaultLocation" = "8:[ProgramFiles64Folder][Manufacturer]\\[ProductName]" + "Name" = "8:#1925" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:TARGETDIR" + "Folders" + { + } + } + "{1525181F-901A-416C-8A58-119130FE478E}:_1A4CE70184DD4999A525B06E51F43351" + { + "Name" = "8:#1919" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:ProgramMenuFolder" + "Folders" + { + } + } + "{1525181F-901A-416C-8A58-119130FE478E}:_80BFBBCF23A542A4A062E984EEEF723E" + { + "Name" = "8:#1916" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:DesktopFolder" + "Folders" + { + } + } + } + "LaunchCondition" + { + } + "Locator" + { + } + "MsiBootstrapper" + { + "LangId" = "3:2052" + "RequiresElevation" = "11:FALSE" + } + "Product" + { + "Name" = "8:Microsoft Visual Studio" + "ProductName" = "8:SCCServer" + "ProductCode" = "8:{E00CE8DB-D79F-4890-910F-64AE0F37AEED}" + "PackageCode" = "8:{2881D34B-31F4-4DA0-AE7A-7FAF55389480}" + "UpgradeCode" = "8:{3089869A-5F6B-4EC2-B2CA-54B51499079F}" + "AspNetVersion" = "8:2.0.50727.0" + "RestartWWWService" = "11:FALSE" + "RemovePreviousVersions" = "11:FALSE" + "DetectNewerInstalledVersion" = "11:TRUE" + "InstallAllUsers" = "11:FALSE" + "ProductVersion" = "8:1.0.0" + "Manufacturer" = "8:CMHI" + "ARPHELPTELEPHONE" = "8:" + "ARPHELPLINK" = "8:" + "Title" = "8:InstallerServerApp_amd64" + "Subject" = "8:" + "ARPCONTACT" = "8:CMHI" + "Keywords" = "8:" + "ARPCOMMENTS" = "8:" + "ARPURLINFOABOUT" = "8:" + "ARPPRODUCTICON" = "8:_EA7054C5B4964DB2B269B3E7E3744CB9" + "ARPIconIndex" = "3:0" + "SearchPath" = "8:" + "UseSystemSearchPath" = "11:TRUE" + "TargetPlatform" = "3:1" + "PreBuildEvent" = "8:" + "PostBuildEvent" = "8:" + "RunPostBuildEvent" = "3:0" + } + "Registry" + { + "HKLM" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_AD9BDBC4EB9A4344B4700EA928607297" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_C19DD0966C6B4EDCA5E119801B37E56A" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCU" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_72640D359F2C4D688BE15FE591CEE514" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_609F4D3304914E2BBCA26B80893FEDBC" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCR" + { + "Keys" + { + } + } + "HKU" + { + "Keys" + { + } + } + "HKPU" + { + "Keys" + { + } + } + } + "Sequences" + { + } + "Shortcut" + { + } + "UserInterface" + { + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_1C1D1F0083E24099864CB3032609E149" + { + "Name" = "8:#1901" + "Sequence" = "3:2" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_A3269881A7494CD1A70C6F6DD9CEB8C9" + { + "Sequence" = "3:100" + "DisplayName" = "8:进度" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_2852A88E2FCD4F29B35FC7F1C8ECC720" + { + "Name" = "8:#1900" + "Sequence" = "3:1" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_418F45C4184443CA94343574ADA4E871" + { + "Sequence" = "3:300" + "DisplayName" = "8:确认安装" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_512C0097F124469E897F8F6AC287A915" + { + "Sequence" = "3:100" + "DisplayName" = "8:欢迎使用" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_CE8629AEF2A7482584AA8A6EB44FA2E1" + { + "Sequence" = "3:200" + "DisplayName" = "8:安装文件夹" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFolderDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "InstallAllUsersVisible" + { + "Name" = "8:InstallAllUsersVisible" + "DisplayName" = "8:#1059" + "Description" = "8:#1159" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_4CC667F9FF1C43128B58A14A642E9D54" + { + "Name" = "8:#1902" + "Sequence" = "3:2" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_DCA8D8962D7447E18E27BE94C519C672" + { + "Sequence" = "3:100" + "DisplayName" = "8:已完成" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_72B2EBCB41BA4B6DA07D377D645FDB9E" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdBasicDialogs.wim" + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_9AE6FF1128144F2A9F2DC563A98F89B3" + { + "Name" = "8:#1902" + "Sequence" = "3:1" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_4290D0E007534BE68AFBEE9BF9BC2449" + { + "Sequence" = "3:100" + "DisplayName" = "8:已完成" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "UpdateText" + { + "Name" = "8:UpdateText" + "DisplayName" = "8:#1058" + "Description" = "8:#1158" + "Type" = "3:15" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1258" + "DefaultValue" = "8:#1258" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_A5F14F527A364BCFACBDC46C3ED100D5" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdUserInterface.wim" + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_CBC9C1A5D61047C985BC84BE7A479FFF" + { + "Name" = "8:#1900" + "Sequence" = "3:2" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_070048208B844D708AF8E2B593346388" + { + "Sequence" = "3:300" + "DisplayName" = "8:确认安装" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_402BDC0A4CBA4BFCAE1A4AA9BB57A346" + { + "Sequence" = "3:200" + "DisplayName" = "8:安装文件夹" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFolderDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_AAC7E66BB63B452A9FA8E08D2C725D46" + { + "Sequence" = "3:100" + "DisplayName" = "8:欢迎使用" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_E7DC4B66EDC442A588E91CBE4F3CDBBB" + { + "Name" = "8:#1901" + "Sequence" = "3:1" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_048D41DFCBDD4DEE93A26F2F2DEBC90A" + { + "Sequence" = "3:100" + "DisplayName" = "8:进度" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + } + "MergeModule" + { + } + "ProjectOutput" + { + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_051B58ED18044668A8D8F5D293AEFB1B" + { + "SourcePath" = "8:..\\x64\\Debug\\NetTunnelSDK.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_0777490231CD48A0970C1FCD623EA32A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectGuid" = "8:{1584BAD4-DBEC-43D2-BC06-08C23F02489A}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_3775F83A472C4D1A86E7872BAB26AC1D" + { + "SourcePath" = "8:" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_0777490231CD48A0970C1FCD623EA32A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Documentation" + "OutputProjectGuid" = "8:{441A93B0-DBA1-429A-8AC0-35A8945614E6}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_6B33B9880105403AB07A0250E9FE451D" + { + "SourcePath" = "8:..\\x64\\Debug\\NetTunnelServerApp.exe" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_0777490231CD48A0970C1FCD623EA32A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectGuid" = "8:{441A93B0-DBA1-429A-8AC0-35A8945614E6}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_76903192DD6E4BE891D60EFA018B694B" + { + "SourcePath" = "8:" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_0777490231CD48A0970C1FCD623EA32A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:LocalizedResourceDlls" + "OutputProjectGuid" = "8:{441A93B0-DBA1-429A-8AC0-35A8945614E6}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_844801C3D61D478E968C73E56692F4DE" + { + "SourcePath" = "8:" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_0777490231CD48A0970C1FCD623EA32A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:ContentFiles" + "OutputProjectGuid" = "8:{441A93B0-DBA1-429A-8AC0-35A8945614E6}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_FAAF7BAED61247E3A64EB83CA52A3EF3" + { + "SourcePath" = "8:..\\x64\\Debug\\NetTunnelSvr.exe" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_0777490231CD48A0970C1FCD623EA32A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectGuid" = "8:{0A2EEDAF-F4A8-41E0-A874-2F30D1EEB55E}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + } + } +} diff --git a/NetTunnelApp/MainForm.cs b/NetTunnelApp/MainForm.cs index a2b89e6..6f991c4 100644 --- a/NetTunnelApp/MainForm.cs +++ b/NetTunnelApp/MainForm.cs @@ -15,25 +15,6 @@ public partial class MainForm : Form private string _wireguardPath = string.Empty; - public void GetCurrentWgCfgs(string username) - { - IntPtr pt = new IntPtr(); //Marshal.AllocHGlobal(Marshal.SizeOf(typeof(FilePath)) * 32); - int size = 0; - - _curFilePaths.Clear(); - - var v = NetTunnelLib.GetUserConfigFiles(username, out pt, ref size); - for (int i = 0; i < size; i++) - { - IntPtr ptr = new IntPtr(pt.ToInt64() + Marshal.SizeOf(typeof(FilePath)) * i); - FilePath path = (FilePath)Marshal.PtrToStructure(ptr, typeof(FilePath)); - //Console.WriteLine("{0}: {1} status {2}", i, path.CfgPath, path.curUsed); - _curFilePaths.Add(path); - } - - Marshal.FreeCoTaskMem(pt); - } - public void GetCurrentNetCard() { IntPtr pt = new IntPtr(); //Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NetCard)) * 32); @@ -65,7 +46,7 @@ public partial class MainForm : Form string.Format("{0:yyyyMMdd}", DateTime.Now) + ".log"; //NetTunnelLib.InitTunnelSDKLog(path, LogLevel.LOG_DEBUG); NetTunnelLib.TunnelSDKInitEnv(Environment.CurrentDirectory, "http://xajhuang.com:9276", path, LogLevel.LOG_DEBUG, menuSetModeServer.Checked); - NetTunnelLib.EnableSCGProxy(true, "efc.xajhuang.com", 10000); + //NetTunnelLib.EnableSCGProxy(true, "efc.xajhuang.com", 10000); GetCurrentNetCard(); NetCardMenuItems menuItems = new NetCardMenuItems(_curNetCard); @@ -107,52 +88,6 @@ public partial class MainForm : Form Marshal.FreeCoTaskMem(pt); } - - private void test_create_wg_svr_cfg() - { - WgSvrConfig wsg = new WgSvrConfig(); - - wsg.Name = "wg_svr"; - wsg.Address = "10.10.10.250/24"; - wsg.ListenPort = 10000; - wsg.PrivateKey = "EOHYEXSK4xw0LlB4I3ZlF5UqSaoma3Ea2KPhLfIdA14="; - wsg.CliPubKey = "6BWnmkCJqJC5iNoCEZWTxwGNG7qwkxFoVgAk4DoIKCk="; - wsg.AllowNet = "10.10.10.5/32"; - - var v = NetTunnelLib.WireGuardCreateServerConfig(wsg); - - Console.WriteLine("Create WireGuard Server Configure File: {0}", v); - } - - public void test_create_wg_cli_cfg() - { - WgCliConfig cli = new WgCliConfig(); - - cli.Name = "wg_cli"; - cli.Address = "10.10.10.1/32"; - cli.PrivateKey = "WGAlqvys3O83VmWug6Z8NzUrxGr/PNHSeOVFnKLSe2k="; - - cli.SvrPubKey = "8KEaqtWM5U35SR8S3QJriGHPr0VIqvk8A7BEuOjjp1M="; - cli.AllowNet = "10.10.10.0/24, 10.0.4.16/30"; - cli.ServerURL = "101.35.234.160:10010"; - - var v = NetTunnelLib.WireGuardCreateClientConfig(cli); - - Console.WriteLine("Create WireGuard Client Configure File: {0}", v); - } - - private void test_uninstall_wg_server() - { - var v = NetTunnelLib.WireGuardInstallServerService(false); - Console.WriteLine("Uninstall Result: {0}", v); - } - - private void test_install_wg_server() - { - var v = NetTunnelLib.WireGuardInstallServerService(true); - Console.WriteLine("Install Result: {0}", v); - } - private void button1_Click(object sender, EventArgs e) { //var buffer = new StringBuilder(256 + 1); @@ -291,7 +226,7 @@ public partial class MainForm : Form //Marshal.FreeCoTaskMem(cfg.pVMConfig); //Marshal.FreeCoTaskMem(pt); - GetCurrentWgCfgs(args.HashArgs["UserName"] as string); + //GetCurrentWgCfgs(args.HashArgs["UserName"] as string); ServerMenuItems svrMenu = new ServerMenuItems(_userConfig.vmList); diff --git a/NetTunnelApp/NetTunnelLib.cs b/NetTunnelApp/NetTunnelLib.cs index fcaf359..40fc68d 100644 --- a/NetTunnelApp/NetTunnelLib.cs +++ b/NetTunnelApp/NetTunnelLib.cs @@ -178,38 +178,16 @@ public class NetTunnelLib [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void TunnelSDKUnInit(); - - [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern int SetProtocolEncryptType(ProtoCryptoType type, String pProKey); - + [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int GetAllNICInfo(out IntPtr netCard, ref int size); - - [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern int WireGuardCreateServerConfig(WgSvrConfig cfg); - - [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern int WireGuardCreateClientConfig(WgCliConfig cfg); - - [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern int WireGuardInstallServerService(bool install); - + [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int GetUserClientConfigure(String UserName, String token, out IntPtr userCfg); - [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern int GetUserConfigFiles(String UserName, out IntPtr path, ref int size); - - [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern void ConnectServerControlService(String svrUrl); - [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int RemoteCtrlSvrCfgUserTunnel(int vmid, String cliNetwork); - - [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] - public static extern int SetTunnelConfigure(String cliPrivateKey, String svrPublicKey, String svrNetwork, - String cliNetwork, String svrAddr); - + [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int RemoteWireGuardControl(bool startOrStop); @@ -230,7 +208,4 @@ public class NetTunnelLib [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] public static extern bool UsedSCGProxy(); - - //[DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] - //public static extern int RunPipeCmd(String pszCmd, StringBuilder pszResultBuffer, int dwResultBufferSize); } \ No newline at end of file diff --git a/NetTunnelSDK/NetTunnelSDK.vcxproj b/NetTunnelSDK/NetTunnelSDK.vcxproj index 4202ea5..63f1e81 100644 --- a/NetTunnelSDK/NetTunnelSDK.vcxproj +++ b/NetTunnelSDK/NetTunnelSDK.vcxproj @@ -129,10 +129,14 @@ copy /y $(ProjectDir)depends\WireGuardNT\amd64\wireguard.dll $(TargetDir) copy /y $(TargetDir)fmtd.dll $(SolutionDir)NetTunnelApp\bin\$(ConfigurationName)\ copy /y $(TargetDir)NetTunnelSDK.dll $(SolutionDir)NetTunnelApp\bin\$(ConfigurationName)\ - - - +copy /y $(ProjectDir)include\sccsdk.h $(ProjectDir)sdk\ +copy /y $(ProjectDir)include\common.h $(ProjectDir)sdk\ +copy /y $(ProjectDir)include\usrerr.h $(ProjectDir)sdk\ +$(ProjectDir)scripts\gensdk.bat + + $(ProjectDir)scripts\cleansdk.bat + @@ -165,6 +169,7 @@ copy /y $(TargetDir)NetTunnelSDK.dll $(SolutionDir)NetTunnelApp\bin\$(Configurat + diff --git a/NetTunnelSDK/NetTunnelSDK.vcxproj.filters b/NetTunnelSDK/NetTunnelSDK.vcxproj.filters index cdcf2a8..117a9e2 100644 --- a/NetTunnelSDK/NetTunnelSDK.vcxproj.filters +++ b/NetTunnelSDK/NetTunnelSDK.vcxproj.filters @@ -75,15 +75,18 @@ 头文件 - - 头文件 - 头文件 头文件 + + 头文件 + + + 头文件 + diff --git a/NetTunnelSDK/include/common.h b/NetTunnelSDK/include/common.h index 11e48ef..e00315a 100644 --- a/NetTunnelSDK/include/common.h +++ b/NetTunnelSDK/include/common.h @@ -3,7 +3,7 @@ /** * @brief WireGuard key 最大长度 */ -constexpr auto WG_KEY_MAX = (64); +#define WG_KEY_MAX (64) /** * @brief 操作系统最大网卡数 @@ -66,10 +66,44 @@ typedef enum { HASH_SHA512 ///< SHA512 HASH 算法 } HASH_TYPE; +/** + * @brief 网络共享模式 + * + */ typedef enum { - CHK_SYSTEM_INIT, - CHK_WIREGUARD_CONFIG, - CHK_WIREGUARD_SERVICE, - CHK_WG_INTERFACE_PRIVATE, - CHK_MAX -} CHECK_FUNCTION; \ No newline at end of file + ICS_SHARE_MODE = 0, ///< Internet Share Mode(ICS) 模式 + NAT_SHARE_MODE = 1 ///< Net Address Translation(NAT) 模式 +} NET_SHARE_MODE; + +/** + * + * @brief 虚拟主机配置信息 + */ +typedef struct { + int vmId; ///< 用户虚拟机 ID + TCHAR vmName[MAX_PATH]; ///< 用户虚拟机名称 + TCHAR svrPublicKey[64]; ///< 用户服务端公钥 + TCHAR vmNetwork[MAX_IP_LEN]; ///< 用户虚拟机网络地址 + TCHAR scgGateWay[MAX_PATH]; ///< 用户服务端接入网关 + TCHAR scgTunnelGw[MAX_PATH]; ///< 用户隧道接入网关 +} VM_CFG, *PVM_CFG; + +/** + * + * @brief 客户端用户相关配置信息 + */ +typedef struct { + int scgCtrlAppId; ///< 用户接入网关控制 ID + int scgTunnelAppId; ///< 用户接入网关隧道 ID + TCHAR cliPrivateKey[64]; ///< 用户客户端私钥 + TCHAR cliPublicKey[64]; ///< 用户客户端公钥 + TCHAR cliAddress[MAX_IP_LEN]; ///< 用户客户端隧道IP地址 + PVM_CFG pVMConfig; ///< 用户虚拟机配置列表 + int tolVM; ///< 用户虚拟机配置最大数 +} USER_CLIENT_CONFIG, *PUSER_CLIENT_CONFIG; + +typedef struct { + int svrListenPort; ///< 用户服务端监听端口 + TCHAR svrPrivateKey[64]; ///< 用户服务端公钥 + TCHAR svrAddress[MAX_IP_LEN]; ///< 用户服务端隧道 IP 地址 +} USER_SERVER_CONFIG, *PUSER_SERVER_CONFIG; \ No newline at end of file diff --git a/NetTunnelSDK/include/globalcfg.h b/NetTunnelSDK/include/globalcfg.h index 590c497..0f3ce52 100644 --- a/NetTunnelSDK/include/globalcfg.h +++ b/NetTunnelSDK/include/globalcfg.h @@ -26,39 +26,6 @@ typedef struct { TCHAR wgCfgPath[MAX_PATH]; ///< 配置文件路径 } WGINTERFACE_CFG, *PWGINTERFACE_CFG; -/** - * - * @brief 虚拟主机配置信息 - */ -typedef struct { - int vmId; ///< 用户虚拟机 ID - TCHAR vmName[MAX_PATH]; ///< 用户虚拟机名称 - TCHAR svrPublicKey[64]; ///< 用户服务端公钥 - TCHAR vmNetwork[MAX_IP_LEN]; ///< 用户虚拟机网络地址 - TCHAR scgGateWay[MAX_PATH]; ///< 用户服务端接入网关 - TCHAR scgTunnelGw[MAX_PATH]; ///< 用户隧道接入网关 -} VM_CFG, *PVM_CFG; - -/** - * - * @brief 客户端用户相关配置信息 - */ -typedef struct { - int scgCtrlAppId; ///< 用户接入网关控制 ID - int scgTunnelAppId; ///< 用户接入网关隧道 ID - TCHAR cliPrivateKey[64]; ///< 用户客户端私钥 - TCHAR cliPublicKey[64]; ///< 用户客户端公钥 - TCHAR cliAddress[MAX_IP_LEN]; ///< 用户客户端隧道IP地址 - PVM_CFG pVMConfig; ///< 用户虚拟机配置列表 - int tolVM; ///< 用户虚拟机配置最大数 -} USER_CLIENT_CONFIG, *PUSER_CLIENT_CONFIG; - -typedef struct { - int svrListenPort; ///< 用户服务端监听端口 - TCHAR svrPrivateKey[64]; ///< 用户服务端公钥 - TCHAR svrAddress[MAX_IP_LEN]; ///< 用户服务端隧道 IP 地址 -} USER_SERVER_CONFIG, *PUSER_SERVER_CONFIG; - /** * @brief 用户信息配置 */ @@ -91,7 +58,6 @@ typedef struct { TCHAR systemDirectory[MAX_PATH]; ///< 操作系统目录 TCHAR workDirectory[MAX_PATH]; ///< SDK 当前工作目录 bool isWorkServer; ///< SDK 当前模式 客户端/服务端 - //int scgProxyPort; ///< SCG 代理端口, >0 启动 SCG代理,<=0 关闭SCG代理 PROTO_CRYPTO_TYPE proCryptoType; ///< 协议加密类型 TCHAR proKeyBuf[256]; ///< 协议加密秘钥 BOOL enableLog; ///< 是否启用日志 @@ -100,7 +66,7 @@ typedef struct { WGINTERFACE_CFG wgServerCfg; ///< wireguard 服务端网络接口配置 WGINTERFACE_CFG wgClientCfg; ///< wireguard 客户端网络接口配置 USER_CONFIG userCfg; ///< 用户配置项 - SCG_PROXY_INFO scgProxy; ///< SCG UDP 代理信息 + SCG_PROXY_INFO scgProxy; ///< SCG UDP 代理信息 int curConnVmId; ///< 当前连接的VM } SDK_CONFIG, *PSDK_CONFIG; diff --git a/NetTunnelSDK/include/network.h b/NetTunnelSDK/include/network.h index 875e671..c980205 100644 --- a/NetTunnelSDK/include/network.h +++ b/NetTunnelSDK/include/network.h @@ -1,53 +1,12 @@ #pragma once -#include -#ifdef NETTUNNELSDK_EXPORTS -#define NETWORK_API __declspec(dllexport) -#else -#define NETWORK_API __declspec(dllimport) -#endif - -/** - * - * @brief 本地计算机网卡信息 - */ -typedef struct { - int InterfaceIndex; ///< 网卡索引 - TCHAR NetCardUUID[260]; ///< 网卡名称, Windows标识为 UUID - TCHAR NetCardName[MAX_NETCARD_NAME]; ///< 网卡名称 - TCHAR NetCardDescription[132]; ///< 网卡描述 - TCHAR NetCardIpaddr[MAX_IP_LEN]; ///< 网卡 IP 地址 - TCHAR NetCardNetmask[MAX_IP_LEN]; ///< 网卡子网掩码 - TCHAR NetCardGateway[MAX_IP_LEN]; ///< 网卡网关 - TCHAR NetCardMacAddr[20]; ///< 网卡 MAC 地址 -} NIC_CONTENT, *PNIC_CONTENT; +#include "sccsdk.h" #ifdef __cplusplus // If used by C++ code, extern "C" { // we need to export the C interface #endif -/** - * @brief 获取本机网卡信息 - * @param[out] pInfo 网卡信息 @see NIC_CONTENT - * @param[out] pItemCounts 计算机当前操作系统中网卡总数 最大值 32 - * @return 函数执行结果 0: 成功, 小于0 失败 @see USER_ERRNO - * - -ERR_INPUT_PARAMS 输入参数错误 - * - -ERR_MALLOC_MEMORY 分配内存失败 - * - ERR_SUCCESS 成功 - */ -TUNNEL_API int __cdecl GetAllNICInfo(PNIC_CONTENT *pInfo, int *pItemCounts); - -/** - * @brief 获取当前 Internet 网卡名 - * @param[out] pIfIndex 网卡索引 - * @return 函数执行结果 0: 成功, 小于0 失败 @see USER_ERRNO - * - -ERR_INPUT_PARAMS 输入参数错误 - * - -ERR_ITEM_UNEXISTS 未找到具有 Internet 连接的网卡 - * - ERR_SUCCESS 成功 - */ -TUNNEL_API int __cdecl GetInternetIfIndex(int *pIfIndex); - /** * @brief 根据网卡 IP地址 获取网卡索引 * @param[in] pIpAddr 网卡IP地址 @@ -59,7 +18,7 @@ TUNNEL_API int __cdecl GetInternetIfIndex(int *pIfIndex); * - -ERR_UN_SUPPORT 系统不支持该操作 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl GetInterfaceIfIndexByIpAddr(const TCHAR *pIpAddr, ULONG *pIfIndex); +int GetInterfaceIfIndexByIpAddr(const TCHAR *pIpAddr, ULONG *pIfIndex); /** * @brief 根据网卡 GUDI 获取网卡名称 @@ -73,7 +32,7 @@ TUNNEL_API int __cdecl GetInterfaceIfIndexByIpAddr(const TCHAR *pIpAddr, ULONG * * - -ERR_ITEM_UNEXISTS GUID 不存在 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl GetInterfaceNameByGUID(const TCHAR *pGUID, TCHAR ifName[MAX_NETCARD_NAME]); +int GetInterfaceNameByGUID(const TCHAR *pGUID, TCHAR ifName[MAX_NETCARD_NAME]); /** * @brief 根据网卡名获取网卡索引 @@ -86,7 +45,7 @@ TUNNEL_API int __cdecl GetInterfaceNameByGUID(const TCHAR *pGUID, TCHAR ifName[M * - -ERR_MALLOC_MEMORY 分配内存失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl GetInterfaceIfIndexByName(const TCHAR *pInterfaceName, int *pIfIndex); +int GetInterfaceIfIndexByName(const TCHAR *pInterfaceName, int *pIfIndex); /** * @brief 根据网卡名获取网卡 GUID @@ -99,7 +58,7 @@ TUNNEL_API int __cdecl GetInterfaceIfIndexByName(const TCHAR *pInterfaceName, in * - -ERR_MALLOC_MEMORY 分配内存失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl GetInterfaceGUIDByIfIndex(const int ifIndex, GUID *pGuid); +int GetInterfaceGUIDByIfIndex(const int ifIndex, GUID *pGuid); /** * @brief 根据网卡名获取网卡 GUID @@ -112,9 +71,9 @@ TUNNEL_API int __cdecl GetInterfaceGUIDByIfIndex(const int ifIndex, GUID *pGuid) * - -ERR_MALLOC_MEMORY 分配内存失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl GetInterfaceGUIDByName(const TCHAR *pInterfaceName, GUID *pGuid); +int GetInterfaceGUIDByName(const TCHAR *pInterfaceName, GUID *pGuid); -TUNNEL_API int __cdecl WaitNetAdapterConnected(const TCHAR *pInterfaceName, int timeOutOfMs); +int WaitNetAdapterConnected(const TCHAR *pInterfaceName, int timeOutOfMs); /** * @brief 判断当前网络适配器是否拥有 Internet 连接 @@ -127,7 +86,7 @@ TUNNEL_API int __cdecl WaitNetAdapterConnected(const TCHAR *pInterfaceName, int * - -ERR_GET_IPFOWARDTBL 获取防火墙信息失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl IsInternetConnectAdapter(int ifIndex, bool *pRet); +int IsInternetConnectAdapter(int ifIndex, bool *pRet); /** * @brief 获取网卡 NetworkCategory 是否设置为 Private 模式 @@ -143,7 +102,7 @@ TUNNEL_API int __cdecl IsInternetConnectAdapter(int ifIndex, bool *pRet); * - -ERR_MEMORY_STR 字符集转换失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl GetNetConnectionNetworkCategory(const TCHAR *pInterfaceName, bool *pIsPrivate); +int GetNetConnectionNetworkCategory(const TCHAR *pInterfaceName, bool *pIsPrivate); /** * @brief 启动/停止 Windows 网络共享服务 @@ -162,7 +121,7 @@ TUNNEL_API int __cdecl GetNetConnectionNetworkCategory(const TCHAR *pInterfaceNa * - -ERR_NET_UNCONNECT 网络未连接 * - ERR_SUCCESS 成功 */ -NETWORK_API int __cdecl SetNetIntelnetConnectionSharing(int ifIndex, bool isEnable, bool isSetPrivate); +int SetNetIntelnetConnectionSharing(int ifIndex, bool isEnable, bool isSetPrivate); /** * @brief 获取当前网络共享服务状态 @@ -179,7 +138,7 @@ NETWORK_API int __cdecl SetNetIntelnetConnectionSharing(int ifIndex, bool isEnab * - -ERR_CALL_COMMOBJECT 获取网络共享状态失败 * - ERR_SUCCESS 成功 */ -NETWORK_API int __cdecl GetNetIntelnetConnectionSharing(int ifIndex, bool *pIsEnable); +int GetNetIntelnetConnectionSharing(int ifIndex, bool *pIsEnable); /** * @brief 设置网卡为 Private/Public 模式 * @param[in] pInterfaceName pInterfaceName 网卡名称 @@ -193,7 +152,7 @@ NETWORK_API int __cdecl GetNetIntelnetConnectionSharing(int ifIndex, bool *pIsEn * - -ERR_PROCESS_RETURN 系统调用执行结束返回失败 * - ERR_SUCCESS 成功 */ -NETWORK_API int __cdecl SetNetConnectionNetworkCategory(const TCHAR *pInterfaceName, const bool isPrivate); +int SetNetConnectionNetworkCategory(const TCHAR *pInterfaceName, const bool isPrivate); /** * @brief 添加系统路由表项 @@ -207,7 +166,7 @@ NETWORK_API int __cdecl SetNetConnectionNetworkCategory(const TCHAR *pInterfaceN * - -ERR_NET_REMOVE_ROUTE 删除路由表项失败 * - ERR_SUCCESS 成功 */ -NETWORK_API int __cdecl AddRouteTable(const char *pIP, const char *pMask, const char *pGateway); +int AddRouteTable(const char *pIP, const char *pMask, const char *pGateway); /** * @brief 开启 Windows WireGuard NAT 转发功能 @@ -220,7 +179,7 @@ NETWORK_API int __cdecl AddRouteTable(const char *pIP, const char *pMask, const * - -ERR_PROCESS_RETURN 系统调用执行结束返回失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl SetNATRule(const TCHAR *pInterfaceName, const TCHAR *pCidrIpaddr); +int SetNATRule(const TCHAR *pInterfaceName, const TCHAR *pCidrIpaddr); /** * @brief 关闭 Windows WireGuard NAT 转发功能 @@ -232,8 +191,9 @@ TUNNEL_API int __cdecl SetNATRule(const TCHAR *pInterfaceName, const TCHAR *pCid * - -ERR_PROCESS_RETURN 系统调用执行结束返回失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl RemoveNATRule(const TCHAR *pInterfaceName); +int RemoveNATRule(const TCHAR *pInterfaceName); +#if 0 /** * @brief 设置网络接口IP地址 * @param[in] pInterfaceName 网卡名称 @@ -246,9 +206,8 @@ TUNNEL_API int __cdecl RemoveNATRule(const TCHAR *pInterfaceName); * - -ERR_CALL_SHELL 调用系统命令行失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl SetInterfaceIpAddress(const TCHAR *pInterfaceName, const TCHAR *pIpaddr, const TCHAR *pNetmask); + int SetInterfaceIpAddress(const TCHAR *pInterfaceName, const TCHAR *pIpaddr, const TCHAR *pNetmask); -#if 0 /** * @brief 获取Windows Hyper-V 虚拟机状态, 必须开启后才能开启NAT转发功能 * @param[out] pEnabled 当前 Hyper-V 虚拟机状态, TRUE 表示开启, FALSE 表示关闭 @@ -258,7 +217,7 @@ TUNNEL_API int __cdecl SetInterfaceIpAddress(const TCHAR *pInterfaceName, const * - -ERR_CALL_SHELL 调用系统命令行失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl GetWindowsHyperVStatus(int *pEnabled); + int GetWindowsHyperVStatus(int *pEnabled); /** * @brief 启用/禁用 Windows Hyper-V 功能 @@ -270,7 +229,7 @@ TUNNEL_API int __cdecl GetWindowsHyperVStatus(int *pEnabled); * - -ERR_PROCESS_RETURN 系统调用执行结束返回失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl EnableWindowsHyperV(bool enabled); + int EnableWindowsHyperV(bool enabled); /** * @brief 设置网卡为 Private/Public 模式 @@ -285,7 +244,7 @@ TUNNEL_API int __cdecl EnableWindowsHyperV(bool enabled); * - -ERR_PROCESS_RETURN 系统调用执行结束返回失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl SetInterfacePrivate(const TCHAR *pInterfaceName, bool isPrivate); + int SetInterfacePrivate(const TCHAR *pInterfaceName, bool isPrivate); /** * @brief 获取网卡 NetworkCategory 是否设置为 Private 模式 @@ -301,7 +260,7 @@ TUNNEL_API int __cdecl SetInterfacePrivate(const TCHAR *pInterfaceName, bool isP * - -ERR_PROCESS_RETURN 系统调用执行结束返回失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl IsInterfacePrivate(const TCHAR *pInterfaceName, bool *pIsPrivateMode); + int IsInterfacePrivate(const TCHAR *pInterfaceName, bool *pIsPrivateMode); /** * @brief 获取网卡接口索引编号 @@ -314,7 +273,7 @@ TUNNEL_API int __cdecl IsInterfacePrivate(const TCHAR *pInterfaceName, bool *pIs * - -ERR_CALL_SHELL 调用系统命令行失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl GetInterfaceIndexByName(const TCHAR *pInterfaceName, int *pIndex); + int GetInterfaceIndexByName(const TCHAR *pInterfaceName, int *pIndex); /** * @brief 删除接口网络地址 @@ -326,7 +285,7 @@ TUNNEL_API int __cdecl GetInterfaceIndexByName(const TCHAR *pInterfaceName, int * - -ERR_CALL_SHELL 调用系统命令行失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl RemoveInterfaceIpAddress(const TCHAR *pInterfaceName); + int RemoveInterfaceIpAddress(const TCHAR *pInterfaceName); /** * @brief 设置网络接口IP地址 @@ -339,7 +298,7 @@ TUNNEL_API int __cdecl RemoveInterfaceIpAddress(const TCHAR *pInterfaceName); * - -ERR_CALL_SHELL 调用系统命令行失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl SetInterfaceIpAddressFromCIDR(const TCHAR *pInterfaceName, const TCHAR *pCidrIpaddr); + int SetInterfaceIpAddressFromCIDR(const TCHAR *pInterfaceName, const TCHAR *pCidrIpaddr); /** * @brief 设置网络接口IP地址 @@ -353,7 +312,7 @@ TUNNEL_API int __cdecl SetInterfaceIpAddressFromCIDR(const TCHAR *pInterfaceName * - -ERR_CALL_SHELL 调用系统命令行失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl SetInterfaceIpAddress(const TCHAR *pInterfaceName, const TCHAR *pIpaddr, const TCHAR *pNetmask); + int SetInterfaceIpAddress(const TCHAR *pInterfaceName, const TCHAR *pIpaddr, const TCHAR *pNetmask); /** @@ -370,7 +329,7 @@ TUNNEL_API int __cdecl SetInterfaceIpAddress(const TCHAR *pInterfaceName, const * - -ERR_PROCESS_RETURN 系统调用执行结束返回失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl IsNetConnectionSharingEnabled(const TCHAR *pInterfaceName, bool *pIsEnabled); + int IsNetConnectionSharingEnabled(const TCHAR *pInterfaceName, bool *pIsEnabled); /** * @brief WireGuard 服务 Windows PowerShell 自定义命令是否安装 @@ -378,7 +337,7 @@ TUNNEL_API int __cdecl IsNetConnectionSharingEnabled(const TCHAR *pInterfaceName * - TRUE 已经安装 * - FALSE 未安装 */ -TUNNEL_API bool __cdecl IsCustomNatPSCmdInstalled(); + bool IsCustomNatPSCmdInstalled(); #endif #ifdef __cplusplus } diff --git a/NetTunnelSDK/include/sccsdk.h b/NetTunnelSDK/include/sccsdk.h new file mode 100644 index 0000000..f6b3dfd --- /dev/null +++ b/NetTunnelSDK/include/sccsdk.h @@ -0,0 +1,266 @@ +#pragma once +#include +#include "common.h" +#include "usrerr.h" + +#ifdef NETTUNNELSDK_EXPORTS +#define SCCSDK_API __declspec(dllexport) +#else +#define SCCSDK_API __declspec(dllimport) +#endif + +typedef void (*PTUNNEL_HEART_ROUTINE)(const TCHAR *pMessage, unsigned int timeStampOfSeconds); +typedef PTUNNEL_HEART_ROUTINE LPTUNNEL_HEART_ROUTINE; + +/** + * + * @brief 本地计算机网卡信息 + */ +typedef struct { + int InterfaceIndex; ///< 网卡索引 + TCHAR NetCardUUID[260]; ///< 网卡名称, Windows标识为 UUID + TCHAR NetCardName[MAX_NETCARD_NAME]; ///< 网卡名称 + TCHAR NetCardDescription[132]; ///< 网卡描述 + TCHAR NetCardIpaddr[MAX_IP_LEN]; ///< 网卡 IP 地址 + TCHAR NetCardNetmask[MAX_IP_LEN]; ///< 网卡子网掩码 + TCHAR NetCardGateway[MAX_IP_LEN]; ///< 网卡网关 + TCHAR NetCardMacAddr[20]; ///< 网卡 MAC 地址 +} NIC_CONTENT, *PNIC_CONTENT; + +#ifdef __cplusplus // If used by C++ code, +extern "C" { +// we need to export the C interface +#endif + +/** + * @brief 初始化 SDK 运行环境 + * @param[in] pWorkDir 程序工作路径,如果不设置系统自动获取 + * @param[in] pSvrUrl 管理平台 URL 地址 example: http://localhost:2313, https://localhost:2313 + * @param[in] pLogFile 日志文件名称/完整路径 + * @param[in] level 日志最低有效等级 + * @param[in] isWorkServer SDK 工作模式 + * - TRUE 服务端 + * - FALSE 客户端 + * @return 函数执行结果 0: 成功, 小于0 失败 @see USER_ERRNO + * - -ERR_ITEM_EXISTS 未找到 WireGuard 程序 + * - -ERR_SYS_CALL 获取配置本地配置文件存储目录失败 + * - -ERR_CREATE_FILE 创建用户配置文件目录失败 + * - -ERR_ITEM_UNEXISTS WireGuard 未安装 + * - ERR_SUCCESS 成功 + */ +SCCSDK_API int __cdecl TunnelSDKInitEnv(const TCHAR *pWorkDir, + const TCHAR *pSvrUrl, + const TCHAR *pLogFile, + LOG_LEVEL level, + bool isWorkServer); + +/** + * @brief 清理 SDK 运行资源 + */ +SCCSDK_API void __cdecl TunnelSDKUnInit(); + +/** + * @brief 打开/关闭 SDK 日志开关 + * @param enLog 日志开关 + * - TRUE 打开日志 + * - FALSE 关闭日志 + */ +SCCSDK_API void __cdecl TunnelLogEnable(bool enLog); + +/** + * @brief 获取当前 WireGuard 服务隧道是否正则运行 + * @param pTunnelName 隧道服务名 + * @param pIsRunning pIsRunning WireGuard 服务隧道运行状态 + * - TRUE 已经安装 + * - FALSE 未安装 + * @return 函数执行结果 0: 成功, 小于0 失败 @see USER_ERRNO + * - -ERR_INPUT_PARAMS 输入参数错误 + * - -ERR_OPEN_SCM 打开服务管理器设备失败 + * - ERR_SUCCESS 成功 + */ +SCCSDK_API int __cdecl GetWireGuardServiceStatus(const TCHAR *pTunnelName, bool *pIsRunning); + +/** + * @brief 判断当前网络服务工作模式 客户端/服务端 + * @param[out] pIsWorkServer 工作模式 + * - TRUE 服务端 + * - FALSE 客户端 + * @return 函数执行结果 0: 成功, 小于0 失败 @see USER_ERRNO + * - -ERR_INPUT_PARAMS 输入参数错误 + * - ERR_SUCCESS 成功 + */ +SCCSDK_API int __cdecl GetWireGuardWorkMode(bool *pIsWorkServer); + +/** + * @brief 获取当前 WireGuard 服务隧道是否正则运行 + * @param[in] pIfName WireGuard 隧道网络接口名称 + * @param[out] pIsRunning WireGuard 服务隧道运行状态 + * - TRUE 已经安装 + * - FALSE 未安装 + * @return 0: 成功, 小于0 失败 @see USER_ERRNO + * - -ERR_INPUT_PARAMS 输入参数错误 + * - -ERR_MALLOC_MEMORY 分配内存失败 + * - ERR_SUCCESS 成功 + */ +SCCSDK_API int __cdecl IsWireGuardServerRunning(const TCHAR *pIfName, bool *pIsRunning); + +/** + * @brief SCG 代理服务开关 + * @param isEnable TRUE: 启动 SCG 代理, FALSE: 禁用 SCG 代理 + * @param pSCGIpAddr SCG 代理 IP + * @param scgPort SCG 代理端口 + * @return 0: 成功, 小于0 失败 @see USER_ERRNO + * - -ERR_INPUT_PARAMS 输入参数错误 + * - ERR_SUCCESS 成功 + */ +SCCSDK_API int __cdecl EnableSCGProxy(bool isEnable, const TCHAR *pSCGIpAddr, int scgPort); + +/** + * @brief 获取当前 SCG 代理服务状态 + * @return TRUE: SCG 代理启动, FALSE: SCG 代理禁用 + */ +SCCSDK_API bool __cdecl UsedSCGProxy(); + +/** + * @brief 获取当前网络共享模式 + * @return 当前网络共享模式 @see NET_SHARE_MODE + */ +SCCSDK_API NET_SHARE_MODE __cdecl GetCurrentNetShareMode(); + +/** + * @brief 设置获取当前网络共享模式 + * @param shareMode 网络共享模式 @see NET_SHARE_MODE + */ +SCCSDK_API void __cdecl SetCurrentNetShareMode(NET_SHARE_MODE shareMode); + +/** + * @brief 获取本机网卡信息 + * @param[out] pInfo 网卡信息 @see NIC_CONTENT + * @param[out] pItemCounts 计算机当前操作系统中网卡总数 最大值 32 + * @return 函数执行结果 0: 成功, 小于0 失败 @see USER_ERRNO + * - -ERR_INPUT_PARAMS 输入参数错误 + * - -ERR_MALLOC_MEMORY 分配内存失败 + * - ERR_SUCCESS 成功 + */ +SCCSDK_API int __cdecl GetAllNICInfo(PNIC_CONTENT *pInfo, int *pItemCounts); + +/** + * @brief 获取当前 Internet 网卡名 + * @param[out] pIfIndex 网卡索引 + * @return 函数执行结果 0: 成功, 小于0 失败 @see USER_ERRNO + * - -ERR_INPUT_PARAMS 输入参数错误 + * - -ERR_ITEM_UNEXISTS 未找到具有 Internet 连接的网卡 + * - ERR_SUCCESS 成功 + */ +SCCSDK_API int __cdecl GetInternetIfIndex(int *pIfIndex); + +/** + * @brief 云电脑服务端创建控制服务 + * @param pSvr 服务端配置信息 + * @return 0: 成功, 小于0 失败 @see USER_ERRNO + * - -ERR_INPUT_PARAMS 输入参数错误 + * - -ERR_CREATE_THREAD 创建线程失败 + * - -ERR_SOCKET_BIND_PORT 绑定端口失败 + * - -ERR_ITEM_EXISTS 服务线程状态异常 + * - ERR_SUCCESS 成功 + */ +SCCSDK_API int __cdecl CreateControlService(PUSER_SERVER_CONFIG pSvr); + +/** + * @brief 获取用户服务端配置信息 + * @param[in] pUserName 用户名 + * @param[in] pToken 用户访问令牌 + * @param[out] pSvrCfg 服务端用户配置信息 + * @return 0: 成功, 小于0 失败 @see USER_ERRNO + * - -ERR_INPUT_PARAMS 输入参数错误 + * - -ERR_MEMORY_STR 字符串处理 + * - -ERR_CREATE_FILE 创建用户配置目录失败 + * - ERR_SUCCESS 成功 + */ +SCCSDK_API int __cdecl GetUserServerConfigure(const TCHAR *pUserName, + const TCHAR *pToken, + PUSER_SERVER_CONFIG *pSvrCfg); + +/** + * @brief 获取用户客户端配置信息 + * @param[in] pUserName 用户名 + * @param[in] pToken 用户访问令牌 + * @param[out] pCliCfg 客户端用户配置信息 + * @return 0: 成功, 小于0 失败 @see USER_ERRNO + * - -ERR_INPUT_PARAMS 输入参数错误 + * - -ERR_MEMORY_STR 字符串处理 + * - -ERR_CREATE_FILE 创建用户配置目录失败 + * - ERR_SUCCESS 成功 + */ +SCCSDK_API int __cdecl GetUserClientConfigure(const TCHAR *pUserName, + const TCHAR *pToken, + PUSER_CLIENT_CONFIG *pCliCfg); + +/** + * @brief 连接远程控制服务配置隧道参数 + * @param[in] vmId 需要连接的虚拟机ID编号 + * @param[in] pCliNetwork 需要共享的本地网络地址 + * @return 成功, 小于0 失败 @see USER_ERRNO + * - -ERR_INPUT_PARAMS 输入参数错误 + * - -ERR_SYSTEM_UNINITIALIZE 服务端参数未初始化 + * - -ERR_MALLOC_MEMORY 分配内存失败 + * - -ERR_OPEN_FILE 打开文件失败 + * - -ERR_MEMORY_STR 字符串处理失败 + * - -ERR_UN_SUPPORT 不支持的格式转换 + * - -ERR_JSON_CREATE 创建 JSON 字符串失败 + * - -ERR_HTTP_POST_DATA 调用 POST 方法失败 + * - -ERR_HTTP_SERVER_RSP 服务端返回失败(非200) + * - -ERR_READ_FILE 服务端返回空数据 + * - -ERR_JSON_DECODE 解析 JSON 数据失败 + * - ERR_SUCCESS 成功 + */ +SCCSDK_API int __cdecl RemoteCtrlSvrCfgUserTunnel(int vmId, const TCHAR *pCliNetwork); + +/** + * @brief 启动/停止远程云电脑中的 WireGuard 隧道服务 + * @param[in] isStart 启动/停止服务 TRUE 启动服务, FALSE 停止服务 + * @return 0: 成功, 小于0 失败 @see USER_ERRNO + * - -ERR_INPUT_PARAMS 输入参数错误 + * - -ERR_SYSTEM_UNINITIALIZE 未初始化远程服务 URL 地址 + * - -ERR_CREATE_FILE 创建用户配置目录失败 + * - -ERR_HTTP_POST_DATA POST 数据到服务端失败 + * - -ERR_HTTP_SERVER_RSP HTTP 服务器返回错误 + * - -ERR_READ_FILE 服务端未返回正确的消息 + * - -ERR_JSON_DECODE JSON 字符串解码失败 + * - ERR_SUCCESS 成功 + */ +SCCSDK_API int __cdecl RemoteWireGuardControl(bool isStart); + +/** + * @brief 启动/停止 本地 WireGuard 隧道服务 + * @param[in] isStart 启动/停止服务 TRUE 启动服务, FALSE 停止服务 + * @param[in] setPrivateMode 是否设置网卡工作模式为 专用网络模式(Private) + * @return 0: 成功, 小于0 失败 @see USER_ERRNO + * - -ERR_INPUT_PARAMS 输入参数错误 + * - -ERR_NET_CATEGORY_MODE 网卡工作模式错误 + * - -ERR_UN_SUPPORT 不支持的网络共享类型 + * - ERR_SUCCESS 成功 + */ +SCCSDK_API int __cdecl LocalWireGuardControl(bool isStart, bool setPrivateMode); + +/** + * @brief 启动/停止 隧道控制服务心跳 + * @param isStart 启动/停止服务 TRUE 启动服务, FALSE 停止服务 + * @param lpHeartCbAddress 心跳服务回调函数 @see PTUNNEL_HEART_ROUTINE + * @return 0: 成功, 小于0 失败 @see USER_ERRNO + * - -ERR_INPUT_PARAMS 输入参数错误 + * - -ERR_CREATE_TIMER 创建定时器失败 + * - -ERR_DELETE_TIMER 删除定时器失败 + * - ERR_SUCCESS 成功 + */ +SCCSDK_API int __cdecl RemoteHeartControl(bool isStart, LPTUNNEL_HEART_ROUTINE lpHeartCbAddress); + +/** + * @brief 获取用户错误码字符串 + * @param err 用户错误码 + * @return 用户错误码对应的字符串, "UNKNOWN": 未知错误 + */ +SCCSDK_API const CHAR* __cdecl GetSDKErrorMessage(USER_ERRNO err); +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/NetTunnelSDK/include/tunnel.h b/NetTunnelSDK/include/tunnel.h index 1dd5f15..6cb02b6 100644 --- a/NetTunnelSDK/include/tunnel.h +++ b/NetTunnelSDK/include/tunnel.h @@ -1,22 +1,13 @@ #pragma once +#include "sccsdk.h" -#include "common.h" -#include - -#ifdef NETTUNNELSDK_EXPORTS -#define TUNNEL_API __declspec(dllexport) -#else -#define TUNNEL_API __declspec(dllimport) -#endif - -/** - * @brief 网络共享模式 - * - */ typedef enum { - ICS_SHARE_MODE = 0, ///< Internet Share Mode(ICS) 模式 - NAT_SHARE_MODE = 1 ///< Net Address Translation(NAT) 模式 -} NET_SHARE_MODE; + CHK_SYSTEM_INIT, + CHK_WIREGUARD_CONFIG, + CHK_WIREGUARD_SERVICE, + CHK_WG_INTERFACE_PRIVATE, + CHK_MAX +} CHECK_FUNCTION; typedef struct { CHECK_FUNCTION chk; @@ -56,41 +47,6 @@ typedef struct { extern "C" { // we need to export the C interface #endif - -/** - * @brief 获取当前网络共享模式 - * @return 当前网络共享模式 @see NET_SHARE_MODE - */ -TUNNEL_API NET_SHARE_MODE __cdecl GetCurrentNetShareMode(); - -/** - * @brief 设置获取当前网络共享模式 - * @param shareMode 网络共享模式 @see NET_SHARE_MODE - */ -TUNNEL_API void __cdecl SetCurrentNetShareMode(NET_SHARE_MODE shareMode); - -/** - * @brief 初始化 SDK 运行环境 - * @param[in] pWorkDir 程序工作路径,如果不设置系统自动获取 - * @param[in] pSvrUrl 管理平台 URL 地址 example: http://localhost:2313, https://localhost:2313 - * @param[in] pLogFile 日志文件名称/完整路径 - * @param[in] level 日志最低有效等级 - * @param[in] isWorkServer SDK 工作模式 - * - TRUE 服务端 - * - FALSE 客户端 - * @return 函数执行结果 0: 成功, 小于0 失败 @see USER_ERRNO - * - -ERR_ITEM_EXISTS 未找到 WireGuard 程序 - * - -ERR_SYS_CALL 获取配置本地配置文件存储目录失败 - * - -ERR_CREATE_FILE 创建用户配置文件目录失败 - * - -ERR_ITEM_UNEXISTS WireGuard 未安装 - * - ERR_SUCCESS 成功 - */ -TUNNEL_API int __cdecl TunnelSDKInitEnv(const TCHAR *pWorkDir, - const TCHAR *pSvrUrl, - const TCHAR *pLogFile, - LOG_LEVEL level, - bool isWorkServer); - /** * @brief 设置传输协议加密方式,默认 CRYPTO_NONE * @param[in] type 协议加密类型 @see PROTO_CRYPTO_TYPE @@ -99,15 +55,7 @@ TUNNEL_API int __cdecl TunnelSDKInitEnv(const TCHAR *pWorkDir, * - -ERR_INPUT_PARAMS 输入参数错误 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl SetProtocolEncryptType(const PROTO_CRYPTO_TYPE type, const TCHAR *pProKey); - -/** - * @brief 打开/关闭 SDK 日志开关 - * @param enLog 日志开关 - * - TRUE 打开日志 - * - FALSE 关闭日志 - */ -TUNNEL_API void __cdecl TunnelLogEnable(bool enLog); +int SetProtocolEncryptType(const PROTO_CRYPTO_TYPE type, const TCHAR *pProKey); /** * @brief 创建 WireGuard 服务端配置文件 @@ -119,7 +67,7 @@ TUNNEL_API void __cdecl TunnelLogEnable(bool enLog); * - -ERR_MEMORY_STR 字符串处理失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl WireGuardCreateServerConfig(const PWGSERVER_CONFIG pWgConfig); +int WireGuardCreateServerConfig(const PWGSERVER_CONFIG pWgConfig); /** * @brief 创建 WireGuard 客户端配置文件 @@ -131,7 +79,7 @@ TUNNEL_API int __cdecl WireGuardCreateServerConfig(const PWGSERVER_CONFIG pWgCon * - -ERR_MEMORY_STR 字符串处理失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl WireGuardCreateClientConfig(const PWGCLIENT_CONFIG pWgConfig); +int WireGuardCreateClientConfig(const PWGCLIENT_CONFIG pWgConfig); /** * @brief 通过 WireGuard 配置文件安装隧道服务 @@ -147,22 +95,10 @@ TUNNEL_API int __cdecl WireGuardCreateClientConfig(const PWGCLIENT_CONFIG pWgCon * - -ERR_START_SERVICE 停止服务失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl CreateWireGuardService(const TCHAR *pInterfaceName, const TCHAR *pWGConfigFilePath); +int CreateWireGuardService(const TCHAR *pInterfaceName, const TCHAR *pWGConfigFilePath); -/** - * @brief 获取当前 WireGuard 服务隧道是否正则运行 - * @param pTunnelName 隧道服务名 - * @param pIsRunning pIsRunning WireGuard 服务隧道运行状态 - * - TRUE 已经安装 - * - FALSE 未安装 - * @return 函数执行结果 0: 成功, 小于0 失败 @see USER_ERRNO - * - -ERR_INPUT_PARAMS 输入参数错误 - * - -ERR_OPEN_SCM 打开服务管理器设备失败 - * - ERR_SUCCESS 成功 - */ -TUNNEL_API int __cdecl GetWireGuardServiceStatus(const TCHAR *pTunnelName, bool *pIsRunning); +int GetWireGuradTunnelInfo(const TCHAR *pTunnelName); -TUNNEL_API int __cdecl GetWireGuradTunnelInfo(const TCHAR *pTunnelName); /** * @brief 移除 WireGuard 隧道服务 * @param pTunnelName 隧道服务名 @@ -175,14 +111,14 @@ TUNNEL_API int __cdecl GetWireGuradTunnelInfo(const TCHAR *pTunnelName); * - -ERR_DELETE_SERVICE 删除服务失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl RemoveGuardService(const TCHAR *pTunnelName, bool bIsWaitStop); +int RemoveGuardService(const TCHAR *pTunnelName, bool bIsWaitStop); /** * @brief 安装/卸载 WireGuard 服务 * @param[in] bInstall TRUE 安装服务, FALSE 卸载服务 * @return 函数执行结果 0: 成功, 小于0 失败 @see USER_ERRNO */ -TUNNEL_API int __cdecl WireGuardInstallDefaultServerService(bool bInstall); +int WireGuardInstallDefaultServerService(bool bInstall); /** * @brief 通过 WireGuard 配置文件安装隧道服务 @@ -193,7 +129,7 @@ TUNNEL_API int __cdecl WireGuardInstallDefaultServerService(bool bInstall); * - -ERR_CALL_SHELL 调用 WireGuard 外部服务失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl WireGuardInstallServerService(const TCHAR *pTunnelCfgPath); +int WireGuardInstallServerService(const TCHAR *pTunnelCfgPath); /** * @brief 卸载 WireGuard 隧道服务 @@ -204,18 +140,7 @@ TUNNEL_API int __cdecl WireGuardInstallServerService(const TCHAR *pTunnelCfgPath * - -ERR_CALL_SHELL 调用 WireGuard 外部服务失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl WireGuardUnInstallServerService(const TCHAR *pTunnelName); - -/** - * @brief 判断当前网络服务工作模式 客户端/服务端 - * @param[out] pIsWorkServer 工作模式 - * - TRUE 服务端 - * - FALSE 客户端 - * @return 函数执行结果 0: 成功, 小于0 失败 @see USER_ERRNO - * - -ERR_INPUT_PARAMS 输入参数错误 - * - ERR_SUCCESS 成功 - */ -TUNNEL_API int __cdecl GetWireGuardWorkMode(bool *pIsWorkServer); +int WireGuardUnInstallServerService(const TCHAR *pTunnelName); /** * @brief 获取当前 WireGuard 服务是否安装 @@ -229,42 +154,7 @@ TUNNEL_API int __cdecl GetWireGuardWorkMode(bool *pIsWorkServer); * - -ERR_GET_SERVICESSTATUS, 获取服务状态失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl IsWireGuardServerInstalled(bool *pIsInstalled); - -/** - * @brief 获取当前 WireGuard 服务隧道是否正则运行 - * @param[in] pIfName WireGuard 隧道网络接口名称 - * @param[out] pIsRunning WireGuard 服务隧道运行状态 - * - TRUE 已经安装 - * - FALSE 未安装 - * @return 0: 成功, 小于0 失败 @see USER_ERRNO - * - -ERR_INPUT_PARAMS 输入参数错误 - * - -ERR_MALLOC_MEMORY 分配内存失败 - * - ERR_SUCCESS 成功 - */ -TUNNEL_API int __cdecl IsWireGuardServerRunning(const TCHAR *pIfName, bool *pIsRunning); - -/** - * @brief 清理 SDK 运行资源 - */ -TUNNEL_API void __cdecl TunnelSDKUnInit(); - -/** - * @brief SCG 代理服务开关 - * @param isEnable TRUE: 启动 SCG 代理, FALSE: 禁用 SCG 代理 - * @param pSCGIpAddr SCG 代理 IP - * @param scgPort SCG 代理端口 - * @return 0: 成功, 小于0 失败 @see USER_ERRNO - * - -ERR_INPUT_PARAMS 输入参数错误 - * - ERR_SUCCESS 成功 - */ -TUNNEL_API int __cdecl EnableSCGProxy(bool isEnable, const TCHAR* pSCGIpAddr, int scgPort); - -/** - * @brief 获取当前 SCG 代理服务状态 - * @return TRUE: SCG 代理启动, FALSE: SCG 代理禁用 - */ -TUNNEL_API bool __cdecl UsedSCGProxy(); +int IsWireGuardServerInstalled(bool *pIsInstalled); /** * @brief 计算文件 Hash @@ -282,7 +172,7 @@ TUNNEL_API bool __cdecl UsedSCGProxy(); * - -ERR_BCRYPT_FINISHHASH 计算 Hash 结果失败 * - ERR_SUCCESS 成功 */ -TUNNEL_API int __cdecl CalcFileHash(const HASH_TYPE type, const TCHAR *pPath, TCHAR outHash[]); + int CalcFileHash(const HASH_TYPE type, const TCHAR *pPath, TCHAR outHash[]); #ifdef __cplusplus } diff --git a/NetTunnelSDK/include/user.h b/NetTunnelSDK/include/user.h index 0ac5ece..f1b556e 100644 --- a/NetTunnelSDK/include/user.h +++ b/NetTunnelSDK/include/user.h @@ -1,14 +1,7 @@ #pragma once -#include -#ifdef NETTUNNELSDK_EXPORTS -#define USERMANAGER_API __declspec(dllexport) -#else -#define USERMANAGER_API __declspec(dllimport) -#endif +#include "sccsdk.h" #define HEART_PERIOD_MS (3000) -typedef void (*PTUNNEL_HEART_ROUTINE)(const TCHAR *pMessage, unsigned int timeStampOfSeconds); -typedef PTUNNEL_HEART_ROUTINE LPTUNNEL_HEART_ROUTINE; /** * @@ -27,19 +20,7 @@ extern "C" { * @brief 连接到服务端控制服务 * @param pUserSvrUrl 服务端控制服务 URL 地址 */ -USERMANAGER_API void __cdecl ConnectServerControlService(const TCHAR *pUserSvrUrl); - -/** - * @brief 云电脑服务端创建控制服务 - * @param pSvr 服务端配置信息 - * @return 0: 成功, 小于0 失败 @see USER_ERRNO - * - -ERR_INPUT_PARAMS 输入参数错误 - * - -ERR_CREATE_THREAD 创建线程失败 - * - -ERR_SOCKET_BIND_PORT 绑定端口失败 - * - -ERR_ITEM_EXISTS 服务线程状态异常 - * - ERR_SUCCESS 成功 - */ -USERMANAGER_API int __cdecl CreateControlService(PUSER_SERVER_CONFIG pSvr); +void ConnectServerControlService(const TCHAR *pUserSvrUrl); /** * @brief 停止云电脑服务端服务 @@ -47,27 +28,7 @@ USERMANAGER_API int __cdecl CreateControlService(PUSER_SERVER_CONFIG pSvr); * - -ERROR_TIMEOUT 等待超时 * - ERR_SUCCESS 成功 */ -USERMANAGER_API int __cdecl StopControlService(); - -/** - * @brief 连接远程控制服务配置隧道参数 - * @param[in] vmId 需要连接的虚拟机ID编号 - * @param[in] pCliNetwork 需要共享的本地网络地址 - * @return 成功, 小于0 失败 @see USER_ERRNO - * - -ERR_INPUT_PARAMS 输入参数错误 - * - -ERR_SYSTEM_UNINITIALIZE 服务端参数未初始化 - * - -ERR_MALLOC_MEMORY 分配内存失败 - * - -ERR_OPEN_FILE 打开文件失败 - * - -ERR_MEMORY_STR 字符串处理失败 - * - -ERR_UN_SUPPORT 不支持的格式转换 - * - -ERR_JSON_CREATE 创建 JSON 字符串失败 - * - -ERR_HTTP_POST_DATA 调用 POST 方法失败 - * - -ERR_HTTP_SERVER_RSP 服务端返回失败(非200) - * - -ERR_READ_FILE 服务端返回空数据 - * - -ERR_JSON_DECODE 解析 JSON 数据失败 - * - ERR_SUCCESS 成功 - */ -USERMANAGER_API int __cdecl RemoteCtrlSvrCfgUserTunnel(int vmId, const TCHAR *pCliNetwork); +int StopControlService(); /** * @brief 设置本地 WireGuard 隧道配置 @@ -87,81 +48,14 @@ USERMANAGER_API int __cdecl RemoteCtrlSvrCfgUserTunnel(int vmId, const TCHAR *pC * - -ERR_MALLOC_MEMORY 分配内存失败 * - ERR_SUCCESS 成功 */ -USERMANAGER_API int __cdecl SetTunnelConfigure(const TCHAR *pCliPrivateKey, - const TCHAR *pSvrPublicKey, - const TCHAR *pSvrNetwork, - const TCHAR *pCliNetwork, - const TCHAR *pSvrTunnelAddr, - const TCHAR *pSvrEndPoint); +int SetTunnelConfigure(const TCHAR *pCliPrivateKey, + const TCHAR *pSvrPublicKey, + const TCHAR *pSvrNetwork, + const TCHAR *pCliNetwork, + const TCHAR *pSvrTunnelAddr, + const TCHAR *pSvrEndPoint); -/** - * @brief 启动/停止 隧道控制服务心跳 - * @param isStart 启动/停止服务 TRUE 启动服务, FALSE 停止服务 - * @param lpHeartCbAddress 心跳服务回调函数 @see PTUNNEL_HEART_ROUTINE - * @return 0: 成功, 小于0 失败 @see USER_ERRNO - * - -ERR_INPUT_PARAMS 输入参数错误 - * - -ERR_CREATE_TIMER 创建定时器失败 - * - -ERR_DELETE_TIMER 删除定时器失败 - * - ERR_SUCCESS 成功 - */ -USERMANAGER_API int __cdecl RemoteHeartControl(bool isStart, LPTUNNEL_HEART_ROUTINE lpHeartCbAddress); - -/** - * @brief 启动/停止远程云电脑中的 WireGuard 隧道服务 - * @param[in] isStart 启动/停止服务 TRUE 启动服务, FALSE 停止服务 - * @return 0: 成功, 小于0 失败 @see USER_ERRNO - * - -ERR_INPUT_PARAMS 输入参数错误 - * - -ERR_SYSTEM_UNINITIALIZE 未初始化远程服务 URL 地址 - * - -ERR_CREATE_FILE 创建用户配置目录失败 - * - -ERR_HTTP_POST_DATA POST 数据到服务端失败 - * - -ERR_HTTP_SERVER_RSP HTTP 服务器返回错误 - * - -ERR_READ_FILE 服务端未返回正确的消息 - * - -ERR_JSON_DECODE JSON 字符串解码失败 - * - ERR_SUCCESS 成功 - */ -USERMANAGER_API int __cdecl RemoteWireGuardControl(bool isStart); - -/** - * @brief 启动/停止 本地 WireGuard 隧道服务 - * @param[in] isStart 启动/停止服务 TRUE 启动服务, FALSE 停止服务 - * @param[in] setPrivateMode 是否设置网卡工作模式为 专用网络模式(Private) - * @return 0: 成功, 小于0 失败 @see USER_ERRNO - * - -ERR_INPUT_PARAMS 输入参数错误 - * - -ERR_NET_CATEGORY_MODE 网卡工作模式错误 - * - -ERR_UN_SUPPORT 不支持的网络共享类型 - * - ERR_SUCCESS 成功 - */ -USERMANAGER_API int __cdecl LocalWireGuardControl(bool isStart, bool setPrivateMode); - -/** - * @brief 获取用户服务端配置信息 - * @param[in] pUserName 用户名 - * @param[in] pToken 用户访问令牌 - * @param[out] pSvrCfg 服务端用户配置信息 - * @return 0: 成功, 小于0 失败 @see USER_ERRNO - * - -ERR_INPUT_PARAMS 输入参数错误 - * - -ERR_MEMORY_STR 字符串处理 - * - -ERR_CREATE_FILE 创建用户配置目录失败 - * - ERR_SUCCESS 成功 - */ -USERMANAGER_API int __cdecl GetUserServerConfigure(const TCHAR *pUserName, - const TCHAR *pToken, - PUSER_SERVER_CONFIG *pSvrCfg); -/** - * @brief 获取用户客户端配置信息 - * @param[in] pUserName 用户名 - * @param[in] pToken 用户访问令牌 - * @param[out] pCliCfg 客户端用户配置信息 - * @return 0: 成功, 小于0 失败 @see USER_ERRNO - * - -ERR_INPUT_PARAMS 输入参数错误 - * - -ERR_MEMORY_STR 字符串处理 - * - -ERR_CREATE_FILE 创建用户配置目录失败 - * - ERR_SUCCESS 成功 - */ -USERMANAGER_API int __cdecl GetUserClientConfigure(const TCHAR *pUserName, - const TCHAR *pToken, - PUSER_CLIENT_CONFIG *pCliCfg); -USERMANAGER_API int __cdecl GetUserConfigFiles(const TCHAR *pUserName, PUSER_CFGFILE* pCfgFile, int *pItems); + int GetUserConfigFiles(const TCHAR *pUserName, PUSER_CFGFILE* pCfgFile, int *pItems); #ifdef __cplusplus } diff --git a/NetTunnelSDK/misc/misc.cpp b/NetTunnelSDK/misc/misc.cpp index 20c5af5..f40e8b0 100644 --- a/NetTunnelSDK/misc/misc.cpp +++ b/NetTunnelSDK/misc/misc.cpp @@ -1,11 +1,12 @@ #include "pch.h" #include "misc.h" -#include "usrerr.h" +#include "sccsdk.h" #include #include #include +#include TCHAR *binToHexString(TCHAR *p, const unsigned char *cp, unsigned int count) { static const TCHAR hex_asc[] = TEXT("0123456789abcdef"); @@ -307,8 +308,28 @@ int TCharToWideChar(const TCHAR *pTStr, WCHAR *pOutStr, int maxOutLen) { } MultiByteToWideChar(CP_ACP, 0, pTStr, lstrlen(pTStr), pOutStr, len); - pOutStr[len] = 0; - - return ERR_SUCCESS; - } + pOutStr[len] = 0; + + return ERR_SUCCESS; + } +} + +static std::unordered_map g_UserErrorMap; + +const CHAR *GetSDKErrorMessage(USER_ERRNO err) { + std::unordered_map::iterator iter; + + if (g_UserErrorMap.empty()) { + constexpr auto color_entries = magic_enum::enum_entries(); + + for (auto colorEntry : color_entries) { + g_UserErrorMap.emplace(colorEntry.first, std::string(colorEntry.second)); + } + } + + if ((iter = g_UserErrorMap.find(err)) != g_UserErrorMap.end()) { + return iter->second.c_str(); + } else { + return "UNKNOWN"; + } } \ No newline at end of file diff --git a/NetTunnelSDK/network/ControlService.cpp b/NetTunnelSDK/network/ControlService.cpp index a8d7049..7289867 100644 --- a/NetTunnelSDK/network/ControlService.cpp +++ b/NetTunnelSDK/network/ControlService.cpp @@ -205,7 +205,7 @@ int CreateControlService(PUSER_SERVER_CONFIG pSvr) { } if (reqData.msgContent.isStart) { - SPDLOG_INFO(TEXT("Tunnel Service Start Now: {0}"), GetGlobalCfgInfo()->userCfg.userName); + SPDLOG_INFO(TEXT("Tunnel Service Start Now ......: {0}"), GetGlobalCfgInfo()->userCfg.userName); } else { SPDLOG_INFO(TEXT("Tunnel Service Stoped: {0}"), GetGlobalCfgInfo()->userCfg.userName); } diff --git a/NetTunnelSDK/network/ProxyService.cpp b/NetTunnelSDK/network/ProxyService.cpp index 996ca08..990aaf5 100644 --- a/NetTunnelSDK/network/ProxyService.cpp +++ b/NetTunnelSDK/network/ProxyService.cpp @@ -9,6 +9,8 @@ #include #include +#define SCG_UDP_HEAD_SIZE (11) + typedef struct { bool isRunning; HANDLE proxyThread; @@ -99,22 +101,41 @@ static DWORD UDPProxyRecvThread(LPVOID lpParameter) { bool isRemoteInit = false; sockaddr_in localWgAddr {}; sockaddr_in scgAddr {}; + unsigned char recvBuf[1500 + SCG_UDP_HEAD_SIZE]; const PSCG_PROXY_INFO pProxy = &GetGlobalCfgInfo()->scgProxy; - pProxy->exitNow = false; + unsigned char vmid[4]; + const unsigned int id = htonl(GetGlobalCfgInfo()->curConnVmId); + const auto svrId = static_cast(GetGlobalCfgInfo()->userCfg.cliConfig.scgTunnelAppId); + char *pRecBuf = reinterpret_cast(&recvBuf[SCG_UDP_HEAD_SIZE]); scgAddr.sin_family = AF_INET; scgAddr.sin_port = htons(pProxy->scgGwPort); InetPton(AF_INET, pProxy->scgIpAddr, &scgAddr.sin_addr.s_addr); + memcpy(vmid, &id, 4); + + // 构建 SCG UDP 包头 + recvBuf[0] = 0x01; // VERSION + recvBuf[1] = 0x09; // Length + recvBuf[2] = 0xF0; // ++++++ INFO[0] TYPE + recvBuf[3] = 0x04; // INFO[0] LENGTH + recvBuf[4] = vmid[0]; // INFO[0] VMID[0] + recvBuf[5] = vmid[1]; // INFO[0] VMID[1] + recvBuf[6] = vmid[2]; // INFO[0] VMID[2] + recvBuf[7] = vmid[3]; // INFO[0] VMID[3] + recvBuf[8] = 0xF1; // INFO[1] TYPE + recvBuf[9] = 0x01; // INFO[1] LENGTH + recvBuf[10] = svrId; // ------ INFO[1] SCG Service ID + + pProxy->exitNow = false; while (!pProxy->exitNow) { TCHAR ipAddr[MAX_IP_LEN]; int addrSize = sizeof(SOCKADDR); - char recvBuf[1500]; int iRecvBytes; // 代理服务 Out iRecvBytes = recvfrom(pProxy->udpProxySock, - recvBuf, + pRecBuf, 1500, 0, reinterpret_cast(&localWgAddr), @@ -127,6 +148,12 @@ static DWORD UDPProxyRecvThread(LPVOID lpParameter) { ipAddr, ntohs(localWgAddr.sin_port)); + if (iRecvBytes >= (1450 - SCG_UDP_HEAD_SIZE)) { + SPDLOG_WARN(TEXT("!Maybe MTU overflow: Current package {0} bytes, UDP MTU 1450, SCG Head Used {1} bytes"), + iRecvBytes, + SCG_UDP_HEAD_SIZE); + } + if (iRecvBytes != SOCKET_ERROR) { int sendBytes; @@ -152,8 +179,10 @@ static DWORD UDPProxyRecvThread(LPVOID lpParameter) { pProxy->hProxySCGThread = handle; } - sendBytes = sendto(pProxy->scgGwSock, - recvBuf, + // 增加SCG包头数据长度 + iRecvBytes += 11; + sendBytes = sendto(pProxy->scgGwSock, + reinterpret_cast(recvBuf), iRecvBytes, 0, reinterpret_cast(&scgAddr), @@ -188,9 +217,9 @@ int CreateUDPProxyServer() { return -ERR_SOCKET_CREATE; } - server.sin_family = AF_INET; + server.sin_family = AF_INET; server.sin_addr.s_addr = htonl(INADDR_ANY); - server.sin_port = htons(0); + server.sin_port = htons(0); if (bind(sock, reinterpret_cast(&server), sizeof(SOCKADDR)) == SOCKET_ERROR) { closesocket(sock); diff --git a/NetTunnelSDK/network/network.cpp b/NetTunnelSDK/network/network.cpp index 1fc7b15..1aec87d 100644 --- a/NetTunnelSDK/network/network.cpp +++ b/NetTunnelSDK/network/network.cpp @@ -1,5 +1,5 @@ #include "pch.h" -#include "tunnel.h" + #include "usrerr.h" #include #include @@ -1241,6 +1241,7 @@ int RemoveNATRule(const TCHAR *pInterfaceName) { return ERR_SUCCESS; } +#if 0 int SetInterfaceIpAddress(const TCHAR *pInterfaceName, const TCHAR *pIpaddr, const TCHAR *pNetmask) { int ret; TCHAR cmdBuf[MAX_PATH]; @@ -1287,7 +1288,6 @@ int SetInterfaceIpAddress(const TCHAR *pInterfaceName, const TCHAR *pIpaddr, con return ERR_SUCCESS; } -#if 0 int GetWindowsHyperVStatus(int *pEnabled) { int ret; TCHAR cmdBuf[MAX_PATH]; diff --git a/NetTunnelSDK/protocol/protocol.cpp b/NetTunnelSDK/protocol/protocol.cpp index 5d6bf15..9a1c71b 100644 --- a/NetTunnelSDK/protocol/protocol.cpp +++ b/NetTunnelSDK/protocol/protocol.cpp @@ -37,21 +37,22 @@ int InitControlServer(const TCHAR *pUserSvrUrl) { if (UsedSCGProxy()) { int ret; unsigned char vmid[4]; + unsigned char *p; const unsigned int id = htonl(GetGlobalCfgInfo()->curConnVmId); - unsigned char scgProxy[] = {0x01, // VERSION - 0x09, // Length - 0xF0, // ++++++ INFO[0] TYPE - 0x04, // INFO[0] LENGTH - 0, // INFO[0] VMID[0] - 0, // INFO[0] VMID[1] - 0, // INFO[0] VMID[2] - 0, // INFO[0] VMID[3] - 0xF1, // INFO[1] TYPE - 0x01, // INFO[1] LENGTH - 0x07}; // ------ INFO[1] SCG Service ID - - unsigned char *p = scgProxy; + const auto svrId = static_cast(GetGlobalCfgInfo()->userCfg.cliConfig.scgCtrlAppId); + unsigned char scgProxy[] = {0x01, // VERSION + 0x09, // Length + 0xF0, // ++++++ INFO[0] TYPE + 0x04, // INFO[0] LENGTH + 0, // INFO[0] VMID[0] + 0, // INFO[0] VMID[1] + 0, // INFO[0] VMID[2] + 0, // INFO[0] VMID[3] + 0xF1, // INFO[1] TYPE + 0x01, // INFO[1] LENGTH + svrId}; // ------ INFO[1] SCG Service ID + p = scgProxy; memcpy(vmid, &id, 4); scgProxy[4] = vmid[0]; scgProxy[5] = vmid[1]; diff --git a/NetTunnelSDK/scripts/cleansdk.bat b/NetTunnelSDK/scripts/cleansdk.bat new file mode 100644 index 0000000..f31d823 --- /dev/null +++ b/NetTunnelSDK/scripts/cleansdk.bat @@ -0,0 +1,6 @@ +@echo off +setlocal EnableDelayedExpansion + +set "CurrCD=%~dp0" + +powershell -Command "& {Remove-Item sdk/*}" \ No newline at end of file diff --git a/NetTunnelSDK/scripts/gensdk.bat b/NetTunnelSDK/scripts/gensdk.bat new file mode 100644 index 0000000..0fc193a --- /dev/null +++ b/NetTunnelSDK/scripts/gensdk.bat @@ -0,0 +1,8 @@ +@echo off +setlocal EnableDelayedExpansion + +set "CurrCD=%~dp0" + +for /f %%i in ('dir sdk /b /s') do ( + powershell -Command "& {$fileContent = Get-Content -Path %%i;$newContent = $fileContent -replace 'TCHAR', 'CHAR ';$newContent | Set-Content -Path %%i}" +) \ No newline at end of file diff --git a/NetTunnelSDK/sdk/common.h b/NetTunnelSDK/sdk/common.h new file mode 100644 index 0000000..011d0a9 --- /dev/null +++ b/NetTunnelSDK/sdk/common.h @@ -0,0 +1,109 @@ +#pragma once + +/** + * @brief WireGuard key 󳤶 + */ +#define WG_KEY_MAX (64) + +/** + * @brief ϵͳ + */ +#define NET_CARD_MAX (32) + +/** + * @brief IP ַ󳤶(֧IPv6) + */ +#define MAX_IP_LEN (48) + +/** + * @brief IP ַС + */ +#define MIN_IP_LEN (7) + +/** + * @brief ַ󳤶(֧IPv6) + */ +#define MAX_NETCARD_NAME (64) + +/** + * @brief Э + * + */ +typedef enum { + CRYPTO_NONE = 0, ///< + CRYPTO_BASE64 = 1, ///< BASE64 ַ + CRYPTO_AES128 = 2, ///< AES 128λԿ + CRYPTO_3DES = 3, ///< 3DES + CRYPTO_AES256 = 4, ///< AES 256 λԿ + CRYPTO_MAX, +} PROTO_CRYPTO_TYPE; + +/** + * @brief ־ȼ + * + */ +enum LOG_LEVEL { + LOG_TRACE = 0, ///< TRACE ־ȼ + LOG_DEBUG, ///< DEBUG ־ȼ + LOG_INFO, ///< INFO ־ȼ + LOG_WARN, ///< WARN ־ȼ + LOG_ERROR, ///< ERROR ־ȼ + LOG_CRITICAL, ///< CRITICAL ־ȼ + LOG_OFF ///< ر־ +}; + +/** + * @brief Hash 㷨 + * + */ +typedef enum { + HASH_MD2 = 0, ///< MD2 HASH 㷨 + HASH_MD4, ///< MD4 HASH 㷨 + HASH_MD5, ///< MD5 HASH 㷨 + HASH_SHA1, ///< SHA1 HASH 㷨 + HASH_SHA256, ///< SHA256 HASH 㷨 + HASH_SHA384, ///< SHA384 HASH 㷨 + HASH_SHA512 ///< SHA512 HASH 㷨 +} HASH_TYPE; + +/** + * @brief 繲ģʽ + * + */ +typedef enum { + ICS_SHARE_MODE = 0, ///< Internet Share Mode(ICS) ģʽ + NAT_SHARE_MODE = 1 ///< Net Address Translation(NAT) ģʽ +} NET_SHARE_MODE; + +/** + * + * @brief Ϣ + */ +typedef struct { + int vmId; ///< û ID + CHAR vmName[MAX_PATH]; ///< û + CHAR svrPublicKey[64]; ///< û˹Կ + CHAR vmNetwork[MAX_IP_LEN]; ///< ûַ + CHAR scgGateWay[MAX_PATH]; ///< û˽ + CHAR scgTunnelGw[MAX_PATH]; ///< û +} VM_CFG, *PVM_CFG; + +/** + * + * @brief ͻûϢ + */ +typedef struct { + int scgCtrlAppId; ///< ûؿ ID + int scgTunnelAppId; ///< û ID + CHAR cliPrivateKey[64]; ///< ûͻ˽Կ + CHAR cliPublicKey[64]; ///< ûͻ˹Կ + CHAR cliAddress[MAX_IP_LEN]; ///< ûͻIPַ + PVM_CFG pVMConfig; ///< ûб + int tolVM; ///< û +} USER_CLIENT_CONFIG, *PUSER_CLIENT_CONFIG; + +typedef struct { + int svrListenPort; ///< û˼˿ + CHAR svrPrivateKey[64]; ///< û˹Կ + CHAR svrAddress[MAX_IP_LEN]; ///< û IP ַ +} USER_SERVER_CONFIG, *PUSER_SERVER_CONFIG; diff --git a/NetTunnelSDK/sdk/sccsdk.h b/NetTunnelSDK/sdk/sccsdk.h new file mode 100644 index 0000000..77bb976 --- /dev/null +++ b/NetTunnelSDK/sdk/sccsdk.h @@ -0,0 +1,266 @@ +#pragma once +#include +#include "common.h" +#include "usrerr.h" + +#ifdef NETTUNNELSDK_EXPORTS +#define SCCSDK_API __declspec(dllexport) +#else +#define SCCSDK_API __declspec(dllimport) +#endif + +typedef void (*PTUNNEL_HEART_ROUTINE)(const CHAR *pMessage, unsigned int timeStampOfSeconds); +typedef PTUNNEL_HEART_ROUTINE LPTUNNEL_HEART_ROUTINE; + +/** + * + * @brief ؼϢ + */ +typedef struct { + int InterfaceIndex; ///< + CHAR NetCardUUID[260]; ///< ƣ WindowsʶΪ UUID + CHAR NetCardName[MAX_NETCARD_NAME]; ///< + CHAR NetCardDescription[132]; ///< + CHAR NetCardIpaddr[MAX_IP_LEN]; ///< IP ַ + CHAR NetCardNetmask[MAX_IP_LEN]; ///< + CHAR NetCardGateway[MAX_IP_LEN]; ///< + CHAR NetCardMacAddr[20]; ///< MAC ַ +} NIC_CONTENT, *PNIC_CONTENT; + +#ifdef __cplusplus // If used by C++ code, +extern "C" { +// we need to export the C interface +#endif + +/** + * @brief ʼ SDK л + * @param[in] pWorkDir ·ϵͳԶȡ + * @param[in] pSvrUrl ƽ̨ URL ַ example: http://localhost:2313, https://localhost:2313 + * @param[in] pLogFile ־ļ/· + * @param[in] level ־Чȼ + * @param[in] isWorkServer SDK ģʽ + * - TRUE + * - FALSE ͻ + * @return ִн 0: ɹ С0 ʧ @see USER_ERRNO + * - -ERR_ITEM_EXISTS δҵ WireGuard + * - -ERR_SYS_CALL ȡñļ洢Ŀ¼ʧ + * - -ERR_CREATE_FILE ûļĿ¼ʧ + * - -ERR_ITEM_UNEXISTS WireGuard δװ + * - ERR_SUCCESS ɹ + */ +SCCSDK_API int __cdecl TunnelSDKInitEnv(const CHAR *pWorkDir, + const CHAR *pSvrUrl, + const CHAR *pLogFile, + LOG_LEVEL level, + bool isWorkServer); + +/** + * @brief SDK Դ + */ +SCCSDK_API void __cdecl TunnelSDKUnInit(); + +/** + * @brief /ر SDK ־ + * @param enLog ־ + * - TRUE ־ + * - FALSE ر־ + */ +SCCSDK_API void __cdecl TunnelLogEnable(bool enLog); + +/** + * @brief ȡǰ WireGuard Ƿ + * @param pTunnelName + * @param pIsRunning pIsRunning WireGuard ״̬ + * - TRUE Ѿװ + * - FALSE δװ + * @return ִн 0: ɹ С0 ʧ @see USER_ERRNO + * - -ERR_INPUT_PARAMS + * - -ERR_OPEN_SCM 򿪷豸ʧ + * - ERR_SUCCESS ɹ + */ +SCCSDK_API int __cdecl GetWireGuardServiceStatus(const CHAR *pTunnelName, bool *pIsRunning); + +/** + * @brief жϵǰģʽ ͻ/ + * @param[out] pIsWorkServer ģʽ + * - TRUE + * - FALSE ͻ + * @return ִн 0: ɹ С0 ʧ @see USER_ERRNO + * - -ERR_INPUT_PARAMS + * - ERR_SUCCESS ɹ + */ +SCCSDK_API int __cdecl GetWireGuardWorkMode(bool *pIsWorkServer); + +/** + * @brief ȡǰ WireGuard Ƿ + * @param[in] pIfName WireGuard ӿ + * @param[out] pIsRunning WireGuard ״̬ + * - TRUE Ѿװ + * - FALSE δװ + * @return 0: ɹ С0 ʧ @see USER_ERRNO + * - -ERR_INPUT_PARAMS + * - -ERR_MALLOC_MEMORY ڴʧ + * - ERR_SUCCESS ɹ + */ +SCCSDK_API int __cdecl IsWireGuardServerRunning(const CHAR *pIfName, bool *pIsRunning); + +/** + * @brief SCG 񿪹 + * @param isEnable TRUE: SCG , FALSE: SCG + * @param pSCGIpAddr SCG IP + * @param scgPort SCG ˿ + * @return 0: ɹ С0 ʧ @see USER_ERRNO + * - -ERR_INPUT_PARAMS + * - ERR_SUCCESS ɹ + */ +SCCSDK_API int __cdecl EnableSCGProxy(bool isEnable, const CHAR *pSCGIpAddr, int scgPort); + +/** + * @brief ȡǰ SCG ״̬ + * @return TRUE: SCG , FALSE: SCG + */ +SCCSDK_API bool __cdecl UsedSCGProxy(); + +/** + * @brief ȡǰ繲ģʽ + * @return ǰ繲ģʽ @see NET_SHARE_MODE + */ +SCCSDK_API NET_SHARE_MODE __cdecl GetCurrentNetShareMode(); + +/** + * @brief ûȡǰ繲ģʽ + * @param shareMode 繲ģʽ @see NET_SHARE_MODE + */ +SCCSDK_API void __cdecl SetCurrentNetShareMode(NET_SHARE_MODE shareMode); + +/** + * @brief ȡϢ + * @param[out] pInfo Ϣ @see NIC_CONTENT + * @param[out] pItemCounts ǰϵͳ ֵ 32 + * @return ִн 0: ɹ С0 ʧ @see USER_ERRNO + * - -ERR_INPUT_PARAMS + * - -ERR_MALLOC_MEMORY ڴʧ + * - ERR_SUCCESS ɹ + */ +SCCSDK_API int __cdecl GetAllNICInfo(PNIC_CONTENT *pInfo, int *pItemCounts); + +/** + * @brief ȡǰ Internet + * @param[out] pIfIndex + * @return ִн 0: ɹ С0 ʧ @see USER_ERRNO + * - -ERR_INPUT_PARAMS + * - -ERR_ITEM_UNEXISTS δҵ Internet ӵ + * - ERR_SUCCESS ɹ + */ +SCCSDK_API int __cdecl GetInternetIfIndex(int *pIfIndex); + +/** + * @brief ƵԷ˴Ʒ + * @param pSvr Ϣ + * @return 0: ɹ С0 ʧ @see USER_ERRNO + * - -ERR_INPUT_PARAMS + * - -ERR_CREATE_THREAD ߳ʧ + * - -ERR_SOCKET_BIND_PORT 󶨶˿ʧ + * - -ERR_ITEM_EXISTS ߳״̬쳣 + * - ERR_SUCCESS ɹ + */ +SCCSDK_API int __cdecl CreateControlService(PUSER_SERVER_CONFIG pSvr); + +/** + * @brief ȡûϢ + * @param[in] pUserName û + * @param[in] pToken û + * @param[out] pSvrCfg ûϢ + * @return 0: ɹ С0 ʧ @see USER_ERRNO + * - -ERR_INPUT_PARAMS + * - -ERR_MEMORY_STR ַ + * - -ERR_CREATE_FILE ûĿ¼ʧ + * - ERR_SUCCESS ɹ + */ +SCCSDK_API int __cdecl GetUserServerConfigure(const CHAR *pUserName, + const CHAR *pToken, + PUSER_SERVER_CONFIG *pSvrCfg); + +/** + * @brief ȡûͻϢ + * @param[in] pUserName û + * @param[in] pToken û + * @param[out] pCliCfg ͻûϢ + * @return 0: ɹ С0 ʧ @see USER_ERRNO + * - -ERR_INPUT_PARAMS + * - -ERR_MEMORY_STR ַ + * - -ERR_CREATE_FILE ûĿ¼ʧ + * - ERR_SUCCESS ɹ + */ +SCCSDK_API int __cdecl GetUserClientConfigure(const CHAR *pUserName, + const CHAR *pToken, + PUSER_CLIENT_CONFIG *pCliCfg); + +/** + * @brief Զ̿Ʒ + * @param[in] vmId ҪӵID + * @param[in] pCliNetwork Ҫıַ + * @return ɹ С0 ʧ @see USER_ERRNO + * - -ERR_INPUT_PARAMS + * - -ERR_SYSTEM_UNINITIALIZE ˲δʼ + * - -ERR_MALLOC_MEMORY ڴʧ + * - -ERR_OPEN_FILE ļʧ + * - -ERR_MEMORY_STR ַʧ + * - -ERR_UN_SUPPORT ֵ֧ĸʽת + * - -ERR_JSON_CREATE JSON ַʧ + * - -ERR_HTTP_POST_DATA POST ʧ + * - -ERR_HTTP_SERVER_RSP ˷ʧܣ200 + * - -ERR_READ_FILE ˷ؿ + * - -ERR_JSON_DECODE JSON ʧ + * - ERR_SUCCESS ɹ + */ +SCCSDK_API int __cdecl RemoteCtrlSvrCfgUserTunnel(int vmId, const CHAR *pCliNetwork); + +/** + * @brief /ֹͣԶƵе WireGuard + * @param[in] isStart /ֹͣ TRUE , FALSE ֹͣ + * @return 0: ɹ С0 ʧ @see USER_ERRNO + * - -ERR_INPUT_PARAMS + * - -ERR_SYSTEM_UNINITIALIZE δʼԶ̷ URL ַ + * - -ERR_CREATE_FILE ûĿ¼ʧ + * - -ERR_HTTP_POST_DATA POST ݵʧ + * - -ERR_HTTP_SERVER_RSP HTTP ش + * - -ERR_READ_FILE δȷϢ + * - -ERR_JSON_DECODE JSON ַʧ + * - ERR_SUCCESS ɹ + */ +SCCSDK_API int __cdecl RemoteWireGuardControl(bool isStart); + +/** + * @brief /ֹͣ WireGuard + * @param[in] isStart /ֹͣ TRUE , FALSE ֹͣ + * @param[in] setPrivateMode ǷģʽΪ רģʽ(Private) + * @return 0: ɹ С0 ʧ @see USER_ERRNO + * - -ERR_INPUT_PARAMS + * - -ERR_NET_CATEGORY_MODE ģʽ + * - -ERR_UN_SUPPORT ֵ֧繲 + * - ERR_SUCCESS ɹ + */ +SCCSDK_API int __cdecl LocalWireGuardControl(bool isStart, bool setPrivateMode); + +/** + * @brief /ֹͣ Ʒ + * @param isStart /ֹͣ TRUE , FALSE ֹͣ + * @param lpHeartCbAddress ص @see PTUNNEL_HEART_ROUTINE + * @return 0: ɹ С0 ʧ @see USER_ERRNO + * - -ERR_INPUT_PARAMS + * - -ERR_CREATE_TIMER ʱʧ + * - -ERR_DELETE_TIMER ɾʱʧ + * - ERR_SUCCESS ɹ + */ +SCCSDK_API int __cdecl RemoteHeartControl(bool isStart, LPTUNNEL_HEART_ROUTINE lpHeartCbAddress); + +/** + * @brief ȡûַ + * @param err û + * @return ûӦַ, "UNKNOWN": δ֪ + */ +SCCSDK_API const CHAR* __cdecl GetSDKErrorMessage(USER_ERRNO err); +#ifdef __cplusplus +} +#endif diff --git a/NetTunnelSDK/sdk/usrerr.h b/NetTunnelSDK/sdk/usrerr.h new file mode 100644 index 0000000..bee39b3 --- /dev/null +++ b/NetTunnelSDK/sdk/usrerr.h @@ -0,0 +1,69 @@ +#pragma once + +/** + * @brief SDK ô + */ +enum USER_ERRNO { + ERR_SUCCESS = 0, ///< ɹ + ERR_INPUT_PARAMS, ///< + ERR_UN_SUPPORT, ///< ֵ֧IJ + ERR_CALL_SHELL, ///< Shellʧ + ERR_ITEM_EXISTS, ///< Ѿ + ERR_ITEM_UNEXISTS, ///< ݲ + ERR_SYS_INIT, ///< ϵͳж + ERR_SYS_CALL, ///< ϵͳ + ERR_LOAD_LIBRARY, ///< ϵͳʧ + ERR_MAP_LIBRARY, ///< ϵͳӿʧ + ERR_SYS_TIMEOUT, ///< ϵͳʱ + ERR_SYSTEM_UNINITIALIZE, ///< ϵͳδʼ + ERR_CREATE_FILE, ///< ļ/Ŀ¼ʧ + ERR_OPEN_FILE, ///< ļʧ + ERR_READ_FILE, ///< ȡļʧ + ERR_WRITE_FILE, ///< дļʧ + ERR_FILE_NOT_EXISTS, ///< ļ + ERR_FILE_LOCKED, ///< ļ + ERR_GET_FILE_SIZE, ///< ȡļСʧ + ERR_FIND_FILE, ///< ļʧ + ERR_COPY_FILE, ///< ļʧ + ERR_OPEN_SCM, ///< 򿪷豸ʧ + ERR_OPEN_SERVICE, ///< 򿪷ʧ + ERR_CREATE_SERVICE, ///< ʧ + ERR_START_SERVICE, ///< ʧ + ERR_STOP_SERVICE, ///< ֹͣʧ + ERR_DELETE_SERVICE, ///< ɾʧ + ERR_CONFIG_SERVICE, ///< ޸ķʧ + ERR_GET_SERVICESSTATUS, ///< ȡ״̬ʧ + ERR_MALLOC_MEMORY, ///< ڴʧ + ERR_MMAP_MEMORY, ///< ڴʧ + ERR_MEMORY_STR, ///< ַʧ + ERR_CREATE_PROCESS, ///< ʧ + ERR_PROCESS_RETURN, ///< ̵÷ʧ + ERR_CREATE_THREAD, ///< ߳ʧ + ERR_CREATE_TIMER, ///< ʱʧ + ERR_DELETE_TIMER, ///< ٶʱʧ + ERR_SOCKET_CREATE, ///< SOCKET ʧ + ERR_SOCKET_BIND, ///< SOCKET ˿ʧ + ERR_SOCKET_CONNECT, ///< TCP SOCKET ʧ + ERR_SOCKET_LISTEN, ///< TCP SOCKET ʧ + ERR_SOCKET_BIND_PORT, ///< 󶨶˿ʧ + ERR_SOCKET_SET_OPT, ///< SOCKET ʧ + ERR_SOCKET_GET_OPT, ///< ȡ SOCKET ʧ + ERR_BCRYPT_OPEN = 100, ///< 㷨ʧ + ERR_BCRYPT_GETPROPERTY, ///< ȡ㷨ʧ + ERR_BCRYPT_CREATEHASH, ///< Hash 㷨ʧ + ERR_BCRYPT_HASHDATA, ///< Hash ʧ + ERR_BCRYPT_FINISHHASH, ///< Hash ʧ + ERR_NET_UNCONNECT = 200, ///< δ + ERR_NET_CATEGORY_MODE, ///< 繤ģʽ + ERR_NET_INTELNEL_ICS, ///< Intelnet ICS ʧ + ERR_NET_WIREGUARD_ICS, ///< WireGuard ICS ʧ + ERR_GET_IPFOWARDTBL = 300, ///< ȡϵͳ IP תʧ + ERR_CREATE_COMMOBJECT = 400, ///< COM ʧ + ERR_CALL_COMMOBJECT, ///< COM ʧ + ERR_JSON_CREATE = 500, ///< JSON ʧ + ERR_JSON_DECODE, ///< JSON лʧ + ERR_HTTP_SERVER_RSP = 600, ///< HTTP ˷ش + ERR_HTTP_POST_DATA, ///< POST ʧ + ERR_NET_ADD_ROUTE, ///< ·ʧ + ERR_NET_REMOVE_ROUTE, ///< ɾ·ʧ +}; diff --git a/NetTunnelSDKTestApp/WireGurad.cpp b/NetTunnelSDKTestApp/WireGurad.cpp index 956e9c9..feac360 100644 --- a/NetTunnelSDKTestApp/WireGurad.cpp +++ b/NetTunnelSDKTestApp/WireGurad.cpp @@ -631,7 +631,7 @@ int main_wireguard(bool isDelete) { WireGuardGetAdapterLUID(Adapter, &AddressRow.InterfaceLuid); - SetInterfaceIpAddress("Demo", "10.10.10.1", "255.255.255.0"); + //SetInterfaceIpAddress("Demo", "10.10.10.1", "255.255.255.0"); #if 0 InitializeIpForwardEntry(&DefaultRoute); diff --git a/NetTunnelServerApp/NetTunnelServerApp.cpp b/NetTunnelServerApp/NetTunnelServerApp.cpp new file mode 100644 index 0000000..304902c --- /dev/null +++ b/NetTunnelServerApp/NetTunnelServerApp.cpp @@ -0,0 +1,45 @@ +// NetTunnelServerApp.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// +#include +#include + +#include "sccsdk.h" + +int main() { + PUSER_SERVER_CONFIG pSvrCfg; + int ret; + + if ((ret = TunnelSDKInitEnv(nullptr, "http://xajhuang.com:9276", nullptr, LOG_DEBUG, true)) != ERR_SUCCESS) { + wprintf(L"Init SCC SDK Error: %d\n", ret); + return -1; + } + + if (ERR_SUCCESS != (ret = GetUserServerConfigure("tunnel_svr", "asfdafdafdaf", &pSvrCfg))) { + wprintf(L"GetUserServerConfigure Error: %d\n", ret); + return -2; + } + + if (ERR_SUCCESS != (ret = CreateControlService(pSvrCfg))) { + wprintf(L"CreateControlService Error: %d\n", ret); + return -2; + } + + wprintf(L"Press Key 'X' to exit......\n"); + + do { + ret = _getch(); + } while (ret != 'X' && ret != 'x'); + + return 0; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 \ No newline at end of file diff --git a/NetTunnelServerApp/NetTunnelServerApp.vcxproj b/NetTunnelServerApp/NetTunnelServerApp.vcxproj new file mode 100644 index 0000000..3580f6a --- /dev/null +++ b/NetTunnelServerApp/NetTunnelServerApp.vcxproj @@ -0,0 +1,142 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {441a93b0-dba1-429a-8ac0-35a8945614e6} + NetTunnelServerApp + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + $(SolutionDir)$(Platform)\$(Configuration)\ + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + $(SolutionDir)NetTunnelSDK\sdk;%(AdditionalIncludeDirectories) + MultiThreadedDebug + + + Console + true + $(SolutionDir)$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories) + NetTunnelSDK.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/NetTunnelServerApp/NetTunnelServerApp.vcxproj.filters b/NetTunnelServerApp/NetTunnelServerApp.vcxproj.filters new file mode 100644 index 0000000..2d0c405 --- /dev/null +++ b/NetTunnelServerApp/NetTunnelServerApp.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 源文件 + + + \ No newline at end of file diff --git a/NetTunnelServerApp/NetTunnelServerApp.vcxproj.user b/NetTunnelServerApp/NetTunnelServerApp.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/NetTunnelServerApp/NetTunnelServerApp.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/TestNetTunnelSDK/TestNetTunnelSDK.cpp b/TestNetTunnelSDK/TestNetTunnelSDK.cpp index 1c1fcad..cf94439 100644 --- a/TestNetTunnelSDK/TestNetTunnelSDK.cpp +++ b/TestNetTunnelSDK/TestNetTunnelSDK.cpp @@ -1,12 +1,7 @@ #include "pch.h" #include "CppUnitTest.h" -#include "globalcfg.h" -#include "tunnel.h" -#include "usrerr.h" -#include "misc.h" -#include "network.h" -#include "user.h" +#include "sccsdk.h" #include using namespace Microsoft::VisualStudio::CppUnitTestFramework; @@ -109,13 +104,6 @@ public: TEST_METHOD(TestWireGuardNetConnectionSharingEnable) { Assert::AreEqual(RET_OK, WireGuardNetConnectionSharingEnable()); } -#endif - - TEST_METHOD(TestIsWireGuardServerRunning) { - bool bRet; - Assert::AreEqual(RET_OK, IsWireGuardServerRunning(TEXT("tunnel_svr"), &bRet)); - Assert::AreEqual(false, bRet); - } TEST_METHOD(TestCalcFileHash) { TCHAR outHash[MAX_PATH] = {0}; @@ -137,21 +125,6 @@ public: Assert::AreEqual(false, bRet); } - TEST_METHOD(TestGetNetConnectionSharing) { - //bool chkStatus; - //Assert::AreEqual(RET_OK, GetNetIntelnetConnectionSharing(TEXT("admin"), &chkStatus)); - //Assert::IsTrue(chkStatus); - } - - TEST_METHOD(TestSetNetConnectionNetworkCategory) { - //Assert::AreEqual(RET_OK, SetNetConnectionNetworkCategory()); - } - - TEST_METHOD(TestUserLogin) { - PUSER_CLIENT_CONFIG pCfg; - Assert::AreEqual(RET_OK, GetUserClientConfigure(TEXT("admin"), TEXT("123455"), &pCfg)); - } - TEST_METHOD(TestGetNetConnectionNetworkCategory) { bool chkStatus = false; Assert::AreEqual(RET_OK, GetNetConnectionNetworkCategory(TEXT("admin"), &chkStatus)); @@ -192,6 +165,38 @@ public: Assert::AreNotEqual(-1, static_cast(index)); } + TEST_METHOD(TestGetWireGuradTunnelInfo) { + + Assert::AreEqual(RET_OK, GetWireGuradTunnelInfo(TEXT("admin"))); + + //Assert::AreEqual(RET_OK, RemoteWireGuardControl(false)); + //Assert::AreEqual(RET_OK, LocalWireGuardControl(false, false)); + } +#endif + + TEST_METHOD(TestIsWireGuardServerRunning) { + bool bRet; + Assert::AreEqual(RET_OK, IsWireGuardServerRunning(TEXT("tunnel_svr"), &bRet)); + Assert::AreEqual(false, bRet); + } + + TEST_METHOD(TestGetNetConnectionSharing) { + //bool chkStatus; + //Assert::AreEqual(RET_OK, GetNetIntelnetConnectionSharing(TEXT("admin"), &chkStatus)); + //Assert::IsTrue(chkStatus); + } + + TEST_METHOD(TestSetNetConnectionNetworkCategory) { + //Assert::AreEqual(RET_OK, SetNetConnectionNetworkCategory()); + } + + TEST_METHOD(TestUserLogin) { + PUSER_CLIENT_CONFIG pCfg; + Assert::AreEqual(RET_OK, GetUserClientConfigure(TEXT("admin"), TEXT("123455"), &pCfg)); + } + + + TEST_METHOD(TestClientProgress) { PUSER_CLIENT_CONFIG pCfg = nullptr; Assert::AreEqual(RET_OK, GetUserClientConfigure(TEXT("admin"), TEXT("1323245235"), &pCfg)); @@ -212,12 +217,9 @@ public: Assert::AreEqual(RET_OK, LocalWireGuardControl(false, false)); } - TEST_METHOD(TestGetWireGuradTunnelInfo) { - - Assert::AreEqual(RET_OK, GetWireGuradTunnelInfo(TEXT("admin"))); - - //Assert::AreEqual(RET_OK, RemoteWireGuardControl(false)); - //Assert::AreEqual(RET_OK, LocalWireGuardControl(false, false)); + TEST_METHOD(TestGetSDKErrorMessage) { + const CHAR* pErrStr = GetSDKErrorMessage(ERR_INPUT_PARAMS); + Assert::AreEqual(pErrStr, "ERR_INPUT_PARAMS"); } }; } \ No newline at end of file diff --git a/TestNetTunnelSDK/TestNetTunnelSDK.vcxproj b/TestNetTunnelSDK/TestNetTunnelSDK.vcxproj index d0b9ad2..25d3704 100644 --- a/TestNetTunnelSDK/TestNetTunnelSDK.vcxproj +++ b/TestNetTunnelSDK/TestNetTunnelSDK.vcxproj @@ -92,7 +92,7 @@ Use Level3 true - ..\NetTunnelSDK\include;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + ..\NetTunnelSDK\sdk;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) _DEBUG;%(PreprocessorDefinitions) true pch.h diff --git a/tunnel_windows.sln b/tunnel_windows.sln index 4021309..2643588 100644 --- a/tunnel_windows.sln +++ b/tunnel_windows.sln @@ -23,7 +23,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetTunnelSDKTestApp", "NetT EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetTunnelSvr", "NetTunnelSvr\NetTunnelSvr.vcxproj", "{0A2EEDAF-F4A8-41E0-A874-2F30D1EEB55E}" EndProject -Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "InstallerSDK_amd64", "InstallerSDK_amd64\InstallerSDK_amd64.vdproj", "{709C9DD6-6B42-40A9-AA70-629274A75BAC}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetTunnelServerApp", "NetTunnelServerApp\NetTunnelServerApp.vcxproj", "{441A93B0-DBA1-429A-8AC0-35A8945614E6}" + ProjectSection(ProjectDependencies) = postProject + {0A2EEDAF-F4A8-41E0-A874-2F30D1EEB55E} = {0A2EEDAF-F4A8-41E0-A874-2F30D1EEB55E} + {1584BAD4-DBEC-43D2-BC06-08C23F02489A} = {1584BAD4-DBEC-43D2-BC06-08C23F02489A} + EndProjectSection +EndProject +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "InstallerSDK_amd64", "InstallerSDK_amd64\InstallerSDK_amd64.vdproj", "{AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}" +EndProject +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "InstallerServerApp_amd64", "InstallerServerApp_amd64\InstallerServerApp_amd64.vdproj", "{91B0160A-DDA5-404E-871B-B729557DC7F2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -249,26 +257,106 @@ Global {0A2EEDAF-F4A8-41E0-A874-2F30D1EEB55E}.Release|x64.Build.0 = Release|x64 {0A2EEDAF-F4A8-41E0-A874-2F30D1EEB55E}.Release|x86.ActiveCfg = Release|Win32 {0A2EEDAF-F4A8-41E0-A874-2F30D1EEB55E}.Release|x86.Build.0 = Release|Win32 - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Debug DLL|Any CPU.ActiveCfg = Debug - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Debug DLL|ARM.ActiveCfg = Debug - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Debug DLL|ARM64.ActiveCfg = Debug - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Debug DLL|x64.ActiveCfg = Debug - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Debug DLL|x86.ActiveCfg = Debug - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Debug|Any CPU.ActiveCfg = Debug - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Debug|ARM.ActiveCfg = Debug - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Debug|ARM64.ActiveCfg = Debug - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Debug|x64.ActiveCfg = Debug - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Debug|x86.ActiveCfg = Debug - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Release DLL|Any CPU.ActiveCfg = Release - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Release DLL|ARM.ActiveCfg = Release - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Release DLL|ARM64.ActiveCfg = Release - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Release DLL|x64.ActiveCfg = Release - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Release DLL|x86.ActiveCfg = Release - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Release|Any CPU.ActiveCfg = Release - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Release|ARM.ActiveCfg = Release - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Release|ARM64.ActiveCfg = Release - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Release|x64.ActiveCfg = Release - {709C9DD6-6B42-40A9-AA70-629274A75BAC}.Release|x86.ActiveCfg = Release + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug DLL|Any CPU.ActiveCfg = Debug|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug DLL|Any CPU.Build.0 = Debug|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug DLL|ARM.ActiveCfg = Debug|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug DLL|ARM.Build.0 = Debug|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug DLL|ARM64.ActiveCfg = Debug|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug DLL|ARM64.Build.0 = Debug|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug DLL|x64.ActiveCfg = Debug|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug DLL|x64.Build.0 = Debug|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug DLL|x86.ActiveCfg = Debug|Win32 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug DLL|x86.Build.0 = Debug|Win32 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug|Any CPU.ActiveCfg = Debug|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug|Any CPU.Build.0 = Debug|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug|ARM.ActiveCfg = Debug|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug|ARM.Build.0 = Debug|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug|ARM64.ActiveCfg = Debug|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug|ARM64.Build.0 = Debug|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug|x64.ActiveCfg = Debug|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug|x64.Build.0 = Debug|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug|x86.ActiveCfg = Debug|Win32 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Debug|x86.Build.0 = Debug|Win32 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release DLL|Any CPU.ActiveCfg = Release|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release DLL|Any CPU.Build.0 = Release|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release DLL|ARM.ActiveCfg = Release|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release DLL|ARM.Build.0 = Release|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release DLL|ARM64.ActiveCfg = Release|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release DLL|ARM64.Build.0 = Release|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release DLL|x64.ActiveCfg = Release|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release DLL|x64.Build.0 = Release|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release DLL|x86.ActiveCfg = Release|Win32 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release DLL|x86.Build.0 = Release|Win32 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release|Any CPU.ActiveCfg = Release|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release|Any CPU.Build.0 = Release|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release|ARM.ActiveCfg = Release|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release|ARM.Build.0 = Release|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release|ARM64.ActiveCfg = Release|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release|ARM64.Build.0 = Release|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release|x64.ActiveCfg = Release|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release|x64.Build.0 = Release|x64 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release|x86.ActiveCfg = Release|Win32 + {441A93B0-DBA1-429A-8AC0-35A8945614E6}.Release|x86.Build.0 = Release|Win32 + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug DLL|Any CPU.ActiveCfg = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug DLL|Any CPU.Build.0 = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug DLL|ARM.ActiveCfg = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug DLL|ARM.Build.0 = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug DLL|ARM64.ActiveCfg = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug DLL|ARM64.Build.0 = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug DLL|x64.ActiveCfg = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug DLL|x64.Build.0 = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug DLL|x86.ActiveCfg = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug DLL|x86.Build.0 = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug|Any CPU.ActiveCfg = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug|Any CPU.Build.0 = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug|ARM.ActiveCfg = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug|ARM.Build.0 = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug|ARM64.ActiveCfg = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug|ARM64.Build.0 = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug|x64.ActiveCfg = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug|x64.Build.0 = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug|x86.ActiveCfg = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Debug|x86.Build.0 = Debug + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release DLL|Any CPU.ActiveCfg = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release DLL|Any CPU.Build.0 = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release DLL|ARM.ActiveCfg = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release DLL|ARM.Build.0 = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release DLL|ARM64.ActiveCfg = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release DLL|ARM64.Build.0 = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release DLL|x64.ActiveCfg = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release DLL|x64.Build.0 = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release DLL|x86.ActiveCfg = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release DLL|x86.Build.0 = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release|Any CPU.ActiveCfg = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release|Any CPU.Build.0 = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release|ARM.ActiveCfg = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release|ARM.Build.0 = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release|ARM64.ActiveCfg = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release|ARM64.Build.0 = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release|x64.ActiveCfg = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release|x64.Build.0 = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release|x86.ActiveCfg = Release + {AC420CA6-82BE-4EA9-8094-C9213C3A4BA0}.Release|x86.Build.0 = Release + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Debug DLL|Any CPU.ActiveCfg = Debug + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Debug DLL|ARM.ActiveCfg = Debug + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Debug DLL|ARM64.ActiveCfg = Debug + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Debug DLL|x64.ActiveCfg = Debug + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Debug DLL|x86.ActiveCfg = Debug + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Debug|Any CPU.ActiveCfg = Debug + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Debug|ARM.ActiveCfg = Debug + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Debug|ARM64.ActiveCfg = Debug + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Debug|x64.ActiveCfg = Debug + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Debug|x86.ActiveCfg = Debug + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Release DLL|Any CPU.ActiveCfg = Release + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Release DLL|ARM.ActiveCfg = Release + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Release DLL|ARM64.ActiveCfg = Release + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Release DLL|x64.ActiveCfg = Release + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Release DLL|x86.ActiveCfg = Release + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Release|Any CPU.ActiveCfg = Release + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Release|ARM.ActiveCfg = Release + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Release|ARM64.ActiveCfg = Release + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Release|x64.ActiveCfg = Release + {91B0160A-DDA5-404E-871B-B729557DC7F2}.Release|x86.ActiveCfg = Release EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE