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 (f *FakeIPTables) IsIPv6() bool
- func (f *FakeIPTables) Monitor(canary iptables.Chain, tables []iptables.Table, reloadFunc func(), ...)
- func (f *FakeIPTables) Protocol() iptables.Protocol
- 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 ¶
const ( // Destination represents the destination address flag Destination = "-d " // Source represents the source address flag Source = "-s " // DPort represents the destination port flag DPort = "--dport " // Protocol represents the protocol flag Protocol = "-p " // Jump represents jump flag specifies the jump target Jump = "-j " // Reject specifies the reject target Reject = "REJECT" // Accept specifies the accept target Accept = "ACCEPT" // ToDest represents the flag used to specify the destination address in DNAT ToDest = "--to-destination " // Recent represents the sub-command recent that allows to dynamically create list of IP address to match against Recent = "recent " // MatchSet represents the flag which match packets against the specified set MatchSet = "--match-set " // SrcType represents the --src-type flag which matches if the source address is of given type SrcType = "--src-type " // Masquerade represents the target that is used in nat table. 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 }
FakeIPTables is no-op implementation of iptables Interface.
func NewIPv6Fake ¶ added in v1.19.0
func NewIPv6Fake() *FakeIPTables
NewIPv6Fake returns a no-op iptables.Interface with IsIPv6() == true
func (*FakeIPTables) DeleteChain ¶ added in v1.5.0
DeleteChain is part of iptables.Interface
func (*FakeIPTables) DeleteRule ¶ added in v1.5.0
DeleteRule is part of iptables.Interface
func (*FakeIPTables) EnsureChain ¶ added in v1.5.0
EnsureChain is part of iptables.Interface
func (*FakeIPTables) EnsureRule ¶ added in v1.5.0
func (*FakeIPTables) EnsureRule(position iptables.RulePosition, table iptables.Table, chain iptables.Chain, args ...string) (bool, error)
EnsureRule is part of iptables.Interface
func (*FakeIPTables) FlushChain ¶ added in v1.5.0
FlushChain is part of iptables.Interface
func (*FakeIPTables) GetRules ¶ added in v1.5.0
func (f *FakeIPTables) GetRules(chainName string) (rules []Rule)
GetRules is part of iptables.Interface
func (*FakeIPTables) HasRandomFully ¶ added in v1.16.0
func (f *FakeIPTables) HasRandomFully() bool
HasRandomFully is part of iptables.Interface
func (*FakeIPTables) IsIPv6 ¶ added in v1.19.0
func (f *FakeIPTables) IsIPv6() bool
IsIPv6 is part of iptables.Interface
func (*FakeIPTables) Monitor ¶ added in v1.17.0
func (f *FakeIPTables) Monitor(canary iptables.Chain, tables []iptables.Table, reloadFunc func(), interval time.Duration, stopCh <-chan struct{})
Monitor is part of iptables.Interface
func (*FakeIPTables) Protocol ¶ added in v1.19.0
func (f *FakeIPTables) Protocol() iptables.Protocol
Protocol is part of iptables.Interface
func (*FakeIPTables) Restore ¶ added in v1.5.0
func (*FakeIPTables) Restore(table iptables.Table, data []byte, flush iptables.FlushFlag, counters iptables.RestoreCountersFlag) error
Restore is part of iptables.Interface
func (*FakeIPTables) RestoreAll ¶ added in v1.5.0
func (f *FakeIPTables) RestoreAll(data []byte, flush iptables.FlushFlag, counters iptables.RestoreCountersFlag) error
RestoreAll is part of iptables.Interface
func (*FakeIPTables) Save ¶ added in v1.5.0
func (f *FakeIPTables) Save(table iptables.Table) ([]byte, error)
Save is part of iptables.Interface
func (*FakeIPTables) SetHasRandomFully ¶ added in v1.16.0
func (f *FakeIPTables) SetHasRandomFully(can bool) *FakeIPTables
SetHasRandomFully is part of iptables.Interface