mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 17:39:53 +03:00
Merge PR #1184: vpntest.c: add "setupapi" command to test SetupAPI (Windows only)
This commit is contained in:
commit
ff247687ed
@ -14,24 +14,6 @@
|
|||||||
#include <Cedar/Cedar.h>
|
#include <Cedar/Cedar.h>
|
||||||
#include "vpntest.h"
|
#include "vpntest.h"
|
||||||
|
|
||||||
void server_manager_test(UINT num, char **arg)
|
|
||||||
{
|
|
||||||
#ifdef OS_WIN32
|
|
||||||
SMExec();
|
|
||||||
#else // OS_WIN32
|
|
||||||
Print("This command is supported only on Win32.");
|
|
||||||
#endif // OS_WIN32
|
|
||||||
}
|
|
||||||
|
|
||||||
void client_manager_test(UINT num, char **arg)
|
|
||||||
{
|
|
||||||
#ifdef OS_WIN32
|
|
||||||
CMExec();
|
|
||||||
#else // OS_WIN32
|
|
||||||
Print("This command is supported only on Win32.");
|
|
||||||
#endif // OS_WIN32
|
|
||||||
}
|
|
||||||
|
|
||||||
void client_test(UINT num, char **arg)
|
void client_test(UINT num, char **arg)
|
||||||
{
|
{
|
||||||
Print("VPN Client Test. Press Enter key to stop the VPN Client .\n");
|
Print("VPN Client Test. Press Enter key to stop the VPN Client .\n");
|
||||||
@ -70,6 +52,26 @@ void bridge_test(UINT num, char **arg)
|
|||||||
StFree();
|
StFree();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef OS_WIN32
|
||||||
|
void server_manager_test(UINT num, char **arg)
|
||||||
|
{
|
||||||
|
SMExec();
|
||||||
|
}
|
||||||
|
|
||||||
|
void client_manager_test(UINT num, char **arg)
|
||||||
|
{
|
||||||
|
CMExec();
|
||||||
|
}
|
||||||
|
|
||||||
|
void setup_test(UINT num, char **arg)
|
||||||
|
{
|
||||||
|
char name[MAX_SIZE];
|
||||||
|
Print("SetupAPI test. Please enter the name of the NIC I should retrieve the status of.\n");
|
||||||
|
GetLine(name, sizeof(name));
|
||||||
|
Print("Status: %s\n", MsIsVLanEnabledWithoutLock(name) ? "enabled" : "disabled");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void memory_leak_test(UINT num, char **arg)
|
void memory_leak_test(UINT num, char **arg)
|
||||||
{
|
{
|
||||||
char *a = Malloc(1);
|
char *a = Malloc(1);
|
||||||
@ -78,7 +80,6 @@ void memory_leak_test(UINT num, char **arg)
|
|||||||
Print("Just now I called Malloc(1) and never free! Ha ha ha !!\n");
|
Print("Just now I called Malloc(1) and never free! Ha ha ha !!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// The list of test functions
|
// The list of test functions
|
||||||
// Test function definition list
|
// Test function definition list
|
||||||
typedef void (TEST_PROC)(UINT num, char **arg);
|
typedef void (TEST_PROC)(UINT num, char **arg);
|
||||||
@ -95,8 +96,11 @@ TEST_LIST test_list[] =
|
|||||||
{"c", client_test, "VPN Client in Test Mode, enter key to graceful stop."},
|
{"c", client_test, "VPN Client in Test Mode, enter key to graceful stop."},
|
||||||
{"s", server_test, "VPN Server in Test Mode, enter key to graceful stop."},
|
{"s", server_test, "VPN Server in Test Mode, enter key to graceful stop."},
|
||||||
{"b", bridge_test, "VPN Bridge in Test Mode, enter key to graceful stop."},
|
{"b", bridge_test, "VPN Bridge in Test Mode, enter key to graceful stop."},
|
||||||
{"sm", server_manager_test, "VPN Server Manager UI in Test Mode (Win32 only)"},
|
#ifdef OS_WIN32
|
||||||
{"cm", client_manager_test, "VPN Client Manager UI in Test Mode (Win32 only)"},
|
{"sm", server_manager_test, "VPN Server Manager UI in Test Mode."},
|
||||||
|
{"cm", client_manager_test, "VPN Client Manager UI in Test Mode."},
|
||||||
|
{"setupapi", setup_test, "SetupAPI test: tries to retrieve the specified NIC's status."},
|
||||||
|
#endif
|
||||||
{"memory_leak", memory_leak_test, "Memory leak test: Try to leak one byte by malloc()."},
|
{"memory_leak", memory_leak_test, "Memory leak test: Try to leak one byte by malloc()."},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user