iptables

package
v0.0.0-...-984fd4e Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const LockfilePath16x = "/run/xtables.lock"
View Source
const WaitIntervalString = "-W"

WaitIntervalString a constant for specifying the wait interval flag

View Source
const WaitIntervalUsecondsValue = "100000"

WaitIntervalUsecondsValue a constant for specifying the default wait interval useconds

View Source
const WaitSecondsValue = "5"

WaitSecondsValue a constant for specifying the default wait seconds

View Source
const WaitString = "-w"

WaitString a constant for specifying the wait flag

Variables

View Source
var MinCheckVersion = utilversion.MustParseGeneric("1.4.11")

MinCheckVersion minimum version to be checked Versions of iptables less than this do not support the -C / --check flag (test whether a rule exists).

View Source
var RandomFullyMinVersion = utilversion.MustParseGeneric("1.6.2")

RandomFullyMinVersion is the minimum version from which the --random-fully flag is supported, used for port mapping to be fully randomized

View Source
var WaitIntervalMinVersion = utilversion.MustParseGeneric("1.6.1")

WaitIntervalMinVersion a minimum iptables versions supporting the wait interval useconds

View Source
var WaitMinVersion = utilversion.MustParseGeneric("1.4.20")

WaitMinVersion a minimum iptables versions supporting the -w and -w<seconds> flags

View Source
var WaitRestoreMinVersion = utilversion.MustParseGeneric("1.6.2")

WaitRestoreMinVersion a minimum iptables versions supporting the wait restore seconds

View Source
var WaitSecondsMinVersion = utilversion.MustParseGeneric("1.4.22")

WaitSecondsMinVersion a minimum iptables versions supporting the wait seconds

Functions

This section is empty.

Types

type Chain

type Chain string
const (
	ChainPrerouting  Chain = "PREROUTING"
	ChainPostrouting Chain = "POSTROUTING"
	ChainInput       Chain = "INPUT"
	ChainForward     Chain = "FORWARD"
	ChainOUTPUT      Chain = "OUTPUT"
)

type FlushFlag

type FlushFlag bool
const FlushTables FlushFlag = true
const NoFlushTables FlushFlag = false

type Interface

type Interface interface {
	EnsureChian(table Table, chain Chain) (bool, error)
	FlushChain(table Table, chain Chain) error
	DeleteChain(table Table, chain Chain) error

	EnsureRule(position RulePosition, table Table, chain Chain, args ...string) (bool, error)
	DeleteRule(table Table, chain Chain, args ...string) error

	SaveInto(table Table, buffer *bytes.Buffer) error
	Restore(table Table, data []byte, flush FlushFlag, counters RestoreCountersFlag) error
	RestoreAll(data []byte, flush FlushFlag, counters RestoreCountersFlag) error
}

func New

func New(exec utilexec.Interface, protocol Protocol) Interface

type IptablesCommand

type IptablesCommand string

type Protocol

type Protocol string
const (
	ProtocolIPv4 Protocol = "IPv4"

	ProtocolIPv6 Protocol = "IPv6"
)

type RestoreCountersFlag

type RestoreCountersFlag bool
const NoRestoreCounters RestoreCountersFlag = false
const RestoreCounters RestoreCountersFlag = true

type RulePosition

type RulePosition string
const (
	Prepend RulePosition = "-I"
	Append  RulePosition = "-A"
)

type Table

type Table string
const (
	TableNAT    Table = "nat"
	TableFilter Table = "filter"
	TableMangle Table = "mangle"
)

Jump to

Keyboard shortcuts

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