Documentation ¶
Overview ¶
Package iptables implements objects that manipulate netfilter rules by calling the iptables binary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Iptables ¶ added in v0.3.11
type Iptables struct {
// contains filtered or unexported fields
}
Iptables adds and removes iptables rules by executing the `iptables` binary.
type Rule ¶ added in v0.3.11
type Rule struct { // Table is the netfilter table to which this rule belongs. It is usually "filter". Table string // Chain is the netfilter chain to which this rule belongs. Usual values are "INPUT", "OUTPUT". Chain string // Args is the rest of the netfilter rule. // Arguments must be space-separated. Using shell-style quotes or backslashes to group more than one space-separated // word as one argument is not allowed. Args string }
Rule is a netfilter/iptables rule.
type RuleSet ¶ added in v0.3.11
type RuleSet struct {
// contains filtered or unexported fields
}
RuleSet is a stateful object that allows adding rules and keeping track of them to remove them later.
func NewRuleSet ¶ added in v0.3.11
NewRuleSet builds a RuleSet that uses the provided Iptables instance to add and remove rules.
Click to show internal directories.
Click to hide internal directories.