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 (*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" // 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 ¶
type FakeIPTables struct { Lines []byte // contains filtered or unexported fields }
FakeIPTables is no-op implementation of iptables Interface.
func NewIpv6Fake ¶
func NewIpv6Fake() *FakeIPTables
NewIpv6Fake returns a no-op iptables.Interface with IsIPv6() == true
func (*FakeIPTables) DeleteChain ¶
DeleteChain is part of iptables.Interface
func (*FakeIPTables) DeleteRule ¶
DeleteRule is part of iptables.Interface
func (*FakeIPTables) EnsureChain ¶
EnsureChain is part of iptables.Interface
func (*FakeIPTables) EnsureRule ¶
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 ¶
FlushChain is part of iptables.Interface
func (*FakeIPTables) GetRules ¶
func (f *FakeIPTables) GetRules(chainName string) (rules []Rule)
GetRules is part of iptables.Interface
func (*FakeIPTables) HasRandomFully ¶
func (f *FakeIPTables) HasRandomFully() bool
HasRandomFully is part of iptables.Interface
func (*FakeIPTables) IsIpv6 ¶
func (f *FakeIPTables) IsIpv6() bool
IsIpv6 is part of iptables.Interface
func (*FakeIPTables) Monitor ¶
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) Restore ¶
func (*FakeIPTables) Restore(table iptables.Table, data []byte, flush iptables.FlushFlag, counters iptables.RestoreCountersFlag) error
Restore is part of iptables.Interface
func (*FakeIPTables) RestoreAll ¶
func (f *FakeIPTables) RestoreAll(data []byte, flush iptables.FlushFlag, counters iptables.RestoreCountersFlag) error
RestoreAll is part of iptables.Interface
func (*FakeIPTables) Save ¶
func (f *FakeIPTables) Save(table iptables.Table) ([]byte, error)
Save is part of iptables.Interface
func (*FakeIPTables) SetHasRandomFully ¶
func (f *FakeIPTables) SetHasRandomFully(can bool) *FakeIPTables
SetHasRandomFully is part of iptables.Interface