nfds

package
v0.0.0-...-4995b8b Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	Name     string
	Table    *Table
	Hooknum  *nftables.ChainHook
	Priority *nftables.ChainPriority
	Type     nftables.ChainType
	Policy   *nftables.ChainPolicy
	Device   string
	// contains filtered or unexported fields
}

type Conn

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

func WrapConn

func WrapConn(c *nftables.Conn) *Conn

func (*Conn) AddChain

func (cc *Conn) AddChain(c *Chain) *Chain

func (*Conn) AddRule

func (cc *Conn) AddRule(r *Rule) *Rule

func (*Conn) AddSet

func (cc *Conn) AddSet(s *Set, elems []nftables.SetElement) error

func (*Conn) AddTable

func (cc *Conn) AddTable(t *Table) *Table

func (*Conn) CloseLasting

func (c *Conn) CloseLasting() error

func (*Conn) DelChain

func (cc *Conn) DelChain(c *Chain)

func (*Conn) DelRule

func (cc *Conn) DelRule(r *Rule) error

func (*Conn) DelSet

func (cc *Conn) DelSet(s *Set)

func (*Conn) Flush

func (c *Conn) Flush() error

func (*Conn) FlushTable

func (cc *Conn) FlushTable(t *Table)

func (*Conn) InsertRule

func (cc *Conn) InsertRule(r *Rule) *Rule

func (*Conn) SetAddElements

func (cc *Conn) SetAddElements(s *Set, vals []nftables.SetElement) error

func (*Conn) SetDeleteElements

func (cc *Conn) SetDeleteElements(s *Set, vals []nftables.SetElement) error

type Rule

type Rule struct {
	Table    *Table
	Chain    *Chain
	Position *Rule
	Exprs    []expr.Any
	UserData []byte
	// contains filtered or unexported fields
}

type Set

type Set struct {
	Table      *Table
	Name       string
	Anonymous  bool
	Constant   bool
	Interval   bool
	IsMap      bool
	HasTimeout bool
	Counter    bool
	// Can be updated per evaluation path, per `nft list ruleset`
	// indicates that set contains "flags dynamic"
	// https://git.netfilter.org/libnftnl/tree/include/linux/netfilter/nf_tables.h?id=84d12cfacf8ddd857a09435f3d982ab6250d250c#n298
	Dynamic bool
	// Indicates that the set contains a concatenation
	// https://git.netfilter.org/nftables/tree/include/linux/netfilter/nf_tables.h?id=d1289bff58e1878c3162f574c603da993e29b113#n306
	Concatenation bool
	Timeout       time.Duration
	KeyType       nftables.SetDatatype
	KeyType6      nftables.SetDatatype
	DataType      nftables.SetDatatype
	DataType6     nftables.SetDatatype
	// Either host (binaryutil.NativeEndian) or big (binaryutil.BigEndian) endian as per
	// https://git.netfilter.org/nftables/tree/include/datatype.h?id=d486c9e626405e829221b82d7355558005b26d8a#n109
	KeyByteOrder binaryutil.ByteOrder
	// contains filtered or unexported fields
}

func (*Set) Reference

func (s *Set) Reference(fam uint8) (uint32, string)

type Table

type Table struct {
	Name  string
	Use   uint32
	Flags uint32
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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