decoder

package
v0.16.8 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbstractDecoder

type AbstractDecoder struct {

	// used to keep track of the number of generated audit records
	NumRecordsWritten int64

	// Name of the decoder
	Name string

	// Description of the decoder
	Description string

	// Icon name for the decoder (for Maltego)
	Icon string

	// init functions
	PostInit func(decoder *AbstractDecoder) error
	DeInit   func(decoder *AbstractDecoder) error

	// Writer for audit records
	Writer netio.AuditRecordWriter

	// Type of the audit records produced by this decoder
	Type types.Type
}

AbstractDecoder implements custom logic to decode data from a TCP / UDP network conversation this structure has an optimized field order to avoid excessive padding.

func (*AbstractDecoder) DeInitFunc

func (ad *AbstractDecoder) DeInitFunc() error

DeInitFunc is called prior to teardown.

func (*AbstractDecoder) Destroy

func (ad *AbstractDecoder) Destroy() (name string, size int64)

Destroy closes and flushes all writers and calls deinit if set.

func (*AbstractDecoder) FlushCurrentState

func (ad *AbstractDecoder) FlushCurrentState() int64

FlushCurrentState flushes the writer buffer for abstract decoders. Abstract decoders write records immediately, so there's no accumulated state to flush. This just ensures any buffered data is written to disk.

func (*AbstractDecoder) GetChan

func (ad *AbstractDecoder) GetChan() <-chan []byte

GetChan returns a channel to receive serialized protobuf data from the decoder.

func (*AbstractDecoder) GetDescription

func (ad *AbstractDecoder) GetDescription() string

GetDescription returns the description of the

func (*AbstractDecoder) GetName

func (ad *AbstractDecoder) GetName() string

GetName returns the name of the

func (*AbstractDecoder) GetType

func (ad *AbstractDecoder) GetType() types.Type

GetType returns the netcap type of the

func (*AbstractDecoder) GetWriter

func (ad *AbstractDecoder) GetWriter() netio.AuditRecordWriter

GetWriter returns the current writer.

func (*AbstractDecoder) NumRecords

func (ad *AbstractDecoder) NumRecords() int64

NumRecords returns the number of written records.

func (*AbstractDecoder) PostInitFunc

func (ad *AbstractDecoder) PostInitFunc() error

PostInitFunc is called after the decoder has been initialized.

func (*AbstractDecoder) SetWriter

func (ad *AbstractDecoder) SetWriter(w netio.AuditRecordWriter)

SetWriter sets the netcap writer to use for the

type StreamDecoder

type StreamDecoder struct {

	// used to keep track of the number of generated audit records
	NumRecordsWritten int64

	// Name of the decoder
	Name string

	// Description of the decoder
	Description string

	// Icon name for the decoder (for Maltego)
	Icon string

	// init functions
	PostInit func(decoder *StreamDecoder) error
	DeInit   func(decoder *StreamDecoder) error

	// Writer for audit records
	Writer netio.AuditRecordWriter

	// Type of the audit records produced by this decoder
	Type types.Type

	// canDecode checks whether the decoder can parse the protocol
	CanDecode func(client []byte, server []byte) bool

	// Specificity declares how much evidence CanDecode requires, using the
	// core.Specificity* scale. It ranks decoders in the port-independent
	// scan, which would otherwise be decided by port number alone.
	Specificity int

	// PortOnly excludes ambiguous signatures from the port-independent
	// fallback scan. They remain available on every registered port.
	PortOnly bool

	// FallbackMinSpecificity requires this much evidence before a
	// port-independent match can claim a conversation.
	FallbackMinSpecificity int

	// Confidence optionally reports the specificity of one match, for
	// decoders whose evidence varies with the input. When nil, Specificity
	// is used for every match.
	Confidence func(client []byte, server []byte) int

	// factory for stream readers
	Factory core.StreamDecoderFactory

	Typ core.TransportProtocol
}

StreamDecoder implements custom logic to decode data from a TCP / UDP network conversation this structure has an optimized field order to avoid excessive padding.

func (*StreamDecoder) CanDecodeStream

func (sd *StreamDecoder) CanDecodeStream(client []byte, server []byte) bool

CanDecodeStream invokes the canDecode function of the underlying decoder to determine whether the decoder can understand the protocol.

func (*StreamDecoder) DeInitFunc

func (sd *StreamDecoder) DeInitFunc() error

DeInitFunc is called prior to teardown.

func (*StreamDecoder) Destroy

func (sd *StreamDecoder) Destroy() (name string, size int64)

Destroy closes and flushes all writers and calls deinit if set.

func (*StreamDecoder) FlushCurrentState

func (sd *StreamDecoder) FlushCurrentState() int64

FlushCurrentState flushes the writer buffer for stream decoders. Stream decoders write records immediately during stream processing, so there's no accumulated state to flush. This just ensures any buffered data is written to disk.

func (*StreamDecoder) GetChan

func (sd *StreamDecoder) GetChan() <-chan []byte

GetChan returns a channel to receive serialized protobuf data from the decoder.

func (*StreamDecoder) GetDescription

func (sd *StreamDecoder) GetDescription() string

GetDescription returns the description of the

func (*StreamDecoder) GetName

func (sd *StreamDecoder) GetName() string

GetName returns the name of the

func (*StreamDecoder) GetReaderFactory

func (sd *StreamDecoder) GetReaderFactory() core.StreamDecoderFactory

GetReaderFactory returns a new stream reader for the decoder type.

func (*StreamDecoder) GetType

func (sd *StreamDecoder) GetType() types.Type

GetType returns the netcap type of the

func (*StreamDecoder) GetWriter

func (sd *StreamDecoder) GetWriter() netio.AuditRecordWriter

GetWriter returns the current writer.

func (*StreamDecoder) MatchSpecificity

func (sd *StreamDecoder) MatchSpecificity(client, server []byte) int

MatchSpecificity reports how much evidence this decoder required to accept these bytes, preferring a per-match answer when the decoder supplies one.

func (*StreamDecoder) NumRecords

func (sd *StreamDecoder) NumRecords() int64

NumRecords returns the number of written records.

func (*StreamDecoder) PostInitFunc

func (sd *StreamDecoder) PostInitFunc() error

PostInitFunc is called after the decoder has been initialized.

func (*StreamDecoder) SetWriter

func (sd *StreamDecoder) SetWriter(w netio.AuditRecordWriter)

SetWriter sets the netcap writer to use for the

func (*StreamDecoder) Transport

func (sd *StreamDecoder) Transport() core.TransportProtocol

Transport returns the transport protocol (Layer 4 in the OSI model)

Directories

Path Synopsis
Package db holds the vulnerability and exploit database handles used by the stream decoders.
Package db holds the vulnerability and exploit database handles used by the stream decoders.
Package packet Package decoder implements decoders to transform network packets into protocol buffers for various protocols
Package packet Package decoder implements decoders to transform network packets into protocol buffers for various protocols
bgp
cip
dns
ftp
ipp
irc
network
Package network handles network-layer protocol conversations (ICMP, IGMP, GRE, etc.) that don't have a transport layer.
Package network handles network-layer protocol conversations (ICMP, IGMP, GRE, etc.) that don't have a transport layer.
quic
Package quic implements QUIC protocol analysis for both gQUIC and IETF QUIC.
Package quic implements QUIC protocol analysis for both gQUIC and IETF QUIC.
rdp
rtp
sip
smb
ssh
tcp
tls
udp

Jump to

Keyboard shortcuts

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