netfilter

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2017 License: MIT Imports: 4 Imported by: 2

Documentation

Overview

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 (
	AF_INET = 2

	NF_DROP   Verdict = 0
	NF_ACCEPT Verdict = 1
	NF_STOLEN Verdict = 2
	NF_QUEUE  Verdict = 3
	NF_REPEAT Verdict = 4
	NF_STOP   Verdict = 5

	NF_DEFAULT_PACKET_SIZE uint32 = 0xffff
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

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

func New

func New(queueID uint16, maxPacketsInQueue uint32, packetSize uint32) (*Queue, error)

Create and bind to queue specified by queueId

func (*Queue) Close

func (nfq *Queue) Close()

Unbind and close the queue

func (*Queue) Packets

func (nfq *Queue) Packets() <-chan *RawPacket

func (*Queue) Run

func (nfq *Queue) Run()

func (*Queue) SetVerdict

func (nfq *Queue) SetVerdict(packet *RawPacket, verdict Verdict) (err error)

TODO: make functions explicit. for example: SetVerdictAccept, SetVerdictDrop

func (*Queue) SetVerdictModifed

func (nfq *Queue) SetVerdictModifed(packet *RawPacket, buffer []byte, verdict Verdict) (err error)

type RawPacket

type RawPacket struct {
	ID   uint32
	Data []byte
}

type Verdict

type Verdict C.uint

Verdict for a packet

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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