nfqueue

package
v0.0.0-...-bd5c281 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2017 License: BSD-3-Clause Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const (
	NFQNL_CFG_CMD_BIND   = 1
	NFQNL_CFG_CMD_UNBIND = 2

	NFQNL_COPY_META   = 1
	NFQNL_COPY_PACKET = 2

	NFNL_SUBSYS_QUEUE = 3

	NFQNL_MSG_PACKET  = 0
	NFQNL_MSG_VERDICT = 1
	NFQNL_MSG_CONFIG  = 2

	NFNETLINK_V0 = 0

	NFQA_CFG_COMMAND = 1
	NFQA_CFG_PARAMS  = 2

	NFQA_PACKET_HDR  = 1
	NFQA_VERDICT_HDR = 2
	NFQA_MARK        = 3
	NFQA_PAYLOAD     = 10

	NF_DROP   = 0
	NF_ACCEPT = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NFQPacket

type NFQPacket struct {
	HwProto uint16          // hardware protocol
	Packet  gopacket.Packet // packet data
	// contains filtered or unexported fields
}

func (*NFQPacket) Accept

func (p *NFQPacket) Accept() error

Accept sets the NF_ACCEPT verdict on this packet

func (*NFQPacket) Drop

func (p *NFQPacket) Drop() error

Drop sets the NF_DROP verdict on this packet

type NFQueue

type NFQueue struct {
	// contains filtered or unexported fields
}

func NewNFQueue

func NewNFQueue(queue uint16) *NFQueue

NewNFQueue creates and returns a new NFQueue instance.

func (*NFQueue) Close

func (q *NFQueue) Close()

Close this queue instance

func (*NFQueue) EnableDebug

func (q *NFQueue) EnableDebug()

EnableDebug sets a flag on the associated NetlinkSocket causing it to dump information about each received and transmitted message.

func (*NFQueue) Open

func (q *NFQueue) Open() (<-chan *NFQPacket, error)

Open this queue instance. Returns a channel for reading received packets.

func (*NFQueue) PendingError

func (q *NFQueue) PendingError() error

PendingError returns the error that was encountered while receiving packets if any.

func (*NFQueue) SetCopySize

func (q *NFQueue) SetCopySize(sz uint32)

SetCopySize can be called before Open to set the packet capture size

Jump to

Keyboard shortcuts

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