Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var EmptyStream = &Stream{done: true}
EmptyStream is used to finish bidi that only have one stream, in collectOldStreams.
Functions ¶
This section is empty.
Types ¶
type BidirectionalStream ¶
type BidirectionalStream struct {
// contains filtered or unexported fields
}
BidirectionalStream stores each unidirectional side of a bidirectional stream.
When a new stream comes in, if we don't have an opposite stream, a bidi is created with 'a' set to the new stream. If we DO have an opposite stream, 'b' is set to the new stream.
type FlowKey ¶
type FlowKey struct {
// contains filtered or unexported fields
}
FlowKey is used to map bidirectional streams to each other
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream implements tcpassembly.Stream
func (*Stream) Reassembled ¶
func (s *Stream) Reassembled(rs []tcpassembly.Reassembly)
Reassembled handles reassembled TCP stream data.
func (*Stream) ReassemblyComplete ¶
func (s *Stream) ReassemblyComplete()
ReassemblyComplete marks this stream as finished.
type StreamFactory ¶
type StreamFactory struct { // bidirectionalStreamMap maps keys to bidirectional stream pairs. BidirectionalStreamMap map[FlowKey]*BidirectionalStream Timeout time.Duration TcpSessionChan chan *types.TcpSession }
StreamFactory implements tcpassmebly.StreamFactory
func (*StreamFactory) CollectOldStreams ¶
func (f *StreamFactory) CollectOldStreams()
CollectOldStreams finds any streams that haven't received a packet within 'timeout', and sets/finishes the 'b' stream inside them. The 'a' stream may still receive packets after this.
func (*StreamFactory) New ¶
func (f *StreamFactory) New(netFlow, tcpFlow gopacket.Flow) tcpassembly.Stream
New handles creating a new tcpassembly.Stream.