iptables

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iptables

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

func NewIptables

func NewIptables() (*Iptables, error)

func (*Iptables) CheckRule added in v0.2.0

func (ipt *Iptables) CheckRule(table, chain string, rulespec ...string) (bool, error)

CheckRule checks if the specified rule is present and return bool status and err.

func (*Iptables) DeleteChain

func (ipt *Iptables) DeleteChain(table, chain string) error

DeleteRule checks if the specified rule is present and, if so, deletes it.

func (*Iptables) DeleteRule

func (ipt *Iptables) DeleteRule(table, chain string, rulespec ...string) error

DeleteRule checks if the specified rule is present and, if so, deletes it.

func (*Iptables) EnsureChain

func (ipt *Iptables) EnsureChain(table, chain, policy string) (bool, error)

EnsureChain checks if the specified chain exists and, if not, creates it. If the chain existed, return true.

func (*Iptables) EnsureRule

func (ipt *Iptables) EnsureRule(pos int, table, chain string, rulespec ...string) (bool, error)

EnsureRule checks if the specified rule is present and, if not, creates it. If the rule existed, return true.

Jump to

Keyboard shortcuts

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