Extension-Header Length¶
pcapkit.corekit.schema.extlen converts between octets and the length
field of an IPv6-extension-style header, which counts 8-octet units not
including the first 8 octets [RFC 6564 Section 4], for the extension headers,
the Mobility Header, HIP, the jumbogram lookup and IPv6 reassembly alike.
Added in version 1.7.0.
- pcapkit.corekit.schema.extlen.ext_len_to_octets(ext_len)[source]¶
Octets of a header whose length field is
ext_len.- Parameters:
ext_len (
int) – Length field, in 8-octet units not including the first 8 octets, asHdr Ext Len[RFC 8200 Section 4.3], MH’sHeader Len[RFC 6275 Section 6.1.1] and HIP’sHeader Length[RFC 7401 Section 5.1] count.- Return type:
- Returns:
(ext_len + 1) * 8.
Added in version 1.7.0.
- pcapkit.corekit.schema.extlen.octets_to_ext_len(length)[source]¶
Length field of a header of
lengthoctets, the inverse ofext_len_to_octets().- Parameters:
length (
int) – Octets of the header, the first 8 included.- Return type:
- Returns:
length // 8 - 1, rounded down wherelengthis not a multiple of 8; a maker that must not declare fewer octets than it packs padslengthfirst.
Added in version 1.7.0.