MCPcopy Index your code
hub / github.com/cloudflare/cloudflared / EncodeLayers

Method EncodeLayers

packet/decoder_test.go:245–256  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

243}
244
245func (u *UDP) EncodeLayers() ([]gopacket.SerializableLayer, error) {
246 ipLayers, err := u.IP.EncodeLayers()
247 if err != nil {
248 return nil, err
249 }
250 udpLayer := layers.UDP{
251 SrcPort: u.SrcPort,
252 DstPort: u.DstPort,
253 }
254 udpLayer.SetNetworkLayerForChecksum(ipLayers[0].(gopacket.NetworkLayer))
255 return append(ipLayers, &udpLayer), nil
256}
257
258func FuzzIPDecoder(f *testing.F) {
259 f.Fuzz(func(t *testing.T, data []byte) {

Callers

nothing calls this directly

Calls 1

EncodeLayersMethod · 0.65

Tested by

no test coverage detected