#pragma once #include #ifdef NETTUNNELSDK_EXPORTS #define TUNNEL_API __declspec(dllexport) #else #define TUNNEL_API __declspec(dllimport) #endif #define WG_KEY_MAX (64) #define NET_CARD_MAX (32) typedef enum { CRYPTO_NONE = 0, CRYPTO_BASE64 = 1, CRYPTO_AES128 = 2, CRYPTO_3DES = 3, CRYPTO_AES256 = 4, CRYPTO_MAX, } PROTO_CRYPTO_TYPE; typedef enum { LOG_TRACE = 0, LOG_DEBUG, LOG_INFO, LOG_WARN, LOG_ERROR, LOG_CRITICAL, 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; #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); #ifdef __cplusplus } #endif