NetTunnelWindows/NetTunnelSDK/globalcfg.h

46 lines
1.8 KiB
C
Raw Normal View History

#pragma once
#include <spdlog/spdlog.h>
/**
* @brief WireGuard
*/
typedef struct {
TCHAR wireguardPath[MAX_PATH]; ///< wireguard.exe 路径
BOOL wireguardExists; ///< wireguard.exe 是否存在
TCHAR wgPath[MAX_PATH]; ///< wg.exe 路径
BOOL wgExists; ///< wg.exe 是否存在
} WIREGUARD_CFG, *PWIREGUARD_CFG;
2023-06-21 10:04:16 +00:00
typedef struct {
TCHAR wgName[260]; ///< 网卡名称, Windows标识为 UUID
TCHAR wgIpaddr[MAX_IP_LEN]; ///< 网卡 IP 地址
TCHAR wgNetmask[MAX_IP_LEN]; ///< 网卡子网掩码
TCHAR wgCfgPath[MAX_PATH]; ///< 配置文件路径
} WGINTERFACE_CFG, *PWGINTERFACE_CFG;
/**
* @brief SDK
*/
typedef struct {
TCHAR systemDirectory[MAX_PATH]; ///< 操作系统目录
TCHAR workDirectory[MAX_PATH]; ///< SDK 当前工作目录
PROTO_CRYPTO_TYPE proCryptoType; ///< 协议加密类型
TCHAR proKeyBuf[256]; ///< 协议加密秘钥
BOOL enableLog; ///< 是否启用日志
spdlog::level::level_enum logLevel; ///< 日志等级
TCHAR cfgPath[MAX_PATH]; ///< 配置文件路径
WIREGUARD_CFG wireguardCfg; ///< wireguard 配置项 @see WIREGUARD_CFG
2023-06-21 10:04:16 +00:00
WGINTERFACE_CFG wgServerCfg; ///< wireguard 服务端网络接口配置
WGINTERFACE_CFG wgClientCfg; ///< wireguard 客户端网络接口配置
} SDK_CONFIG, *PSDK_CONFIG;
#ifdef __cplusplus // If used by C++ code,
extern "C" {
// we need to export the C interface
#endif
PSDK_CONFIG GetGlobalCfgInfo();
#ifdef __cplusplus
}
#endif