nftset_utils

package
v5.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClosed = errors.New("closed handler")
)

Functions

This section is empty.

Types

type HandlerOpts

type HandlerOpts struct {
	TableFamily nftables.TableFamily
	TableName   string
	SetName     string
}

type NftSetHandler

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

NftSetHandler can add netip.Prefix to the corresponding set. The table that contains this set must be an inet family table. If the set has a 'interval' flag, the prefix from netip.Prefix will be applied.

func NewNtSetHandler

func NewNtSetHandler(opts HandlerOpts) *NftSetHandler

NewNtSetHandler inits NftSetHandler.

func (*NftSetHandler) AddElems

func (h *NftSetHandler) AddElems(es ...netip.Prefix) error

AddElems adds netip.Prefix(s) to set in a single batch.

func (*NftSetHandler) Close added in v5.1.1

func (h *NftSetHandler) Close() error

Jump to

Keyboard shortcuts

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