Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stream ¶
type Stream interface { // Closed check stream closed Closed() bool // Recv data from stream; // chan closed when Stream close; // return empty bytes when stream lost some data. Recv() <-chan []byte }
Stream stream for watcher
type StreamConfig ¶
type StreamConfig struct { // RecvBufferLen recv channel length, // min is recvBufferMin(128) RecvBufferLen int // MaxBuffered is an upper limit on the number of // out-of-order packet. MaxBuffered int }
StreamConfig config of tcp stream
type StreamFactory ¶
StreamFactory is used by assembly to create a new stream for each new TCP session.
type StreamPool ¶
type StreamPool struct {
// contains filtered or unexported fields
}
StreamPool storage all cap tcp stream Notice: cannot run at muti threads
func NewStreamPool ¶
func NewStreamPool(factory StreamFactory, cfg StreamConfig) *StreamPool
NewStreamPool new tcp stream reassembly pool
func (*StreamPool) AssembleWithTimestamp ¶
func (p *StreamPool) AssembleWithTimestamp(netFlow gopacket.Flow, t *layers.TCP, timestamp time.Time)
AssembleWithTimestamp write tcp package from pcap
func (*StreamPool) FlushOlderThan ¶
func (p *StreamPool) FlushOlderThan(t time.Time)
FlushOlderThan close connection last input data time < `t`
Click to show internal directories.
Click to hide internal directories.