nftables

package
v0.0.0-...-93fed14 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AclManager

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

func (*AclManager) AddFiltering

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

AddFiltering rule to the firewall

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

func (*AclManager) DeleteRule

func (m *AclManager) DeleteRule(rule firewall.Rule) error

DeleteRule from the firewall by rule definition

func (*AclManager) Flush

func (m *AclManager) Flush() error

Flush rule/chain/set operations from the buffer

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

type Manager

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

Manager of iptables firewall

func Create

func Create(context context.Context, wgIface iFaceMapper) (*Manager, error)

Create nftables firewall manager

func (*Manager) AddFiltering

func (m *Manager) AddFiltering(
	ip net.IP,
	proto firewall.Protocol,
	sPort *firewall.Port,
	dPort *firewall.Port,
	direction firewall.RuleDirection,
	action firewall.Action,
	ipsetName string,
	comment string,
) ([]firewall.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) AllowNetbird

func (m *Manager) AllowNetbird() error

AllowNetbird allows netbird interface traffic todo review this method usage

func (*Manager) DeleteRule

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

DeleteRule from the firewall by rule definition

func (*Manager) Flush

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 todo review this method usage

func (*Manager) InsertRoutingRules

func (m *Manager) InsertRoutingRules(pair firewall.RouterPair) error

func (*Manager) IsServerRouteSupported

func (m *Manager) IsServerRouteSupported() bool

func (*Manager) RemoveRoutingRules

func (m *Manager) RemoveRoutingRules(pair firewall.RouterPair) error

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