nft

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const (
	NFT = iota
	TABLE
	CHAIN

	FamilyIP     = Family("ip")
	FamilyIP6    = Family("ip6")
	FamilyNET    = Family("net")
	FamilyINET   = Family("inet")
	FamilyARP    = Family("arp")
	FamilyBridge = Family("bridge")

	TypeSkipCreate = Type("")
	TypeNAT        = Type("nat")
	TypeFilter     = Type("filter")
)

Variables

This section is empty.

Functions

func Apply

func Apply(nft Nft) error

Apply (merge) nft rules

func ApplyFromFile

func ApplyFromFile(cfg string) error

ApplyFromFile applies nft rules from a file

func Drop

func Drop(family Family, table, chain string, handle int) error

Drop drops a single rule given a handle

func DropRules

func DropRules(sub Nft) error

DropRules removes nft rules from a file

Types

type Chain

type Chain struct {
	Type     Type
	Hook     string
	Priority int
	Policy   string
	Rules    []Rule
}

type Chains

type Chains map[string]Chain

type Family

type Family string

type Nft

type Nft map[string]Table

func Get

func Get() (Nft, error)

Get gets current nft ruleset

func Parse

func Parse(config string) (Nft, error)

func (Nft) MarshalText

func (n Nft) MarshalText() ([]byte, error)

type Rule

type Rule struct {
	Handle int
	Body   string
}

type Table

type Table struct {
	Family Family
	Chains Chains
}

type Type

type Type string

Jump to

Keyboard shortcuts

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