Documentation ¶
Index ¶
- type IFaceMapper
- type Manager
- func (m *Manager) AddFiltering(ip net.IP, proto firewall.Protocol, sPort *firewall.Port, dPort *firewall.Port, ...) ([]firewall.Rule, error)
- func (m *Manager) AddUDPPacketHook(in bool, ip net.IP, dPort uint16, hook func([]byte) bool) string
- func (m *Manager) AllowNetbird() error
- func (m *Manager) DeleteRule(rule firewall.Rule) error
- func (m *Manager) DropIncoming(packetData []byte) bool
- func (m *Manager) DropOutgoing(packetData []byte) bool
- func (m *Manager) Flush() error
- func (m *Manager) InsertRoutingRules(pair firewall.RouterPair) error
- func (m *Manager) IsServerRouteSupported() bool
- func (m *Manager) RemovePacketHook(hookID string) error
- func (m *Manager) RemoveRoutingRules(pair firewall.RouterPair) error
- func (m *Manager) Reset() error
- func (m *Manager) SetNetwork(network *net.IPNet)
- type Rule
- type RuleSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IFaceMapper ¶
type IFaceMapper interface { SetFilter(iface.PacketFilter) error Address() iface.WGAddress }
IFaceMapper defines subset methods of interface required for manager
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager userspace firewall manager
func Create ¶
func Create(iface IFaceMapper) (*Manager, error)
Create userspace firewall manager constructor
func CreateWithNativeFirewall ¶ added in v0.24.4
func CreateWithNativeFirewall(iface IFaceMapper, nativeFirewall firewall.Manager) (*Manager, error)
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) AddUDPPacketHook ¶ added in v0.21.2
func (m *Manager) AddUDPPacketHook( in bool, ip net.IP, dPort uint16, hook func([]byte) bool, ) string
AddUDPPacketHook calls hook when UDP packet from given direction matched
Hook function returns flag which indicates should be the matched package dropped or not
func (*Manager) AllowNetbird ¶ added in v0.23.0
AllowNetbird allows netbird interface traffic
func (*Manager) DeleteRule ¶
DeleteRule from the firewall by rule definition
func (*Manager) DropIncoming ¶
DropIncoming filter incoming packets
func (*Manager) DropOutgoing ¶
DropOutgoing filter outgoing packets
func (*Manager) InsertRoutingRules ¶ added in v0.24.4
func (m *Manager) InsertRoutingRules(pair firewall.RouterPair) error
func (*Manager) IsServerRouteSupported ¶ added in v0.24.4
func (*Manager) RemovePacketHook ¶ added in v0.21.2
RemovePacketHook removes packet hook by given ID
func (*Manager) RemoveRoutingRules ¶ added in v0.24.4
func (m *Manager) RemoveRoutingRules(pair firewall.RouterPair) error
RemoveRoutingRules removes a routing firewall rule
func (*Manager) SetNetwork ¶
SetNetwork of the wireguard interface to which filtering applied