Documentation ¶
Index ¶
- Constants
- type FakeIPTables
- func (*FakeIPTables) DeleteChain(table iptables.Table, chain iptables.Chain) error
- func (*FakeIPTables) DeleteRule(table iptables.Table, chain iptables.Chain, args ...string) error
- func (*FakeIPTables) EnsureChain(table iptables.Table, chain iptables.Chain) (bool, error)
- func (*FakeIPTables) EnsureRule(position iptables.RulePosition, table iptables.Table, chain iptables.Chain, ...) (bool, error)
- func (*FakeIPTables) FlushChain(table iptables.Table, chain iptables.Chain) error
- func (f *FakeIPTables) GetRules(chainName string) (rules []Rule)
- func (f *FakeIPTables) HasRandomFully() bool
- func (*FakeIPTables) IsIpv6() bool
- func (f *FakeIPTables) Monitor(canary iptables.Chain, tables []iptables.Table, reloadFunc func(), ...)
- func (*FakeIPTables) Restore(table iptables.Table, data []byte, flush iptables.FlushFlag, ...) error
- func (f *FakeIPTables) RestoreAll(data []byte, flush iptables.FlushFlag, counters iptables.RestoreCountersFlag) error
- func (f *FakeIPTables) Save(table iptables.Table) ([]byte, error)
- func (f *FakeIPTables) SaveInto(table iptables.Table, buffer *bytes.Buffer) error
- func (f *FakeIPTables) SetHasRandomFully(can bool) *FakeIPTables
- type Rule
Constants ¶
View Source
const ( Destination = "-d " Source = "-s " DPort = "--dport " Protocol = "-p " Jump = "-j " Reject = "REJECT" ToDest = "--to-destination " Recent = "recent " MatchSet = "--match-set " SrcType = "--src-type " Masquerade = "MASQUERADE " )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeIPTables ¶ added in v1.5.0
type FakeIPTables struct { Lines []byte // contains filtered or unexported fields }
no-op implementation of iptables Interface
func NewFake ¶
func NewFake() *FakeIPTables
func (*FakeIPTables) DeleteChain ¶ added in v1.5.0
func (*FakeIPTables) DeleteRule ¶ added in v1.5.0
func (*FakeIPTables) EnsureChain ¶ added in v1.5.0
func (*FakeIPTables) EnsureRule ¶ added in v1.5.0
func (*FakeIPTables) EnsureRule(position iptables.RulePosition, table iptables.Table, chain iptables.Chain, args ...string) (bool, error)
func (*FakeIPTables) FlushChain ¶ added in v1.5.0
func (*FakeIPTables) GetRules ¶ added in v1.5.0
func (f *FakeIPTables) GetRules(chainName string) (rules []Rule)
GetChain returns a list of rules for the given chain. The chain name must match exactly. The matching is pretty dumb, don't rely on it for anything but testing.
func (*FakeIPTables) HasRandomFully ¶ added in v1.16.0
func (f *FakeIPTables) HasRandomFully() bool
func (*FakeIPTables) IsIpv6 ¶ added in v1.5.0
func (*FakeIPTables) IsIpv6() bool
func (*FakeIPTables) Restore ¶ added in v1.5.0
func (*FakeIPTables) Restore(table iptables.Table, data []byte, flush iptables.FlushFlag, counters iptables.RestoreCountersFlag) error
func (*FakeIPTables) RestoreAll ¶ added in v1.5.0
func (f *FakeIPTables) RestoreAll(data []byte, flush iptables.FlushFlag, counters iptables.RestoreCountersFlag) error
func (*FakeIPTables) Save ¶ added in v1.5.0
func (f *FakeIPTables) Save(table iptables.Table) ([]byte, error)
func (*FakeIPTables) SetHasRandomFully ¶ added in v1.16.0
func (f *FakeIPTables) SetHasRandomFully(can bool) *FakeIPTables
Click to show internal directories.
Click to hide internal directories.