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

Function NewDecodingLayerParser

parser.go:222–233  ·  view source on GitHub ↗

NewDecodingLayerParser creates a new DecodingLayerParser and adds in all of the given DecodingLayers with AddDecodingLayer. Each call to DecodeLayers will attempt to decode the given bytes first by treating them as a 'first'-type layer, then by using NextLayerType on subsequently decoded layers to

(first LayerType, decoders ...DecodingLayer)

Source from the content-addressed store, hash-verified

220// NewDecodingLayerParser uses DecodingLayerMap container by
221// default.
222func NewDecodingLayerParser(first LayerType, decoders ...DecodingLayer) *DecodingLayerParser {
223 dlp := &DecodingLayerParser{first: first}
224 dlp.df = dlp // Cast this once to the interface
225 // default container
226 dlc := DecodingLayerContainer(DecodingLayerMap(make(map[LayerType]DecodingLayer)))
227 for _, d := range decoders {
228 dlc = dlc.Put(d)
229 }
230
231 dlp.SetDecodingLayerContainer(dlc)
232 return dlp
233}
234
235// SetDecodingLayerContainer specifies container with decoders. This
236// call replaces all decoders already registered in given instance of

Calls 4

DecodingLayerContainerInterface · 0.85
DecodingLayerMapTypeAlias · 0.85
PutMethod · 0.65

Used in the wild real call sites across dependent graphs

searching dependent graphs…