iptables

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Exec = defaultExec

Exec executes given args

Functions

func AddRuleWithRemoval

func AddRuleWithRemoval(rule Rule) (func(), error)

AddRuleWithRemoval activates given rule

Types

type Rule

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

Rule is a packet filter rule for IPTables.

func AppendTo

func AppendTo(chainName string) Rule

AppendTo creates a new rule to be appended to the specified chain.

func InsertAt

func InsertAt(chainName string, line int) Rule

InsertAt creates a new rule to be inserted into the specified chain.

func (Rule) ApplyArgs

func (r Rule) ApplyArgs() []string

ApplyArgs returns an argument list to be passed to the iptables executable to APPLY the rule.

func (Rule) Equals

func (r Rule) Equals(another Rule) bool

Equals checks if two Rules are equal.

func (Rule) RemoveArgs

func (r Rule) RemoveArgs() []string

RemoveArgs returns an argument list to be passed to the iptables executable to REMOVE the rule.

func (Rule) RuleSpec

func (r Rule) RuleSpec(spec ...string) Rule

RuleSpec sets the rule specification (see `man iptables`).

Jump to

Keyboard shortcuts

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