Back to godoc.org
github.com/safing/portmaster/firewall/interception/nfqueue

package nfqueue

v0.3.1
Latest Go to latest
Published: Jul 5, 2019 | License: AGPL-3.0 | Module: github.com/safing/portmaster

Index

Constants

const (
	NFQ_DROP   uint32 = 0 // discarded the packet
	NFQ_ACCEPT uint32 = 1 // the packet passes, continue iterations
	NFQ_STOLEN uint32 = 2 // gone away
	NFQ_QUEUE  uint32 = 3 // inject the packet into a different queue (the target queue number is in the high 16 bits of the verdict)
	NFQ_REPEAT uint32 = 4 // iterate the same cycle once more
	NFQ_STOP   uint32 = 5 // accept, but don't continue iterations
)

Variables

var (
	ErrVerdictSentOrTimedOut error = fmt.Errorf("The verdict was already sent or timed out.")
)

type NFQueue

type NFQueue struct {
	DefaultVerdict uint32
	Timeout        time.Duration

	Packets chan packet.Packet
	// contains filtered or unexported fields
}

func NewNFQueue

func NewNFQueue(qid uint16) (nfq *NFQueue, err error)

func (*NFQueue) Destroy

func (this *NFQueue) Destroy()

func (*NFQueue) Valid

func (this *NFQueue) Valid() bool

type Packet

type Packet struct {
	packet.Base

	QueueId    uint16
	Id         uint32
	HWProtocol uint16
	Hook       uint8
	Mark       uint32
	// contains filtered or unexported fields
}

func (*Packet) Accept

func (pkt *Packet) Accept() error

func (*Packet) Block

func (pkt *Packet) Block() error

func (*Packet) Drop

func (pkt *Packet) Drop() error

func (*Packet) PermanentAccept

func (pkt *Packet) PermanentAccept() error

func (*Packet) PermanentBlock

func (pkt *Packet) PermanentBlock() error

func (*Packet) PermanentDrop

func (pkt *Packet) PermanentDrop() error

func (*Packet) RerouteToNameserver

func (pkt *Packet) RerouteToNameserver() error

func (*Packet) RerouteToTunnel

func (pkt *Packet) RerouteToTunnel() error
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier