Source code for pcapkit.protocols.misc.raw.data
# -*- coding: utf-8 -*-
"""data models for raw protocol data"""
from typing import TYPE_CHECKING
from pcapkit.corekit.infoclass import info_final
from pcapkit.protocols.data import Protocol
if TYPE_CHECKING:
from typing import Optional
__all__ = ['Raw']
[docs]
@info_final
class Raw(Protocol):
"""Raw packet is an unknown protocol.
.. versionchanged:: 1.3.1.post8
``packet`` is not a field of this class, so its constructor takes
``protocol`` and ``error`` only.
:class:`~pcapkit.protocols.protocol.ProtocolBase` sets ``packet`` on
the data model of every protocol it constructs.
"""
#: Original enumeration of this protocol.
protocol: 'Optional[int]'
#: Message saying why the packet data is kept raw, if any -- that of the error its
#: parse raised, or the dissection limit it is past.
error: 'Optional[str]'
if TYPE_CHECKING:
def __init__(self, protocol: 'Optional[int]', error: 'Optional[str]') -> 'None': ... # pylint: disable=unused-argument,super-init-not-called,multiple-statements