diff --git a/docs/source/pcapkit/foundation/registry.rst b/docs/source/pcapkit/foundation/registry.rst index ed9b479b3..334b4a27e 100644 --- a/docs/source/pcapkit/foundation/registry.rst +++ b/docs/source/pcapkit/foundation/registry.rst @@ -55,6 +55,8 @@ Protocol Registries .. autofunction:: pcapkit.foundation.registry.protocols.register_protocol +.. autofunction:: pcapkit.foundation.registry.protocols.register_protocol_code + Top-Level Registries ~~~~~~~~~~~~~~~~~~~~ diff --git a/pcapkit/foundation/registry/protocols.py b/pcapkit/foundation/registry/protocols.py index f0c45eb0d..f218d7d22 100644 --- a/pcapkit/foundation/registry/protocols.py +++ b/pcapkit/foundation/registry/protocols.py @@ -302,9 +302,8 @@ def register_protocol_code(protocol: 'Type[ProtocolBase]', code: 'Any') -> 'None r"""Register ``protocol`` into the next-layer dispatch registry (or registries) named by ``code``. - This is what backs the ``code`` keyword of - :meth:`ProtocolBase.__init_subclass__ - `; it can also + This is what backs the ``code`` class keyword of + :class:`~pcapkit.protocols.protocol.ProtocolBase` subclasses; it can also be called directly to register a class that declined at class-definition time. diff --git a/pcapkit/toolkit/dpkt.py b/pcapkit/toolkit/dpkt.py index 8faa3358f..074c3b2ec 100644 --- a/pcapkit/toolkit/dpkt.py +++ b/pcapkit/toolkit/dpkt.py @@ -4,10 +4,10 @@ .. module:: pcapkit.toolkit.dpkt -:mod:`pcapkit.toolkit.dpkt` contains all you need for -:mod:`pcapkit` handy usage with `DPKT`_ engine. All reforming -functions returns with a flag to indicate if usable for -its caller. +:mod:`pcapkit.toolkit.dpkt` contains the adapters for the `DPKT`_ engine. +The reassembly and flow tracing adapters return the data their +:mod:`pcapkit.foundation` counterpart consumes, or :data:`None` if the frame +cannot be used for it. .. _DPKT: https://dpkt.readthedocs.io diff --git a/pcapkit/toolkit/pcap.py b/pcapkit/toolkit/pcap.py index 828aced38..242d91c44 100644 --- a/pcapkit/toolkit/pcap.py +++ b/pcapkit/toolkit/pcap.py @@ -4,10 +4,10 @@ .. module:: pcapkit.toolkit.pcap -:mod:`pcapkit.toolkit.pcap` contains all you need for -:mod:`pcapkit` handy usage of PCAP file format. All -functions returns with a flag to indicate if usable -for its caller. +:mod:`pcapkit.toolkit.pcap` contains the adapters for the PCAP format. +The reassembly and flow tracing adapters return the data their +:mod:`pcapkit.foundation` counterpart consumes, or :data:`None` if the frame +cannot be used for it. """ from typing import TYPE_CHECKING, cast diff --git a/pcapkit/toolkit/pcap_ct.py b/pcapkit/toolkit/pcap_ct.py index 23ac454a2..4c0895da5 100644 --- a/pcapkit/toolkit/pcap_ct.py +++ b/pcapkit/toolkit/pcap_ct.py @@ -4,10 +4,7 @@ .. module:: pcapkit.toolkit.pcap_ct -:mod:`pcapkit.toolkit.pcap_ct` contains all you need for -:mod:`pcapkit` handy usage with `pcap-ct`_ engine. All reforming -functions returns with a flag to indicate if usable for -its caller. +:mod:`pcapkit.toolkit.pcap_ct` contains the adapters for the `pcap-ct`_ engine. .. _pcap-ct: https://pypi.org/project/pcap-ct/ diff --git a/pcapkit/toolkit/pcapng.py b/pcapkit/toolkit/pcapng.py index 1bbfa7503..9b654a93b 100644 --- a/pcapkit/toolkit/pcapng.py +++ b/pcapkit/toolkit/pcapng.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- -"""PCAP-NG-NG Tools -=================== +"""PCAP-NG Tools +============= .. module:: pcapkit.toolkit.pcapng -:mod:`pcapkit.toolkit.pcapng` contains all you need -for :mod:`pcapkit` handy usage of PCAP-NG-NG file format. -All functions returns with a flag to indicate if -usable for its caller. +:mod:`pcapkit.toolkit.pcapng` contains the adapters for the PCAP-NG format. +The reassembly and flow tracing adapters return the data their +:mod:`pcapkit.foundation` counterpart consumes, or :data:`None` if the frame +cannot be used for it. """ from typing import TYPE_CHECKING, cast diff --git a/pcapkit/toolkit/pypcap.py b/pcapkit/toolkit/pypcap.py index e81673806..6a26c0fa3 100644 --- a/pcapkit/toolkit/pypcap.py +++ b/pcapkit/toolkit/pypcap.py @@ -4,10 +4,7 @@ .. module:: pcapkit.toolkit.pypcap -:mod:`pcapkit.toolkit.pypcap` contains all you need for -:mod:`pcapkit` handy usage with `PyPCAP`_ engine. All reforming -functions returns with a flag to indicate if usable for -its caller. +:mod:`pcapkit.toolkit.pypcap` contains the adapters for the `PyPCAP`_ engine. .. _PyPCAP: https://github.com/pynetwork/pypcap diff --git a/pcapkit/toolkit/pypcapfile.py b/pcapkit/toolkit/pypcapfile.py index 64a5f64cd..cf39236ac 100644 --- a/pcapkit/toolkit/pypcapfile.py +++ b/pcapkit/toolkit/pypcapfile.py @@ -4,10 +4,10 @@ .. module:: pcapkit.toolkit.pypcapfile -:mod:`pcapkit.toolkit.pypcapfile` contains all you need for -:mod:`pcapkit` handy usage with `PyPCAPFile`_ engine. All reforming -functions returns with a flag to indicate if usable for -its caller. +:mod:`pcapkit.toolkit.pypcapfile` contains the adapters for the `PyPCAPFile`_ engine. +The reassembly and flow tracing adapters return the data their +:mod:`pcapkit.foundation` counterpart consumes, or :data:`None` if the frame +cannot be used for it. .. _PyPCAPFile: https://github.com/kisom/pypcapfile diff --git a/pcapkit/toolkit/pyshark.py b/pcapkit/toolkit/pyshark.py index 61922a97b..27481c260 100644 --- a/pcapkit/toolkit/pyshark.py +++ b/pcapkit/toolkit/pyshark.py @@ -2,10 +2,10 @@ """PyShark Tools =================== -:mod:`pcapkit.toolkit.pyshark` contains all you need for -:mod:`pcapkit` handy usage with `PyShark`_ engine. All -reforming functions returns with a flag to indicate if -usable for its caller. +:mod:`pcapkit.toolkit.pyshark` contains the adapters for the `PyShark`_ engine. +The reassembly and flow tracing adapters return the data their +:mod:`pcapkit.foundation` counterpart consumes, or :data:`None` if the frame +cannot be used for it. .. _PyShark: https://kiminewt.github.io/pyshark diff --git a/pcapkit/toolkit/scapy.py b/pcapkit/toolkit/scapy.py index 3164ba717..517d57742 100644 --- a/pcapkit/toolkit/scapy.py +++ b/pcapkit/toolkit/scapy.py @@ -4,10 +4,10 @@ .. module:: pcapkit.toolkit.scapy -:mod:`pcapkit.toolkit.scapy` contains all you need for -:mod:`pcapkit` handy usage with `Scapy`_ engine. All reforming -functions returns with a flag to indicate if usable for -its caller. +:mod:`pcapkit.toolkit.scapy` contains the adapters for the `Scapy`_ engine. +The reassembly and flow tracing adapters return the data their +:mod:`pcapkit.foundation` counterpart consumes, or :data:`None` if the frame +cannot be used for it. .. _Scapy: https://scapy.net diff --git a/pcapkit/utilities/logging.py b/pcapkit/utilities/logging.py index ac8bcb473..517668d20 100644 --- a/pcapkit/utilities/logging.py +++ b/pcapkit/utilities/logging.py @@ -96,7 +96,7 @@ #: logging.StreamHandler: The historical :obj:`sys.stderr` handler. It is only #: *attached* under :envvar:`PCAPKIT_DEVMODE`; it is constructed unconditionally #: so that ``logger.addHandler(handler)`` remains a one-line way back to the -#: pre-1.4 default output. +#: pre-1.5 default output. handler = logging.StreamHandler(sys.stderr) handler.setFormatter(formatter) @@ -287,7 +287,7 @@ def configure(level: 'Optional[Union[int, str]]' = None, *, one is meant to receive ``fmt`` would be ambiguous. Example: - Restore the pre-1.4 default of :obj:`sys.stderr` at + Restore the pre-1.5 default of :obj:`sys.stderr` at :data:`logging.INFO`:: configure(logging.INFO, stream=sys.stderr)