iptables

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2020 License: Apache-2.0, BSD-3-Clause, MIT Imports: 6 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterArgType

func RegisterArgType(name string, n int)

func RegisterType

func RegisterType(t OptionType)

Types

type Chain

type Chain struct {
	Table string
	Chain string
	Rules Rules
}

func (*Chain) Add

func (this *Chain) Add(r Rule) *Chain

func (*Chain) Index

func (this *Chain) Index(r Rule) int

type ChainRequest

type ChainRequest struct {
	*Chain
	Cleanup bool
}

func NewChainRequest

func NewChainRequest(table, chain string, rules Rules, cleanup bool) *ChainRequest

type IPTables

type IPTables struct {
	*iptables.IPTables
}

func New

func New() (*IPTables, error)

func (*IPTables) AppendRule

func (this *IPTables) AppendRule(table, chain string, rule Rule) error

func (*IPTables) AssureChain

func (this *IPTables) AssureChain(logger logger.LogContext, chain *Chain) error

func (*IPTables) DeleteRule

func (this *IPTables) DeleteRule(table, chain string, rule Rule) error

func (*IPTables) Execute

func (this *IPTables) Execute(logger logger.LogContext, req *ChainRequest) error

func (*IPTables) InsertRule

func (this *IPTables) InsertRule(table, chain string, pos int, rule Rule) error

func (*IPTables) ListChain

func (this *IPTables) ListChain(table, chain string) (*Chain, error)

func (*IPTables) UpdateChain

func (this *IPTables) UpdateChain(logger logger.LogContext, chain *Chain) error

type Option

type Option []string

func Opt

func Opt(args ...string) Option

func (Option) Equals

func (this Option) Equals(s Option) bool

func (Option) Index

func (this Option) Index(val string) int

type OptionType

type OptionType interface {
	Extract(list []string) (Option, []string)
}

type Options

type Options []Option

func (Options) Index

func (this Options) Index(o Option) int

type Requests

type Requests []*ChainRequest

type Rule

type Rule Options

func ParseRule

func ParseRule(list []string) Rule

func (*Rule) Add

func (this *Rule) Add(o Option) *Rule

func (Rule) AsList

func (this Rule) AsList() []string

func (Rule) Equals

func (this Rule) Equals(r Rule) bool

func (*Rule) HasOption

func (this *Rule) HasOption(name string) bool

func (Rule) Index

func (this Rule) Index(o Option) int

func (*Rule) Remove

func (this *Rule) Remove(o Option) *Rule

func (*Rule) RemoveOption

func (this *Rule) RemoveOption(name string) *Rule

type Rules

type Rules []Rule

func (*Rules) Add

func (this *Rules) Add(r Rule) *Rules

func (Rules) Index

func (this Rules) Index(r Rule) int

type StringList

type StringList []string

func (StringList) Index

func (this StringList) Index(val string) int

Jump to

Keyboard shortcuts

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