MCPcopy Index your code
hub / github.com/google/gopacket / Decode

Method Decode

layertype.go:87–98  ·  view source on GitHub ↗

Decode decodes the given data using the decoder registered with the layer type.

(data []byte, c PacketBuilder)

Source from the content-addressed store, hash-verified

85// Decode decodes the given data using the decoder registered with the layer
86// type.
87func (t LayerType) Decode(data []byte, c PacketBuilder) error {
88 var d Decoder
89 if 0 <= int(t) && int(t) < maxLayerType {
90 d = ltMeta[int(t)].Decoder
91 } else {
92 d = ltMetaMap[t].Decoder
93 }
94 if d != nil {
95 return d.Decode(data, c)
96 }
97 return fmt.Errorf("Layer type %v has no associated decoder", t)
98}
99
100// String returns the string associated with this layer type.
101func (t LayerType) String() (s string) {

Callers

nothing calls this directly

Calls 1

DecodeMethod · 0.95

Tested by

no test coverage detected