2023-06-15 01:35:37 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <Windows.h>
|
|
|
|
|
|
|
|
|
|
#ifdef NETTUNNELSDK_EXPORTS
|
2023-06-19 11:08:42 +00:00
|
|
|
|
#define TUNNEL_API __declspec(dllexport)
|
2023-06-15 01:35:37 +00:00
|
|
|
|
#else
|
2023-06-19 11:08:42 +00:00
|
|
|
|
#define TUNNEL_API __declspec(dllimport)
|
2023-06-15 01:35:37 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2023-06-19 11:08:42 +00:00
|
|
|
|
#define WG_KEY_MAX (64)
|
|
|
|
|
#define NET_CARD_MAX (32)
|
|
|
|
|
|
|
|
|
|
typedef enum
|
2023-06-15 01:35:37 +00:00
|
|
|
|
{
|
|
|
|
|
CRYPTO_NONE = 0,
|
|
|
|
|
CRYPTO_BASE64 = 1,
|
|
|
|
|
CRYPTO_AES128 = 2,
|
|
|
|
|
CRYPTO_3DES = 3,
|
|
|
|
|
CRYPTO_AES256 = 4,
|
|
|
|
|
CRYPTO_MAX,
|
2023-06-19 11:08:42 +00:00
|
|
|
|
} PROTO_CRYPTO_TYPE;
|
2023-06-15 01:35:37 +00:00
|
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
2023-06-19 11:08:42 +00:00
|
|
|
|
LOG_TRACE = 0,
|
|
|
|
|
LOG_DEBUG,
|
|
|
|
|
LOG_INFO,
|
|
|
|
|
LOG_WARN,
|
|
|
|
|
LOG_ERROR,
|
|
|
|
|
LOG_CRITICAL,
|
2023-06-15 01:35:37 +00:00
|
|
|
|
LOG_MAX
|
|
|
|
|
} LOG_LEVEL;
|
|
|
|
|
|
2023-06-19 11:08:42 +00:00
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
TCHAR NetCardName[256];
|
|
|
|
|
TCHAR NetCardDescription[256];
|
|
|
|
|
TCHAR NetCardIpaddr[256];
|
|
|
|
|
TCHAR NetCardNetmask[256];
|
|
|
|
|
TCHAR NetCardMacAddr[256];
|
|
|
|
|
} NIC_CONTENT, *PNIC_CONTENT;
|
|
|
|
|
|
|
|
|
|
|
2023-06-15 01:35:37 +00:00
|
|
|
|
#ifdef __cplusplus // If used by C++ code,
|
|
|
|
|
extern "C" {
|
|
|
|
|
// we need to export the C interface
|
|
|
|
|
#endif
|
|
|
|
|
|
2023-06-19 11:08:42 +00:00
|
|
|
|
TUNNEL_API int __cdecl CreateTunnel(LPCSTR lpszMsg);
|
|
|
|
|
TUNNEL_API const TCHAR* __cdecl TestMessage();
|
|
|
|
|
TUNNEL_API int __cdecl Add(int a, int b);
|
|
|
|
|
TUNNEL_API int __cdecl TunnelSDKInitEnv(const TCHAR* pWorkDir);
|
|
|
|
|
TUNNEL_API int __cdecl SetProtocolEncryptType(PROTO_CRYPTO_TYPE type, const TCHAR* pProKey);
|
|
|
|
|
TUNNEL_API void __cdecl InitTunnelSDKLog(const TCHAR* pLogFile, LOG_LEVEL level);
|
|
|
|
|
TUNNEL_API void __cdecl TunnelLogEnable(bool enLog);
|
|
|
|
|
TUNNEL_API int __cdecl FindWireguardExe(TCHAR* pFullPath, int maxSize);
|
|
|
|
|
TUNNEL_API int __cdecl SetWireguardPath(TCHAR* pPath);
|
|
|
|
|
TUNNEL_API void __cdecl TunnelSDKUnInit();
|
|
|
|
|
TUNNEL_API int __cdecl GenerateWireguardKeyPairs(TCHAR* pPubKey, int pubkeySize, TCHAR* pPrivKey, int privKeySize);
|
|
|
|
|
TUNNEL_API int __cdecl GetAllNICInfo(PNIC_CONTENT pInfo, int* pItemCounts);
|
2023-06-15 01:35:37 +00:00
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|