iptables

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateIP4Chain

func CreateIP4Chain(table, chain string)

func CreateIP6Chain

func CreateIP6Chain(table, chain string)

func DeleteIP4Tables

func DeleteIP4Tables(rules []IPTablesRule) error

DeleteIP4Tables delete specified iptables rules

func DeleteIP6Tables

func DeleteIP6Tables(rules []IPTablesRule) error

DeleteIP6Tables delete specified iptables rules

func SetupAndEnsureIP4Tables

func SetupAndEnsureIP4Tables(getRules func() []IPTablesRule, resyncPeriod int)

func SetupAndEnsureIP6Tables

func SetupAndEnsureIP6Tables(getRules func() []IPTablesRule, resyncPeriod int)

Types

type IPTables

type IPTables interface {
	AppendUnique(table string, chain string, rulespec ...string) error
	ChainExists(table, chain string) (bool, error)
	ClearChain(table, chain string) error
	Delete(table string, chain string, rulespec ...string) error
	Exists(table string, chain string, rulespec ...string) (bool, error)
}

type IPTablesError

type IPTablesError interface {
	IsNotExist() bool
	Error() string
}

type IPTablesRestore

type IPTablesRestore interface {
	// ApplyWithoutFlush apply without flush chains
	ApplyWithoutFlush(rules IPTablesRestoreRules) error
}

IPTablesRestore wrapper for iptables-restore

func NewIPTablesRestoreWithProtocol

func NewIPTablesRestoreWithProtocol(protocol iptables.Protocol) (IPTablesRestore, error)

NewIPTablesRestoreWithProtocol build new IPTablesRestore for supplied proto

type IPTablesRestoreRuleSpec

type IPTablesRestoreRuleSpec []string

IPTablesRestoreRuleSpec represents one rule spec delimited by space

type IPTablesRestoreRules

type IPTablesRestoreRules map[string][]IPTablesRestoreRuleSpec

IPTablesRestoreRules represents iptables-restore table block

type IPTablesRule

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

func ForwardRules

func ForwardRules(flannelNetwork string) []IPTablesRule

func MasqIP6Rules

func MasqIP6Rules(cluster_cidrs []ip.IP6Net, lease *lease.Lease) []IPTablesRule

func MasqRules

func MasqRules(cluster_cidrs []ip.IP4Net, lease *lease.Lease) []IPTablesRule

Jump to

Keyboard shortcuts

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