utils

package
v0.6.11 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: BSD-3-Clause, GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Stats struct {
	sync.Mutex

	IPdefrag            int64
	MissedBytes         int64
	Pkt                 int64
	Sz                  int64
	Totalsz             int64
	RejectFsm           int64
	RejectOpt           int64
	RejectConnFsm       int64
	Reassembled         int64
	OutOfOrderBytes     int64
	OutOfOrderPackets   int64
	BiggestChunkBytes   int64
	BiggestChunkPackets int64
	OverlapBytes        int64
	OverlapPackets      int64
	SavedTCPConnections int64
	SavedUDPConnections int64
	NumSoftware         int64
	NumServices         int64

	Requests  int64
	Responses int64
	Count     int64
	DataBytes int64
	NumConns  int64
	NumFlows  int64

	// HTTP
	NumUnmatchedResp        int64
	NumNilRequests          int64
	NumFoundRequests        int64
	NumRemovedRequests      int64
	NumUnansweredRequests   int64
	NumClientStreamNotFound int64
	NumRequests             int64
	NumResponses            int64

	// keep this one after all 64bit types to fix alignment problems on ARM
	NumErrors uint
}

Stats contains statistics about the stream reassembly.

Functions

func DecodeConversation

func DecodeConversation(
	ident string,
	data core.DataFragments,
	client func(buf *bufio.Reader) error,
	server func(buf *bufio.Reader) error,
)

DecodeConversation is a Transport layer agnostic util to decode client / server data streams.

func SaveConversation

func SaveConversation(proto string, conversation core.DataFragments, ident string, firstPacket time.Time, transport gopacket.Flow) error

SaveConversation will save TCP / UDP conversations to disk this also invokes the harvesters on the conversation banner

func SaveFile

func SaveFile(conv *core.ConversationInfo, source, name string, err error, body []byte, encoding []string, host string, contentType string) error

SaveFile TODO: create a structure for passing all the args

func SetLogger

func SetLogger(l *zap.Logger)

SetLogger configures the logger for this package.

Types

This section is empty.

Jump to

Keyboard shortcuts

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