Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnsupported = errors.New(`unsupported`)
Functions ¶
Types ¶
type Driver ¶ added in v1.1.0
type Driver interface { RuleFrom(rule *Rule) []string Enabled(on bool) error Reset() error Import(wfwFile string) error Export(wfwFile string) error Insert(pos int, rule *Rule) error Append(rule *Rule) error Update(pos int, rule *Rule) error Delete(rule *Rule) error Exists(rule *Rule) (bool, error) List(table, chain string) ([]*Rule, error) }
type Rule ¶
type Rule struct { Type string `json:"type" xml:"type"` // filter / nat / etc. Name string `json:"name" xml:"name"` Direction string `json:"direction" xml:"direction"` // INPUT / OUTPUT / etc. Action string `json:"action" xml:"action"` // ACCEPT / DROP / etc. Protocol string `json:"protocol" xml:"protocol"` // tcp / udp / etc. // IP or Port RemoteIP string `json:"remoteIP" xml:"remoteIP"` LocalIP string `json:"localIP" xml:"localIP"` RemotePort string `json:"remotePort" xml:"remotePort"` LocalPort string `json:"localPort" xml:"localPort"` }
Click to show internal directories.
Click to hide internal directories.