iptables

package
v1.5.23 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

View Source
const (
	CNIInputChain  = "AZURECNIINPUT"
	CNIOutputChain = "AZURECNIOUTPUT"
)

cni iptable chains

View Source
const (
	Input       = "INPUT"
	Output      = "OUTPUT"
	Forward     = "FORWARD"
	Prerouting  = "PREROUTING"
	Postrouting = "POSTROUTING"
	Swift       = "SWIFT"
	Snat        = "SNAT"
	Return      = "RETURN"
)

standard iptable chains

View Source
const (
	Filter = "filter"
	Nat    = "nat"
	Mangle = "mangle"
)

Standard Table names

View Source
const (
	Accept     = "ACCEPT"
	Drop       = "DROP"
	Masquerade = "MASQUERADE"
)

target

View Source
const (
	Insert = "I"
	Append = "A"
	Delete = "D"
)

actions

View Source
const (
	Established = "ESTABLISHED"
	Related     = "RELATED"
)

states

View Source
const (
	V4 = "4"
	V6 = "6"
)
View Source
const (
	DNSPort  = 53
	HTTPPort = 80
)

known ports

View Source
const (
	UDP = "udp"
	TCP = "tcp"
)

known protocols

Variables

View Source
var DisableIPTableLock bool

Functions

This section is empty.

Types

type Client added in v1.5.17

type Client struct{}

func NewClient added in v1.5.17

func NewClient() *Client

func (*Client) AppendIptableRule added in v1.5.17

func (c *Client) AppendIptableRule(version, tableName, chainName, match, target string) error

Append iptable rule at end of iptable chain

func (*Client) ChainExists added in v1.5.17

func (c *Client) ChainExists(version, tableName, chainName string) bool

check if iptable chain alreay exists

func (*Client) CreateChain added in v1.5.17

func (c *Client) CreateChain(version, tableName, chainName string) error

create new iptable chain under specified table name

func (*Client) DeleteIptableRule added in v1.5.17

func (c *Client) DeleteIptableRule(version, tableName, chainName, match, target string) error

Delete matched iptable rule

func (*Client) GetAppendIptableRuleCmd added in v1.5.17

func (c *Client) GetAppendIptableRuleCmd(version, tableName, chainName, match, target string) IPTableEntry

func (*Client) GetCreateChainCmd added in v1.5.17

func (c *Client) GetCreateChainCmd(version, tableName, chainName string) IPTableEntry

func (*Client) GetInsertIptableRuleCmd added in v1.5.17

func (c *Client) GetInsertIptableRuleCmd(version, tableName, chainName, match, target string) IPTableEntry

func (*Client) InsertIptableRule added in v1.5.17

func (c *Client) InsertIptableRule(version, tableName, chainName, match, target string) error

Insert iptable rule at beginning of iptable chain

func (*Client) RuleExists added in v1.5.17

func (c *Client) RuleExists(version, tableName, chainName, match, target string) bool

check if iptable rule alreay exists

func (*Client) RunCmd added in v1.5.17

func (c *Client) RunCmd(version, params string) error

Run iptables command

type IPTableEntry

type IPTableEntry struct {
	Version string
	Params  string
}

Jump to

Keyboard shortcuts

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