While experimenting with decoder stacks, I realized that we're reinitializing the decoder stack for each packet, in decodeLayers(). This works against the performance benefit of gopacket.NewDecodingLayerParser and is probably accidental.
The DecodingLayerParser & decoder stack ([]gopacket.LayerType{}) should be initialized once and either passed to decodeLayers() as pointers or stored in globals.
While experimenting with decoder stacks, I realized that we're reinitializing the decoder stack for each packet, in
decodeLayers()
. This works against the performance benefit ofgopacket.NewDecodingLayerParser
and is probably accidental.The
DecodingLayerParser
& decoder stack ([]gopacket.LayerType{}
) should be initialized once and either passed todecodeLayers()
as pointers or stored in globals.