nfqueue

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2019 License: AGPL-3.0 Imports: 11 Imported by: 0

README

Parts of this package (this directory) are forked from the go-nfqueue repo: https://github.com/OneOfOne/go-nfqueue These portions are copyrighted by Ahmed W. The fork commit is (with high certainty): https://github.com/OneOfOne/go-nfqueue/commit/3bdd8bdfd98a1ed51119f9cf7494162484dfbe7c

Documentation

Index

Constants

View Source
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

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

Functions

This section is empty.

Types

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

Jump to

Keyboard shortcuts

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