MCPcopy
hub / github.com/google/gopacket / DecodingLayer

Interface DecodingLayer

parser.go:29–46  ·  view source on GitHub ↗

DecodingLayer is an interface for packet layers that can decode themselves. The important part of DecodingLayer is that they decode themselves in-place. Calling DecodeFromBytes on a DecodingLayer totally resets the entire layer to the new state defined by the data passed in. A returned error leave

Source from the content-addressed store, hash-verified

27// Because the DecodingLayer is resetting its own fields, a call to
28// DecodeFromBytes should normally not require any memory allocation.
29type DecodingLayer interface {
30 // DecodeFromBytes resets the internal state of this layer to the state
31 // defined by the passed-in bytes. Slices in the DecodingLayer may
32 // reference the passed-in data, so care should be taken to copy it
33 // first should later modification of data be required before the
34 // DecodingLayer is discarded.
35 DecodeFromBytes(data []byte, df DecodeFeedback) error
36 // CanDecode returns the set of LayerTypes this DecodingLayer can
37 // decode. For Layers that are also DecodingLayers, this will most
38 // often be that Layer's LayerType().
39 CanDecode() LayerClass
40 // NextLayerType returns the LayerType which should be used to decode
41 // the LayerPayload.
42 NextLayerType() LayerType
43 // LayerPayload is the set of bytes remaining to decode after a call to
44 // DecodeFromBytes.
45 LayerPayload() []byte
46}
47
48// DecodingLayerFunc decodes given packet and stores decoded LayerType
49// values into specified slice. Returns either first encountered

Callers 7

LayersDecoderFunction · 0.65
PutMethod · 0.65
PutMethod · 0.65
PutMethod · 0.65
LayersDecoderFunction · 0.65
RunFunction · 0.65
mainFunction · 0.65

Implementers 1

LCMlayers/lcm.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…