 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- Variables
- 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() (string, error)
- func (f *Firewall) Stop() error
- func (f *Firewall) Version() (string, error)
 
- type Forward
- type Iptables
- func (iptables *Iptables) AppendChain(tab string, chain, chain1 string) error
- func (iptables *Iptables) Check() error
- func (iptables *Iptables) NatAdd(protocol, srcPort, dest, destPort string, save bool) error
- func (iptables *Iptables) NatList(chain ...string) ([]IptablesNatInfo, error)
- func (iptables *Iptables) NatRemove(num string, protocol, srcPort, dest, destPort string) error
- func (iptables *Iptables) NewChain(tab, chain string) error
- func (iptables *Iptables) Reload() error
 
- type IptablesFilterInfo
- type IptablesNatInfo
- 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() (string, error)
- func (f *Ufw) Stop() error
- func (f *Ufw) Version() (string, error)
 
Constants ¶
      View Source
      
  
    const ( PreRoutingChain = "1PANEL_PREROUTING" PostRoutingChain = "1PANEL_POSTROUTING" ForwardChain = "1PANEL_FORWARD" )
      View Source
      
  
const ( FilterTab = "filter" NatTab = "nat" )
Variables ¶
      View Source
      
  
var ForwardListRegex = regexp.MustCompile(`^port=(\d{1,5}):proto=(.+?):toport=(\d{1,5}):toaddr=(.*)$`)
    Functions ¶
This section is empty.
Types ¶
type FireInfo ¶
type FireInfo struct {
	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"`
	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 {
	CmdStr string
}
    func NewIptables ¶
func (*Iptables) AppendChain ¶
func (*Iptables) NatList ¶
func (iptables *Iptables) NatList(chain ...string) ([]IptablesNatInfo, error)
type IptablesFilterInfo ¶
type IptablesNatInfo ¶
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.