@@ -96,13 +96,72 @@ that member alone, so no registry binds :class:`~pcapkit.protocols.internet.ip.I
9696the registry only; parsing or building through a base directly is the rule below.
9797
9898**A versioned family's base dispatches on both paths ** (:issue: `2524 `). Parsing
99- octets through it, constructing it from fields and its ``from_data `` give the member
100- the octets, fields or data model describe, never an instance of the base. In
101- :class: `~pcapkit.protocols.application.http.HTTP `,
102- :meth: `~pcapkit.protocols.application.http.HTTP._dispatch_version ` picks the member
103- from the octets, for a payload a transport port binds to HTTP as well, and
104- :meth: `~pcapkit.protocols.application.http.HTTP._dispatch_fields ` from the fields.
105- The other versioned families are tracked on :issue: `2574 `.
99+ octets through it, constructing it from fields and its ``from_data `` give a member,
100+ never an instance of the base, and a subclass of the base is constructed as itself.
101+
102+ **The member is the one the ** ``version `` **keyword names, or else the one the octets
103+ or the data model carry, and never one a field picks. ** ``version `` names the member
104+ on either path, unchecked against the octets it is given; where their format carries
105+ a version, the member's own parser refuses another's. Without it, octets give the
106+ member the version they carry, where the format has one, and ``from_data `` reads the
107+ data model's class or its ``version ``, as the table below gives. No field picks a
108+ member, not even a field only one member takes, and no member is a default: fields
109+ without ``version `` raise :exc: `~pcapkit.utilities.exceptions.ProtocolError `, and a
110+ field the member does not take fails that member's own keyword check. Ruled on
111+ :issue: `2574 `. A class built directly takes ``version `` as well, which must then be
112+ its own version: a member's, or, for a subclass outside the members, the one an IGMP
113+ class states in its ``version ``, which a subclass of the other bases does not have.
114+ While parsing, the keyword is handed on unread, since an IP layer passes its own
115+ version under that name to the layer it carries.
116+
117+ .. list-table ::
118+ :header-rows: 1
119+ :widths: 13 15 42 30
120+
121+ * - Base
122+ - ``version ``
123+ - Octets without ``version ``
124+ - ``from_data ``
125+ * - :class: `~pcapkit.protocols.internet.igmp.IGMP `
126+ - ``1 ``, ``2 ``, ``3 ``
127+ - :meth: `~pcapkit.protocols.internet.igmp.IGMP._dispatch `: type, max response
128+ time and length, placed by
129+ :meth: `~pcapkit.protocols.internet.igmp.IGMP._classify `
130+ - ``version ``, which each IGMP data model carries though no octet does,
131+ ruled on :issue: `2574 `
132+ * - :class: `~pcapkit.protocols.internet.ip.IP `
133+ - ``4 ``, ``6 ``
134+ - the Version nibble
135+ - ``version ``
136+ * - :class: `~pcapkit.protocols.internet.icmp.ICMP `
137+ - ``4 ``, ``6 ``
138+ - refused, below
139+ - the data model; a :obj: `dict ` is refused
140+ * - :class: `~pcapkit.protocols.link.l2tp.L2TP `
141+ - ``2 ``
142+ - the version nibble
143+ - ``version ``
144+ * - :class: `~pcapkit.protocols.link.linux_sll.LinuxSLL `
145+ - ``1 ``, ``2 ``
146+ - refused, below
147+ - the data model; a :obj: `dict ` is refused
148+
149+ :class: `~pcapkit.protocols.application.http.HTTP ` dispatches otherwise. Its octets
150+ go to :meth: `~pcapkit.protocols.application.http.HTTP._dispatch_version `, which reads
151+ the connection preface, a start line or a frame header, for a payload a transport
152+ port binds to HTTP as well. Without ``version ``, its
153+ :meth: `~pcapkit.protocols.application.http.HTTP._dispatch_fields ` picks by each
154+ member's own fields and builds ``HTTPv1 `` from none, and its ``from_data `` reads the
155+ data model, or a :obj: `dict ` by its ``receipt `` or ``sid ``.
156+
157+ **Octets that carry no version are refused through the base without ** ``version ``
158+ (:issue: `2574 `). An ICMP message and a Linux cooked-capture header have no version
159+ field: the enclosing layer names it, by IP protocol number 1 or 58 and by link type
160+ 113 or 276, and those registries bind the members. So ``ICMP(...) `` and
161+ ``LinuxSLL(...) `` on octets raise :exc: `~pcapkit.utilities.exceptions.ProtocolError `
162+ rather than guess, as does their ``from_data `` on a :obj: `dict `, whose keys pick no
163+ member. A version a family has no member for, such as L2TP's ``1 `` (L2F) and ``3 ``,
164+ raises the same way.
106165
107166**Octets neither version takes **, a frameless HTTP/2 connection preface among them,
108167are :class: `~pcapkit.protocols.misc.raw.Raw ` with no ``error `` on the transport path,
0 commit comments