diff --git a/docs/source/pcapkit/const/index.rst b/docs/source/pcapkit/const/index.rst index b540741ad3..6f6ff59478 100644 --- a/docs/source/pcapkit/const/index.rst +++ b/docs/source/pcapkit/const/index.rst @@ -14,9 +14,9 @@ Unrecognised Values Nearly every :term:`registry` below departs from :mod:`enum` in one deliberate way, and it is the behaviour to know about before using any of them: looking one up by a value it does not define does **not** raise. Its ``_missing_`` override returns a -member-like object for a value inside the registry's valid range, named for the -unassigned or reserved band it falls in. Only a value outside that range, or of the -wrong type, raises :exc:`ValueError`. +member-like object for a value that falls in one of the registry's unassigned or +reserved bands, named for that band. Only a value no band covers, or of the wrong +type, raises :exc:`ValueError`. In almost every registry that object is **not** installed: the registry does not grow, and a second lookup of the same value returns an equal but distinct object. @@ -38,7 +38,7 @@ Some behave otherwise, and :ref:`mint-criterion` gives the full split: That is what makes the enumerations usable against live capture data, where a protocol number assigned after this release was generated is a routine -occurrence rather than an error. It also means an enumeration member is not a +occurrence rather than an error. It also means an enumeration is not a closed set: an unassigned value resolves to a member that is, apart from :class:`~pcapkit.const.mh.cga_type.CGAType`, absent from iteration and ``__members__``, and whether a repeat lookup returns the same object varies by registry, so compare such @@ -46,7 +46,7 @@ members by value, not identity. The common form of the override is generated -- see :mod:`pcapkit.vendor.default`, whose template emits it -- while the valid range and the names of the unassigned -bands are per-registry, taken from that registry's own IANA data. The individual +bands are per-registry, taken from that registry's own source data. The individual overrides are therefore not documented per class. .. seealso:: diff --git a/docs/source/pcapkit/const/pcapng.rst b/docs/source/pcapkit/const/pcapng.rst index 7b2e8549d3..fb07c68130 100644 --- a/docs/source/pcapkit/const/pcapng.rst +++ b/docs/source/pcapkit/const/pcapng.rst @@ -150,7 +150,7 @@ which is automatically generated from :class:`pcapkit.vendor.pcapng.tls_key_labe .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-standardized-block-type-cod .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-options -.. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-enhanced-packet-block-flags +.. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-enhanced-packet-block-optio .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-enhanced-packet-block .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-name-resolution-block .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-decryption-secrets-block diff --git a/docs/source/pcapkit/const/vlan.rst b/docs/source/pcapkit/const/vlan.rst index 346fab5be2..654424f192 100644 --- a/docs/source/pcapkit/const/vlan.rst +++ b/docs/source/pcapkit/const/vlan.rst @@ -10,7 +10,7 @@ enumerations include: .. list-table:: - * - :const:`VLAN_PriorityLevel ` + * - :class:`VLAN_PriorityLevel ` - Priority Levels [*]_ Priority levels defined in IEEE 802.1p diff --git a/docs/source/pcapkit/vendor/pcapng.rst b/docs/source/pcapkit/vendor/pcapng.rst index ff1af8ee0f..cd7211ece5 100644 --- a/docs/source/pcapkit/vendor/pcapng.rst +++ b/docs/source/pcapkit/vendor/pcapng.rst @@ -139,7 +139,7 @@ which is automatically generating :class:`pcapkit.const.pcapng.tls_key_label.TLS .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-standardized-block-type-cod .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-options -.. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-enhanced-packet-block-flags +.. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-enhanced-packet-block-optio .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-enhanced-packet-block .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-name-resolution-block .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-decryption-secrets-block diff --git a/pcapkit/const/ftp/command.py b/pcapkit/const/ftp/command.py index 05ad4bb487..c1091838e4 100644 --- a/pcapkit/const/ftp/command.py +++ b/pcapkit/const/ftp/command.py @@ -37,8 +37,8 @@ class FEATCode(EnumRegistry, StrEnum): :meth:`~pcapkit.vendor.ftp.command.Command.process`) -- rather than minting the per-command ones at import time as an incidental side effect of building :class:`Command`'s own rows. GitHub issue :issue:`860`: - that import-time mutation was the same defect shape :issue:`775` removed - from :class:`~pcapkit.const.pcapng.filter_type.FilterType`. ``_missing_`` + that import-time mutation is the same defect shape :issue:`775` rules + out on :class:`~pcapkit.const.pcapng.filter_type.FilterType`. ``_missing_`` still unmints for a keyword that turns up on the wire but names none of these -- the extendability the owner conditionally asked to keep on GitHub issue :issue:`860`: unsure what a diff --git a/pcapkit/const/http/method.py b/pcapkit/const/http/method.py index b7a18c9a31..3f590ef7d4 100644 --- a/pcapkit/const/http/method.py +++ b/pcapkit/const/http/method.py @@ -226,8 +226,8 @@ def get(cls, key: 'str', default: 'Optional[str]' = None) -> 'Method': IANA methods whose member *name* differs from their *value* -- ``BASELINE_CONTROL`` / ``'BASELINE-CONTROL'`` and ``VERSION_CONTROL`` / ``'VERSION-CONTROL'``, a hyphen being unusable - in a Python identifier -- which :meth:`_missing_` (and so the - constructor) also finds by value. + in a Python identifier -- which the constructor also finds by + value, before it falls back to :meth:`_missing_`. It is a :class:`classmethod`, as the base is, because a zero-argument ``super()`` needs a first argument to bind diff --git a/pcapkit/const/ospf/__init__.py b/pcapkit/const/ospf/__init__.py index e5af97b8a3..47baf07f20 100644 --- a/pcapkit/const/ospf/__init__.py +++ b/pcapkit/const/ospf/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # pylint: disable=unused-import """:class:`~pcapkit.protocols.application.ospf.OSPF` Constant Enumerations -====================================================================== +======================================================================= .. module:: pcapkit.const.ospf diff --git a/pcapkit/const/pcapng/__init__.py b/pcapkit/const/pcapng/__init__.py index ec1ab275e5..d7f2c1921e 100644 --- a/pcapkit/const/pcapng/__init__.py +++ b/pcapkit/const/pcapng/__init__.py @@ -30,7 +30,7 @@ .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-standardized-block-type-cod .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-options -.. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-enhanced-packet-block-flags +.. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-enhanced-packet-block-optio .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-enhanced-packet-block .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-name-resolution-block .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-decryption-secrets-block diff --git a/pcapkit/const/reg/apptype/__init__.py b/pcapkit/const/reg/apptype/__init__.py index 228dd7acb9..a2ef55ac4f 100644 --- a/pcapkit/const/reg/apptype/__init__.py +++ b/pcapkit/const/reg/apptype/__init__.py @@ -59,7 +59,7 @@ #: Registries imported on first use rather than with this package, as submodule #: name to class name -- GitHub issue :issue:`1538`. Generated from IANA's -#: registry, the two hold about 49,700 lines of members, about 30% of +#: registry, they hold about 49,700 lines of members, about 30% of #: ``import pcapkit`` when imported eagerly, while SCTP's and DCCP's cost a few #: milliseconds and stay eager. _LAZY = {'tcp': 'TCP', 'udp': 'UDP'} diff --git a/pcapkit/const/reg/apptype/apptype.py b/pcapkit/const/reg/apptype/apptype.py index 2b7efdf48d..b26f91e54e 100644 --- a/pcapkit/const/reg/apptype/apptype.py +++ b/pcapkit/const/reg/apptype/apptype.py @@ -2734,7 +2734,8 @@ def _sanitize_identifier(cls, name: 'str') -> 'str': collapsed = '_'.join(stripped.split()) replaced = re.sub(r'\W', '_', collapsed) identifier = '_'.join(filter(None, replaced.split('_'))) - # NOTE: matches process()'s own keyword guard below -- a name that + # NOTE: matches the keyword guard AppType.process applies at generation + # time in pcapkit.vendor.reg.apptype.apptype -- a name that # sanitises to a reserved word is not usable as an attribute as is, # and a trailing underscore is the same fix the generator already # applies to a statically declared member with the same problem. diff --git a/pcapkit/const/vlan/__init__.py b/pcapkit/const/vlan/__init__.py index 0725bcc406..e0753d56e4 100644 --- a/pcapkit/const/vlan/__init__.py +++ b/pcapkit/const/vlan/__init__.py @@ -11,7 +11,7 @@ .. list-table:: - * - :const:`VLAN_PriorityLevel ` + * - :class:`VLAN_PriorityLevel ` - Priority Levels [*]_ .. [*] https://en.wikipedia.org/wiki/IEEE_P802.1p#Priority_levels diff --git a/pcapkit/corekit/enum.py b/pcapkit/corekit/enum.py index a0f9e20108..3503ad05e4 100644 --- a/pcapkit/corekit/enum.py +++ b/pcapkit/corekit/enum.py @@ -491,7 +491,7 @@ def get_all(cls, key: 'Any') -> 'tuple[Self, ...]': class EnumRegistry(EnumLookup): - """Registry protocol shared by every constant enumeration under + """Registry protocol shared by every open constant enumeration under :mod:`pcapkit.const`. :class:`EnumLookup` above carries the read half -- :meth:`~EnumLookup.get`, diff --git a/pcapkit/corekit/fields/field.py b/pcapkit/corekit/fields/field.py index 6888e882b0..48cb6859c0 100644 --- a/pcapkit/corekit/fields/field.py +++ b/pcapkit/corekit/fields/field.py @@ -433,8 +433,8 @@ def unpack(self, buffer: 'bytes | IO[bytes]', packet: 'dict[str, Any]') -> '_T': # NOTE: ``length`` is frequently wire-derived -- resolved by a # ``_length_callback`` against the very packet being parsed, per # :meth:`Field.__call__` below, or by a schema's own selector building a - # field from a value it just read off the wire (e.g. ``DecryptionSecretsBlock``'s - # ``secrets_data: BytesField(length=lambda pkt: pkt['__length__'])``) -- + # field from a value it just read off the wire (e.g. HIP's + # ``host_id_hi_selector`` returning ``BytesField(length=pkt['hi_len'])``) -- # and is thus attacker-controlled: a corrupt or hostile capture can # declare an arbitrarily large one. Past :data:`~pcapkit.utilities.config.MAX_ZERO_PAD_LENGTH`, a # length that ``buffer`` falls short of is provably bogus: the padding diff --git a/pcapkit/corekit/fields/ipaddress.py b/pcapkit/corekit/fields/ipaddress.py index 9d4a2e682c..9271892a28 100644 --- a/pcapkit/corekit/fields/ipaddress.py +++ b/pcapkit/corekit/fields/ipaddress.py @@ -158,19 +158,18 @@ def parse_ip_address(value: 'IPv4Address | IPv6Address | bytes | int | str', length is the only thing on the wire that carries the family -- must convert the argument itself, and that conversion happens **before** the schema, so it launders a :obj:`bool` into an - :class:`~ipaddress.IPv4Address` that the guard added for :issue:`491` - in :meth:`_IPAddressField.pre_process` can then only see as a + :class:`~ipaddress.IPv4Address` that the :issue:`491` guard in + :meth:`_IPAddressField.pre_process` can then only see as a legitimate address: ``True`` / ``False`` become ``0.0.0.1`` / ``0.0.0.0`` -- or ``::1`` / ``::`` where the wire format fixes the family as IPv6 -- without complaint. Routing every one of them through here rather than giving each its own - :func:`isinstance` check is the whole point: :issue:`469` added - exactly such a check to :meth:`MH._make_opt_mn_id - `, and :issue:`491` - was the same defect surviving at every site that had not been thought - of. A guard that has to be remembered per call site is a guard that - will be forgotten at the next one. + :func:`isinstance` check is the whole point: :meth:`MH._make_opt_mn_id + ` carries exactly + such a check (:issue:`469`), and :issue:`491` is the same defect at + every site that lacks one. A guard that has to be remembered per call + site is a guard that will be forgotten at the next one. The :obj:`bool` rejection is the **first** statement here, ahead of any dispatch on the value's type, for the placement reason :issue:`469` @@ -195,8 +194,8 @@ def parse_ip_address(value: 'IPv4Address | IPv6Address | bytes | int | str', exception classes derive from :exc:`~pcapkit.utilities.exceptions.BaseError` *and* :exc:`ValueError`, so the difference is invisible to ``except BaseError`` and ``except - ValueError``, and nothing in the library catches either one - specifically. + ValueError``, and no call of this function or of a ``_make_*`` in the + library sits inside an ``except`` for either one specifically. .. versionadded:: 1.5.0 diff --git a/pcapkit/corekit/infoclass.py b/pcapkit/corekit/infoclass.py index b640616d20..7cbb8bac93 100644 --- a/pcapkit/corekit/infoclass.py +++ b/pcapkit/corekit/infoclass.py @@ -1272,8 +1272,9 @@ def _nested_types(cls: 'Type[Info]') -> 'dict[str, Type[Info]]': forward reference whose target is defined only *after* the first :meth:`Info.from_dict` call stays one-way for the life of the process. That is accepted rather than fixed: :meth:`Info.from_dict` runs per - parsed packet (see :meth:`IPv4._read_ipv4_options - `), and + parsed packet (see :meth:`IPv4.read + `, which builds its ToS + field with it), and re-resolving the annotations on every call to catch a case that does not arise in this package costs far more than it saves. diff --git a/pcapkit/corekit/sentinels.py b/pcapkit/corekit/sentinels.py index 3a753fe554..379655bae6 100644 --- a/pcapkit/corekit/sentinels.py +++ b/pcapkit/corekit/sentinels.py @@ -457,8 +457,8 @@ class with no ``__eq__`` of its own does; what it lacks is a readable then reads :data:`False` where it once read :data:`True`. :meth:`EnumLookup.get ` is such a consumer but is not affected: its fallback is guarded by - ``default not in cls._value2member_map_`` (added by GitHub issue - :issue:`864` to stop ``default`` minting a new member), and a + ``default not in cls._value2member_map_`` (the GitHub issue + :issue:`864` guard that stops ``default`` minting a new member), and a :class:`NoDefaultType` instance, stale or fresh, is never a registered enum value, so the guard reads :data:`True` for it either way and ``get`` re-raises the original lookup error regardless of which @@ -476,7 +476,7 @@ class with no ``__eq__`` of its own does; what it lacks is a readable docstring note on why it declines to memoise a resolved class, and :mod:`tests.protocols.test_dispatch_default_resolution_unit`'s own ``test_no_stale_class_survives_a_module_reload``, which reloads a module - deliberately to pin the fix for exactly that class of bug. A *future* + deliberately to guard against exactly that class of bug. A *future* comparison site written the vulnerable way -- a bare ``is NO_DEFAULT`` with no independent guard behind it -- would reproduce it. Nothing in this package reloads :mod:`pcapkit.corekit.sentinels` after import, but diff --git a/pcapkit/vendor/ftp/command.py b/pcapkit/vendor/ftp/command.py index 47eae9441d..7a2b69e588 100644 --- a/pcapkit/vendor/ftp/command.py +++ b/pcapkit/vendor/ftp/command.py @@ -77,8 +77,8 @@ class FEATCode(EnumRegistry, StrEnum): :meth:`~pcapkit.vendor.ftp.command.Command.process`) -- rather than minting the per-command ones at import time as an incidental side effect of building :class:`Command`'s own rows. GitHub issue :issue:`860`: - that import-time mutation was the same defect shape :issue:`775` removed - from :class:`~pcapkit.const.pcapng.filter_type.FilterType`. ``_missing_`` + that import-time mutation is the same defect shape :issue:`775` rules + out on :class:`~pcapkit.const.pcapng.filter_type.FilterType`. ``_missing_`` still unmints for a keyword that turns up on the wire but names none of these -- the extendability the owner conditionally asked to keep on GitHub issue :issue:`860`: unsure what a diff --git a/pcapkit/vendor/http/method.py b/pcapkit/vendor/http/method.py index 151d8ec5e6..3917168092 100644 --- a/pcapkit/vendor/http/method.py +++ b/pcapkit/vendor/http/method.py @@ -131,8 +131,8 @@ def get(cls, key: 'str', default: 'Optional[str]' = None) -> '{NAME}': IANA methods whose member *name* differs from their *value* -- ``BASELINE_CONTROL`` / ``'BASELINE-CONTROL'`` and ``VERSION_CONTROL`` / ``'VERSION-CONTROL'``, a hyphen being unusable - in a Python identifier -- which :meth:`_missing_` (and so the - constructor) also finds by value. + in a Python identifier -- which the constructor also finds by + value, before it falls back to :meth:`_missing_`. It is a :class:`classmethod`, as the base is, because a zero-argument ``super()`` needs a first argument to bind diff --git a/pcapkit/vendor/ipv4/tos_thr.py b/pcapkit/vendor/ipv4/tos_thr.py index 3745cd571b..7af2e108d7 100644 --- a/pcapkit/vendor/ipv4/tos_thr.py +++ b/pcapkit/vendor/ipv4/tos_thr.py @@ -30,6 +30,7 @@ class ToSThroughput(Vendor): """ToS (DS Field) Throughput""" + #: Value limit checker. FLAG = 'isinstance(value, int) and 0 <= value <= 1' def request(self) -> 'dict[int, str]': # type: ignore[override] # pylint: disable=arguments-differ diff --git a/pcapkit/vendor/ipv6/extension_header.py b/pcapkit/vendor/ipv6/extension_header.py index 0308c532e3..56dd926f73 100644 --- a/pcapkit/vendor/ipv6/extension_header.py +++ b/pcapkit/vendor/ipv6/extension_header.py @@ -85,20 +85,18 @@ def _validate_value(cls, value: 'Any') -> 'None': class ExtensionHeader(Vendor): """IPv6 Extension Header Types""" - #: Keyword-style names carried over from this crawler's *previous* data - #: source, keyed by protocol number. The Protocol Numbers registry - #: (``protocol-numbers-1.csv``, this crawler's :attr:`LINK` before GitHub - #: issue :issue:`925`) paired each of these headers with a short ``Keyword`` - #: column value, e.g. ``IPv6-Route`` for header 43. The registry - #: :attr:`LINK` points at -- IANA's authoritative *IPv6 Extension - #: Header Types* registry -- has no such column, only a verbose - #: ``Description`` (``Routing Header for IPv6`` for the same header), so - #: deriving names the same way :meth:`process` does for every other - #: 3-column registry (see e.g. - #: :class:`~pcapkit.vendor.ipv6.router_alert.RouterAlert`) - #: would silently rename these members. This mapping keeps - #: the shorter names instead; any header not listed here falls back to a - #: name derived from its description. + #: Keyword-style names taken from the *Protocol Numbers* registry + #: (``protocol-numbers-1.csv``), keyed by protocol number. That registry + #: pairs each of these headers with a short ``Keyword`` column value, e.g. + #: ``IPv6-Route`` for header 43. The registry :attr:`LINK` points at -- + #: IANA's authoritative *IPv6 Extension Header Types* registry -- has no + #: such column, only a verbose ``Description`` (``Routing Header for + #: IPv6`` for the same header), so deriving names the same way + #: :meth:`process` does for every other 3-column registry (see e.g. + #: :class:`~pcapkit.vendor.ipv6.router_alert.RouterAlert`) would give + #: these members long description-derived names (GitHub issue + #: :issue:`925`). This mapping keeps the shorter names instead; any header + #: not listed here falls back to a name derived from its description. NAMES = { 0: 'HOPOPT', 43: 'IPv6-Route', diff --git a/pcapkit/vendor/ipv6/seed_id.py b/pcapkit/vendor/ipv6/seed_id.py index f6eed55bab..816f74d3a9 100644 --- a/pcapkit/vendor/ipv6/seed_id.py +++ b/pcapkit/vendor/ipv6/seed_id.py @@ -39,7 +39,7 @@ def request(self) -> 'dict[int, str]': # type: ignore[override] # pylint: disab """Fetch registry data. Returns: - Registry data (:attr:`~pcapkit.vendor.ipv6.seed_id.DATA`). + Registry data (:data:`~pcapkit.vendor.ipv6.seed_id.DATA`). """ return DATA diff --git a/pcapkit/vendor/ipx/packet.py b/pcapkit/vendor/ipx/packet.py index c51ef76bc4..2297fca217 100644 --- a/pcapkit/vendor/ipx/packet.py +++ b/pcapkit/vendor/ipx/packet.py @@ -34,16 +34,16 @@ ############################################################################### # NOTE: this crawler does not crawl: the registry below is maintained by hand; # see #518. It is the same failure, on the same article and the same removal -# revision, that retired the sibling socket crawler in #507. +# revision, that keeps the sibling socket crawler maintained by hand (#507). # # Its source was the packet-type table in # https://en.wikipedia.org/wiki/Internetwork_Packet_Exchange#IPX_packet_structure, # and two separate things broke that. Wikipedia answers ``requests``' # default ``python-requests/`` User-Agent with HTTP 403 (measured # 2026-09-19: 403 and 126 bytes of robot-policy text for the default agent, 200 -# and 114117 bytes for a descriptive one). That half is fixed in -# ``Vendor._request``, which sends the descriptive agent -# :func:`~pcapkit.vendor.default.get_user_agent` builds -- but it only gets the +# and 114117 bytes for a descriptive one). ``Vendor._request`` answers that +# half by sending the descriptive agent +# :func:`~pcapkit.vendor.default.get_user_agent` builds -- but that only gets the # crawler as far as a page that does not hold the data. The table was deleted # from the article on 2026-08-25, in revision 1371327031 ("deleted some # irrelevant technical tables"), leaving the live page (revision 1372814585) @@ -54,8 +54,7 @@ # Pointing ``LINK`` at the last revision that still carries the table # (``oldid=1368657333``, re-measured 2026-09-19: 200, 118834 bytes, 4 # ``wikitable``s, ``table[1]`` headers ``['Value', 'Meaning/Protocol']``, 8 body -# rows) would have worked, and running the crawler's original ``process()`` -# against it +# rows) would have worked, and scraping it with a table-reading ``process()`` # reproduces the committed constant file byte for byte. It is still the wrong # fix: a network fetch pinned to a frozen snapshot is all of the fragility of a # crawler with none of the freshness, and it would go on selecting a table by @@ -79,9 +78,8 @@ #: Maps a packet type to the enumeration name it takes and the comment rendered #: above it. Names go through :meth:`~Vendor.rename`, so the generated member is #: the :meth:`~Vendor.safe_name` of the first element; comments are stored as the -#: scrape rendered them, reStructuredText markup and all, since the prose-mangling -#: the crawler's original ``process()`` did to Wikipedia's cell text has no source -#: left to mangle. +#: scrape rendered them, reStructuredText markup and all, since no Wikipedia +#: cell text remains for a scraping ``process()`` to rework. #: #: Every value below is independently corroborated by Wireshark's IPX dissector, #: ``epan/dissectors/packet-ipx.h`` (fetched 2026-09-19), which defines diff --git a/pcapkit/vendor/ipx/socket.py b/pcapkit/vendor/ipx/socket.py index 469f9b9ea4..081e0dca5d 100644 --- a/pcapkit/vendor/ipx/socket.py +++ b/pcapkit/vendor/ipx/socket.py @@ -83,8 +83,8 @@ # reserved to mean unknown and all, respectively." The same sentence # reserves all-ones -- 0xFFFF, to mean "all" -- and this table has no entry # for that; ``_missing_`` resolves 0xFFFF through the "Dynamically Assigned" - # range instead. Adding it would change the generated file, so it is left as - # a follow-up rather than done here. + # range instead. Adding it would change the generated file, so it is left + # out. 0x0000: ('Unspecified', "Unspecified socket; this is IPX's own default for the dst/src socket field."), # Sockets in the "Registered by Xerox" range below. These are formally @@ -123,14 +123,14 @@ # it reads 0x451 NCP, 0x452 SAP, 0x453 RIP, 0x455 Novell NetBIOS, 0x456 # Diagnostics, 0x9001 NLSP, 0x9004 "IPXWAN(TM) protocol". The last two have # never been in this enumeration, and 0x9004 is independently reserved by - # :rfc:`1634` line 552 -- "The socket number 0x9004 is a Novell reserved - # socket number for exclusive use with IPX WAN protocol exchange" -- and by - # the two RFCs it obsoletes: :rfc:`1551` line 532 word for word, and - # :rfc:`1362` line 253 with "information exchange" for "protocol exchange". - # So they are known omissions with good sourcing, not rows nobody noticed. - # Adding them would add members to the generated file and so give up the - # byte-identity proof #507 rests on, which makes them a follow-up rather - # than part of it. + # :rfc:`1634#section-4`, "Information Exchange Packet Formats" -- "The + # socket number 0x9004 is a Novell reserved socket number for exclusive use + # with IPX WAN protocol exchange" -- and by the same section of the two RFCs + # it obsoletes: :rfc:`1551` word for word, and :rfc:`1362` with + # "information exchange" for "protocol exchange". So they are known + # omissions with good sourcing, not rows nobody noticed. Adding them would + # add members to the generated file and so give up the byte-identity proof + # #507 rests on. # # Some of the rows below also depart from Novell's own wording: Novell writes # "Novell NetBIOS" and "Diagnostics" where this table says "NetBIOS" and diff --git a/pcapkit/vendor/l2tp/type.py b/pcapkit/vendor/l2tp/type.py index 4f20aca662..603ba89bf9 100644 --- a/pcapkit/vendor/l2tp/type.py +++ b/pcapkit/vendor/l2tp/type.py @@ -56,7 +56,7 @@ def count(self, data: 'dict[int, str]') -> 'Counter[str]': # type: ignore[overr return collections.Counter(map(self.safe_name, data.values())) def process(self, data: 'dict[int, str]') -> 'tuple[list[str], list[str]]': # type: ignore[override] # pylint: disable=arguments-differ - """Process CSV data. + """Process registry data. Args: data: Registry data. diff --git a/pcapkit/vendor/mh/binding_ack_flag.py b/pcapkit/vendor/mh/binding_ack_flag.py index 2972d06621..62b8c9a8d6 100644 --- a/pcapkit/vendor/mh/binding_ack_flag.py +++ b/pcapkit/vendor/mh/binding_ack_flag.py @@ -104,7 +104,7 @@ def process(self, data: 'list[str]') -> 'list[str]': # type: ignore[override] data: CSV data. Returns: - Enumeration fields and missing fields. + Enumeration fields. """ reader = csv.reader(data) diff --git a/pcapkit/vendor/mh/binding_update_flag.py b/pcapkit/vendor/mh/binding_update_flag.py index 5f14e4b29f..87e75b5b07 100644 --- a/pcapkit/vendor/mh/binding_update_flag.py +++ b/pcapkit/vendor/mh/binding_update_flag.py @@ -103,7 +103,7 @@ def process(self, data: 'list[str]') -> 'list[str]': # type: ignore[override] data: CSV data. Returns: - Enumeration fields and missing fields. + Enumeration fields. """ reader = csv.reader(data) diff --git a/pcapkit/vendor/mh/handover_ack_flag.py b/pcapkit/vendor/mh/handover_ack_flag.py index ca3b8b790e..0b0e5aae46 100644 --- a/pcapkit/vendor/mh/handover_ack_flag.py +++ b/pcapkit/vendor/mh/handover_ack_flag.py @@ -104,7 +104,7 @@ def process(self, data: 'list[str]') -> 'list[str]': # type: ignore[override] data: CSV data. Returns: - Enumeration fields and missing fields. + Enumeration fields. """ reader = csv.reader(data) diff --git a/pcapkit/vendor/mh/handover_initiate_flag.py b/pcapkit/vendor/mh/handover_initiate_flag.py index 874471bdf4..6ec9c0cd0f 100644 --- a/pcapkit/vendor/mh/handover_initiate_flag.py +++ b/pcapkit/vendor/mh/handover_initiate_flag.py @@ -104,7 +104,7 @@ def process(self, data: 'list[str]') -> 'list[str]': # type: ignore[override] data: CSV data. Returns: - Enumeration fields and missing fields. + Enumeration fields. """ reader = csv.reader(data) diff --git a/pcapkit/vendor/ospf/__init__.py b/pcapkit/vendor/ospf/__init__.py index 4b91c01bde..bb045ee7ad 100644 --- a/pcapkit/vendor/ospf/__init__.py +++ b/pcapkit/vendor/ospf/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # pylint: disable=unused-import """:class:`~pcapkit.protocols.application.ospf.OSPF` Vendor Crawlers -================================================================ +=================================================================== .. module:: pcapkit.vendor.ospf diff --git a/pcapkit/vendor/pcapng/__init__.py b/pcapkit/vendor/pcapng/__init__.py index 020a12132c..7f768232bd 100644 --- a/pcapkit/vendor/pcapng/__init__.py +++ b/pcapkit/vendor/pcapng/__init__.py @@ -30,7 +30,7 @@ .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-standardized-block-type-cod .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-options -.. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-enhanced-packet-block-flags +.. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-enhanced-packet-block-optio .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-enhanced-packet-block .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-name-resolution-block .. [*] https://www.ietf.org/archive/id/draft-tuexen-opsawg-pcapng-03.html#name-decryption-secrets-block diff --git a/pcapkit/vendor/pcapng/tls_key_label.py b/pcapkit/vendor/pcapng/tls_key_label.py index e6813e513b..008c8dfb01 100644 --- a/pcapkit/vendor/pcapng/tls_key_label.py +++ b/pcapkit/vendor/pcapng/tls_key_label.py @@ -123,10 +123,10 @@ def process(self, data: 'list[str]') -> 'tuple[list[str], list[str]]': Returns: Enumeration fields and missing fields. ``RSA`` is prepended by hand -- see :data:`RSA_COMMENT` -- since it has no row in the - registry itself. The second element is always empty: this - registry does not mint an ``_missing_`` (see - :class:`pcapkit.const.pcapng.tls_key_label.TLSKeyLabel`'s own - docstring for why), so there is nothing to render there. + registry itself. The second element is always empty: the + generated :class:`pcapkit.const.pcapng.tls_key_label.TLSKeyLabel` + has no ``_missing_`` -- its constructor refuses every value no + member carries -- so there is nothing to render there. """ enum = [ diff --git a/pcapkit/vendor/reg/apptype/apptype.py b/pcapkit/vendor/reg/apptype/apptype.py index 99b69345d1..dcec05a057 100644 --- a/pcapkit/vendor/reg/apptype/apptype.py +++ b/pcapkit/vendor/reg/apptype/apptype.py @@ -688,7 +688,8 @@ def _sanitize_identifier(cls, name: 'str') -> 'str': collapsed = '_'.join(stripped.split()) replaced = re.sub(r'\\W', '_', collapsed) identifier = '_'.join(filter(None, replaced.split('_'))) - # NOTE: matches process()'s own keyword guard below -- a name that + # NOTE: matches the keyword guard AppType.process applies at generation + # time in pcapkit.vendor.reg.apptype.apptype -- a name that # sanitises to a reserved word is not usable as an attribute as is, # and a trailing underscore is the same fix the generator already # applies to a statically declared member with the same problem. @@ -1014,8 +1015,9 @@ class Record(Info): """One registry entry, as grouped by :meth:`AppType.records`. IANA's CSV carries one row per ``(service, port, transport)`` triple, so a - service on both TCP and UDP is two rows that become one member. This is what - they are merged into. + service on both TCP and UDP is two rows that become one entry, which each of + those transports' registries then renders as a member of its own. This is + what they are merged into. Every field a merge has to grow is a container, appended to in place, because :class:`~pcapkit.corekit.infoclass.Info` refuses attribute assignment. That is @@ -1024,7 +1026,8 @@ class Record(Info): """ - #: Service name, as IANA spells it. + #: Service name, lower-cased, or one derived from the description where + #: IANA names none. svc: 'str' #: Port number as text, or ``'-1'`` where IANA assigned none. port: 'str' diff --git a/pcapkit/vendor/reg/ethertype.py b/pcapkit/vendor/reg/ethertype.py index ffe19b8be8..62a9b6e309 100644 --- a/pcapkit/vendor/reg/ethertype.py +++ b/pcapkit/vendor/reg/ethertype.py @@ -35,13 +35,10 @@ class EtherType(Vendor): #: Row labels that the historical Neil Sembower list itself marks as #: carrying no real assignment -- a company holding the block but naming #: nothing (``DEC Unassigned``), or a range the list says is dead/invalid - #: outright -- rather than a proprietary protocol's real name. The owner's - #: first ruling on :issue:`775`/:issue:`841` held these out as the only rows to - #: resolve to - #: :meth:`~pcapkit.corekit.enum.EnumRegistry._unregistered_member`, on the - #: theory that a proprietary protocol's company name IS - #: the final concrete name for every other row. :issue:`775` settled on - #: resolving every row alike, so this set does not decide *whether* a + #: outright -- rather than a proprietary protocol's real name. Every range + #: row resolves alike, through + #: :meth:`~pcapkit.corekit.enum.EnumRegistry._unregistered_member` + #: (:issue:`775`, :issue:`841`), so this set does not decide *whether* a #: row registers -- only *how its name is spelled*: these keep the #: bare label with no hex suffix, since the label itself already says #: nothing was assigned, while every other row keeps a hex-suffixed diff --git a/pcapkit/vendor/tcp/checksum.py b/pcapkit/vendor/tcp/checksum.py index 21b1ba7ede..fdfc134ce9 100644 --- a/pcapkit/vendor/tcp/checksum.py +++ b/pcapkit/vendor/tcp/checksum.py @@ -57,7 +57,7 @@ def count(self, data: 'dict[int, str]') -> 'Counter[str]': # type: ignore[overr return collections.Counter(map(self.safe_name, data.values())) def process(self, data: 'dict[int, str]') -> 'tuple[list[str], list[str]]': # type: ignore[override] - """Process CSV data. + """Process registry data. Args: data: Registry data.