diff --git a/docs/source/pcapkit/protocols/internet/hopopt.rst b/docs/source/pcapkit/protocols/internet/hopopt.rst index 2b9e7c6e8..4814396be 100644 --- a/docs/source/pcapkit/protocols/internet/hopopt.rst +++ b/docs/source/pcapkit/protocols/internet/hopopt.rst @@ -108,6 +108,10 @@ Header Schemas :members: :show-inheritance: +.. autoclass:: pcapkit.protocols.schema.internet.hopopt._SMFDPDOption + :members: + :show-inheritance: + .. autoclass:: pcapkit.protocols.schema.internet.hopopt.SMFDPDOption :members: :show-inheritance: @@ -291,6 +295,14 @@ Data Models :members: :show-inheritance: +.. autoclass:: pcapkit.protocols.data.internet.hopopt.QuickStartRequestOption + :members: + :show-inheritance: + +.. autoclass:: pcapkit.protocols.data.internet.hopopt.QuickStartReportOption + :members: + :show-inheritance: + .. autoclass:: pcapkit.protocols.data.internet.hopopt.RPLOption :members: :show-inheritance: diff --git a/docs/source/pcapkit/protocols/internet/ipv4.rst b/docs/source/pcapkit/protocols/internet/ipv4.rst index 87ecfe465..a6287c9ca 100644 --- a/docs/source/pcapkit/protocols/internet/ipv4.rst +++ b/docs/source/pcapkit/protocols/internet/ipv4.rst @@ -330,6 +330,14 @@ Data Models :members: :show-inheritance: +.. autoclass:: pcapkit.protocols.data.internet.ipv4.QuickStartRequestOption + :members: + :show-inheritance: + +.. autoclass:: pcapkit.protocols.data.internet.ipv4.QuickStartReportOption + :members: + :show-inheritance: + .. rubric:: Footnotes .. [*] https://en.wikipedia.org/wiki/IPv4 diff --git a/docs/source/pcapkit/protocols/internet/ipv6_opts.rst b/docs/source/pcapkit/protocols/internet/ipv6_opts.rst index 83b1ecd38..42ac7c95b 100644 --- a/docs/source/pcapkit/protocols/internet/ipv6_opts.rst +++ b/docs/source/pcapkit/protocols/internet/ipv6_opts.rst @@ -108,6 +108,10 @@ Header Schemas :members: :show-inheritance: +.. autoclass:: pcapkit.protocols.schema.internet.ipv6_opts._SMFDPDOption + :members: + :show-inheritance: + .. autoclass:: pcapkit.protocols.schema.internet.ipv6_opts.SMFDPDOption :members: :show-inheritance: @@ -291,6 +295,14 @@ Data Models :members: :show-inheritance: +.. autoclass:: pcapkit.protocols.data.internet.ipv6_opts.QuickStartRequestOption + :members: + :show-inheritance: + +.. autoclass:: pcapkit.protocols.data.internet.ipv6_opts.QuickStartReportOption + :members: + :show-inheritance: + .. autoclass:: pcapkit.protocols.data.internet.ipv6_opts.RPLOption :members: :show-inheritance: diff --git a/pcapkit/protocols/data/internet/hip.py b/pcapkit/protocols/data/internet/hip.py index 3a86d7bdc..80dccb1ca 100644 --- a/pcapkit/protocols/data/internet/hip.py +++ b/pcapkit/protocols/data/internet/hip.py @@ -62,7 +62,13 @@ @info_final class Control(Data): - """Data model for HIP controls.""" + """Data model for HIP controls. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1328`). + + """ #: Anonymous flag. anonymous: 'bool' @@ -92,7 +98,14 @@ class Parameter(Data): @info_final class HIP(Protocol): - """Data model for HIP header.""" + """Data model for HIP header. + + .. versionchanged:: 1.5.0 + + New required fields ``packet_fixed``, ``reserved`` and ``version_fixed`` + (:issue:`1417`, :issue:`1459`). + + """ #: Next header. next: 'TransType' @@ -142,7 +155,13 @@ def __init__(self, type: 'Enum_Parameter', critical: 'bool', length: 'int', cont @info_final class ESPInfoParameter(Parameter): - """Data model for HIP ``ESP_INFO`` parameter.""" + """Data model for HIP ``ESP_INFO`` parameter. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1328`). + + """ #: Reserved octets, carried verbatim so that re-serialising reproduces them. reserved: 'int' @@ -159,7 +178,13 @@ def __init__(self, type: 'Enum_Parameter', critical: 'bool', length: 'int', rese @info_final class R1CounterParameter(Parameter): - """Data model for HIP ``R1_COUNTER`` parameter.""" + """Data model for HIP ``R1_COUNTER`` parameter. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1223`). + + """ #: The four reserved octets, as captured. reserved: 'bytes' @@ -185,7 +210,13 @@ def __init__(self, spi: 'int', ip: 'IPv6Address') -> 'None': ... # pylint: disa @info_final class Locator(Data): - """Data model for HIP locator.""" + """Data model for HIP locator. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1365`). + + """ #: Traffic. traffic: 'int' @@ -220,7 +251,14 @@ def __init__(self, type: 'Enum_Parameter', critical: 'bool', length: 'int', loca @info_final class PuzzleParameter(Parameter): - """Data model for HIP ``PUZZLE`` parameter.""" + """Data model for HIP ``PUZZLE`` parameter. + + .. versionchanged:: 1.5.0 + + New required fields ``lifetime_exponent`` and ``rhash_len`` + (:issue:`653`, :issue:`1323`). + + """ #: Numeric index. index: 'int' @@ -254,6 +292,10 @@ def __init__(self, type: 'Enum_Parameter', critical: 'bool', length: 'int', inde class SolutionParameter(Parameter): """Data model for HIP ``SOLUTION`` parameter. + .. versionchanged:: 1.5.0 + + New required field ``rhash_len`` (:issue:`653`). + .. versionremoved:: 1.5.0 ``lifetime``, now :attr:`reserved`: only ``PUZZLE`` carries a lifetime @@ -361,7 +403,13 @@ def __init__(self, type: 'Enum_Parameter', critical: 'bool', length: 'int', ciph @info_final class NATTraversalModeParameter(Parameter): - """Data model for HIP ``NAT_TRAVERSAL_MODE`` parameter.""" + """Data model for HIP ``NAT_TRAVERSAL_MODE`` parameter. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1223`). + + """ #: The two reserved octets, as captured. reserved: 'bytes' @@ -385,7 +433,13 @@ def __init__(self, type: 'Enum_Parameter', critical: 'bool', length: 'int', min_ @info_final class EncryptedParameter(Parameter): - """Data model for HIP ``ENCRYPTED`` parameter.""" + """Data model for HIP ``ENCRYPTED`` parameter. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1223`). + + """ #: The four reserved octets, as captured. reserved: 'bytes' @@ -468,7 +522,13 @@ def __init__(self, type: 'Enum_Parameter', critical: 'bool', length: 'int', cert @info_final class NotificationParameter(Parameter): - """Data model for HIP ``NOTIFICATION`` parameter.""" + """Data model for HIP ``NOTIFICATION`` parameter. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1223`). + + """ #: The two reserved octets, as captured. reserved: 'bytes' @@ -559,7 +619,13 @@ def __init__(self, type: 'Enum_Parameter', critical: 'bool', length: 'int', life @info_final class RegFromParameter(Parameter): - """Data model for HIP ``REG_FROM`` parameter.""" + """Data model for HIP ``REG_FROM`` parameter. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1223`). + + """ #: The reserved octet, as captured. reserved: 'bytes' @@ -598,7 +664,13 @@ def __init__(self, type: 'Enum_Parameter', critical: 'bool', length: 'int', tf_t @info_final class ESPTransformParameter(Parameter): - """Data model for HIP ``ESP_TRANSFORM`` parameter.""" + """Data model for HIP ``ESP_TRANSFORM`` parameter. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1223`). + + """ #: The two reserved octets, as captured. reserved: 'bytes' @@ -633,7 +705,13 @@ def __init__(self, type: 'Enum_Parameter', critical: 'bool', length: 'int', ack: @info_final class PayloadMICParameter(Parameter): - """Data model for HIP ``PAYLOAD_MIC`` parameter.""" + """Data model for HIP ``PAYLOAD_MIC`` parameter. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1223`). + + """ #: The three reserved octets, as captured. reserved: 'bytes' @@ -672,7 +750,13 @@ def __init__(self, type: 'Enum_Parameter', critical: 'bool', length: 'int', id: @info_final class Flags(Data): - """Data model for the flags in HIP ``ROUTE_DST`` and ``ROUTE_VIA`` parameters.""" + """Data model for the flags in HIP ``ROUTE_DST`` and ``ROUTE_VIA`` parameters. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1417`). + + """ #: Symmetric flag. symmetric: 'bool' @@ -688,7 +772,13 @@ def __init__(self, symmetric: 'bool', must_follow: 'bool', reserved: 'int') -> ' @info_final class RouteDstParameter(Parameter): - """Data model for HIP ``ROUTE_DST`` parameter.""" + """Data model for HIP ``ROUTE_DST`` parameter. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1223`). + + """ #: The two reserved octets, as captured. reserved: 'bytes' @@ -786,7 +876,13 @@ def __init__(self, type: 'Enum_Parameter', critical: 'bool', length: 'int', opaq @info_final class RelayFromParameter(Parameter): - """Data model for HIP ``RELAY_FROM`` parameter.""" + """Data model for HIP ``RELAY_FROM`` parameter. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1223`). + + """ #: The reserved octet, as captured. reserved: 'bytes' @@ -803,7 +899,13 @@ def __init__(self, type: 'Enum_Parameter', critical: 'bool', length: 'int', rese @info_final class RelayToParameter(Parameter): - """Data model for HIP ``RELAY_TO`` parameter.""" + """Data model for HIP ``RELAY_TO`` parameter. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1223`). + + """ #: The reserved octet, as captured. reserved: 'bytes' @@ -820,7 +922,13 @@ def __init__(self, type: 'Enum_Parameter', critical: 'bool', length: 'int', rese @info_final class OverlayTTLParameter(Parameter): - """Data model for HIP ``OVERLAY_TTL`` parameter.""" + """Data model for HIP ``OVERLAY_TTL`` parameter. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1223`). + + """ #: The two reserved octets, as captured. reserved: 'bytes' @@ -833,7 +941,13 @@ def __init__(self, type: 'Enum_Parameter', critical: 'bool', length: 'int', rese @info_final class RouteViaParameter(Parameter): - """Data model for HIP ``ROUTE_VIA`` parameter.""" + """Data model for HIP ``ROUTE_VIA`` parameter. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1223`). + + """ #: The two reserved octets, as captured. reserved: 'bytes' diff --git a/pcapkit/protocols/data/internet/ipv4.py b/pcapkit/protocols/data/internet/ipv4.py index e628a39b5..4cdfc478c 100644 --- a/pcapkit/protocols/data/internet/ipv4.py +++ b/pcapkit/protocols/data/internet/ipv4.py @@ -79,7 +79,13 @@ def __new__(cls, *args: 'Any', **kwargs: 'Any') -> 'ToSField': @info_final class Flags(Data): - """Data model for IPv4 Flags.""" + """Data model for IPv4 Flags. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1326`). + + """ #: Reserved flag bit. reserved: 'int' @@ -193,7 +199,13 @@ def __init__(self, code: 'OptionNumber', length: 'int', type: 'OptionType') -> ' @info_final class SECOption(Option): - """Data model for IPv4 Security (``SEC``) option.""" + """Data model for IPv4 Security (``SEC``) option. + + .. versionchanged:: 1.5.0 + + New required field ``termination`` (:issue:`1393`). + + """ #: Classification level. level: 'ClassificationLevel' @@ -209,7 +221,13 @@ def __init__(self, code: 'OptionNumber', length: 'int', type: 'OptionType', leve @info_final class LSROption(Option): - """Data model for IPv4 Loose Source Route (``LSR``) option.""" + """Data model for IPv4 Loose Source Route (``LSR``) option. + + .. versionchanged:: 1.5.0 + + New required field ``remaining`` (:issue:`1319`). + + """ #: Pointer. pointer: 'int' @@ -224,7 +242,14 @@ def __init__(self, code: 'OptionNumber', length: 'int', type: 'OptionType', poin @info_final class TSOption(Option): - """Data model for IPv4 Time Stamp (``TS``) option.""" + """Data model for IPv4 Time Stamp (``TS``) option. + + .. versionchanged:: 1.5.0 + + New required fields ``remaining`` and ``remainder`` (:issue:`1349`, + :issue:`1392`). + + """ #: Pointer. pointer: 'int' @@ -258,7 +283,13 @@ def __init__(self, code: 'OptionNumber', length: 'int', type: 'OptionType', form @info_final class RROption(Option): - """Data model for IPv4 Record Route (``RR``) option.""" + """Data model for IPv4 Record Route (``RR``) option. + + .. versionchanged:: 1.5.0 + + New required field ``remaining`` (:issue:`1319`). + + """ #: Pointer. pointer: 'int' @@ -284,7 +315,13 @@ def __init__(self, code: 'OptionNumber', length: 'int', type: 'OptionType', sid: @info_final class SSROption(Option): - """Data model for IPv4 Strict Source Route (``SSR``) option.""" + """Data model for IPv4 Strict Source Route (``SSR``) option. + + .. versionchanged:: 1.5.0 + + New required field ``remaining`` (:issue:`1319`). + + """ #: Pointer. pointer: 'int' @@ -371,7 +408,13 @@ class QSOption(Option): @info_final class QuickStartRequestOption(QSOption): - """Data model for IPv4 Quick Start request option.""" + """Data model for IPv4 Quick Start request option. + + .. versionchanged:: 1.5.0 + + New required field ``reserved`` (:issue:`1326`). + + """ #: TTL. ttl: 'timedelta' @@ -386,7 +429,13 @@ def __init__(self, code: 'OptionNumber', length: 'int', type: 'OptionType', func @info_final class QuickStartReportOption(QSOption): - """Data model for IPv4 Quick Start report of approved rate option.""" + """Data model for IPv4 Quick Start report of approved rate option. + + .. versionchanged:: 1.5.0 + + New required fields ``unused`` and ``reserved`` (:issue:`1326`). + + """ #: Not-used octet, where a request carries its TTL. unused: 'int' diff --git a/pcapkit/protocols/data/internet/mh.py b/pcapkit/protocols/data/internet/mh.py index f02376659..635396320 100644 --- a/pcapkit/protocols/data/internet/mh.py +++ b/pcapkit/protocols/data/internet/mh.py @@ -822,7 +822,15 @@ def __init__(self, type: 'Enum_Option', length: 'int', data: 'bytes') -> 'None': @info_final class BindingRefreshAdviceOption(Option): - """Data model for Binding Refresh Advice option.""" + """Data model for Binding Refresh Advice option. + + .. versionremoved:: 1.1.0 + + ``BindRefreshAdviceOption``, this class's former name, and its + re-export ``pcapkit.protocols.data.internet.MH_BindRefreshAdviceOption``, + with no alias. + + """ #: Refresh interval before re-registration. Counted on the wire in units of #: 4 seconds [:rfc:`6275#section-6.2.4`]. @@ -858,7 +866,16 @@ def __init__(self, type: 'Enum_Option', length: 'int', home: 'int', careof: 'int @info_final class AuthorizationDataOption(Option): - """Data model for Binding Authorization Data option.""" + """Data model for Binding Authorization Data option. + + .. versionremoved:: 1.1.0 + + ``BindingAuthorizationDataOption``, this class's former name, and + its re-export + ``pcapkit.protocols.data.internet.MH_BindingAuthorizationDataOption``, + with no alias. + + """ #: Authenticator. data: 'bytes' diff --git a/pcapkit/protocols/internet/hopopt.py b/pcapkit/protocols/internet/hopopt.py index 34ba7e6ab..a02f91e45 100644 --- a/pcapkit/protocols/internet/hopopt.py +++ b/pcapkit/protocols/internet/hopopt.py @@ -1516,7 +1516,7 @@ def _make_opt_pad(self, code: 'Enum_Option', opt: 'Optional[Data_PadOption]' = N :attr:`Data_PadOption.length ` counts the *whole* option, whereas :attr:`Schema_PadOption.len - ` is the + ` is the ``Opt Data Len`` field: two octets fewer, and absent altogether for a ``Pad1``. ``opt`` is honoured so that re-making a parsed padding option keeps its type and size. A ``PadN`` with ``length`` ``0`` is diff --git a/pcapkit/protocols/internet/internet.py b/pcapkit/protocols/internet/internet.py index 835f183d2..fce3f641a 100644 --- a/pcapkit/protocols/internet/internet.py +++ b/pcapkit/protocols/internet/internet.py @@ -182,6 +182,13 @@ def register(cls, code: 'Enum_TransType', protocol: 'ModuleDescriptor[ProtocolBa guard this shares with ``register_protocol``, and for the shipped descriptor a restore puts back (:issue:`1504`). + .. versionchanged:: 1.3.0 + + Takes the class, or a + :class:`~pcapkit.corekit.module.ModuleDescriptor` naming it, as + ``protocol``, in place of the ``module`` and ``class_`` name + strings. + """ incumbent = cls.__proto__.get(code) entry = cls._next_layer_entry(code, protocol) diff --git a/pcapkit/protocols/internet/ipv6.py b/pcapkit/protocols/internet/ipv6.py index ea3b09a73..d3801d8bf 100644 --- a/pcapkit/protocols/internet/ipv6.py +++ b/pcapkit/protocols/internet/ipv6.py @@ -111,9 +111,8 @@ class IPv6(IP[Data_IPv6, Schema_IPv6], #: Three groups are deliberately absent: #: #: * :attr:`~pcapkit.const.ipv6.extension_header.ExtensionHeader.Shim6` - #: has no dedicated parser (``pcapkit/protocols/internet/NotImplemented/shim6.py`` - #: is a 0-byte placeholder), so there is no "own parser" for it to raise - #: from. It reaches :class:`~pcapkit.protocols.internet.ipv6_ext.IPv6_Ext` + #: has no dedicated parser class in this package, so there is no "own + #: parser" for it to raise from. It reaches :class:`~pcapkit.protocols.internet.ipv6_ext.IPv6_Ext` #: by *direct* registration (see the bottom of #: :mod:`pcapkit.protocols.internet.ipv6_ext`), which already produces #: exactly this class. diff --git a/pcapkit/protocols/internet/ipv6_ext.py b/pcapkit/protocols/internet/ipv6_ext.py index e2dcdb35e..e10e3adb9 100644 --- a/pcapkit/protocols/internet/ipv6_ext.py +++ b/pcapkit/protocols/internet/ipv6_ext.py @@ -329,8 +329,8 @@ class sits between them and def next(self) -> 'Optional[Enum_TransType]': """Next header, as parsed off the wire. - Shared by every subclass rather than fallback-role-only; see - :class:`_NextHeaderData` for why that is sound. + Shared by every subclass rather than fallback-role-only, since each of + their data models records the Next Header value under this name. :data:`None` when the declared length would have overrun what remained of the chain and the walk stopped instead of trusting it; see the diff --git a/pcapkit/protocols/internet/ipv6_opts.py b/pcapkit/protocols/internet/ipv6_opts.py index 16cea5cd6..87c924e40 100644 --- a/pcapkit/protocols/internet/ipv6_opts.py +++ b/pcapkit/protocols/internet/ipv6_opts.py @@ -1505,7 +1505,7 @@ def _make_opt_pad(self, code: 'Enum_Option', opt: 'Optional[Data_PadOption]' = N :attr:`Data_PadOption.length ` counts the *whole* option, whereas :attr:`Schema_PadOption.len - ` is the + ` is the ``Opt Data Len`` field: two octets fewer, and absent altogether for a ``Pad1``. ``opt`` is honoured so that re-making a parsed padding option keeps its type and size. A ``PadN`` with ``length`` ``0`` is diff --git a/pcapkit/protocols/internet/ipv6_route.py b/pcapkit/protocols/internet/ipv6_route.py index 27492d240..cf97d6409 100644 --- a/pcapkit/protocols/internet/ipv6_route.py +++ b/pcapkit/protocols/internet/ipv6_route.py @@ -92,6 +92,12 @@ class IPv6_Route(IPv6_Ext[Data_IPv6_Route, Schema_IPv6_Route], - :meth:`~pcapkit.protocols.internet.ipv6_route.IPv6_Route._read_data_type_rpl` - :meth:`~pcapkit.protocols.internet.ipv6_route.IPv6_Route._make_data_type_rpl` + .. versionchanged:: 1.3.4 + + :attr:`length`, and the ``length`` field of the parsed data model, is + the header's size in octets rather than the raw Hdr Ext Len value + (:issue:`218`). + .. versionchanged:: 1.5.0 * Hdr Ext Len is in 8-octet units both on read and on build diff --git a/pcapkit/protocols/internet/mh.py b/pcapkit/protocols/internet/mh.py index 65cbebda4..be332e597 100644 --- a/pcapkit/protocols/internet/mh.py +++ b/pcapkit/protocols/internet/mh.py @@ -3003,12 +3003,12 @@ def _read_opt_pad(self, schema: 'Schema_PadOption', *, Note: A ``Pad1`` option occupies a single octet and carries no ``Option Length`` field, so its - :attr:`~pcapkit.protocols.data.internet.mh.PadOption.length` is + :attr:`~pcapkit.protocols.data.internet.mh.Option.length` is ``1`` rather than ``length + 2``. That one-octet wire shape is enforced by :class:`~pcapkit.protocols.schema.internet.mh.PadOption` itself, which sizes both the length octet and the padding data from the - option type [:rfc:`6275#section-6.2.5`]; ``clen`` is therefore + option type [:rfc:`6275#section-6.2.2`]; ``clen`` is therefore always ``0`` here for a parsed ``Pad1``, and the check below only guards a schema built by hand. A ``PadN`` whose ``Option Length`` is ``0`` is a valid two-octet padding option @@ -7744,7 +7744,7 @@ def _make_pad_options(self, offset: 'int') -> 'tuple[list[Schema_PadOption], int ``pad_len`` octets means an ``Option Length`` of ``pad_len - 2``. One or two octets are padded with ``Pad1`` options instead, that being the only form which can occupy a single octet - [:rfc:`6275#section-6.2.5`]; two octets need two separate ``Pad1`` + [:rfc:`6275#section-6.2.2`]; two octets need two separate ``Pad1`` schemas, since a schema instance is mutable and must not be shared between two entries of the option list. @@ -7769,7 +7769,7 @@ def _pad_mh_message(self, data: 'Schema_Packet | bytes') -> 'Schema_Packet | byt Note: The padding goes into the message's mobility options, which is where - :rfc:`6275#section-6.2.5` puts it. A message whose body is opaque has + :rfc:`6275#section-6.1.1` puts it. A message whose body is opaque has nowhere to put it -- :class:`~pcapkit.protocols.schema.internet.mh.UnknownMessage` and :class:`~pcapkit.protocols.schema.internet.mh.ExperimentalMessage` @@ -7913,9 +7913,9 @@ def _make_opt_pad(self, type: 'Enum_Option', option: 'Optional[Data_PadOption]' Note: :attr:`Data_PadOption.length - ` counts the + ` counts the *whole* option, whereas :attr:`Schema_PadOption.length - ` is the + ` is the ``Option Length`` field -- two octets fewer, and absent altogether for a ``Pad1``. Copying one into the other unconverted would make a re-made parsed ``PadN`` come back two octets too long. diff --git a/pcapkit/protocols/schema/internet/hip.py b/pcapkit/protocols/schema/internet/hip.py index c7c5346fd..52e9c1610 100644 --- a/pcapkit/protocols/schema/internet/hip.py +++ b/pcapkit/protocols/schema/internet/hip.py @@ -287,10 +287,11 @@ def transport_format_list_len(pkt: 'dict[str, Any]') -> 'int': its own ``type`` field, since a TF type *is* a HIP parameter type number -- which is why ``formats``' ``item_type`` is ``EnumField(length=2, ...)``, the width of the items at all three of - :func:`two_octet_prefix_list_len`'s call sites as well. This function only answers how many *bytes* the - list occupies; getting that number right and the item width wrong (one - octet) would still corrupt every non-empty list, just by reading twice as - many entries as the wire holds instead of dropping octets. + :func:`two_octet_prefix_list_len`'s call sites as well. This function + only answers how many *bytes* the list occupies; getting that number + right and the item width wrong -- one octet instead of two -- would still + corrupt every non-empty list, just by reading twice as many entries as + the wire holds instead of dropping octets. Args: pkt: Parameter unpacked schema. diff --git a/pcapkit/protocols/schema/internet/mh.py b/pcapkit/protocols/schema/internet/mh.py index f809e1544..b4d7f38bf 100644 --- a/pcapkit/protocols/schema/internet/mh.py +++ b/pcapkit/protocols/schema/internet/mh.py @@ -408,7 +408,7 @@ def pad_opt_data_len(pkt: 'dict[str, Any]') -> 'int': Note: A ``Pad1`` option is a single octet with neither an ``Option Length`` - field nor any option data (c.f. :rfc:`6275#section-6.2.5`), which is why + field nor any option data (c.f. :rfc:`6275#section-6.2.2`), which is why :attr:`Option.length` is declared as a :class:`~pcapkit.corekit.fields.misc.ConditionalField` and is skipped for it. A skipped conditional field is *recorded* in the packet data as @@ -664,8 +664,8 @@ class PadOption(Option, code=[Enum_Option.Pad1, The two padding options do **not** share a wire shape: a ``Pad1`` option is a lone type octet, whereas a ``PadN`` option is a type octet, an ``Option Length`` octet, and that many padding octets - [:rfc:`6275#section-6.2.5`]. Both the ``Option Length`` octet - (:attr:`Option.length`) and the padding data + [:rfc:`6275#section-6.2.2`, :rfc:`6275#section-6.2.3`]. Both the + ``Option Length`` octet (:attr:`Option.length`) and the padding data (:attr:`self.data `) are therefore sized from the option type, so that a ``Pad1`` option consumes exactly one octet. @@ -680,7 +680,15 @@ def __init__(self, type: 'Enum_Option', length: 'int', data: 'bytes') -> 'None': @schema_final class BindingRefreshAdviceOption(Option, code=Enum_Option.Binding_Refresh_Advice): - """Header schema for MH binding refresh advice options.""" + """Header schema for MH binding refresh advice options. + + .. versionremoved:: 1.1.0 + + ``BindRefreshAdviceOption``, this class's former name, and its + re-export ``pcapkit.protocols.schema.internet.MH_BindRefreshAdviceOption``, + with no alias. + + """ #: Refresh interval. One time unit is 4 seconds [:rfc:`6275#section-6.2.4`]. interval: 'int' = UInt16Field() @@ -715,7 +723,16 @@ def __init__(self, type: 'Enum_Option', length: 'int', home: 'int', careof: 'int @schema_final class AuthorizationDataOption(Option, code=Enum_Option.Authorization_Data): - """Header schema for MH binding authorization data options.""" + """Header schema for MH binding authorization data options. + + .. versionremoved:: 1.1.0 + + ``BindingAuthorizationDataOption``, this class's former name, and + its re-export + ``pcapkit.protocols.schema.internet.MH_BindingAuthorizationDataOption``, + with no alias. + + """ #: Authenticator. data: 'bytes' = BytesField(length=lambda pkt: pkt['length'])