iptables

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMaxCustomChainName

func GetMaxCustomChainName(originName string) string

func NewAction

func NewAction() generictables.ActionFactory

func NewMatch

func NewMatch() generictables.MatchCriteria

func WithIPFamily

func WithIPFamily(family int) option

func WithLockSecondsTimeout

func WithLockSecondsTimeout(timeout int) option

Types

type AcceptAction

type AcceptAction struct{}

func (AcceptAction) String

func (a AcceptAction) String() string

func (AcceptAction) ToParameter

func (a AcceptAction) ToParameter() string

type DropAction

type DropAction struct{}

func (DropAction) String

func (a DropAction) String() string

func (DropAction) ToParameter

func (a DropAction) ToParameter() string

type GotoAction

type GotoAction struct {
	// contains filtered or unexported fields
}

func (GotoAction) String

func (a GotoAction) String() string

func (GotoAction) ToParameter

func (a GotoAction) ToParameter() string

type JumpToChainAction

type JumpToChainAction struct {
	// contains filtered or unexported fields
}

func (JumpToChainAction) String

func (a JumpToChainAction) String() string

func (JumpToChainAction) ToParameter

func (a JumpToChainAction) ToParameter() string

type LogAction

type LogAction struct {
	// contains filtered or unexported fields
}

func (LogAction) String

func (a LogAction) String() string

func (LogAction) ToParameter

func (a LogAction) ToParameter() string

type RejectAction

type RejectAction struct {
	// contains filtered or unexported fields
}

func (RejectAction) String

func (a RejectAction) String() string

func (RejectAction) ToParameter

func (a RejectAction) ToParameter() string

type Renderer

type Renderer interface {
	RenderAppend(rule *generictables.Rule, chainName string, hash string) string
	RenderInsert(rule *generictables.Rule, chainName string, hash string) string
	RenderInsertAtIndex(rule *generictables.Rule, chainName string, index int, hash string) string
	RenderReplace(rule *generictables.Rule, chainName string, index int, hash string) string
	RenderDelete(renderedRule string) string
	RenderDeleteAtIndex(chainName string, index int) string
	RuleHashes(c *generictables.Chain) []string
}

func NewRenderer

func NewRenderer(hashCommentPrefix string) Renderer

type RestoreBuilder

type RestoreBuilder struct {
	// contains filtered or unexported fields
}

RestoreBuilder build iptables data example:

*filter :TEST_CHAIN - [0:0] -A TEST_CHAIN -m comment --comment "test chain" -A TEST_CHAIN -j ACCEPT COMMIT

func (*RestoreBuilder) EndTransaction

func (b *RestoreBuilder) EndTransaction()

func (*RestoreBuilder) IsEmpty

func (b *RestoreBuilder) IsEmpty() bool

func (*RestoreBuilder) Reset

func (b *RestoreBuilder) Reset()

func (*RestoreBuilder) StartTransaction

func (b *RestoreBuilder) StartTransaction(tableName string)

func (*RestoreBuilder) WriteChain

func (b *RestoreBuilder) WriteChain(chainName string)

func (*RestoreBuilder) WriteRule

func (b *RestoreBuilder) WriteRule(rule string)

type ReturnAction

type ReturnAction struct{}

func (ReturnAction) String

func (a ReturnAction) String() string

func (ReturnAction) ToParameter

func (a ReturnAction) ToParameter() string

type Table

type Table struct {
	// contains filtered or unexported fields
}

func NewTable

func NewTable(name string, hashPrefix string, opts ...option) (*Table, error)

func (*Table) Apply

func (t *Table) Apply()

func (*Table) Clean

func (t *Table) Clean() error

Clean all our rules and chains

func (*Table) NeedClean

func (t *Table) NeedClean()

func (*Table) SetDefaultRuleOfDefaultChain

func (t *Table) SetDefaultRuleOfDefaultChain(chainName string, rule generictables.Rule)

func (*Table) UpdateChain

func (t *Table) UpdateChain(chain *generictables.Chain)

func (*Table) UpdateChains

func (t *Table) UpdateChains(chains []*generictables.Chain)

UpdateChains update rules of our chain

type Unlocker

type Unlocker interface {
	Unlock() error
}

Jump to

Keyboard shortcuts

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