Documentation
¶
Overview ¶
Package decode provides multithreaded TCP packet decoding.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DecodedPacket ¶
type DecodedPacket struct {
Info gopacket.CaptureInfo
TCP layers.TCP
Payload gopacket.Payload
FlowHash uint64
NetFlow gopacket.Flow
// contains filtered or unexported fields
}
DecodedPacket holds the broken down structure of a decoded TCP packet.
func (*DecodedPacket) IsTCP ¶
func (dp *DecodedPacket) IsTCP() bool
IsTCP returns true if dp was successfully decoded as a TCP packet.
type Handler ¶
type Handler func(db []*DecodedPacket)
Handler is a user-provided function for processing a single packet.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool is a set of workers for decoding network packets. It is bound to a single PacketSource. A Pool operates on a pull model, only requesting packet data when there is a worker ready to receive it.
func NewPool ¶
NewPool creates a new Pool of workers. As packets are captured and decoded, handler is invoked. handler is invoked from multiple worker gorountines concurrently and thus must be threadsafe.