func (dl DecodingLayerMap) Decoder(typ LayerType) (DecodingLayer, bool) {
	d, ok := dl[typ]
	return d, ok
}
Decoder implements DecodingLayerContainer interface.
package gopacket
import (
	"fmt"
)
type decodingLayerElem struct {
	typ LayerType
	dec DecodingLayer
}
type DecodingLayer interface {
	DecodeFromBytes(data []byte, df DecodeFeedback) error
	CanDecode() LayerClass
	NextLayerType() LayerType
	LayerPayload() []byte
}
type DecodingLayerFunc func([]byte, *[]LayerType) (LayerType, error)
type DecodingLayerContainer interface {
	Put(DecodingLayer) DecodingLayerContainer
	Decoder(LayerType) (DecodingLayer, bool)
	LayersDecoder(first LayerType, df DecodeFeedback) DecodingLayerFunc
}
type DecodingLayerSparse []DecodingLayer
func (dl DecodingLayerSparse) Put(d DecodingLayer) DecodingLayerContainer {
	maxLayerType := LayerType(len(dl) - 1)
	for _, typ := range d.CanDecode().LayerTypes() {
		if typ > maxLayerType {
			maxLayerType = typ
		}
	}
	if extra := maxLayerType - LayerType(len(dl)) + 1; extra > 0 {
		dl = append(dl, make([]DecodingLayer, extra)...)
	}
	for _, typ := range d.CanDecode().LayerTypes() {
		dl[typ] = d
	}
	return dl
}
func (dl DecodingLayerSparse) LayersDecoder(first LayerType, df DecodeFeedback) DecodingLayerFunc {
	return LayersDecoder(dl, first, df)
}
func (dl DecodingLayerSparse) Decoder(typ LayerType) (DecodingLayer, bool) {
	if int64(typ) < int64(len(dl)) {
		decoder := dl[typ]
		return decoder, decoder != nil
	}
	return nil, false
}
type DecodingLayerArray []decodingLayerElem
func (dl DecodingLayerArray) Put(d DecodingLayer) DecodingLayerContainer {
TYPES:
	for _, typ := range d.CanDecode().LayerTypes() {
		for i := range dl {
			if dl[i].typ == typ {
				dl[i].dec = d
				continue TYPES
			}
		}
		dl = append(dl, decodingLayerElem{typ, d})
	}
	return dl
}
func (dl DecodingLayerArray) Decoder(typ LayerType) (DecodingLayer, bool) {
	for i := range dl {
		if dl[i].typ == typ {
			return dl[i].dec, true
		}
	}
	return nil, false
}
func (dl DecodingLayerArray) LayersDecoder(first LayerType, df DecodeFeedback) DecodingLayerFunc {
	return LayersDecoder(dl, first, df)
}
type DecodingLayerMap map[LayerType]DecodingLayer
func (dl DecodingLayerMap) Put(d DecodingLayer) DecodingLayerContainer {
	for _, typ := range d.CanDecode().LayerTypes() {
		if dl == nil {
			dl = make(map[LayerType]DecodingLayer)
		}
		dl[typ] = d
	}
	return dl
}