Documentation
¶
Index ¶
- Variables
- func CleanupReassembly(_ bool, assemblers []*reassembly.Assembler)
- func CloseStreamReaderChannelsAndWait()
- func CloseStreamReaderChannelsAndWaitQuiet()
- func GetStreamPool() *reassembly.StreamPool
- func NumSavedTCPConns() int64
- func ReassemblePacket(packet gopacket.Packet, assembler *reassembly.Assembler)
- func ResetStreamFactory()
- func SetLogger(l *zap.Logger)
- func WriteReassemblyHealth() error
- type ReassemblyHealth
Constants ¶
This section is empty.
Variables ¶
var StreamFactory = newStreamFactory()
StreamFactory is a structure that manages TCP stream reassembly
Functions ¶
func CleanupReassembly ¶
func CleanupReassembly(_ bool, assemblers []*reassembly.Assembler)
CleanupReassembly finalizes all pools after packet workers have joined. The wait argument is retained for callers; even forced shutdown must drain data.
func CloseStreamReaderChannelsAndWait ¶
func CloseStreamReaderChannelsAndWait()
CloseStreamReaderChannelsAndWait closes all TCP stream reader channels and waits for goroutines to finish. Call only after packet workers join and every assembler has been flushed. This MUST be called BEFORE closing log files to avoid write errors. CRITICAL: Each TCP connection spawns 2 goroutines (client + server) that run tcpStreamReader.Run() These goroutines must be properly shut down before log files are closed.
func CloseStreamReaderChannelsAndWaitQuiet ¶
func CloseStreamReaderChannelsAndWaitQuiet()
CloseStreamReaderChannelsAndWaitQuiet is like CloseStreamReaderChannelsAndWait but doesn't log. Use this when log files may already be closed (e.g., between multi-file processing).
func GetStreamPool ¶
func GetStreamPool() *reassembly.StreamPool
GetStreamPool returns the stream pool.
func NumSavedTCPConns ¶
func NumSavedTCPConns() int64
NumSavedTCPConns returns the number of saved TCP connections.
func ReassemblePacket ¶
func ReassemblePacket(packet gopacket.Packet, assembler *reassembly.Assembler)
ReassemblePacket takes care of submitting a TCP / UDP packet to the reassembly. The caller owns the assembler and serializes assembly and maintenance.
func ResetStreamFactory ¶
func ResetStreamFactory()
ResetStreamFactory clears state between captures, after all workers and readers join.
func WriteReassemblyHealth ¶
func WriteReassemblyHealth() error
Types ¶
type ReassemblyHealth ¶
type ReassemblyHealth struct {
Version int `json:"version"`
ChecksumPolicy string `json:"checksumPolicy"`
RejectedChecksums int64 `json:"rejectedChecksums"`
RejectedIPv4Checksums int64 `json:"rejectedIPv4Checksums"`
RejectedOptions int64 `json:"rejectedOptions"`
RejectedFSM int64 `json:"rejectedFSM"`
MissingBytes int64 `json:"missingBytes"`
Limitations []string `json:"limitations"`
}