diff --git a/README.md b/README.md index 319c1d8..17675fa 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# DenyIP: 拒绝非大陆IP访问的Linux服务器防火墙工具 +# DenyIP ## 概述 diff --git a/cap.c b/cap.c index 48f83ba..9d83bbc 100644 --- a/cap.c +++ b/cap.c @@ -2,8 +2,13 @@ #include "common.h" #include "libipset.h" + +pcap_if_t *alldevs, *device; +pcap_t *handle; // 会话句柄 +struct bpf_program fp; // 编译后的过滤器 + +pid_t pid = -1; // 子进程全局PID -pid_t pid = -1; // 子进程全局PID #define SHM_SIZE 1024 // 共享内存大小 #define SHM_KEY 1234 // 共享内存键值 int shmid = -1; @@ -209,10 +214,6 @@ void usage() exit(0); } - pcap_if_t *alldevs, *device; - pcap_t *handle; // 会话句柄 - struct bpf_program fp; // 编译后的过滤器 - void cleanup_(int signum) { diff --git a/cap.o b/cap.o index 8fdfa89..10ea2f4 100644 Binary files a/cap.o and b/cap.o differ diff --git a/common.c b/common.c index 125c259..b336329 100644 --- a/common.c +++ b/common.c @@ -55,7 +55,6 @@ void _printf(const char *format, ...) va_end(args); // 结束对变参列表的处理 } - void split_string(char string[], char delims[], char (*whitelist_ip)[WHITELIST_IP_NUM]) { int i = 0; @@ -96,7 +95,6 @@ int whitelist(char *client_ip, char (*whitelist_ip)[WHITELIST_IP_NUM]) return 0; // 未找到匹配 } - // 地域段白名单对比 int isregion(char *str, char (*region_list)[WHITELIST_IP_NUM]) { diff --git a/denyip b/denyip index 1a57f99..072267f 100644 Binary files a/denyip and b/denyip differ