增加白名单支持,还未大量测试

This commit is contained in:
2025-07-24 15:05:03 +08:00
parent 62013fbab9
commit c27df40923
5 changed files with 156 additions and 31 deletions

View File

@@ -1,5 +1,7 @@
#include "cache.h"
struct ip_cache_node *ip_cache_head = NULL; // 缓存链表的头节点
int cache_size = 0; // 当前缓存中的 IP 数量
@@ -88,7 +90,7 @@ void free_ip_cache()
cache_size = 0;
}
char cn_ip[MAXIPSET_][MAXIPLEN] = { 0 };
// 添加一个 IP 到集合(如果已存在则不添加)
int add_cn_ip(char cn_ip[MAXIPSET_][MAXIPLEN], char *ip)