iptables

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Append Action = "-A"
	Delete Action = "-D"
	Insert Action = "-I"
	Nat    Table  = "nat"
	Filter Table  = "filter"
	Mangle Table  = "mangle"
)

Variables

View Source
var (
	ErrIptablesNotFound = errors.New("Iptables not found")
)

Functions

func Exists

func Exists(table Table, chain string, rule ...string) bool

Check if a rule exists

func OperatePortMap

func OperatePortMap(action Action, chain string, rule []string) error

Check if a dnat rule exists

func PortMapExists

func PortMapExists(chain string, rule []string) bool

func PortMapUsed

func PortMapUsed(chain string, proto string, begin, end int) bool

func Raw

func Raw(args ...string) ([]byte, error)

Call 'iptables' system command, passing supplied arguments

Types

type Action

type Action string

type Chain

type Chain struct {
	Name   string
	Bridge string
	Table  Table
}

type ChainError

type ChainError struct {
	Chain  string
	Output []byte
}

func (*ChainError) Error

func (e *ChainError) Error() string

type Table

type Table string

Jump to

Keyboard shortcuts

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