75 lines
1.6 KiB
C
75 lines
1.6 KiB
C
|
#pragma once
|
|||
|
|
|||
|
/**
|
|||
|
* @brief WireGuard key 最大长度
|
|||
|
*/
|
|||
|
constexpr auto WG_KEY_MAX = (64);
|
|||
|
|
|||
|
/**
|
|||
|
* @brief 操作系统最大网卡数
|
|||
|
*/
|
|||
|
#define NET_CARD_MAX (32)
|
|||
|
|
|||
|
/**
|
|||
|
* @brief IP 字符串最大长度(支持IPv6)
|
|||
|
*/
|
|||
|
#define MAX_IP_LEN (48)
|
|||
|
|
|||
|
/**
|
|||
|
* @brief IP 字符串最小长度
|
|||
|
*/
|
|||
|
#define MIN_IP_LEN (7)
|
|||
|
|
|||
|
/**
|
|||
|
* @brief 网卡名称字符串最大长度(支持IPv6)
|
|||
|
*/
|
|||
|
#define MAX_NETCARD_NAME (64)
|
|||
|
|
|||
|
/**
|
|||
|
* @brief 协议加密类型
|
|||
|
*
|
|||
|
*/
|
|||
|
typedef enum {
|
|||
|
CRYPTO_NONE = 0, ///< 不加密
|
|||
|
CRYPTO_BASE64 = 1, ///< BASE64 字符串编码
|
|||
|
CRYPTO_AES128 = 2, ///< AES 128位秘钥 加密
|
|||
|
CRYPTO_3DES = 3, ///< 3DES 加密
|
|||
|
CRYPTO_AES256 = 4, ///< AES 256 位秘钥加密
|
|||
|
CRYPTO_MAX,
|
|||
|
} PROTO_CRYPTO_TYPE;
|
|||
|
|
|||
|
/**
|
|||
|
* @brief 日志等级
|
|||
|
*
|
|||
|
*/
|
|||
|
enum LOG_LEVEL {
|
|||
|
LOG_TRACE = 0, ///< TRACE 日志等级
|
|||
|
LOG_DEBUG, ///< DEBUG 日志等级
|
|||
|
LOG_INFO, ///< INFO 日志等级
|
|||
|
LOG_WARN, ///< WARN 日志等级
|
|||
|
LOG_ERROR, ///< ERROR 日志等级
|
|||
|
LOG_CRITICAL, ///< CRITICAL 日志等级
|
|||
|
LOG_OFF ///< 关闭日志
|
|||
|
};
|
|||
|
|
|||
|
/**
|
|||
|
* @brief Hash 算法类型
|
|||
|
*
|
|||
|
*/
|
|||
|
typedef enum {
|
|||
|
HASH_MD2 = 0, ///< MD2 HASH 算法
|
|||
|
HASH_MD4, ///< MD4 HASH 算法
|
|||
|
HASH_MD5, ///< MD5 HASH 算法
|
|||
|
HASH_SHA1, ///< SHA1 HASH 算法
|
|||
|
HASH_SHA256, ///< SHA256 HASH 算法
|
|||
|
HASH_SHA384, ///< SHA384 HASH 算法
|
|||
|
HASH_SHA512 ///< SHA512 HASH 算法
|
|||
|
} HASH_TYPE;
|
|||
|
|
|||
|
typedef enum {
|
|||
|
CHK_SYSTEM_INIT,
|
|||
|
CHK_WIREGUARD_CONFIG,
|
|||
|
CHK_WIREGUARD_SERVICE,
|
|||
|
CHK_WG_INTERFACE_PRIVATE,
|
|||
|
CHK_MAX
|
|||
|
} CHECK_FUNCTION;
|