nftables

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: BSD-3-Clause Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// FilterTableName is the name of the table that is used for filtering by the Netbird client
	FilterTableName = "netbird-acl"

	// FilterInputChainName is the name of the chain that is used for filtering incoming packets
	FilterInputChainName = "netbird-acl-input-filter"

	// FilterOutputChainName is the name of the chain that is used for filtering outgoing packets
	FilterOutputChainName = "netbird-acl-output-filter"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager of iptables firewall

func Create

func Create(wgIface iFaceMapper) (*Manager, error)

Create nftables firewall manager

func (*Manager) AddFiltering

func (m *Manager) AddFiltering(
	ip net.IP,
	proto fw.Protocol,
	sPort *fw.Port,
	dPort *fw.Port,
	direction fw.RuleDirection,
	action fw.Action,
	ipsetName string,
	comment string,
) (fw.Rule, error)

AddFiltering rule to the firewall

If comment argument is empty firewall manager should set rule ID as comment for the rule

func (*Manager) DeleteRule

func (m *Manager) DeleteRule(rule fw.Rule) error

DeleteRule from the firewall by rule definition

func (*Manager) Flush added in v0.21.9

func (m *Manager) Flush() error

Flush rule/chain/set operations from the buffer

Method also get all rules after flush and refreshes handle values in the rulesets

func (*Manager) Reset

func (m *Manager) Reset() error

Reset firewall to the default state

type Rule

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

Rule to handle management of rules

func (*Rule) GetRuleID

func (r *Rule) GetRuleID() string

GetRuleID returns the rule id

Jump to

Keyboard shortcuts

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