testing

package
v1.8.0-alpha.2....-ef85265 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Destination = "-d "
	Source      = "-s "
	DPort       = "--dport "
	Protocol    = "-p "
	Jump        = "-j "
	Reject      = "REJECT"
	ToDest      = "--to-destination "
	Recent      = "recent "
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeIPTables

type FakeIPTables struct {
	Lines []byte
}

no-op implementation of iptables Interface

func NewFake

func NewFake() *FakeIPTables

func (*FakeIPTables) AddReloadFunc

func (*FakeIPTables) AddReloadFunc(reloadFunc func())

func (*FakeIPTables) DeleteChain

func (*FakeIPTables) DeleteChain(table iptables.Table, chain iptables.Chain) error

func (*FakeIPTables) DeleteRule

func (*FakeIPTables) DeleteRule(table iptables.Table, chain iptables.Chain, args ...string) error

func (*FakeIPTables) Destroy

func (*FakeIPTables) Destroy()

func (*FakeIPTables) EnsureChain

func (*FakeIPTables) EnsureChain(table iptables.Table, chain iptables.Chain) (bool, error)

func (*FakeIPTables) EnsureRule

func (*FakeIPTables) EnsureRule(position iptables.RulePosition, table iptables.Table, chain iptables.Chain, args ...string) (bool, error)

func (*FakeIPTables) FlushChain

func (*FakeIPTables) FlushChain(table iptables.Table, chain iptables.Chain) error

func (*FakeIPTables) GetRules

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) GetVersion

func (*FakeIPTables) GetVersion() (string, error)

func (*FakeIPTables) IsIpv6

func (*FakeIPTables) IsIpv6() bool

func (*FakeIPTables) Restore

func (*FakeIPTables) Restore(table iptables.Table, data []byte, flush iptables.FlushFlag, counters iptables.RestoreCountersFlag) error

func (*FakeIPTables) RestoreAll

func (f *FakeIPTables) RestoreAll(data []byte, flush iptables.FlushFlag, counters iptables.RestoreCountersFlag) error

func (*FakeIPTables) Save

func (f *FakeIPTables) Save(table iptables.Table) ([]byte, error)

func (*FakeIPTables) SaveInto

func (f *FakeIPTables) SaveInto(table iptables.Table, buffer *bytes.Buffer) error

type Rule

type Rule map[string]string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL