// RegisterUDPPortLayerType creates a new mapping between a UDPPort // and an underlaying LayerType. func RegisterUDPPortLayerType(port UDPPort, layerType gopacket.LayerType) { udpPortLayerType[port] = layerType }
parser := gopacket.NewDecodingLayerParser( layers.LayerTypeEthernet, ðLayer, &ipLayer, &tcpLayer, ) foundLayerTypes := []gopacket.LayerType{} err := parser.DecodeLayers(packet.Data(), &foundLayerTypes) if err != nil { fmt.Println("Trouble decoding layers: ", err) }