internal

package
v0.0.0-...-79a8e0d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func (*FlowKey) String

func (k *FlowKey) String() string

String prints out the key in a human-readable fashion.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL