Registry Management¶
pcapkit.foundation.registry holds the registration functions for
pcapkit’s engines, dumpers, callbacks and protocols.
A code the shipped enumerations do not define can still be registered: most constant enumerations return a member-like object for an in-range unknown value rather than rejecting it (see Unrecognised Values), so a newly assigned number needs no regeneration.
Foundation Registries¶
Changed in version 1.5.0: NULL, the default of every class_ argument here, is now the
pcapkit.corekit.sentinels.NULL sentinel; in 1.4.x it was the
string '(null)' (#833).
Changed in version 1.7.0: Each registrar takes the one entry its classmethod takes, under that
classmethod’s parameter name, where it took module and class_, with
no shim (#2838).
Engine Registries¶
- pcapkit.foundation.registry.foundation.register_extractor_engine(name, engine)[source]¶
Register a new engine class.
The function will register the given engine class to the
pcapkit.foundation.extraction.Extractor.__engine__registry.- Parameters:
name (
str) – engine name, stored lower-casedengine (
ModuleDescriptor[Engine] |Type[Engine]) – module descriptor or anEnginesubclass (a class deriving only fromEngineBaseis refused: that is the base for pcapkit’s own engines, unless it is the enginenameshipped with, which restores it)
- Raises:
RegistryError – If
nameis not astr, orengineis refused as above.
Changed in version 1.3.0: The engine name, which was
engine, isname, with no alias.
Dumper Registries¶
- pcapkit.foundation.registry.foundation.register_dumper(format, dumper, *, ext)[source]¶
Register a new dumper class.
The function will register the given dumper class to the
pcapkit.foundation.traceflow.traceflow.TraceFlow.__output__andpcapkit.foundation.extraction.Extractor.__output__registries.- Parameters:
format (
str) – format namedumper (
ModuleDescriptor[dictdumper.dumper.Dumper] |Type[dictdumper.dumper.Dumper]) – module descriptor or aDumpersubclassext (
str) – file extension
- Return type:
See also
Changed in version 1.3.0:
extis keyword-only.Changed in version 1.7.0:
dumperis the class, wheremoduleandclass_named it (#2838).
- pcapkit.foundation.registry.foundation.register_extractor_dumper(format, dumper, *, ext)[source]¶
Register a new dumper class.
The function will register the given dumper class to the
pcapkit.foundation.extraction.Extractor.__output__registry.- Parameters:
format (
str) – format namedumper (
ModuleDescriptor[dictdumper.dumper.Dumper] |Type[dictdumper.dumper.Dumper]) – module descriptor or aDumpersubclassext (
str) – file extension
- Return type:
Changed in version 1.3.0:
extis keyword-only.Changed in version 1.7.0:
dumperis the class, wheremoduleandclass_named it (#2838).
- pcapkit.foundation.registry.foundation.register_traceflow_dumper(format, dumper, *, ext)[source]¶
Register a new dumper class.
The function will register the given dumper class to the
pcapkit.foundation.traceflow.traceflow.TraceFlow.__output__registry.- Parameters:
format (
str) – format namedumper (
ModuleDescriptor[dictdumper.dumper.Dumper] |Type[dictdumper.dumper.Dumper]) – module descriptor or aDumpersubclassext (
str) – file extension
- Return type:
Changed in version 1.3.0:
extis keyword-only.Changed in version 1.7.0:
dumperis the class, wheremoduleandclass_named it (#2838).
Callback Registries¶
- pcapkit.foundation.registry.foundation.register_reassembly_callback(protocol, callback, *, index=None)[source]¶
Register a callback function of a reassembler.
The function will register the given callback function to the
__callback_fn__list of the reassembly class registered underprotocolinpcapkit.foundation.extraction.Extractor.__reassembly__, through itsregister_callback(). It reaches DTLS and a reassembler registered withregister_extractor_reassembly()as it reaches IPv4, IPv6 and TCP.- Parameters:
protocol (
str) – name the reassembler is registered by, case-insensitively, such as'ipv4'or'dtls'callback (
Callable[[List[_DT]],None]) – callback function, which will be called when reassembled datagram is obtained, with the list of reassembled datagrams as its only argumentindex (
int|None) – index to be inserted in the callback list; by default, the callback will be appended to the end of the list
- Raises:
RegistryError – If
protocolis not astror names no registered reassembler, or ifcallbackis not callable.- Return type:
Added in version 1.7.0.
- pcapkit.foundation.registry.foundation.register_traceflow_callback(protocol, callback, *, index=None)[source]¶
Register a callback function of a flow tracer.
The function will register the given callback function to the
__callback_fn__list of the flow tracing class registered underprotocolinpcapkit.foundation.extraction.Extractor.__traceflow__, through itsregister_callback().- Parameters:
protocol (
str) – name the flow tracer is registered by, case-insensitively, such as'tcp'callback (
Callable[[_IT],None]) – callback function, which will be called when a traced flow is finalised, with the flow’s index entry as its only argumentindex (
int|None) – index to be inserted in the callback list; by default, the callback will be appended to the end of the list
- Raises:
RegistryError – If
protocolis not astror names no registered flow tracer, or ifcallbackis not callable.- Return type:
Added in version 1.7.0.
Removed in version 1.7.0: register_reassembly_ipv4_callback, register_reassembly_ipv6_callback,
register_reassembly_tcp_callback and register_traceflow_tcp_callback,
which register_reassembly_callback() and
register_traceflow_callback() replace with no alias (#2838).
Extractor Registries¶
- pcapkit.foundation.registry.foundation.register_extractor_reassembly(protocol, reassembly)[source]¶
Register a new reassembly class.
The function will register the given reassembly class to the
pcapkit.foundation.extraction.Extractor.__reassembly__registry.- Parameters:
protocol (
str) – protocol name, stored lower-casedreassembly (
ModuleDescriptor[Reassembly] |Type[Reassembly]) – module descriptor or aReassemblysubclass (a class deriving only fromReassemblyBaseis refused: that is the base for pcapkit’s own classes, unless it is the classprotocolshipped with, which restores it)
- Raises:
RegistryError – If
protocolis not astr, orreassemblyis refused as above.
Changed in version 1.7.0:
reassemblyis the class, wheremoduleandclass_named it (#2838), andprotocolis stored lower-cased, one that is not astrraisingRegistryError(#2879).
- pcapkit.foundation.registry.foundation.register_engine_reassembly(engine, protocol, adapter)[source]¶
Register a new reassembly adapter of an engine.
The function will register the given
pcapkit.toolkitadapter to theEngineBase.__reassembly__registry ofengine, which then feeds the reassembler registered underprotocolfrom its frames.- Parameters:
engine (
str|Type[EngineBase]) – engine name, as registered inpcapkit.foundation.extraction.Extractor.__engine__, or anEngineBasesubclass;PCAPandPCAPNGhave no name, so take the classprotocol (
str) – reassembly nameadapter (
ModuleDescriptor[Callable[...,Any]] |Callable[...,Any]) – module descriptor or the adapter itself
- Raises:
RegistryError – If
enginenames no registered engine, or is not anEngineBasesubclass.
Added in version 1.7.0.
- pcapkit.foundation.registry.foundation.register_extractor_traceflow(protocol, traceflow)[source]¶
Register a new flow tracing class.
The function will register the given flow tracing class to the
pcapkit.foundation.extraction.Extractor.__traceflow__registry.- Parameters:
protocol (
str) – protocol name, stored lower-casedtraceflow (
ModuleDescriptor[TraceFlow] |Type[TraceFlow]) – module descriptor or aTraceFlowsubclass (a class deriving only fromTraceFlowBaseis refused: that is the base for pcapkit’s own classes, unless it is the classprotocolshipped with, which restores it)
- Raises:
RegistryError – If
protocolis not astr, ortraceflowis refused as above.
Changed in version 1.7.0:
traceflowis the class, wheremoduleandclass_named it (#2838), andprotocolis stored lower-cased, one that is not astrraisingRegistryError(#2879).
- pcapkit.foundation.registry.foundation.register_engine_traceflow(engine, protocol, adapter)[source]¶
Register a new flow tracing adapter of an engine.
The function will register the given
pcapkit.toolkitadapter to theEngineBase.__traceflow__registry ofengine, which then feeds the flow tracer registered underprotocolfrom its frames.- Parameters:
engine (
str|Type[EngineBase]) – engine name, as registered inpcapkit.foundation.extraction.Extractor.__engine__, or anEngineBasesubclass;PCAPandPCAPNGhave no name, so take the classprotocol (
str) – flow tracing nameadapter (
ModuleDescriptor[Callable[...,Any]] |Callable[...,Any]) – module descriptor or the adapter itself
- Raises:
RegistryError – If
enginenames no registered engine, or is not anEngineBasesubclass.
Added in version 1.7.0.
Protocol Registries¶
pcapkit.foundation.registry.protocols is a package of one submodule per
layer of pcapkit.protocols, beside
protocol for the registries the
others build on. Every function below is exported by the package, and by
pcapkit.foundation.registry, as well as by its own submodule.
Changed in version 1.5.0: NULL, the default of every class_ argument here, is now the
pcapkit.corekit.sentinels.NULL sentinel; in 1.4.x it was the
string '(null)' (#833).
Changed in version 1.6.0: A package of per-layer submodules rather than a single module (#2578).
Changed in version 1.7.0: Each registrar takes the one entry its classmethod takes, under that
classmethod’s parameter name, where it took module and class_; one
taking meth refuses a pair that is not two callables (#2838).
- pcapkit.foundation.registry.protocols.protocol.register_protocol(protocol)[source]¶
Register a protocol class.
The protocol class must be a subclass of
ProtocolBase, and will be registered to the by-name registryProtocolBase.__registry__throughProtocolBase.register_protocol, replacing the entry its name holds.The registry is keyed on
protocol.__name__.upper(), which nothing makes unique: two protocol classes of the same name, such as a user’s class named after a shipped one, compete for one key. Defining the second as aProtocolsubclass keeps the first, and registering it here replaces whichever was there, and the replacement is observable through every reader of the registry, e.g.Protocol.expand_comp, which resolves a bare protocol name through it. Per #675 the overwrite is reported, matchingProtocol.registerand the other overwrite-warning registries.The guard reads “key present and incumbent is a different class” – presence alone is not enough. This registry’s key is derived from the class rather than supplied by a caller, and this function is the funnel every wrapper registrar calls –
register_tcp(),register_udp(),register_apptype(),register_linktype()and the rest all end by calling it with their class, and registering their code back undoes that call’s write (#1505). So registering one class under two codes, a supported and documented thing to do, reaches this function twice with the same class and nothing at stake; a presence-only guard would warn about an overwrite that overwrote nothing. Warning on the harmless case is not free: it teaches a caller to filterRegistryWarningwholesale, and that filter would then hide the name collision this warning exists to surface. The siblingregistermethods across the package, each keyed on a caller-suppliedcode, apply the same identity criterion (#718). A built-in’sModuleDescriptorentry is the class it names for that criterion.Making the key itself unique would resolve the collision rather than merely reporting it, but it is a registry-format change that the bare-name readers outside this module cannot absorb on their own – the registry is a documented public attribute, and its readers look a bare name up and then degrade silently on a miss rather than raising, so a re-keying would not announce itself either.
Protocol.expand_compfalls back to the name as a plain string, and theprotocolproperties onReassemblyMetaandTraceFlowMetafall back toRaw. The registry redesign of #514 keeps this key, and its thread records the shared namespace as a risk that design does not resolve, so the collision is reported here rather than fixed.- Parameters:
protocol (
Type[ProtocolBase]) – Protocol class.- Raises:
pcapkit.utilities.exceptions.RegistryError – If
protocolis not aProtocolBasesubclass.- Warns:
pcapkit.utilities.warnings.RegistryWarning– If the registry already holds a different class under this protocol’s name, i.e. the registration displaced another protocol class. Re-registering the same class under the same name is silent.
Changed in version 1.6.0: The HTTP member classes are named
HTTPv1andHTTPv2, so registering one keeps its own key and no longer displacesHTTPunder'HTTP'(#2529). The registry isProtocolBase.__registry__, written byProtocolBase.register_protocol, where it waspcapkit.protocols.__proto__(#2763).
- pcapkit.foundation.registry.protocols.protocol.register_protocol_code(protocol, code)[source]¶
Register
protocolinto the next-layer dispatch registry (or registries) named bycode.This is what backs the
codeclass keyword ofProtocolBasesubclasses; it can also be called directly to register a class that declined at class-definition time.codeis normalised into a flat sequence of targets, where each item is either:an enum member, whose type names the class(es) owning the matching
__proto__in its__proto_dest__–EtherTypetoLink,TransTypetoInternet,PayloadProtocolIdentifiertoSCTP,ARPHRDtoLinuxSLL, andLinkTypeto bothFrameandPCAPNG; ora
dictmapping an explicit destination class to a key – the only form accepted for a bareint, since e.g. a port number does not say by itself whether it meansTCPorUDP;
or an iterable of either, to register
protocolinto several registries from one call – e.g. aL2TPsubclass reachable both by its IP protocol number and by a UDP port:register_protocol_code(L2TPv3, [TransType.L2TP, {UDP: 1701}])
The explicit mapping form is accepted for any key, even one whose type could be inferred – being more explicit than required is never an error.
Note
That example names
L2TPv3, which this package does not implement, rather thanL2TPv2. It is v3 that is genuinely reachable both ways: RFC 3931 §4.1.1 puts it directly over IP on protocol 115 and §4.1.2 puts it over UDP on port 1701.L2TPv2answers on port 1701 only, and registering it atTransType.L2TPwould point the RFC 2661 parser at a v3-over-IP header – seeL2TPand GitHub issue #548 for what that produced when measured.- Parameters:
protocol (
Type[ProtocolBase]) – Protocol class to register.code (
Any) – Registration key(s); see above.
- Raises:
RegistryError – If a bare
int(or any other non-enum, non-mapping value) is given without an explicit destination, or if an enum member’s type declares no__proto_dest__– inference refuses rather than guesses; or if a key is not of the type its destination’s registry is keyed by, as its typed registrar would reject it, e.g.{Frame: TransType.ICMP}. What a registry is keyed by is read from the__proto_key__declared by the class owning it, so a destination sharing another’s registry is checked as its owner is, and one whose owner declares no pairing is not checked. Every target is checked before any is registered, so a rejectedcodeleaves every registry as it was (#2268).
Top-Level Registries¶
These are in misc with the
PCAP-NG registries below, as Frame
and PCAPNG are in
pcapkit.protocols.misc.
- pcapkit.foundation.registry.protocols.misc.register_linktype(code, protocol)[source]¶
Register a new protocol class.
The function will register the given protocol class to the following registries:
- Parameters:
protocol (
ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module descriptor or aProtocolBasesubclass
See also
- Raises:
RegistryError – If
codeis not aLinkTypemember, e.g. a member of another enum, orprotocolis not aProtocolBasesubclass.
- pcapkit.foundation.registry.protocols.misc.register_pcap(code, protocol)[source]¶
Register a new protocol class.
The function will register the given protocol class to the
pcapkit.protocols.misc.pcap.frame.protocol.Frame.__proto__registry.- Parameters:
protocol (
ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module descriptor or aProtocolBasesubclass
- Raises:
RegistryError – If
codeis not aLinkTypemember, e.g. a member of another enum, orprotocolis not aProtocolBasesubclass.
- pcapkit.foundation.registry.protocols.misc.register_pcapng(code, protocol)[source]¶
Register a new protocol class.
The function will register the given protocol class to the
pcapkit.protocols.misc.pcapng.protocol.PCAPNG.__proto__registry.- Parameters:
protocol (
ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module descriptor or aProtocolBasesubclass
- Raises:
RegistryError – If
codeis not aLinkTypemember, e.g. a member of another enum, orprotocolis not aProtocolBasesubclass.
Link Layer Registries¶
- pcapkit.foundation.registry.protocols.link.register_ethertype(code, protocol)[source]¶
Register a new protocol class.
The function will register the given protocol class to the
pcapkit.protocols.link.link.Link.__proto__registry.- Parameters:
protocol (
ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module descriptor or aProtocolBasesubclass
- Raises:
RegistryError – If
codeis not aEtherTypemember, e.g. a member of another enum, orprotocolis not aProtocolBasesubclass.
- pcapkit.foundation.registry.protocols.link.register_loopback(code, protocol)[source]¶
Register a new protocol class.
The function will register the given protocol class to the
pcapkit.protocols.link.loopback.protocol.Loopback.__proto__registry.- Parameters:
code (
int) – BSD address familyprotocol (
ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module descriptor or aProtocolBasesubclass
Important
Unlike
register_ethertype(),codeis an address family, not an EtherType:Loopbackkeeps a registry of its own.- Raises:
RegistryError – If
codeis not anint(aboolis not accepted, even though it is one), or is a member of an enum, orprotocolis not aProtocolBasesubclass.
Added in version 1.6.0.
- pcapkit.foundation.registry.protocols.link.register_arphrd(code, protocol)[source]¶
Register a new protocol class.
The function will register the given protocol class to the
pcapkit.protocols.link.linux_sll.protocol.LinuxSLL.__proto__registry, so that a Linux “cooked” capture on thatarphrd_typedispatches to it instead of readingprotocol_typeas an EtherType.- Parameters:
protocol (
ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module descriptor or aProtocolBasesubclass
- Raises:
RegistryError – If
codeis not aARPHRDmember, e.g. a member of another enum, orprotocolis not aProtocolBasesubclass.
- pcapkit.foundation.registry.protocols.link.register_frad(code, protocol)[source]¶
Register a new protocol class.
The function will register the given protocol class to the
pcapkit.protocols.link.frad.protocol.FRAD.__proto__registry.- Parameters:
code (
int) – NLPID, after resolving the0x00pad ahead of a SNAP headerprotocol (
ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module descriptor or aProtocolBasesubclass
- Raises:
RegistryError – If
codeis not anint(aboolis not accepted, even though it is one), or is a member of an enum.
- pcapkit.foundation.registry.protocols.link.register_netlink(code, protocol)[source]¶
Register a new protocol class.
The function will register the given protocol class to the
pcapkit.protocols.link.netlink.protocol.Netlink.__proto__registry.- Parameters:
code (
int) –nlmsg_typeof the dissected messageprotocol (
ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module descriptor or aProtocolBasesubclass
- Raises:
RegistryError – If
codeis not anint(aboolis not accepted, even though it is one), or is a member of an enum.
- pcapkit.foundation.registry.protocols.link.register_ppp(code, protocol)[source]¶
Register a new protocol class.
The function will register the given protocol class to the
pcapkit.protocols.link.ppp.protocol.PPP.__proto__registry.- Parameters:
protocol (
ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module descriptor or aProtocolBasesubclass
- Raises:
RegistryError – If
codeis not aProtocolmember, e.g. a member of another enum, orprotocolis not aProtocolBasesubclass.
Added in version 1.7.0.
- pcapkit.foundation.registry.protocols.link.register_ppp_control(code, meth, *, schema=None)[source]¶
Register a PPP control packet parser.
The function will register the given parser to the
pcapkit.protocols.link.ppp.protocol.PPP.__control__registry. A frame of that protocol number is read as a control packet at header level, rather than dispatched as a next layer, once the schema registry holds a layout for it.- Parameters:
meth (
str|tuple[Callable[[Protocol,ControlPacket],ControlPacket],Callable[[Protocol,ControlPacket|Mapping[str,Any]],ControlPacket]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the control packet. A name names the_read_control_*and_make_control_*methods, and has to name an existing_read_control_*one.schema (
Type[ControlPacket] |None) – Layout the packets are read with, opening with Code, Identifier and Length. It should be a subclass ofpcapkit.protocols.link.ppp.schema.ControlPacket.
- Raises:
RegistryError – If
codeis not aProtocolmember,methis a name with no matching_read_control_*method or neither a name nor a pair of two callables, orschemais not aControlPacketsubclass.- Return type:
Added in version 1.7.0.
- pcapkit.foundation.registry.protocols.link.register_radiotap(code, protocol)[source]¶
Register a new protocol class.
The function will register the given protocol class to the
pcapkit.protocols.link.radiotap.protocol.Radiotap.__proto__registry, keyed by the link type of the frame a radiotap header precedes. Any link type is accepted, butRadiotap.readconsultsLinkType.IEEE802_11alone: registering that key replaces the 802.11 dissector, and an entry under any other key is stored and never reached.- Parameters:
protocol (
ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module descriptor or aProtocolBasesubclass
- Raises:
RegistryError – If
codeis not aLinkTypemember, e.g. a member of another enum, orprotocolis not aProtocolBasesubclass.
- pcapkit.foundation.registry.protocols.link.register_radiotap_field(code, meth, *, schema=None)[source]¶
Register a radiotap field parser.
The function will register the given field parser to the
pcapkit.protocols.link.radiotap.protocol.Radiotap.__field__registry. A field type is decoded once both it and the schema registry hold an entry for it. A presence bit 28 to 30 follows rules of its own, as does a vendor namespace TLV item, so an entry for one is stored and not reached there; a type from 32 on is reached only as a TLV item.- Parameters:
meth (
str|tuple[Callable[[FieldType,RadiotapField],RadiotapField],Callable[[FieldType,RadiotapField|Mapping[str,Any]],RadiotapField]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the field. A name names the_read_field_*and_make_field_*methods, and has to name an existing_read_field_*one.schema (
Type[RadiotapField] |None) –Schemaclass for the field, whose fields are its subfields and whose__align__is its alignment. It should be a subclass ofpcapkit.protocols.link.radiotap.schema.RadiotapField.
- Raises:
RegistryError – If
codeis not aFieldTypemember, e.g. a member of another enum, ormethis a name with no matching_read_field_*method, or neither a name nor a pair of two callables.- Return type:
Added in version 1.6.0.
Internet Layer Registries¶
- pcapkit.foundation.registry.protocols.internet.register_transtype(code, protocol)[source]¶
Register a new protocol class.
The function will register the given protocol class to the
pcapkit.protocols.internet.internet.Internet.__proto__registry.- Parameters:
protocol (
ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module descriptor or aProtocolBasesubclass
- Raises:
RegistryError – If
codeis not aTransTypemember, e.g. a member of another enum, orprotocolis not aProtocolBasesubclass.
- pcapkit.foundation.registry.protocols.internet.register_ipx(code, protocol)[source]¶
Register a new protocol class.
The function will register the given protocol class to the
pcapkit.protocols.internet.ipx.protocol.IPX.__proto__registry.- Parameters:
protocol (
ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module descriptor or aProtocolBasesubclass
Important
Unlike
register_transtype(),codeis an IPX Packet Type, not an IP protocol number:IPXkeeps a registry of its own (#2169).- Raises:
RegistryError – If
codeis neither anint(aboolis not accepted, even though it is one) nor aPacketmember, e.g. aTransTypemember, orprotocolis not aProtocolBasesubclass.
Added in version 1.6.0.
- pcapkit.foundation.registry.protocols.internet.register_ipv4_option(code, meth, *, schema=None)[source]¶
Register an option parser.
The function will register the given option parser to the
pcapkit.protocols.internet.ipv4.protocol.IPv4.__option__registry.- Parameters:
code (
OptionNumber) –IPv4option code as inOptionNumber.meth (
str|tuple[Callable[[Option,OrderedMultiDict[OptionNumber,Option]],Option],Callable[[OptionNumber,Option|None,Any],Option]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the option. A name names the_read_opt_*and_make_opt_*methods, and has to name an existing_read_opt_*one.schema (
Type[Option] |None) –Schemaclass for the option. It should be a subclass ofpcapkit.protocols.internet.ipv4.schema.Option.
- Raises:
RegistryError – If
codeis not aOptionNumbermember, e.g. a member of another enum, ormethis a name with no matching_read_opt_*method, or neither a name nor a pair of two callables.- Return type:
- pcapkit.foundation.registry.protocols.internet.register_icmp_type(code, meth)[source]¶
Register a message body parser.
The function will register the given message body parser to the
__type__registry whencodeis an ICMPv4 type, or to__type__when it is an ICMPv6 type. Each registry is written by that class’s ownregister_type()classmethod.- Parameters:
- Raises:
RegistryError – If
codeis not a member of either ICMP type enum, ormethis a name with no matching_read_data_type_*method, or neither a name nor a pair of two callables.
- pcapkit.foundation.registry.protocols.internet.register_hip_parameter(code, meth, *, schema=None)[source]¶
Register a parameter parser.
The function will register the given parameter parser to the
pcapkit.protocols.internet.hip.protocol.HIP.__parameter__registry.- Parameters:
meth (
str|tuple[Callable[[Parameter,int,OrderedMultiDict[Parameter,Parameter]],Parameter],Callable[[Parameter,Parameter|None,int,Any],Parameter]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the parameter. A name names the_read_param_*and_make_param_*methods, and has to name an existing_read_param_*one.schema (
Type[Parameter] |None) –Schemaclass for the parameter. It should be a subclass ofpcapkit.protocols.internet.hip.schema.Parameter.
- Raises:
RegistryError – If
codeis not aParametermember, e.g. a member of another enum, ormethis a name with no matching_read_param_*method, or neither a name nor a pair of two callables.- Return type:
- pcapkit.foundation.registry.protocols.internet.register_hopopt_option(code, meth, *, schema=None)[source]¶
Register an option parser.
The function will register the given option parser to the
pcapkit.protocols.internet.hopopt.protocol.HOPOPT.__option__registry.- Parameters:
meth (
str|tuple[Callable[[Option,OrderedMultiDict[Option,Option]],Option],Callable[[Option,Option|None,Any],Option]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the option. A name names the_read_opt_*and_make_opt_*methods, and has to name an existing_read_opt_*one.schema (
Type[Option] |None) –Schemaclass for the option. It should be a subclass ofpcapkit.protocols.internet.hopopt.schema.Option.
- Raises:
RegistryError – If
codeis not aOptionmember, e.g. a member of another enum, ormethis a name with no matching_read_opt_*method, or neither a name nor a pair of two callables.- Return type:
- pcapkit.foundation.registry.protocols.internet.register_ipv6_opts_option(code, meth, *, schema=None)[source]¶
Register an option parser.
The function will register the given option parser to the
pcapkit.protocols.internet.ipv6_opts.protocol.IPv6_Opts.__option__registry.- Parameters:
meth (
str|tuple[Callable[[Option,OrderedMultiDict[Option,Option]],Option],Callable[[Option,Option|None,Any],Option]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the option. A name names the_read_opt_*and_make_opt_*methods, and has to name an existing_read_opt_*one.schema (
Type[Option] |None) –Schemaclass for the option. It should be a subclass ofpcapkit.protocols.internet.ipv6_opts.schema.Option.
- Raises:
RegistryError – If
codeis not aOptionmember, e.g. a member of another enum, ormethis a name with no matching_read_opt_*method, or neither a name nor a pair of two callables.- Return type:
- pcapkit.foundation.registry.protocols.internet.register_ipv6_route_routing(code, meth, *, schema=None)[source]¶
Register a routing data parser.
The function will register the given routing data parser to the
pcapkit.protocols.internet.ipv6_route.protocol.IPv6_Route.__routing__registry.- Parameters:
code (
Routing) –IPv6-Routedata type code as inRouting.meth (
str|tuple[Callable[[RoutingType,IPv6_Route],IPv6_Route],Callable[[Routing,IPv6_Route|None,IPv6Address|None,Any],RoutingType]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the data. A name names the_read_data_type_*and_make_data_type_*methods, and has to name an existing_read_data_type_*one.schema (
Type[RoutingType] |None) –Schemaclass for the routing data. It should be a subclass ofpcapkit.protocols.internet.ipv6_route.schema.RoutingType.
- Raises:
RegistryError – If
codeis not aRoutingmember, e.g. a member of another enum, ormethis a name with no matching_read_data_type_*method, or neither a name nor a pair of two callables.- Return type:
- pcapkit.foundation.registry.protocols.internet.register_mh_message(code, meth, *, schema=None)[source]¶
Register an MH message type parser.
The function will register the given message type parser to the
pcapkit.protocols.internet.mh.protocol.MH.__message__registry.- Parameters:
meth (
str|tuple[Callable[[Packet,MH],MH],Callable[[MH|None,Any],Packet]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the data. A name names the_read_msg_*and_make_msg_*methods, and has to name an existing_read_msg_*one.schema (
Type[Packet] |None) –Schemaclass for the message type. It should be a subclass ofpcapkit.protocols.internet.mh.schema.Packet.
- Raises:
RegistryError – If
codeis not aPacketmember, e.g. a member of another enum, ormethis a name with no matching_read_msg_*method, or neither a name nor a pair of two callables.- Return type:
- pcapkit.foundation.registry.protocols.internet.register_mh_option(code, meth, *, schema=None)[source]¶
Register an MH option parser.
The function will register the given option parser to the
pcapkit.protocols.internet.mh.protocol.MH.__option__registry.- Parameters:
meth (
str|tuple[Callable[[Option,OrderedMultiDict[Option,Option]],Option],Callable[[Option,Option|None,Any],Option]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the data. A name names the_read_opt_*and_make_opt_*methods, and has to name an existing_read_opt_*one.schema (
Type[Option] |None) –Schemaclass for the option. It should be a subclass ofpcapkit.protocols.internet.mh.schema.Option.
- Raises:
RegistryError – If
codeis not aOptionmember, e.g. a member of another enum, ormethis a name with no matching_read_opt_*method, or neither a name nor a pair of two callables.- Return type:
- pcapkit.foundation.registry.protocols.internet.register_mh_extension(code, meth, *, schema=None)[source]¶
Register a CGA extension parser.
The function will register the given CGA extension parser to the
pcapkit.protocols.internet.mh.protocol.MH.__extension__registry.- Parameters:
code (
CGAExtension) –MHCGA extension code as inCGAExtension.meth (
str|tuple[Callable[[CGAExtension,OrderedMultiDict[CGAExtension,CGAExtension]],CGAExtension],Callable[[CGAExtension,CGAExtension|None,Any],CGAExtension]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the data. A name names the_read_ext_*and_make_ext_*methods, and has to name an existing_read_ext_*one.schema (
Type[CGAExtension] |None) –Schemaclass for the CGA extension. It should be a subclass ofpcapkit.protocols.internet.mh.schema.CGAExtension.
- Raises:
RegistryError – If
codeis not aCGAExtensionmember, e.g. a member of another enum, ormethis a name with no matching_read_ext_*method, or neither a name nor a pair of two callables.- Return type:
Changed in version 1.5.0:
schemais keyword-only, as in the otherregister_*functions that take one (#516).
Transport Layer Registries¶
- pcapkit.foundation.registry.protocols.transport.register_apptype(code, protocol, *, transport=None)[source]¶
Register a new protocol class.
The function will register the given protocol class to the
pcapkit.protocols.transport.tcp.protocol.TCP.__proto__and/orpcapkit.protocols.transport.udp.protocol.UDP.__proto__registry.- Parameters:
protocol (
ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module descriptor or aProtocolBasesubclasstransport (
TransportProtocol|str|Sequence[TransportProtocol|str] |None) – transport protocol to registercodeunder, or alistortupleof several, each aTransportProtocolmember or that member’sname(case-insensitively, e.g.'tcp','TCP'or'Tcp'alike); the two forms are coerced to the same member and behave identically, including which error they raise. Where none is given andcodeis anAppTypemember, the member’s ownprotois used, which names exactly the registry the member lives in. A bareintcarries no such default and so requires at least one.
- Raises:
pcapkit.utilities.exceptions.RegistryError – If
codeis neither anint(aboolis not accepted, even though it is one) nor anAppTypemember, e.g. a member of another enum; if no transport protocol is given for a bareint; if one of those given (member or name) names no port-keyed registry; or if astrmatches noTransportProtocolmember’sname. A composite such astcp | udp, or its string form'tcp|udp', names two and is refused for the same reason: each item names one transport protocol.- Return type:
Important
SCTPis deliberately not one of the registries this writes to, so namingsctphere is an error rather than a no-op. Its__proto__registry is keyed by the DATA or I-DATA chunk’s payload protocol identifier rather than by port number, so writing a port number into it would dispatch on a number from the wrong registry. Usepcapkit.foundation.registry.protocols.transport.register_sctp()instead.See also
Removed in version 1.3.1:
register_port, which this replaces with no alias.Changed in version 1.5.0: The keyword-only
protois replaced by*transport, one transport protocol per argument, with no alias (#806).Changed in version 1.7.0:
protocolreplacesmoduleandclass_, and the keyword-onlytransportreplaces*transport, with no shim (#2838).
- pcapkit.foundation.registry.protocols.transport.register_tcp(code, protocol)[source]¶
Register a new protocol class.
The function will register the given protocol class to the
pcapkit.protocols.transport.tcp.protocol.TCP.__proto__registry.- Parameters:
protocol (
ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module descriptor or aProtocolBasesubclass
- Raises:
RegistryError – If
codeis neither anint(aboolis not accepted, even though it is one) nor anAppTypemember, e.g. a member of another enum.
- pcapkit.foundation.registry.protocols.transport.register_tcp_option(code, meth, *, schema=None)[source]¶
Register an option parser.
The function will register the given option parser to the
pcapkit.protocols.transport.tcp.protocol.TCP.__option__registry.- Parameters:
meth (
str|tuple[Callable[[Option,OrderedMultiDict[Option,Option]],Option],Callable[[Option,Option|None,Any],Option]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the option. A name names the_read_mode_*and_make_mode_*methods, and has to name an existing_read_mode_*one.schema (
Type[Option] |None) –Schemaclass for the option. It should be a subclass ofpcapkit.protocols.transport.tcp.schema.Option.
- Raises:
RegistryError – If
codeis not aOptionmember, e.g. a member of another enum, ormethis a name with no matching_read_mode_*method, or neither a name nor a pair of two callables.- Return type:
- pcapkit.foundation.registry.protocols.transport.register_tcp_mp_option(code, meth, *, schema=None)[source]¶
Register an MPTCP option parser.
The function will register the given option parser to the
pcapkit.protocols.transport.tcp.protocol.TCP.__mp_option__registry.- Parameters:
code (
MPTCPOption) – MultipathTCPoption code as inMPTCPOption.meth (
str|tuple[Callable[[MPTCP,OrderedMultiDict[Option,Option]],MPTCP],Callable[[MPTCPOption,MPTCP|None,Any],MPTCP]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the option. A name names the_read_mptcp_*and_make_mptcp_*methods, and has to name an existing_read_mptcp_*one.schema (
Type[MPTCP] |None) –Schemaclass for the option. It should be a subclass ofpcapkit.protocols.transport.tcp.schema.MPTCP.
- Raises:
RegistryError – If
codeis not aMPTCPOptionmember, e.g. a member of another enum, ormethis a name with no matching_read_mptcp_*method, or neither a name nor a pair of two callables.- Return type:
- pcapkit.foundation.registry.protocols.transport.register_udp(code, protocol)[source]¶
Register a new protocol class.
The function will register the given protocol class to the
pcapkit.protocols.transport.udp.protocol.UDP.__proto__registry.- Parameters:
protocol (
ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module descriptor or aProtocolBasesubclass
- Raises:
RegistryError – If
codeis neither anint(aboolis not accepted, even though it is one) nor anAppTypemember, e.g. a member of another enum.
- pcapkit.foundation.registry.protocols.transport.register_sctp(code, protocol)[source]¶
Register a new protocol class.
The function will register the given protocol class to the
pcapkit.protocols.transport.sctp.protocol.SCTP.__proto__registry.- Parameters:
code (
int|PayloadProtocolIdentifier) – payload protocol identifier (PPID), as inPayloadProtocolIdentifierprotocol (
ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module descriptor or aProtocolBasesubclass
Important
Unlike
register_tcp()andregister_udp(),codeis a payload protocol identifier taken from the DATA or I-DATA chunk, not a port number: SCTP names its upper layer per chunk rather than per association. See RFC 9260 Section 3.3.1 and RFC 8260 Section 2.1.- Raises:
RegistryError – If
codeis neither anint(aboolis not accepted, even though it is one) nor aPayloadProtocolIdentifiermember, e.g. a member of theSCTPport enum.
- pcapkit.foundation.registry.protocols.transport.register_sctp_chunk(code, meth, *, schema=None)[source]¶
Register a chunk parser.
The function will register the given chunk parser to the
pcapkit.protocols.transport.sctp.protocol.SCTP.__chunk__registry.- Parameters:
meth (
str|tuple[Callable[[Chunk,OrderedMultiDict[Chunk,Chunk]],Chunk],Callable[[Chunk,Chunk|None,Any],Chunk]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the chunk. A name names the_read_chunk_*and_make_chunk_*methods, and has to name an existing_read_chunk_*one.schema (
Type[Chunk] |None) –Schemaclass for the chunk. It should be a subclass ofpcapkit.protocols.transport.sctp.schema.Chunk.
- Raises:
RegistryError – If
codeis not aChunkmember, e.g. a member of another enum, ormethis a name with no matching_read_chunk_*method, or neither a name nor a pair of two callables.- Return type:
Added in version 1.6.0.
- pcapkit.foundation.registry.protocols.transport.register_sctp_parameter(code, meth, *, schema=None)[source]¶
Register a chunk parameter parser.
The function will register the given chunk parameter parser to the
pcapkit.protocols.transport.sctp.protocol.SCTP.__parameter__registry.- Parameters:
code (
Parameter) –SCTPchunk parameter type as inParameter.meth (
str|tuple[Callable[[Parameter,OrderedMultiDict[Parameter,Parameter]],Parameter],Callable[[Parameter,Parameter|None,Any],Parameter]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the parameter. A name names the_read_param_*and_make_param_*methods, and has to name an existing_read_param_*one.schema (
Type[Parameter] |None) –Schemaclass for the parameter. It should be a subclass ofpcapkit.protocols.transport.sctp.schema.Parameter.
- Raises:
RegistryError – If
codeis not aParametermember, e.g. a member of another enum, ormethis a name with no matching_read_param_*method, or neither a name nor a pair of two callables.- Return type:
Added in version 1.6.0.
- pcapkit.foundation.registry.protocols.transport.register_sctp_cause(code, meth, *, schema=None)[source]¶
Register an error cause parser.
The function will register the given error cause parser to the
pcapkit.protocols.transport.sctp.protocol.SCTP.__cause__registry.- Parameters:
meth (
str|tuple[Callable[[ErrorCause,OrderedMultiDict[CauseCode,ErrorCause]],ErrorCause],Callable[[CauseCode,ErrorCause|None,Any],ErrorCause]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the cause. A name names the_read_cause_*and_make_cause_*methods, and has to name an existing_read_cause_*one.schema (
Type[ErrorCause] |None) –Schemaclass for the cause. It should be a subclass ofpcapkit.protocols.transport.sctp.schema.ErrorCause.
- Raises:
RegistryError – If
codeis not aCauseCodemember, e.g. a member of another enum, ormethis a name with no matching_read_cause_*method, or neither a name nor a pair of two callables.- Return type:
Added in version 1.6.0.
- pcapkit.foundation.registry.protocols.transport.register_dccp(code, protocol)[source]¶
Register a new protocol class.
The function will register the given protocol class to the
pcapkit.protocols.transport.dccp.protocol.DCCP.__proto__registry.- Parameters:
protocol (
ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module descriptor or aProtocolBasesubclass
- Raises:
RegistryError – If
codeis neither anint(aboolis not accepted, even though it is one) nor anAppTypemember, e.g. a member of another enum.
Added in version 1.6.0.
- pcapkit.foundation.registry.protocols.transport.register_dccp_option(code, meth, *, schema=None)[source]¶
Register an option parser.
The function will register the given option parser to the
pcapkit.protocols.transport.dccp.protocol.DCCP.__option__registry.- Parameters:
meth (
str|tuple[Callable[[Option,OrderedMultiDict[Option,Option]],Option],Callable[[Option,Option|None,Any],Option]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the option. A name names the_read_opt_*and_make_opt_*methods, and has to name an existing_read_opt_*one.schema (
Type[Option] |None) –Schemaclass for the option. It should be a subclass ofpcapkit.protocols.transport.dccp.schema.Option.
- Raises:
RegistryError – If
codeis not aOptionmember, e.g. a member of another enum, ormethis a name with no matching_read_opt_*method, or neither a name nor a pair of two callables.- Return type:
Added in version 1.6.0.
Application Layer Registries¶
- pcapkit.foundation.registry.protocols.application.register_dns_rdata(code, meth)[source]¶
Register an RDATA parser.
The function will register the given RDATA parser to the
pcapkit.protocols.application.dns.protocol.DNS.__rdata__registry.- Parameters:
meth (
str|tuple[Callable[[RRType,bytes,bytes,int],RData|bytes],Callable[[RRType, Mapping[str, Any],int,dict[tuple[bytes,...],int] |None],bytes]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the RDATA. A name names the_read_rdata_*and_make_rdata_*methods, and has to name an existing_read_rdata_*one.
- Raises:
RegistryError – If
codeis not anRRTypemember, e.g. a member of another enum, ormethis a name with no matching_read_rdata_*method, or neither a name nor a pair of two callables.
Added in version 1.7.0.
- pcapkit.foundation.registry.protocols.application.register_dns_option(code, meth)[source]¶
Register an EDNS(0) option parser.
The function will register the given option parser to the
pcapkit.protocols.application.dns.protocol.DNS.__option__registry.- Parameters:
meth (
str|tuple[Callable[[Option,bytes],OptionData|bytes],Callable[[Option, Mapping[str, Any]],bytes]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the OPTION-DATA. A name names the_read_opt_*and_make_opt_*methods, and has to name an existing_read_opt_*one.
- Raises:
RegistryError – If
codeis not anOptionmember, e.g. a member of another enum, ormethis a name with no matching_read_opt_*method, or neither a name nor a pair of two callables.
Added in version 1.7.0.
- pcapkit.foundation.registry.protocols.application.register_http_frame(code, meth, *, schema=None)[source]¶
Register a frame parser.
The function will register the given frame parser to the
pcapkit.protocols.application.httpv2.protocol.HTTPv2.__frame__registry.- Parameters:
meth (
str|tuple[Callable[[FrameType,HTTPv2],HTTPv2],Callable[[HTTPv2|None,Any],Tuple[FrameType,Flags]]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the frame. A name names the_read_http_*and_make_http_*methods, and has to name an existing_read_http_*one.schema (
Type[FrameType] |None) –Schemaclass for the frame. It should be a subclass ofpcapkit.protocols.application.httpv2.schema.FrameType.
- Raises:
RegistryError – If
codeis not aFramemember, e.g. a member of another enum, ormethis a name with no matching_read_http_*method, or neither a name nor a pair of two callables.- Return type:
- pcapkit.foundation.registry.protocols.application.register_tls_extension(code, meth, *, schema=None)[source]¶
Register an extension parser.
The function will register the given extension parser to the
pcapkit.protocols.application.ssl.protocol.SSL.__extension__registry, whichTLSandDTLSshare.- Parameters:
code (
ExtensionType) – TLS/DTLS extension type as inExtensionType.meth (
str|tuple[Callable[[ExtensionType,Extension,HandshakeType],ExtensionData|bytes],Callable[[ExtensionType,ExtensionData|None,HandshakeType,Any],Extension]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct theextension_data. A name names the_read_ext_*and_make_ext_*methods, and has to name an existing_read_ext_*one.schema (
Type[Extension] |None) –Schemaclass for theextension_data. It should be a subclass ofpcapkit.protocols.application.ssl.schema.Extension.
- Raises:
RegistryError – If
codeis not anExtensionTypemember, e.g. a member of another enum, ormethis a name with no matching_read_ext_*method, or neither a name nor a pair of two callables.- Return type:
Added in version 1.6.0.
Changed in version 1.7.0: Takes
schema. The parser is handed theextension_dataunpacked by that schema, and the constructor returns one, rather than octets (#2833).
Miscellaneous Protocol Registries¶
- pcapkit.foundation.registry.protocols.misc.register_pcapng_block(code, meth, *, schema=None)[source]¶
Register a block parser.
The function will register the given block parser to the
pcapkit.protocols.misc.pcapng.protocol.PCAPNG.__block__registry.- Parameters:
meth (
str|tuple[Callable[[BlockType,PCAPNG],PCAPNG],Callable[[PCAPNG|None,Any],BlockType]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the block. A name names the_read_block_*and_make_block_*methods, and has to name an existing_read_block_*one.schema (
Type[BlockType] |None) –Schemaclass for the block. It should be a subclass ofpcapkit.protocols.misc.pcapng.schema.BlockType.
- Raises:
RegistryError – If
codeis not aBlockTypemember, e.g. a member of another enum, ormethis a name with no matching_read_block_*method, or neither a name nor a pair of two callables.- Return type:
- pcapkit.foundation.registry.protocols.misc.register_pcapng_option(code, meth, *, schema=None)[source]¶
Register an option parser.
The function will register the given option parser to the
pcapkit.protocols.misc.pcapng.protocol.PCAPNG.__option__registry.- Parameters:
code (
OptionType) –PCAPNGoption type code as inOptionType.meth (
str|tuple[Callable[[Option,OrderedMultiDict[OptionType,Option]],Option],Callable[[OptionType,Option|None,Any],Option]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the option. A name names the_read_option_*and_make_option_*methods, and has to name an existing_read_option_*one.schema (
Type[Option] |None) –Schemaclass for the option. It should be a subclass ofpcapkit.protocols.misc.pcapng.schema.Option.
- Raises:
RegistryError – If
codeis not aOptionTypemember, e.g. a member of another enum, ormethis a name with no matching_read_option_*method, or neither a name nor a pair of two callables.- Return type:
- pcapkit.foundation.registry.protocols.misc.register_pcapng_record(code, meth, *, schema=None)[source]¶
Register a name resolution record parser.
The function will register the given name resolution record parser to the
pcapkit.protocols.misc.pcapng.protocol.PCAPNG.__record__registry.- Parameters:
code (
RecordType) –PCAPNGname resolution record type code as inRecordType.meth (
str|tuple[Callable[[NameResolutionRecord,OrderedMultiDict[RecordType,NameResolutionRecord]],NameResolutionRecord],Callable[[RecordType,NameResolutionRecord|None,Any],NameResolutionRecord]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the name resolution record. A name names the_read_record_*and_make_record_*methods, and has to name an existing_read_record_*one.schema (
Type[NameResolutionRecord] |None) –Schemaclass for the name resolution record. It should be a subclass ofpcapkit.protocols.misc.pcapng.schema.NameResolutionRecord.
- Raises:
RegistryError – If
codeis not aRecordTypemember, e.g. a member of another enum, ormethis a name with no matching_read_record_*method, or neither a name nor a pair of two callables.- Return type:
- pcapkit.foundation.registry.protocols.misc.register_pcapng_secrets(code, meth, *, schema=None)[source]¶
Register a decryption secrets parser.
The function will register the given decryption secrets parser to the
pcapkit.protocols.misc.pcapng.protocol.PCAPNG.__secrets__registry.- Parameters:
code (
SecretsType) –PCAPNGdecryption secrets type code as inSecretsType.meth (
str|tuple[Callable[[DSBSecrets,DecryptionSecretsBlock],DSBSecrets],Callable[[SecretsType,DSBSecrets|None,Any],DSBSecrets]]) – Method name, or a(parser, constructor)pair of callables, to parse and construct the decryption secrets. A name names the_read_secrets_*and_make_secrets_*methods, and has to name an existing_read_secrets_*one.schema (
Type[DSBSecrets] |None) –Schemaclass for the decryption secrets. It should be a subclass ofpcapkit.protocols.misc.pcapng.schema.DSBSecrets.
- Raises:
RegistryError – If
codeis not aSecretsTypemember, e.g. a member of another enum, ormethis a name with no matching_read_secrets_*method, or neither a name nor a pair of two callables.- Return type: