Versions in this module Expand all Collapse all v1 v1.1.22 May 23, 2024 v1.1.20 May 23, 2024 Changes in this version + const MaxEndpointSize + var DecodeStreamsAsDatagrams = DecodeOptions + var DecodersByLayerName = map[string]Decoder + var Default = DecodeOptions + var EndpointInvalid = RegisterEndpointType(0, EndpointTypeMetadata{ ... }) + var InvalidEndpoint = NewEndpoint(EndpointInvalid, nil) + var InvalidFlow = NewFlow(EndpointInvalid, nil, nil) + var LayerTypeDecodeFailure = RegisterLayerType(1, LayerTypeMetadata{ ... }) + var LayerTypeFragment = RegisterLayerType(3, LayerTypeMetadata{ ... }) + var LayerTypePayload = RegisterLayerType(2, LayerTypeMetadata{ ... }) + var LayerTypeZero = RegisterLayerType(0, LayerTypeMetadata{ ... }) + var Lazy = DecodeOptions + var NoCopy = DecodeOptions + var TimestampResolutionCaptureInfo = TimestampResolutionNanosecond + var TimestampResolutionInvalid = TimestampResolution + var TimestampResolutionMicrosecond = TimestampResolution + var TimestampResolutionMillisecond = TimestampResolution + var TimestampResolutionNTP = TimestampResolution + var TimestampResolutionNanosecond = TimestampResolution + func LayerDump(l Layer) string + func LayerGoString(l Layer) string + func LayerString(l Layer) string + func LongBytesGoString(buf []byte) string + func SerializeLayers(w SerializeBuffer, opts SerializeOptions, layers ...SerializableLayer) error + func SerializePacket(buf SerializeBuffer, opts SerializeOptions, packet Packet) error + type ApplicationLayer interface + Payload func() []byte + type CaptureInfo struct + AncillaryData []interface{} + CaptureLength int + InterfaceIndex int + Length int + Timestamp time.Time + type DecodeFailure struct + func (d *DecodeFailure) Dump() (s string) + func (d *DecodeFailure) Error() error + func (d *DecodeFailure) LayerContents() []byte + func (d *DecodeFailure) LayerPayload() []byte + func (d *DecodeFailure) LayerType() LayerType + func (d *DecodeFailure) String() string + type DecodeFeedback interface + SetTruncated func() + var NilDecodeFeedback DecodeFeedback = nilDecodeFeedback{} + type DecodeFunc func([]byte, PacketBuilder) error + func (d DecodeFunc) Decode(data []byte, p PacketBuilder) error + type DecodeOptions struct + DecodeStreamsAsDatagrams bool + Lazy bool + NoCopy bool + SkipDecodeRecovery bool + type Decoder interface + Decode func([]byte, PacketBuilder) error + var DecodeFragment Decoder = DecodeFunc(decodeFragment) + var DecodePayload Decoder = DecodeFunc(decodePayload) + var DecodeUnknown Decoder = DecodeFunc(decodeUnknown) + type DecodingLayer interface + CanDecode func() LayerClass + DecodeFromBytes func(data []byte, df DecodeFeedback) error + LayerPayload func() []byte + NextLayerType func() LayerType + type DecodingLayerArray []decodingLayerElem + func (dl DecodingLayerArray) Decoder(typ LayerType) (DecodingLayer, bool) + func (dl DecodingLayerArray) LayersDecoder(first LayerType, df DecodeFeedback) DecodingLayerFunc + func (dl DecodingLayerArray) Put(d DecodingLayer) DecodingLayerContainer + type DecodingLayerContainer interface + Decoder func(LayerType) (DecodingLayer, bool) + LayersDecoder func(first LayerType, df DecodeFeedback) DecodingLayerFunc + Put func(DecodingLayer) DecodingLayerContainer + type DecodingLayerFunc func([]byte, *[]LayerType) (LayerType, error) + func LayersDecoder(dl DecodingLayerContainer, first LayerType, df DecodeFeedback) DecodingLayerFunc + type DecodingLayerMap map[LayerType]DecodingLayer + func (dl DecodingLayerMap) Decoder(typ LayerType) (DecodingLayer, bool) + func (dl DecodingLayerMap) LayersDecoder(first LayerType, df DecodeFeedback) DecodingLayerFunc + func (dl DecodingLayerMap) Put(d DecodingLayer) DecodingLayerContainer + type DecodingLayerParser struct + Truncated bool + func NewDecodingLayerParser(first LayerType, decoders ...DecodingLayer) *DecodingLayerParser + func (l *DecodingLayerParser) AddDecodingLayer(d DecodingLayer) + func (l *DecodingLayerParser) DecodeLayers(data []byte, decoded *[]LayerType) (err error) + func (l *DecodingLayerParser) SetDecodingLayerContainer(dlc DecodingLayerContainer) + func (l *DecodingLayerParser) SetTruncated() + type DecodingLayerParserOptions struct + IgnorePanic bool + IgnoreUnsupported bool + type DecodingLayerSparse []DecodingLayer + func (dl DecodingLayerSparse) Decoder(typ LayerType) (DecodingLayer, bool) + func (dl DecodingLayerSparse) LayersDecoder(first LayerType, df DecodeFeedback) DecodingLayerFunc + func (dl DecodingLayerSparse) Put(d DecodingLayer) DecodingLayerContainer + type Dumper interface + Dump func() string + type Endpoint struct + func NewEndpoint(typ EndpointType, raw []byte) (e Endpoint) + func (a Endpoint) EndpointType() EndpointType + func (a Endpoint) FastHash() (h uint64) + func (a Endpoint) LessThan(b Endpoint) bool + func (a Endpoint) Raw() []byte + func (a Endpoint) String() string + type EndpointType int64 + func RegisterEndpointType(num int, meta EndpointTypeMetadata) EndpointType + func (e EndpointType) String() string + type EndpointTypeMetadata struct + Formatter func([]byte) string + Name string + type ErrorLayer interface + Error func() error + type Flow struct + func FlowFromEndpoints(src, dst Endpoint) (_ Flow, err error) + func NewFlow(t EndpointType, src, dst []byte) (f Flow) + func (f Flow) Dst() (dst Endpoint) + func (f Flow) EndpointType() EndpointType + func (f Flow) Endpoints() (src, dst Endpoint) + func (f Flow) FastHash() (h uint64) + func (f Flow) Reverse() Flow + func (f Flow) Src() (src Endpoint) + func (f Flow) String() string + type Fragment []byte + func (p *Fragment) CanDecode() LayerClass + func (p *Fragment) DecodeFromBytes(data []byte, df DecodeFeedback) error + func (p *Fragment) LayerContents() []byte + func (p *Fragment) LayerPayload() []byte + func (p *Fragment) LayerType() LayerType + func (p *Fragment) NextLayerType() LayerType + func (p *Fragment) Payload() []byte + func (p *Fragment) SerializeTo(b SerializeBuffer, opts SerializeOptions) error + func (p *Fragment) String() string + type Layer interface + LayerContents func() []byte + LayerPayload func() []byte + LayerType func() LayerType + type LayerClass interface + Contains func(LayerType) bool + LayerTypes func() []LayerType + func NewLayerClass(types []LayerType) LayerClass + type LayerClassMap map[LayerType]bool + func NewLayerClassMap(types []LayerType) LayerClassMap + func (m LayerClassMap) Contains(t LayerType) bool + func (m LayerClassMap) LayerTypes() (all []LayerType) + type LayerClassSlice []bool + func NewLayerClassSlice(types []LayerType) LayerClassSlice + func (s LayerClassSlice) Contains(t LayerType) bool + func (s LayerClassSlice) LayerTypes() (all []LayerType) + type LayerType int64 + func OverrideLayerType(num int, meta LayerTypeMetadata) LayerType + func RegisterLayerType(num int, meta LayerTypeMetadata) LayerType + func (l LayerType) Contains(a LayerType) bool + func (l LayerType) LayerTypes() []LayerType + func (t LayerType) Decode(data []byte, c PacketBuilder) error + func (t LayerType) String() (s string) + type LayerTypeMetadata struct + Decoder Decoder + Name string + type LinkLayer interface + LinkFlow func() Flow + type NetworkLayer interface + NetworkFlow func() Flow + type Packet interface + ApplicationLayer func() ApplicationLayer + Data func() []byte + Dump func() string + ErrorLayer func() ErrorLayer + Layer func(LayerType) Layer + LayerClass func(LayerClass) Layer + Layers func() []Layer + LinkLayer func() LinkLayer + Metadata func() *PacketMetadata + NetworkLayer func() NetworkLayer + String func() string + TransportLayer func() TransportLayer + func NewPacket(data []byte, firstLayerDecoder Decoder, options DecodeOptions) Packet + type PacketBuilder interface + AddLayer func(l Layer) + DecodeOptions func() *DecodeOptions + DumpPacketData func() + NextDecoder func(next Decoder) error + SetApplicationLayer func(ApplicationLayer) + SetErrorLayer func(ErrorLayer) + SetLinkLayer func(LinkLayer) + SetNetworkLayer func(NetworkLayer) + SetTransportLayer func(TransportLayer) + type PacketDataSource interface + ReadPacketData func() (data []byte, ci CaptureInfo, err error) + func ConcatFinitePacketDataSources(pds ...PacketDataSource) PacketDataSource + type PacketMetadata struct + Truncated bool + type PacketSource struct + func NewPacketSource(source PacketDataSource, decoder Decoder) *PacketSource + func (p *PacketSource) NextPacket() (Packet, error) + func (p *PacketSource) Packets() chan Packet + type PacketSourceResolution interface + Resolution func() TimestampResolution + type Payload []byte + func (p *Payload) DecodeFromBytes(data []byte, df DecodeFeedback) error + func (p Payload) CanDecode() LayerClass + func (p Payload) GoString() string + func (p Payload) LayerContents() []byte + func (p Payload) LayerPayload() []byte + func (p Payload) LayerType() LayerType + func (p Payload) NextLayerType() LayerType + func (p Payload) Payload() []byte + func (p Payload) SerializeTo(b SerializeBuffer, opts SerializeOptions) error + func (p Payload) String() string + type SerializableLayer interface + LayerType func() LayerType + SerializeTo func(b SerializeBuffer, opts SerializeOptions) error + type SerializeBuffer interface + AppendBytes func(num int) ([]byte, error) + Bytes func() []byte + Clear func() error + Layers func() []LayerType + PrependBytes func(num int) ([]byte, error) + PushLayer func(LayerType) + func NewSerializeBuffer() SerializeBuffer + func NewSerializeBufferExpectedSize(expectedPrependLength, expectedAppendLength int) SerializeBuffer + type SerializeOptions struct + ComputeChecksums bool + FixLengths bool + type TimestampResolution struct + Base int + Exponent int + func (t TimestampResolution) String() string + func (t TimestampResolution) ToDuration() time.Duration + type TransportLayer interface + TransportFlow func() Flow + type UnsupportedLayerType LayerType + func (e UnsupportedLayerType) Error() string + type ZeroCopyPacketDataSource interface + ZeroCopyReadPacketData func() (data []byte, ci CaptureInfo, err error)