The question
AppType is structurally unlike its sibling registries, and 12.3% of its members carry no port. Raised by the maintainer: should the -1 entries be discarded, and should AppType be represented the way the other registries are — a name → code-number mapping?
Measured
|
AppType |
TransType |
LinkType |
| members |
8,182 |
151 |
220 |
enum value type |
str — 'argus [-1 - undefined]' |
int |
int |
| aliases |
1,919 |
— |
— |
Of the 8,182 declarations in pcapkit/const/reg/apptype.py, 1,004 declare port -1 and 7,178 a real port. The -1 group by transport: undefined 580, tcp 300, tcp|udp 64, udp 57, dccp/tcp|sctp/tcp|udp|sctp 1 each. Examples: argus, arp, bbn-rcc-mon, bootp, br-sat-mon, cftp, chaos, clock — several read as IP-protocol names rather than TCP/UDP services.
Why it matters beyond tidiness
Open questions for whoever picks this up
- Where do the
-1 entries come from in the IANA source, and is an entry with a real transport but no port meaningful?
- Is the formatted
str value load-bearing, or incidental? TransType/LinkType prove an int value works for a registry.
- Would a name → port mapping keep
_missing_'s contract and the wire round-trip intact?
Not filed as a defect — nothing is incorrect today. Discarding registry members is a compatibility decision.
The question
AppTypeis structurally unlike its sibling registries, and 12.3% of its members carry no port. Raised by the maintainer: should the-1entries be discarded, and shouldAppTypebe represented the way the other registries are — a name → code-number mapping?Measured
AppTypeTransTypeLinkTypevaluetypestr—'argus [-1 - undefined]'intintOf the 8,182 declarations in
pcapkit/const/reg/apptype.py, 1,004 declare port-1and 7,178 a real port. The-1group by transport:undefined580,tcp300,tcp|udp64,udp57,dccp/tcp|sctp/tcp|udp|sctp1 each. Examples:argus,arp,bbn-rcc-mon,bootp,br-sat-mon,cftp,chaos,clock— several read as IP-protocol names rather than TCP/UDP services.Why it matters beyond tidiness
extend_enum's cost is linear in the target enum's current member count (measuredgetattr = members + 4). At 8,182 members everyAppTypeextension is ~40–200× a normal const enum. Dropping the-1group alone is 8,182 → 7,178.help(-1) is in that set;dict(2628),exec(512),max(6074),set(257) andsum(6551) all have real ports. fix(docs): stop AppType shadowing six builtins in cross-references #724's fix is needed either way.Open questions for whoever picks this up
-1entries come from in the IANA source, and is an entry with a real transport but no port meaningful?strvalue load-bearing, or incidental?TransType/LinkTypeprove anintvalue works for a registry._missing_'s contract and the wire round-trip intact?Not filed as a defect — nothing is incorrect today. Discarding registry members is a compatibility decision.