packetstream

package
v0.0.0-...-ff9824b Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPacketStreamMgmr

func NewPacketStreamMgmr(ctx context.Context, dstIp net.IP, opt options.Options) (*packetStreamMgmr, error)

Types

type PacketStreamMgmr

type PacketStreamMgmr interface {
	StartStream() error
	Close()
}

TODO: move some options from NewPacketStreamMgmr to here

type StreamProtocolLayer

type StreamProtocolLayer interface {
	// Prepare protocol layer before it could be serialized to wire format
	PrepareProtocalLayers(gopacket.NetworkLayer) []gopacket.Layer
	// Post processing after the packet is sent.
	OnSend(gopacket.NetworkLayer, []gopacket.Layer, []byte)
	// Post processing after a packet is received.
	OnReceive(gopacket.Packet)

	// Inform trasport layer of its local end point for checking flow direction.
	SetLocalEnpoint(gopacket.Endpoint)

	CollectOldStreams(time.Duration)

	ShowStats()
}

Interface for protocol layer stream processing. Assuming the protocol runs above IP layer immediately, Could be TransportLayer protocols lik TCP/UDP or control protocols like ICMPv4/ICMPv6

Jump to

Keyboard shortcuts

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