Documentation
¶
Index ¶
Constants ¶
const ( AF_INET = 2 AF_INET6 = 10 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_QUEUE_SIZE uint32 = 4096 NF_DEFAULT_PACKET_SIZE uint32 = 4096 )
const (
IPv4 = 4
)
packet consts
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Packet ¶
type Packet struct { Packet gopacket.Packet Mark uint32 UID uint32 NetworkProtocol uint8 IfaceInIdx int IfaceOutIdx int // contains filtered or unexported fields }
Packet holds the data of a network packet
func (*Packet) SetRequeueVerdict ¶
SetRequeueVerdict apply a verdict on a requeued packet
func (*Packet) SetVerdict ¶
SetVerdict emits a veredict on a packet
func (*Packet) SetVerdictAndMark ¶
SetVerdictAndMark emits a veredict on a packet and marks it in order to not analyze it again.
func (*Packet) SetVerdictWithPacket ¶
SetVerdictWithPacket apply a verdict, but with a new packet
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue holds the information of a netfilter queue. The handles of the connection to the kernel and the created queue. A channel where the intercepted packets will be received. The ID of the queue.
func (*Queue) Close ¶
func (q *Queue) Close()
Close ensures that nfqueue resources are freed and closed. C.stop_reading_packets() stops the reading packets loop, which causes go-subroutine run() to exit. After exit, listening queue is destroyed and closed. If for some reason any of the steps stucks while closing it, we'll exit by timeout.
type VerdictContainer ¶
VerdictContainer struct
type VerdictContainerC ¶
type VerdictContainerC C.verdictContainer
VerdictContainerC is the struct that contains the mark, action, length and payload of a packet. It's defined in queue.h, and filled on go_callback()