Repository navigation
fix(const): answer IANA's transport-less port spans with the registry's transport (#2048) - #2052
Conversation
1da668b to
c8a587b
Compare
|
Sonnet cross-review at
|
c8a587b to
30b14e7
Compare
|
Pushed The new |
|
GOOD TO GO at
The test's mocks assert that the other registry was not called, so a registration onto the wrong registry would fail it. |
|
Ordering check on |
|
Coverage: 91.54% (unit tier, Python 3.15,
Per-file detail: the |
|
no, when for those ports that are partially assigned, each protocol should then return the ranged response with the corresponding protocol. so basically, i think, in |
|
Understood. This PR goes back for rework. My plan, to confirm or correct:
Needs you: is (2) what you mean, including the registry's own transport in the answer? Or should a kept span answer |
|
i think it's (2). for example, originally also, just noticed one issue, in |
|
Recorded, two parts:
The fallback for a port in no span stays |
|
i suppose when It's only that those are genuine |
|
Recorded: the carry-forward covers genuinely |
…2048) IANA assigned 8011 on TCP and UDP only, and its CSV dropped the port from the unassigned span 8011-8014, so DCCP and SCTP answered `unknown`. Per the owner's rulings on #2052: - pcapkit/vendor/reg/apptype/apptype.py: the base crawler reads the spans of the module it replaces (AST of `AppType._missing_`) and carries an unassigned or reserved span forward, per registry, for each transport the CSV now gives the port no row and no span on. Carried branches are marked so the next regeneration carries them again; a port leaves them as IANA assigns it on each transport. Spans naming no transport answer with `cls.__transport__` instead of `TransportProtocol.undefined`. - pcapkit/const/reg/apptype/apptype.py: regenerated offline from the current CSV; the history includes the modules before 1.5.0b13 and 1.5.0b14, which restores 4930 and 8011 for DCCP and SCTP. - A port in no span still answers `unknown` with its registry's transport. - Changelog entry; CHANGELOG.md regenerated. Tests for the carry-forward, the generator's edge cases, and the committed module as a fixed point.
30b14e7 to
1ec7690
Compare
|
Rework pushed as
|
|
so like i ruled, by default |
1ec7690 to
261fd46
Compare
|
Pushed |
|
GOOD TO GO at Two small things, both being fixed in one amend:
|
261fd46 to
78f2c51
Compare
…lists nothing (#2048) Per the owner's ruling on #2052, every port in 0-65535 is `unassigned` on a transport, carrying that transport, unless IANA lists an entry for it there. IANA assigned 8011 on TCP and UDP only, so DCCP and SCTP had read `unknown`; they now read `unassigned [dccp]` / `[sctp]`. - AppType.get (template and generated module, identically): the fallback for a port `_missing_` holds no span for answers `unassigned` with the registry's own transport instead of `unknown`. Still unregistered (#860); out-of-range ports still raise. - AppType._missing_: spans naming no transport answer with `cls.__transport__` instead of `TransportProtocol.undefined`; spans naming a transport (#760) are unchanged. The generated module renders byte-identically from the template and the current IANA CSV. - PortEnumField.post_process: its miss member reads `unassigned` too. - Tests pinning `unknown` or `undefined` for AppType holes and spans move to `unassigned [<registry>]`; new rule and template-agreement tests. - Changelog entry; CHANGELOG.md regenerated.
|
Pushed |
|
Ready to merge at |
…'s transport (#2048) Per the owner's rulings on #2052, an IANA port span naming no transport answers each AppType registry with that registry's own transport rather than `TransportProtocol.undefined`, so `TCP.get(8012)` reads `unassigned [tcp]`. A port in no span keeps `get`'s `unknown` fallback, which already carried the registry's transport: IANA assigned 8011 on TCP and UDP only, so DCCP and SCTP read `unknown [dccp]` / `unknown [sctp]`. - AppType._missing_ (template and generated module, identically): spans naming no transport answer with `cls.__transport__`; spans naming a transport (#760) are unchanged. Outside its generated blocks the committed module matches the rendered template byte for byte. - AppType.get and PortEnumField: unchanged (`unknown`, registry's own transport); comments and docstrings name 8011 as the no-span case. - test_every_transport_named_span_is_claimed_by_one_registry: no span answers `undefined`; new rule and template-agreement tests. - Changelog entry; CHANGELOG.md regenerated.
78f2c51 to
990d037
Compare
|
Pushed |
|
GOOD TO GO at
|
|
Ready to merge at |
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Closes #2048. The IANA port spans that name no transport (
unassignedandreservedranges, and the few named services likex11) now answer with the asking registry's own transport, ascls.__transport__, instead ofTransportProtocol.undefined. So everyAppTypeanswer's.protois the registry it came from.unknown [<transport>]. That coversget()andPortEnumFieldalike, so for example 8011 answersunknown [dccp]/unknown [sctp].numbers.pyis untouched.unknownanswers are exactly the ports with no entry and no span.test_const_apptype_unassigned_2048_unit, the template/module agreement test and the split invariants. Onmain, the span cases fail (the 8012 and 226 ranges on all four registries).PortEnumField, dumpkit and changelog readers all pass.