2023-03-27 11:02:36 +00:00
|
|
|
package dto
|
|
|
|
|
2023-03-30 08:07:28 +00:00
|
|
|
type FirewallBaseInfo struct {
|
2023-03-30 10:03:21 +00:00
|
|
|
Name string `json:"name"`
|
|
|
|
Status string `json:"status"`
|
|
|
|
Version string `json:"version"`
|
|
|
|
PingStatus string `json:"pingStatus"`
|
2023-03-30 08:07:28 +00:00
|
|
|
}
|
|
|
|
|
2023-03-27 11:02:36 +00:00
|
|
|
type RuleSearch struct {
|
|
|
|
PageInfo
|
2023-03-28 07:17:13 +00:00
|
|
|
Info string `json:"info"`
|
2023-03-27 11:02:36 +00:00
|
|
|
Type string `json:"type" validate:"required"`
|
|
|
|
}
|
|
|
|
|
2023-03-30 08:07:28 +00:00
|
|
|
type FirewallOperation struct {
|
2023-03-30 10:03:21 +00:00
|
|
|
Operation string `json:"operation" validate:"required,oneof=start stop disablePing enablePing"`
|
2023-03-30 08:07:28 +00:00
|
|
|
}
|
|
|
|
|
2023-03-27 11:02:36 +00:00
|
|
|
type PortRuleOperate struct {
|
|
|
|
Operation string `json:"operation" validate:"required,oneof=add remove"`
|
|
|
|
Address string `json:"address"`
|
|
|
|
Port string `json:"port" validate:"required"`
|
2023-03-27 15:29:46 +00:00
|
|
|
Protocol string `json:"protocol" validate:"required,oneof=tcp udp tcp/udp"`
|
2023-03-27 11:02:36 +00:00
|
|
|
Strategy string `json:"strategy" validate:"required,oneof=accept drop"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type AddrRuleOperate struct {
|
|
|
|
Operation string `json:"operation" validate:"required,oneof=add remove"`
|
|
|
|
Address string `json:"address" validate:"required"`
|
|
|
|
Strategy string `json:"strategy" validate:"required,oneof=accept drop"`
|
|
|
|
}
|
2023-03-28 07:17:13 +00:00
|
|
|
|
|
|
|
type PortRuleUpdate struct {
|
|
|
|
OldRule PortRuleOperate `json:"oldRule"`
|
|
|
|
NewRule PortRuleOperate `json:"newRule"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type AddrRuleUpdate struct {
|
|
|
|
OldRule AddrRuleOperate `json:"oldRule"`
|
|
|
|
NewRule AddrRuleOperate `json:"newRule"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type BatchRuleOperate struct {
|
|
|
|
Type string `json:"type" validate:"required"`
|
|
|
|
Rules []PortRuleOperate `json:"rules"`
|
|
|
|
}
|