Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions pcapkit/protocols/data/internet/hopopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,19 @@ def __init__(self, type: 'Enum_Option', action: 'int', change: 'bool', length: '


class QuickStartOption(Option):
"""Data model for HOPOPT Quick Start option."""
"""Data model for HOPOPT Quick Start option.

.. versionchanged:: 1.5.0

``rate`` is an :obj:`int` rather than a :obj:`float` (:issue:`2167`).

"""

#: QS function.
func: 'QSFunction'
#: Rate request/report.
#: Rate request/report, in kbps: ``40 * 2 ** N`` for the Rate Request or
#: Rate Report field ``N``, or ``0`` if ``N`` is ``0`` (:rfc:`4782`
#: Section 3.1).
rate: 'int'


Expand Down
12 changes: 10 additions & 2 deletions pcapkit/protocols/data/internet/ipv4.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,11 +409,19 @@ def __init__(self, code: 'OptionNumber', length: 'int', type: 'OptionType', aler


class QSOption(Option):
"""Data model for IPv4 Quick Start (``QS``) option."""
"""Data model for IPv4 Quick Start (``QS``) option.

.. versionchanged:: 1.5.0

``rate`` is an :obj:`int` rather than a :obj:`float` (:issue:`2167`).

"""

#: QS function.
func: 'QSFunction'
#: Rate request/report.
#: Rate request/report, in kbps: ``40 * 2 ** N`` for the Rate Request or
#: Rate Report field ``N``, or ``0`` if ``N`` is ``0`` (:rfc:`4782`
#: Section 3.1).
rate: 'int'


Expand Down
12 changes: 10 additions & 2 deletions pcapkit/protocols/data/internet/ipv6_opts.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,19 @@ def __init__(self, type: 'Enum_Option', action: 'int', change: 'bool', length: '


class QuickStartOption(Option):
"""Data model for IPv6-Opts Quick Start option."""
"""Data model for IPv6-Opts Quick Start option.

.. versionchanged:: 1.5.0

``rate`` is an :obj:`int` rather than a :obj:`float` (:issue:`2167`).

"""

#: QS function.
func: 'QSFunction'
#: Rate request/report.
#: Rate request/report, in kbps: ``40 * 2 ** N`` for the Rate Request or
#: Rate Report field ``N``, or ``0`` if ``N`` is ``0`` (:rfc:`4782`
#: Section 3.1).
rate: 'int'


Expand Down
12 changes: 10 additions & 2 deletions pcapkit/protocols/data/transport/tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,17 @@ def __init__(self, kind: 'OptionNumber', length: 'int', digest: 'bytes') -> 'Non

@info_final
class QuickStartResponse(Option):
"""Data model for TCP quick start response option."""
"""Data model for TCP quick start response option.

#: Rate request.
.. versionchanged:: 1.5.0

``req_rate`` is an :obj:`int` rather than a :obj:`float`
(:issue:`2167`).

"""

#: Rate request, in kbps: ``40 * 2 ** N`` for the Rate Request field
#: ``N``, or ``0`` if ``N`` is ``0`` (:rfc:`4782` Section 3.1).
req_rate: 'int'
#: TTL difference.
ttl_diff: 'int'
Expand Down
12 changes: 12 additions & 0 deletions pcapkit/protocols/transport/tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,14 @@ def _make_tcp_options(self, options: 'list[Schema_Option | tuple[Enum_Option, di
Returns:
Tuple of options and total length of options.

Raises:
ProtocolError: If an option maker rejects its option, e.g. a user
timeout too large for 15 bits of minutes, or an MPTCP option
whose fields, or the segment's flags, it cannot encode.
ProtocolNotImplemented: If an option argument given by name, an
MPTCP ``subtype`` or an alternate checksum ``algorithm``, is
not in its namespace and has no default.

Note:
The options are emitted in the given order, ``NOP`` and ``EOOL``
included, so that a parsed option list re-emits the same octets.
Expand Down Expand Up @@ -2975,6 +2983,10 @@ def _make_mptcp_join(self, subtype: 'Enum_MPTCPOption', opt: 'Optional[Data_MPTC
Returns:
Constructed option schema.

Raises:
ProtocolError: If the segment's flags are none of SYN, SYN/ACK and
ACK.

"""
if Enum_Flags.SYN in self._flags and Enum_Flags.ACK not in self._flags: # MP_JOIN-SYN
return self._make_join_syn(subtype, opt, **kwargs) # type: ignore[arg-type]
Expand Down
Loading