2023-06-19 11:08:42 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
#include <spdlog/spdlog.h>
|
|
|
|
|
|
2023-06-20 09:25:14 +00:00
|
|
|
|
/**
|
|
|
|
|
* @brief WireGuard 配置项
|
|
|
|
|
*/
|
|
|
|
|
typedef struct {
|
|
|
|
|
TCHAR wireguardPath[MAX_PATH]; ///< wireguard.exe 路径
|
|
|
|
|
BOOL wireguardExists; ///< wireguard.exe 是否存在
|
|
|
|
|
TCHAR wgPath[MAX_PATH]; ///< wg.exe 路径
|
|
|
|
|
BOOL wgExists; ///< wg.exe 是否存在
|
2023-06-19 11:08:42 +00:00
|
|
|
|
} 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;
|
|
|
|
|
|
2023-06-20 09:25:14 +00:00
|
|
|
|
/**
|
|
|
|
|
* @brief SDK 全局配置项
|
|
|
|
|
*/
|
|
|
|
|
typedef struct {
|
2023-06-27 02:02:02 +00:00
|
|
|
|
TCHAR systemDirectory[MAX_PATH]; ///< 操作系统目录
|
2023-06-20 09:25:14 +00:00
|
|
|
|
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 客户端网络接口配置
|
2023-06-19 11:08:42 +00:00
|
|
|
|
} SDK_CONFIG, *PSDK_CONFIG;
|
|
|
|
|
|
2023-06-20 09:25:14 +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
|
|
|
|
PSDK_CONFIG GetGlobalCfgInfo();
|
2023-06-20 09:25:14 +00:00
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|