(p []byte)
| 33 | } |
| 34 | |
| 35 | func 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. |
no test coverage detected