netfilter

package
v0.0.0-...-36f1a77 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2016 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package netfilter provides Go bindings for libnetfilter_queue This library provides access to packets in the IPTables netfilter queue (NFQUEUE). The libnetfilter_queue library is part of the http://netfilter.org/projects/libnetfilter_queue/ project.

Index

Constants

View Source
const (
	//AfInet Address Family Inet
	AfInet = 2

	//NfDrop Net filter verdict
	NfDrop verdictType = 0
	//NfAccept Net filter verdict
	NfAccept verdictType = 1
	//NfStolen Net filter verdict
	NfStolen verdictType = 2
	//NfQueue Net filter verdict
	NfQueue verdictType = 3
	//NfRepeat Net filter verdict
	NfRepeat verdictType = 4
	//NfStop Net filter verdict
	NfStop verdictType = 5

	//NfDefaultPacketSize default packet size
	NfDefaultPacketSize uint32 = 0xffff
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NFPacket

type NFPacket struct {
	Buffer []byte
}

NFPacket structure holds the packet

type NFQueue

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

NFQueue implements the queue and holds all related state information

func NewNFQueue

func NewNFQueue(queueID uint16, maxPacketsInQueue uint32, packetSize uint32, processor func(*NFPacket) *Verdict) (*NFQueue, error)

NewNFQueue creates and bind to queue specified by queueID.

func (*NFQueue) Close

func (nfq *NFQueue) Close()

Close Unbind and close the queue

type Verdict

type Verdict struct {
	V       verdictType
	Buffer  []byte
	Payload []byte
	Options []byte
}

Verdict for a packet. Buffer is the original buffer of the packet Payload is any new data that have to be appended to the packet

Jump to

Keyboard shortcuts

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