iptables

package
v0.21.3 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: BSD-3-Clause Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ChainInputFilterName is the name of the chain that is used for filtering incoming packets
	ChainInputFilterName = "NETBIRD-ACL-INPUT"

	// ChainOutputFilterName is the name of the chain that is used for filtering outgoing packets
	ChainOutputFilterName = "NETBIRD-ACL-OUTPUT"
)

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 iptables firewall manager

func (*Manager) AddFiltering

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

AddFiltering rule to the firewall

If comment is empty rule ID is used as comment

func (*Manager) DeleteRule

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

DeleteRule from the firewall by rule definition

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