decoder

package
v0.0.0-...-b3f7bda Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDecoderUnknown = errors.New("Layer type not currently supported")
View Source
var NfsProtocol = RegisterDecoder(2049, nfs.NewDecoder())
View Source
var UnknownProtocol = RegisterDecoder(0, NewDecoderUnknown())

Functions

func Decode

func Decode(id string, data []byte, tl gopacket.TransportLayer) (err error)

func DecodeUseProto

func DecodeUseProto(id string, data []byte, tl gopacket.TransportLayer, proto ApplicationPortocol) (err error)

Types

type ApplicationPortocol

type ApplicationPortocol uint32

func DetectProtocol

func DetectProtocol(data []byte, t gopacket.TransportLayer) ApplicationPortocol

func RegisterDecoder

func RegisterDecoder(num uint32, decoder Decoder) ApplicationPortocol

type Decoder

type Decoder interface {
	Name() string
	CanDecode(data []byte, t gopacket.TransportLayer) (canDecode bool)
	DetectPacketLength(data []byte, t gopacket.TransportLayer) (length uint64, off uint64, err error)
	Decode(data []byte, t gopacket.TransportLayer) (app hook.Protocol, err error)
}

func GetDecoder

func GetDecoder(p ApplicationPortocol) Decoder

type DecoderUnknown

type DecoderUnknown struct {
	// contains filtered or unexported fields
}

func NewDecoderUnknown

func NewDecoderUnknown() *DecoderUnknown

func (*DecoderUnknown) CanDecode

func (self *DecoderUnknown) CanDecode(data []byte, t gopacket.TransportLayer) bool

func (*DecoderUnknown) Decode

func (self *DecoderUnknown) Decode(data []byte, t gopacket.TransportLayer) (app hook.Protocol, err error)

func (*DecoderUnknown) DetectPacketLength

func (self *DecoderUnknown) DetectPacketLength(data []byte, t gopacket.TransportLayer) (length uint64, off uint64, err error)

func (*DecoderUnknown) Name

func (self *DecoderUnknown) Name() string

func (*DecoderUnknown) String

func (self *DecoderUnknown) String() string

Directories

Path Synopsis
nfs

Jump to

Keyboard shortcuts

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