Documentation
¶
Index ¶
- Variables
- type IPTablesInstance
- func (ipt *IPTablesInstance) CreateForward(rule *Rule) error
- func (ipt *IPTablesInstance) DeleteAllForwards() error
- func (ipt *IPTablesInstance) DeleteForwardById(ruleId int) error
- func (ipt *IPTablesInstance) DeleteForwardByRule(rule *Rule) error
- func (ipt *IPTablesInstance) ListForward(outputFormat string) (map[int]string, error)
- func (ipt *IPTablesInstance) ValidateForward(rule *Rule) error
- type Rule
Constants ¶
This section is empty.
Variables ¶
View Source
var ( FwdTable = "nat" FwdChain = "PREROUTING" FwdTarget = "DNAT" )
Functions ¶
This section is empty.
Types ¶
type IPTablesInstance ¶ added in v0.9.1
func NewIPTablesInstance ¶ added in v0.9.1
func NewIPTablesInstance() (*IPTablesInstance, error)
func (*IPTablesInstance) CreateForward ¶ added in v0.9.1
func (ipt *IPTablesInstance) CreateForward(rule *Rule) error
func (*IPTablesInstance) DeleteAllForwards ¶ added in v0.9.1
func (ipt *IPTablesInstance) DeleteAllForwards() error
func (*IPTablesInstance) DeleteForwardById ¶ added in v0.9.1
func (ipt *IPTablesInstance) DeleteForwardById(ruleId int) error
func (*IPTablesInstance) DeleteForwardByRule ¶ added in v0.9.1
func (ipt *IPTablesInstance) DeleteForwardByRule(rule *Rule) error
func (*IPTablesInstance) ListForward ¶ added in v0.9.1
func (ipt *IPTablesInstance) ListForward(outputFormat string) (map[int]string, error)
func (*IPTablesInstance) ValidateForward ¶ added in v0.9.1
func (ipt *IPTablesInstance) ValidateForward(rule *Rule) error
type Rule ¶ added in v0.7.1
type Rule struct {
Iface string `json:"iface" yaml:"iface" default:"lo"`
Proto string `json:"proto" yaml:"proto" default:"tcp"`
Dport int `json:"dport" yaml:"dport"`
Saddr string `json:"saddr" yaml:"saddr"`
Sport int `json:"sport" yaml:"sport"`
Comment string `json:"comment,omitempty" yaml:"comment,omitempty"`
}
func ExtractRuleInfo ¶ added in v0.9.1
ExtractRuleInfo extract forward information from rule if it matches the requirements. Returns the Rule struct and error
Click to show internal directories.
Click to hide internal directories.