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

Function FindIPVersion

packet/decoder.go:35–40  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

33}
34
35func FindIPVersion(p []byte) (uint8, error) {
36 if len(p) == 0 {
37 return 0, fmt.Errorf("packet length is 0")
38 }
39 return p[0] >> 4, nil
40}
41
42// IPDecoder decodes raw packets into IP. It can process packets sequentially without allocating
43// memory for the layers, so it cannot be called concurrently.

Callers 2

FindProtocolFunction · 0.85
decodeByVersionMethod · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected