Skip to main content

count_extensions

Function count_extensions 

Source
fn count_extensions(raw: &[u8]) -> Option<u64>
Expand description

Count the extension headers in a raw block, or None if the bytes do not tile into whole headers.

The block is stored opaque, so the number of headers in it is not something the value carries - it is a property of the bytes, recovered by walking them with the same rule skip_extensions reads them by. This is the only draft that needs it: draft-08 states the field as “Extension Count”, a number of headers, and every later draft states a byte length that extensions.len() supplies directly.