netfilter

package
v0.0.0-...-0bc30a8 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger(customLogger zerolog.Logger)

Types

type Queue

type Queue struct {
	ID uint16
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue(id uint16) *Queue

func (*Queue) Bind

func (q *Queue) Bind() (uint32, error)

func (*Queue) CacheAction

func (q *Queue) CacheAction(packet gopacket.Packet, rule string, action types.NFQActionType)

func (*Queue) CacheConnection

func (q *Queue) CacheConnection(packet gopacket.Packet)

func (*Queue) Connections

func (q *Queue) Connections() (m map[string]*model.Connection)

Connections will lock the db struct and copy the connection map

func (*Queue) Dropped

func (q *Queue) Dropped() (m map[string]*model.Notification)

Dropped will lock the db struct and copy the dropped map

func (*Queue) Handle

func (q *Queue) Handle(attr nfqueue.Attribute) int

NOTE always return zero otherwise the handler will be closed NOTE removed all logging in favor of performance

func (*Queue) LockDB

func (q *Queue) LockDB()

LockDB will lock the mutex on the internal db struct in case we want to copy the maps savely

func (*Queue) Register

func (q *Queue) Register(ctx context.Context) error

func (*Queue) ResetDB

func (q *Queue) ResetDB()

ResetDB will reset the db struct content which is necessary to release memory

func (*Queue) Start

func (q *Queue) Start() error

func (*Queue) Stop

func (q *Queue) Stop() error

func (*Queue) Unbind

func (q *Queue) Unbind() error

func (*Queue) UnlockDB

func (q *Queue) UnlockDB()

UnlockDB will unlock the mutex on the internal db struct

func (*Queue) UpdateExceptions

func (q *Queue) UpdateExceptions(exceptions model.Exceptions)

UpdateExceptions will skip or add IP and DNS addresses from the blocklist

func (*Queue) UpdatePatterns

func (q *Queue) UpdatePatterns(patterns model.Patterns)

UpdatePatterns will create the blocklists for IP and DNS addresses

type QueueVerdictOpts

type QueueVerdictOpts struct {
	Packet gopacket.Packet
	// remember the action which was taken
	CacheAction   bool
	ActionPattern string
	ActionType    types.NFQActionType
}

Jump to

Keyboard shortcuts

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