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

Function decodingLayerDecoder

layers/base.go:38–49  ·  view source on GitHub ↗
(d layerDecodingLayer, data []byte, p gopacket.PacketBuilder)

Source from the content-addressed store, hash-verified

36}
37
38func decodingLayerDecoder(d layerDecodingLayer, data []byte, p gopacket.PacketBuilder) error {
39 err := d.DecodeFromBytes(data, p)
40 if err != nil {
41 return err
42 }
43 p.AddLayer(d)
44 next := d.NextLayerType()
45 if next == gopacket.LayerTypeZero {
46 return nil
47 }
48 return p.NextDecoder(next)
49}
50
51// hacky way to zero out memory... there must be a better way?
52var lotsOfZeros [1024]byte

Callers 15

decodeGREFunction · 0.85
decodeEAPOLFunction · 0.85
decodeEAPOLKeyFunction · 0.85
decodeICMPv6EchoFunction · 0.85
decodeICMPv6RedirectFunction · 0.85
decodeOSPFFunction · 0.85
decodeDot1QFunction · 0.85
decodeICMPv6Function · 0.85

Calls 4

DecodeFromBytesMethod · 0.65
AddLayerMethod · 0.65
NextLayerTypeMethod · 0.65
NextDecoderMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…