NetTunnelWindows/NetTunnelSDK/tunnel.h

66 lines
1.6 KiB
C
Raw Normal View History

2023-06-15 01:35:37 +00:00
#pragma once
#include <Windows.h>
#ifdef NETTUNNELSDK_EXPORTS
#define TUNNEL_API __declspec(dllexport)
2023-06-15 01:35:37 +00:00
#else
#define TUNNEL_API __declspec(dllimport)
2023-06-15 01:35:37 +00:00
#endif
#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,
} PROTO_CRYPTO_TYPE;
2023-06-15 01:35:37 +00:00
typedef enum
{
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;
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
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