IPSet支持IPv6

This commit is contained in:
刘祥超
2022-03-16 20:48:00 +08:00
parent 470314c32e
commit 87a3df3645

View File

@@ -62,12 +62,17 @@ func FindFirewallActionTypeName(actionType FirewallActionType) string {
} }
type FirewallActionIPSetConfig struct { type FirewallActionIPSetConfig struct {
Path string `json:"path"` // 命令路径 TODO 暂时不实现 Path string `json:"path"` // 命令路径 TODO 暂时不实现
WhiteName string `json:"whiteName"` // IPSet白名单名称
BlackName string `json:"blackName"` // IPSet名单名称 WhiteName string `json:"whiteName"` // IPSet名单名称
MaxElements int `json:"maxElements"` // 最多IP数量 TODO 暂时不实现 BlackName string `json:"blackName"` // IPSet黑名单名称
AutoAddToIPTables bool `json:"autoAddToIPTables"` // 是否自动创建IPTables规则
AutoAddToFirewalld bool `json:"autoAddToFirewalld"` // 是否自动加入到Firewalld WhiteNameIPv6 string `json:"whiteNameIPv6"` // IPv6白名单名称
BlackNameIPv6 string `json:"blackNameIPv6"` // IPv6黑名单名称
MaxElements int `json:"maxElements"` // 最多IP数量 TODO 暂时不实现
AutoAddToIPTables bool `json:"autoAddToIPTables"` // 是否自动创建IPTables规则
AutoAddToFirewalld bool `json:"autoAddToFirewalld"` // 是否自动加入到Firewalld
// TODO 添加需要阻止的端口列表 // TODO 添加需要阻止的端口列表
} }
@@ -92,7 +97,7 @@ type FirewallActionScriptConfig struct {
// TODO 添加需要阻止的端口列表 // TODO 添加需要阻止的端口列表
} }
// HTTP API配置 // FirewallActionHTTPAPIConfig HTTP API配置
type FirewallActionHTTPAPIConfig struct { type FirewallActionHTTPAPIConfig struct {
URL string `json:"url"` // URL路径 URL string `json:"url"` // URL路径
TimeoutSeconds int `json:"timeoutSeconds"` // 超时时间 TODO 暂时不实现 TimeoutSeconds int `json:"timeoutSeconds"` // 超时时间 TODO 暂时不实现
@@ -101,7 +106,7 @@ type FirewallActionHTTPAPIConfig struct {
// TODO 添加需要阻止的端口列表 // TODO 添加需要阻止的端口列表
} }
// HTML配置 // FirewallActionHTMLConfig HTML配置
type FirewallActionHTMLConfig struct { type FirewallActionHTMLConfig struct {
Content string `json:"content"` // 完整的HTML内容 Content string `json:"content"` // 完整的HTML内容
} }