Registry Management¶
This module (pcapkit.foundation.registry) provides the registry
management for pcapkit, as the module contains various registry
points.
Foundation Registries¶
Engine Registries¶
- pcapkit.foundation.registry.foundation.register_extractor_engine(name, module, class_='(null)')[source]¶
Registered a new engine class.
- Overloads:
name (str), module (ModuleDescriptor[Engine] | Type[Engine]) → None
name (str), module (str), class_ (str) → None
Notes
The full qualified class name of the new engine class should be as
{module}.{class_}.The function will register the given engine class to the
pcapkit.foundation.extraction.Extractor.__engine__registry.
Dumper Registries¶
- pcapkit.foundation.registry.foundation.register_dumper(format, module, class_='(null)', *, ext)[source]¶
Registered a new dumper class.
- Overloads:
format (str), module (ModuleDescriptor[Dumper] | Type[Dumper]), ext (str) → None
format (str), module (str), class_ (str), ext (str) → None
Notes
The full qualified class name of the new dumper class should be as
{module}.{class_}.The function will register the given dumper class to the
pcapkit.foundation.traceflow.traceflow.TraceFlow.__output__andpcapkit.foundation.extraction.Extractor.__output__registry.
- pcapkit.foundation.registry.foundation.register_extractor_dumper(format, module, class_='(null)', *, ext)[source]¶
Registered a new dumper class.
- Overloads:
format (str), module (ModuleDescriptor[Dumper] | Type[Dumper]), ext (str) → None
format (str), module (str), class_ (str), ext (str) → None
Notes
The full qualified class name of the new dumper class should be as
{module}.{class_}.The function will register the given dumper class to the
pcapkit.foundation.extraction.Extractor.__output__registry.
- pcapkit.foundation.registry.foundation.register_traceflow_dumper(format, module, class_='(null)', *, ext)[source]¶
Registered a new dumper class.
- Overloads:
format (str), module (ModuleDescriptor[Dumper] | Type[Dumper]), ext (str) → None
format (str), module (str), class_ (str), ext (str) → None
Notes
The full qualified class name of the new dumper class should be as
{module}.{class_}.The function will register the given dumper class to the
pcapkit.foundation.traceflow.traceflow.TraceFlow.__output__registry.
Callback Registries¶
- pcapkit.foundation.registry.foundation.register_reassembly_ipv4_callback(callback)[source]¶
Registered a new callback function.
The function will register the given callback function to the
IPv4.__callback_fn__registry.- Parameters:
callback (Reasm_CallbackFn) – callback function
- Return type:
None
- pcapkit.foundation.registry.foundation.register_reassembly_ipv6_callback(callback)[source]¶
Registered a new callback function.
The function will register the given callback function to the
IPv6.__callback_fn__registry.- Parameters:
callback (Reasm_CallbackFn) – callback function
- Return type:
None
- pcapkit.foundation.registry.foundation.register_reassembly_tcp_callback(callback)[source]¶
Registered a new callback function.
The function will register the given callback function to the
TCP.__callback_fn__registry.- Parameters:
callback (Reasm_CallbackFn) – callback function
- Return type:
None
- pcapkit.foundation.registry.foundation.register_traceflow_tcp_callback(callback)[source]¶
Registered a new callback function.
The function will register the given callback function to the
TCP.__callback_fn__registry.- Parameters:
callback (Trace_CallbackFn) – callback function
- Return type:
None
Extractor Registries¶
- pcapkit.foundation.registry.foundation.register_extractor_reassembly(protocol, module, class_='(null)')[source]¶
Registered a new reassembly class.
- Overloads:
protocol (str), module (ModuleDescriptor[Reassembly] | Type[Reassembly]) → None
protocol (str), module (str), class_ (str) → None
Notes
The full qualified class name of the new reassembly class should be as
{module}.{class_}.The function will register the given reassembly class to the
pcapkit.foundation.extraction.Extractor.__reassembly__registry.- Parameters:
protocol (
str) – protocol namemodule (
str|ModuleDescriptor[Reassembly] |Type[Reassembly]) – module name or module descriptor or aReassemblysubclassclass_ (
str) – class name
- pcapkit.foundation.registry.foundation.register_extractor_traceflow(protocol, module, class_='(null)')[source]¶
Registered a new flow tracing class.
- Overloads:
protocol (str), module (ModuleDescriptor[TraceFlow] | Type[TraceFlow]) → None
protocol (str), module (str), class_ (str) → None
Notes
The full qualified class name of the new flow tracing class should be as
{module}.{class_}.The function will register the given flow tracing class to the
pcapkit.foundation.extraction.Extractor.__traceflow__registry.
Protocol Registries¶
- pcapkit.foundation.registry.protocols.register_protocol(protocol)[source]¶
Registered protocol class.
The protocol class must be a subclass of
Protocol, and will be registered to thepcapkit.protocols.__proto__registry.- Parameters:
protocol (
Type[ProtocolBase]) – Protocol class.- Return type:
Top-Level Registries¶
- pcapkit.foundation.registry.protocols.register_linktype(code, module, class_='(null)')[source]¶
Register a new protocol class.
- Overloads:
code (LinkType), module (ModuleDescriptor[Protocol] | Type[Protocol]) → None
code (LinkType), module (str), class_ (str) → None
Notes
The full qualified class name of the new protocol class should be as
{module}.{class_}.The function will register the given protocol class to the following registries:
- Parameters:
module (
str|ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module name or module descriptor or aProtocolsubclassclass_ (
str) – class name
- pcapkit.foundation.registry.protocols.register_pcap(code, module, class_='(null)')[source]¶
Register a new protocol class.
- Overloads:
code (LinkType), module (ModuleDescriptor[Protocol] | Type[Protocol]) → None
code (LinkType), module (str), class_ (str) → None
Notes
The full qualified class name of the new protocol class should be as
{module}.{class_}.The function will register the given protocol class to the
pcapkit.protocols.misc.pcap.frame.Frame.__proto__registry.- Parameters:
module (
str|ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module name or module descriptor or aProtocolsubclassclass_ (
str) – class name
- pcapkit.foundation.registry.protocols.register_pcapng(code, module, class_='(null)')[source]¶
Register a new protocol class.
- Overloads:
code (LinkType), module (ModuleDescriptor[Protocol] | Type[Protocol]) → None
code (LinkType), module (str), class_ (str) → None
Notes
The full qualified class name of the new protocol class should be as
{module}.{class_}.The function will register the given protocol class to the
pcapkit.protocols.misc.pcapng.PCAPNG.__proto__registry.- Parameters:
module (
str|ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module name or module descriptor or aProtocolsubclassclass_ (
str) – class name
Link Layer Registries¶
- pcapkit.foundation.registry.protocols.register_ethertype(code, module, class_='(null)')[source]¶
Register a new protocol class.
- Overloads:
code (EtherType), module (ModuleDescriptor[Protocol] | Type[Protocol]) → None
code (EtherType), module (str), class_ (str) → None
Notes
The full qualified class name of the new protocol class should be as
{module}.{class_}.The function will register the given protocol class to the
pcapkit.protocols.link.link.Link.__proto__registry.- Parameters:
module (
str|ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module name or module descriptor or aProtocolsubclassclass_ (
str) – class name
Internet Layer Registries¶
- pcapkit.foundation.registry.protocols.register_transtype(code, module, class_='(null)')[source]¶
Register a new protocol class.
- Overloads:
code (TransType), module (ModuleDescriptor[Protocol] | Type[Protocol]) → None
code (TransType), module (str), class_ (str) → None
Notes
The full qualified class name of the new protocol class should be as
{module}.{class_}.The function will register the given protocol class to the
pcapkit.protocols.internet.internet.Internet.__proto__registry.- Parameters:
module (
str|ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module name or module descriptor or aProtocolsubclassclass_ (
str) – class name
- pcapkit.foundation.registry.protocols.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.internet.IPv4internal 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 callable to parse and/or construct the option.schema (
Type[Option] |None) –Schemaclass for the option. It should be a subclass ofpcapkit.protocols.schema.internet.ipv4.Option.
- Return type:
- pcapkit.foundation.registry.protocols.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.HIPinternal registry.- Parameters:
meth (
str|tuple[Callable[[Parameter,int,OrderedMultiDict[Parameter,Parameter]],Parameter],Callable[[Parameter,Parameter|None,int,Any],Parameter]]) – Method name or callable to parse and/or construct the parameter.schema (
Type[Parameter] |None) –Schemaclass for the parameter. It should be a subclass ofpcapkit.protocols.schema.internet.hip.Parameter.
- Return type:
- pcapkit.foundation.registry.protocols.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.HOPOPT.__option__registry.- Parameters:
meth (
str|tuple[Callable[[Option,OrderedMultiDict[Option,Option]],Option],Callable[[Option,Option|None,Any],Option]]) – Method name or callable to parse and/or construct the option.schema (
Type[Option] |None) –Schemaclass for the option. It should be a subclass ofpcapkit.protocols.schema.internet.hopopt.Option.
- Return type:
- pcapkit.foundation.registry.protocols.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.IPv6_Opts.__option__registry.- Parameters:
meth (
str|tuple[Callable[[Option,OrderedMultiDict[Option,Option]],Option],Callable[[Option,Option|None,Any],Option]]) – Method name or callable to parse and/or construct the option.schema (
Type[Option] |None) –Schemaclass for the option. It should be a subclass ofpcapkit.protocols.schema.internet.ipv6_opts.Option.
- Return type:
- pcapkit.foundation.registry.protocols.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.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 callable to parse and/or construct the data.schema (
Type[RoutingType] |None) –Schemaclass for the routing data. It should be a subclass ofpcapkit.protocols.schema.internet.ipv6_route.RoutingType.
- Return type:
- pcapkit.foundation.registry.protocols.register_mh_message(code, meth, *, schema=None)[source]¶
Register a MH message type parser.
The function will register the given message type parser to the
pcapkit.protocols.internet.mh.MH.__message__registry.- Parameters:
- Return type:
- pcapkit.foundation.registry.protocols.register_mh_option(code, meth, *, schema=None)[source]¶
Register a MH option parser.
The function will register the given option parser to the
pcapkit.protocols.internet.mh.MH.__option__registry.- Parameters:
meth (
str|tuple[Callable[[Option,OrderedMultiDict[Option,Option]],Option],Callable[[Option,Option|None,Any],Option]]) – Method name or callable to parse and/or construct the data.schema (
Type[Option] |None) –Schemaclass for the message type. It should be a subclass ofpcapkit.protocols.schema.internet.mh.Option.
- Return type:
- pcapkit.foundation.registry.protocols.register_mh_extension(code, meth, schema=None)[source]¶
Register a CGA extension parser.
The function will register the given CGA extension to the
pcapkit.protocols.internet.mh.MH.__extension__registry.- Parameters:
code (
CGAExtension) –MH>data type code as inCGAExtension.meth (
str|tuple[Callable[[CGAExtension,OrderedMultiDict[CGAExtension,CGAExtension]],CGAExtension],Callable[[CGAExtension,CGAExtension|None,Any],CGAExtension]]) – Method name or callable to parse and/or construct the data.schema (
Type[CGAExtension] |None) –Schemaclass for the message type. It should be a subclass ofpcapkit.protocols.schema.internet.mh.CGAExtension.
- Return type:
Transport Layer Registries¶
- pcapkit.foundation.registry.protocols.register_apptype(code, module, class_='(null)', *, proto='(null)')[source]¶
Register a new protocol class.
- Overloads:
code (int), module (ModuleDescriptor[Protocol] | Type[Protocol]), proto (TransportProtocol | str) → None
code (Enum_AppType), module (ModuleDescriptor[Protocol] | Type[Protocol]), proto (TransportProtocol | str) → None
code (int), module (str), class_ (str), proto (TransportProtocol | str) → None
code (Enum_AppType), module (str), class_ (str), proto (TransportProtocol | str) → None
Notes
The full qualified class name of the new protocol class should be as
{module}.{class_}.The function will register the given protocol class to the
pcapkit.protocols.transport.tcp.TCP.__proto__and/orpcapkit.protocols.transport.udp.UDP.__proto__registry.- Parameters:
module (
str|ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module name or module descriptor or aProtocolsubclassclass_ (
str) – class nameproto (
TransportProtocol|str) – protocol name (must be a valid transport protocol)
See also
pcapkit.foundation.registry.register_tcp()pcapkit.foundation.registry.register_udp()
- pcapkit.foundation.registry.protocols.register_tcp(code, module, class_='(null)')[source]¶
Register a new protocol class.
- Overloads:
code (int | Enum_AppType), module (ModuleDescriptor[Protocol] | Type[Protocol]) → None
code (int | Enum_AppType), module (str), class_ (str) → None
Notes
The full qualified class name of the new protocol class should be as
{module}.{class_}.The function will register the given protocol class to the
pcapkit.protocols.transport.tcp.TCP.__proto__registry.- Parameters:
module (
str|ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module name or module descriptor or aProtocolsubclassclass_ (
str) – class name
- pcapkit.foundation.registry.protocols.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.TCP.__option__registry.- Parameters:
meth (
str|tuple[Callable[[Option,OrderedMultiDict[Option,Option]],Option],Callable[[Option,Option|None,Any],Option]]) – Method name or callable to parse and/or construct the option.schema (
Type[Option] |None) –Schemaclass for the option. It should be a subclass ofpcapkit.protocols.schema.transport.tcp.Option.
- Return type:
- pcapkit.foundation.registry.protocols.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.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 callable to parse and/or construct the option.schema (
Type[MPTCP] |None) –Schemaclass for the option. It should be a subclass ofpcapkit.protocols.schema.transport.tcp.MPTCP.
- Return type:
- pcapkit.foundation.registry.protocols.register_udp(code, module, class_='(null)')[source]¶
Register a new protocol class.
- Overloads:
code (int | Enum_AppType), module (ModuleDescriptor[Protocol] | Type[Protocol]) → None
code (int | Enum_AppType), module (str), class_ (str) → None
Notes
The full qualified class name of the new protocol class should be as
{module}.{class_}.The function will register the given protocol class to the
pcapkit.protocols.transport.udp.UDP.__proto__registry.- Parameters:
module (
str|ModuleDescriptor[ProtocolBase] |Type[ProtocolBase]) – module name or module descriptor or aProtocolsubclassclass_ (
str) – class name
Application Layer Registries¶
- pcapkit.foundation.registry.protocols.register_http_frame(code, meth, *, schema=None)[source]¶
Registered a frame parser.
The function will register the given frame parser to the
pcapkit.protocols.application.httpv2.HTTP.__frame__registry.- Parameters:
meth (str | tuple[HTTP_FrameParser, HTTP_FrameConstructor]) – Method name or callable to parse and/or construct the frame.
schema (Optional[Type[Schema_HTTP_FrameType]]) –
Schemaclass for the frame. It should be a subclass ofpcapkit.protocols.schema.application.httpv2.FrameType.
- Return type:
None
Miscellaneous Protocol Registries¶
- pcapkit.foundation.registry.protocols.register_pcapng_block(code, meth, *, schema=None)[source]¶
Registered a block parser.
The function will register the given block parser to the
pcapkit.protocols.misc.pcapng.PCAPNG.__block__registry.- Parameters:
meth (
str|tuple[Callable[[BlockType,PCAPNG],PCAPNG],Callable[[PCAPNG|None,Any],BlockType]]) – Method name or callable to parse and/or construct the block.schema (
Type[BlockType] |None) –Schemaclass for the block. It should be a subclass ofpcapkit.protocols.schema.misc.pcapng.BlockType.
- Return type:
- pcapkit.foundation.registry.protocols.register_pcapng_option(code, meth, *, schema=None)[source]¶
Registered a option parser.
The function will register the given option parser to the
pcapkit.protocols.misc.pcapng.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 callable to parse and/or construct the option.schema (
Type[Option] |None) –Schemaclass for the option. It should be a subclass ofpcapkit.protocols.schema.misc.pcapng.Option.
- Return type:
- pcapkit.foundation.registry.protocols.register_pcapng_record(code, meth, *, schema=None)[source]¶
Registered a name resolution record parser.
The function will register the given name resolution record parser to the
pcapkit.protocols.misc.pcapng.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 callable to parse and/or construct the name resolution record.schema (
Type[NameResolutionRecord] |None) –Schemaclass for the name resolution record. It should be a subclass ofpcapkit.protocols.schema.misc.pcapng.NameResolutionRecord.
- Return type:
- pcapkit.foundation.registry.protocols.register_pcapng_secrets(code, meth, *, schema=None)[source]¶
Registered a decryption secrets parser.
The function will register the given decryption secrets parser to the
pcapkit.protocols.misc.pcapng.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 callable to parse and/or construct the decryption secrets.schema (
Type[DSBSecrets] |None) –Schemaclass for the decryption secrets. It should be a subclass ofpcapkit.protocols.schema.misc.pcapng.DSBSecrets.
- Return type: