Skip to content

design: AppType is str-valued with 1,004 port=-1 members, unlike its int-valued sibling registries #732

Description

@JarryShaw

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

  1. Where do the -1 entries come from in the IANA source, and is an entry with a real transport but no port meaningful?
  2. Is the formatted str value load-bearing, or incidental? TransType/LinkType prove an int value works for a registry.
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    designA design or decision issue: a pattern being decided rather than a defect or a requestquestionIssues asking how something works rather than reporting a defect

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions