This commit is contained in:
sushen339
2025-11-18 12:54:21 +08:00
parent 57ecd5ab17
commit 43fc123cb4
25 changed files with 2978 additions and 2 deletions
+29
View File
@@ -0,0 +1,29 @@
#ifndef BAN_H
#define BAN_H
#include "common.h"
#include "ip_utils.h"
#include <stdbool.h>
/* 封禁IP */
int ban_ip(const char *ip, bool save_to_disk);
/* 解封IP */
int unban_ip(const char *ip);
/* 添加到持久化列表 */
int persist_add_ip(const char *ip, const char *country_code);
/* 从持久化列表移除 */
int persist_remove_ip(const char *ip);
/* 更新IP的国家信息 */
int update_ip_country(const char *ip, const char *country_code);
/* 恢复持久化列表到nftables */
int restore_from_persist(void);
/* 显示持久化列表 */
void show_persist_list(void);
#endif /* BAN_H */