OCT 1. 增加云电脑主机内服务端测试程序以及安装程序

2. 增加SDK安装程序
3. 增加UDP SCG封包功能
This commit is contained in:
黄昕 2023-08-03 17:13:03 +08:00
parent ded3b28a9e
commit 728e645d14
30 changed files with 2523 additions and 645 deletions

View File

@ -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"

File diff suppressed because it is too large Load Diff

View File

@ -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);

View File

@ -179,37 +179,15 @@ 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);
}

View File

@ -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)\
</Command>
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</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>$(ProjectDir)scripts\cleansdk.bat</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@ -165,6 +169,7 @@ copy /y $(TargetDir)NetTunnelSDK.dll $(SolutionDir)NetTunnelApp\bin\$(Configurat
<ClInclude Include="include\protocol.h" />
<ClInclude Include="include\ProtocolBase.h" />
<ClInclude Include="include\resource.h" />
<ClInclude Include="include\sccsdk.h" />
<ClInclude Include="include\tunnel.h" />
<ClInclude Include="include\user.h" />
<ClInclude Include="include\usrerr.h" />

View File

@ -75,15 +75,18 @@
<ClInclude Include="include\resource.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="include\tunnel.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="include\user.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="include\usrerr.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="include\tunnel.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="include\sccsdk.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">

View File

@ -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;
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;

View File

@ -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; ///< 是否启用日志

View File

@ -1,53 +1,12 @@
#pragma once
#include <Windows.h>
#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
}

View File

@ -0,0 +1,266 @@
#pragma once
#include <Windows.h>
#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

View File

@ -1,22 +1,13 @@
#pragma once
#include "sccsdk.h"
#include "common.h"
#include <Windows.h>
#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
}

View File

@ -1,14 +1,7 @@
#pragma once
#include <Windows.h>
#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,
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
}

View File

@ -1,11 +1,12 @@
#include "pch.h"
#include "misc.h"
#include "usrerr.h"
#include "sccsdk.h"
#include <shlwapi.h>
#include <strsafe.h>
#include <spdlog/spdlog.h>
#include <magic_enum.hpp>
TCHAR *binToHexString(TCHAR *p, const unsigned char *cp, unsigned int count) {
static const TCHAR hex_asc[] = TEXT("0123456789abcdef");
@ -312,3 +313,23 @@ int TCharToWideChar(const TCHAR *pTStr, WCHAR *pOutStr, int maxOutLen) {
return ERR_SUCCESS;
}
}
static std::unordered_map<USER_ERRNO, std::string> g_UserErrorMap;
const CHAR *GetSDKErrorMessage(USER_ERRNO err) {
std::unordered_map<USER_ERRNO, std::string>::iterator iter;
if (g_UserErrorMap.empty()) {
constexpr auto color_entries = magic_enum::enum_entries<USER_ERRNO>();
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";
}
}

View File

@ -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);
}

View File

@ -9,6 +9,8 @@
#include <winsock2.h>
#include <ws2tcpip.h>
#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<UINT8>(GetGlobalCfgInfo()->userCfg.cliConfig.scgTunnelAppId);
char *pRecBuf = reinterpret_cast<char *>(&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<SOCKADDR *>(&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;
}
// 增加SCG包头数据长度
iRecvBytes += 11;
sendBytes = sendto(pProxy->scgGwSock,
recvBuf,
reinterpret_cast<char *>(recvBuf),
iRecvBytes,
0,
reinterpret_cast<SOCKADDR *>(&scgAddr),

View File

@ -1,5 +1,5 @@
#include "pch.h"
#include "tunnel.h"
#include "usrerr.h"
#include <strsafe.h>
#include <tchar.h>
@ -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];

View File

@ -37,7 +37,9 @@ int InitControlServer(const TCHAR *pUserSvrUrl) {
if (UsedSCGProxy()) {
int ret;
unsigned char vmid[4];
unsigned char *p;
const unsigned int id = htonl(GetGlobalCfgInfo()->curConnVmId);
const auto svrId = static_cast<UINT8>(GetGlobalCfgInfo()->userCfg.cliConfig.scgCtrlAppId);
unsigned char scgProxy[] = {0x01, // VERSION
0x09, // Length
0xF0, // ++++++ INFO[0] TYPE
@ -48,10 +50,9 @@ int InitControlServer(const TCHAR *pUserSvrUrl) {
0, // INFO[0] VMID[3]
0xF1, // INFO[1] TYPE
0x01, // INFO[1] LENGTH
0x07}; // ------ INFO[1] SCG Service ID
unsigned char *p = scgProxy;
svrId}; // ------ INFO[1] SCG Service ID
p = scgProxy;
memcpy(vmid, &id, 4);
scgProxy[4] = vmid[0];
scgProxy[5] = vmid[1];

View File

@ -0,0 +1,6 @@
@echo off
setlocal EnableDelayedExpansion
set "CurrCD=%~dp0"
powershell -Command "& {Remove-Item sdk/*}"

View File

@ -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}"
)

109
NetTunnelSDK/sdk/common.h Normal file
View File

@ -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;

266
NetTunnelSDK/sdk/sccsdk.h Normal file
View File

@ -0,0 +1,266 @@
#pragma once
#include <Windows.h>
#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

69
NetTunnelSDK/sdk/usrerr.h Normal file
View File

@ -0,0 +1,69 @@
#pragma once
/**
* @brief SDK
*/
enum USER_ERRNO {
ERR_SUCCESS = 0, ///< 成功
ERR_INPUT_PARAMS, ///< 输入参数错误
ERR_UN_SUPPORT, ///< 不支持的操作
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, ///< 删除路由失败
};

View File

@ -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);

View File

@ -0,0 +1,45 @@
// NetTunnelServerApp.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <spdlog/spdlog.h>
#include <conio.h>
#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 文件

View File

@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{441a93b0-dba1-429a-8ac0-35a8945614e6}</ProjectGuid>
<RootNamespace>NetTunnelServerApp</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(SolutionDir)NetTunnelSDK\sdk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>NetTunnelSDK.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="NetTunnelServerApp.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="NetTunnelServerApp.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

View File

@ -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 <strsafe.h>
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<int>(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");
}
};
}

View File

@ -92,7 +92,7 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>..\NetTunnelSDK\include;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\NetTunnelSDK\sdk;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>

View File

@ -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