using System; using System.Runtime.InteropServices; namespace NetTunnelApp; public enum ProtoCryptoType { CRYPTO_NONE = 0, CRYPTO_BASE64 = 1, CRYPTO_AES128 = 2, CRYPTO_3DES = 3, CRYPTO_AES256 = 4 } public enum LogLevel { LOG_DEBUG = 0, LOG_INFO = 1, LOG_WARN = 2, LOG_ERROR = 3 } public class NetTunnelLib { [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int CreateTunnel(String lpszMsg); [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr TestMessage(); [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] internal static extern Int32 Add(int a, int b); [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int TunnelSDKInitEnv(); [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int SetProtocolEncryptType(ProtoCryptoType type, String pProKey); [DllImport("NetTunnelSDK.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void InitTunnelSDKLog(String pProKey, LogLevel level); }