Documentation
¶
Index ¶
- func EnableIptablesForward() error
- type FireInfo
- type Firewall
- func (f *Firewall) EnableForward() error
- func (f *Firewall) ListAddress() ([]FireInfo, error)
- func (f *Firewall) ListForward() ([]FireInfo, error)
- func (f *Firewall) ListPort() ([]FireInfo, error)
- func (f *Firewall) Name() string
- func (f *Firewall) Port(port FireInfo, operation string) error
- func (f *Firewall) PortForward(info Forward, operation string) error
- func (f *Firewall) Reload() error
- func (f *Firewall) Restart() error
- func (f *Firewall) RichRules(rule FireInfo, operation string) error
- func (f *Firewall) Start() error
- func (f *Firewall) Status() (bool, error)
- func (f *Firewall) Stop() error
- func (f *Firewall) Version() (string, error)
- type Forward
- type Iptables
- func (i *Iptables) EnableForward() error
- func (i *Iptables) ListAddress() ([]FireInfo, error)
- func (i *Iptables) ListForward() ([]FireInfo, error)
- func (i *Iptables) ListPort() ([]FireInfo, error)
- func (i *Iptables) Name() string
- func (i *Iptables) Port(port FireInfo, operation string) error
- func (i *Iptables) PortForward(info Forward, operation string) error
- func (i *Iptables) Reload() error
- func (i *Iptables) Restart() error
- func (i *Iptables) RichRules(rule FireInfo, operation string) error
- func (i *Iptables) Start() error
- func (i *Iptables) Status() (bool, error)
- func (i *Iptables) Stop() error
- func (i *Iptables) Version() (string, error)
- type Ufw
- func (f *Ufw) EnableForward() error
- func (f *Ufw) ListAddress() ([]FireInfo, error)
- func (f *Ufw) ListForward() ([]FireInfo, error)
- func (f *Ufw) ListPort() ([]FireInfo, error)
- func (f *Ufw) Name() string
- func (f *Ufw) Port(port FireInfo, operation string) error
- func (f *Ufw) PortForward(info Forward, operation string) error
- func (f *Ufw) Reload() error
- func (f *Ufw) Restart() error
- func (f *Ufw) RichRules(rule FireInfo, operation string) error
- func (f *Ufw) Start() error
- func (f *Ufw) Status() (bool, error)
- func (f *Ufw) Stop() error
- func (f *Ufw) Version() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableIptablesForward ¶
func EnableIptablesForward() error
Types ¶
type FireInfo ¶
type FireInfo struct {
ID uint `json:"id"`
Chain string `json:"chain"`
Family string `json:"family"` // ipv4 ipv6
Address string `json:"address"` // Anywhere
Port string `json:"port"`
Protocol string `json:"protocol"` // tcp udp tcp/udp
Strategy string `json:"strategy"` // accept drop
Num string `json:"num"`
TargetIP string `json:"targetIP"`
TargetPort string `json:"targetPort"`
Interface string `json:"interface"`
UsedStatus string `json:"usedStatus"`
Description string `json:"description"`
}
type Firewall ¶
type Firewall struct{}
func NewFirewalld ¶
func (*Firewall) EnableForward ¶
func (*Firewall) ListAddress ¶
func (*Firewall) ListForward ¶
type Iptables ¶
type Iptables struct{}
func NewIptables ¶
func (*Iptables) EnableForward ¶
func (*Iptables) ListAddress ¶
func (*Iptables) ListForward ¶
type Ufw ¶
type Ufw struct {
CmdStr string
}
func (*Ufw) EnableForward ¶
func (*Ufw) ListAddress ¶
func (*Ufw) ListForward ¶
Click to show internal directories.
Click to hide internal directories.