Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions examples/generators/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,8 +944,9 @@ def _mh_extension_build(code: 'Any', kwargs: 'dict[str, Any]') -> 'Any':
'controls_anonymous': False, 'shit': 0, 'rhit': 0, 'payload': b'',
}

#: Codes that are HIPv1-only, and the version their constructor demands.
HIP_VERSION = {129: 2, 128: 1}
#: Codes tied to one HIP version, and the version their constructor demands:
#: ``R1_Counter`` (128) and ``HIP_TRANSFORM`` (577) are :rfc:`5201` only.
HIP_VERSION = {129: 2, 128: 1, 577: 1}

#: How many copies of the parameter under test go in one packet.
#:
Expand Down Expand Up @@ -975,14 +976,14 @@ def _mh_extension_build(code: 'Any', kwargs: 'dict[str, Any]') -> 'Any':
#: ``Length`` had been counted in 4-octet units where the RFC counts bytes --
#: which is what moved the one-copy figure from 44 to 46, level with two copies.
#:
#: Two remain, neither helped by a second copy since each fails at two copies
#: Two remained, neither helped by a second copy since each fails at two copies
#: as well as at one:
#:
#: * ``HOST_ID`` declares ``len=8`` and packs 18. Recorded as
#: ``hip-parameter/HOST_ID``.
#: * ``HIP_TRANSFORM`` is HIPv1-only -- ``_read_param_hip_transform`` raises for
#: any other version -- while this table builds it at version 2. Recorded as
#: ``hip-parameter/HIP_TRANSFORM``.
#: any other version -- and is now built at version 1 through
#: :data:`HIP_VERSION`, so it round-trips and is no longer recorded.
#:
#: A third gap here, ``R1_Counter`` (128), was closed separately by #690 and was
#: never one of the pair's cancellations above: it parsed as an
Expand All @@ -1005,8 +1006,8 @@ def _mh_extension_build(code: 'Any', kwargs: 'dict[str, Any]') -> 'Any':
#: after #690 47 OK 47 OK
#: ====================== ======== ==========
#:
#: The two gaps above are the only cases either setting fails, and neither
#: their ``status`` nor their ``defect`` moves between settings, so
#: ``HOST_ID`` is now the only case either setting fails, and neither its
#: ``status`` nor its ``defect`` moves between settings, so
#: :data:`tests.protocols.test_option_roundtrip_unit.EXPECTED_FAILURES` needed no
#: change to keep recording them accurately at one copy.
#:
Expand Down
11 changes: 3 additions & 8 deletions tests/protocols/test_option_roundtrip_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,14 +411,9 @@ class Gap(NamedTuple):
# cycle closes and the entry is deleted rather than kept as documentation of
# a defect that is no longer there.

# Two parameters whose own packed length is not what the header arithmetic
# can represent, even at HIP_COPIES's old value of two -- see that
# constant's note in the generator for the measurement that dropped it to
# one without changing either of these.
'hip-parameter/HIP_TRANSFORM': Gap(
'CONSTRUCT', 'HIPv2: [ParamNo 577] invalid parameter',
'pcapkit/protocols/internet/hip.py:698 -- the len check; HIP_TRANSFORM '
'packs to a length the make-side arithmetic cannot express'),
# A parameter whose own packed length is not what the header arithmetic
# can represent, at one copy or two. The generator's HIP_COPIES note
# records it as the one HIP case that fails at either setting.
'hip-parameter/HOST_ID': Gap(
'CONSTRUCT', 'HIPv2: invalid format',
'pcapkit/protocols/internet/hip.py:698 -- HOST_ID packs to 14 octets '
Expand Down
Loading