Constant Enumerations

This module contains all constant enumerations of pcapkit, which are automatically generated from the pcapkit.vendor module.

Unrecognised Values

Every enumeration below departs from enum in one deliberate way, and it is the behaviour to know about before using any of them: looking one up by a value the registry does not define does not raise. Each class overrides _missing_ so that a value inside the registry’s valid range is minted into a new member on the fly – via aenum.extend_enum, named for the unassigned or reserved band it falls in – and returned. Only a value outside that range, or of the wrong type, raises ValueError.

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 closed set: the identity of a minted member is stable for the life of the process, but it does not exist until something asks for it.

The mechanism is uniform because it is generated – see pcapkit.vendor.default, whose template emits the _missing_ override for every registry – while the valid range and the names of the unassigned bands are per-registry, taken from that registry’s own IANA data. The individual overrides are therefore not documented per class.

See also

Registry Management covers the other half of extending a registry: once a code exists, registering a parser class, schema or engine against it.

Protocol Numbers

Miscellanous

Internet Layer

Transport Layer

Application Layer