Whole List Entries

pcapkit.corekit.schema.entries refuses a list length that leaves part of a fixed-width entry, for the lists of SCTP’s parameters, causes and chunks, of HIP’s parameters and of IPv6-Route’s Source Route alike.

Added in version 1.10.0.

pcapkit.corekit.schema.entries.whole_entries(length, width, message)[source]

Refuse a list length that leaves part of a fixed-width entry.

Parameters:
  • length (Callable[[dict[str, Any]], int]) – Callback computing the length of a list of width-octet entries from the packet data.

  • width (int) – Octets of each entry.

  • message (str) – What the refusal says, led by the protocol’s alias, as a str.format_map() template the packet data fills in.

Return type:

Callable[[dict[str, Any]], int]

Returns:

A callback returning that length, which raises ProtocolError where it is no whole number of entries: a structural refusal (RFC Conformance), quiet under a next-layer fallback (#2588). A length of zero or below, as a pack resolves the field before it has one, passes.

Added in version 1.10.0.