Documentation ¶
Overview ¶
Package nfqueue provides network interception capabilities on linux via iptables nfqueue.
Index ¶
- Constants
- Variables
- type NFQueue
- type Packet
- func (pkt *Packet) Accept() error
- func (pkt *Packet) Block() error
- func (pkt *Packet) Drop() error
- func (pkt *Packet) PermanentAccept() error
- func (pkt *Packet) PermanentBlock() error
- func (pkt *Packet) PermanentDrop() error
- func (pkt *Packet) RerouteToNameserver() error
- func (pkt *Packet) RerouteToTunnel() error
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 )
NFQ Packet Constants
Variables ¶
View Source
var (
ErrVerdictSentOrTimedOut = errors.New("the verdict was already sent or timed out")
)
NFQ Errors
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 }
NFQueue holds a Linux NFQ Handle and associated information.
func NewNFQueue ¶
NewNFQueue initializes a new netfilter queue.
func (*NFQueue) PacketChannel ¶ added in v0.4.18
PacketChannel returns a packet channel
type Packet ¶
type Packet struct { packet.Base QueueID uint16 ID uint32 HWProtocol uint16 Hook uint8 Mark uint32 // contains filtered or unexported fields }
Packet represents a packet with a NFQ reference.
func (*Packet) PermanentAccept ¶
PermanentAccept implements the packet interface.
func (*Packet) PermanentBlock ¶
PermanentBlock implements the packet interface.
func (*Packet) PermanentDrop ¶
PermanentDrop implements the packet interface.
func (*Packet) RerouteToNameserver ¶
RerouteToNameserver implements the packet interface.
func (*Packet) RerouteToTunnel ¶
RerouteToTunnel implements the packet interface.
Click to show internal directories.
Click to hide internal directories.