Miscellaneous Protocols¶
Raw Packet Data¶
pcapkit.protocols.raw contains
Raw only, which implements
extractor for unknown protocol, and constructs a
Protocol like object.
-
class
pcapkit.protocols.raw.Raw(file=None, length=None, **kwargs)[source]¶ Bases:
pcapkit.protocols.protocol.ProtocolThis class implements universal unknown protocol.
-
classmethod
__index__()[source]¶ Numeral registry index of the protocol.
- Raises
UnsupportedCall – This protocol has no registry entry.
-
__post_init__(file, length=None, *, error=None, **kwargs)[source]¶ Post initialisation hook.
- Parameters
file (io.BytesIO) – Source packet stream.
length (Optional[int]) – Length of packet data.
- Keyword Arguments
error (Optional[str]) – Parsing errors if any (for parsing).
**kwargs – Arbitrary keyword arguments.
Would
pcapkitencounter malformed packets, the original parsing error message will be provided as inerror.See also
For construction argument, please refer to
make().
-
read(length=None, *, error=None, **kwargs)[source]¶ Read raw packet data.
-
property
length¶ Header length of current protocol.
- Raises
UnsupportedCall – This protocol doesn’t support
length.
-
property
name¶ Name of current protocol.
- Return type
Literal[‘Unknown’]
-
property
protocol¶ Name of next layer protocol.
- Raises
UnsupportedCall – This protocol doesn’t support
protocol.
-
classmethod
No-Payload Packet¶
pcapkit.protocols.null contains
NoPayload only, which
implements a Protocol like
object whose payload is recursively
NoPayload itself.
-
class
pcapkit.protocols.null.NoPayload(file=None, length=None, **kwargs)[source]¶ Bases:
pcapkit.protocols.protocol.ProtocolThis class implements no-payload protocol.
-
classmethod
__index__()[source]¶ Numeral registry index of the protocol.
- Raises
UnsupportedCall – This protocol has no registry entry.
-
__post_init__(file=None, length=None, **kwargs)[source]¶ Post initialisation hook.
- Parameters
file (Optional[io.BytesIO]) – Source packet stream.
length (Optional[int]) – Length of packet data.
- Keyword Arguments
**kwargs – Arbitrary keyword arguments.
-
_decode_next_layer(*args, **kwargs)[source]¶ Decode next layer protocol.
- Parameters
*args – arbitrary positional arguments
- Keyword Arguments
**kwargs – arbitrary keyword arguments
- Raises
UnsupportedCall – This protocol doesn’t support
_decode_next_layer().
-
_import_next_layer(*args, **kwargs)[source]¶ Import next layer extractor.
- Parameters
*args – arbitrary positional arguments
- Keyword Arguments
**kwargs – arbitrary keyword arguments
- Raises
UnsupportedCall – This protocol doesn’t support
_import_next_layer().
-
make(**kwargs)[source]¶ Make (construct) packet data.
- Keyword Arguments
**kwargs – Arbitrary keyword arguments.
- Returns
Constructed packet data.
- Return type
-
property
length¶ Header length of current protocol.
- Raises
UnsupportedCall – This protocol doesn’t support
length.
-
property
name¶ Name of current protocol.
- Return type
Literal[‘Null’]
-
property
protocol¶ Name of next layer protocol.
- Raises
UnsupportedCall – This protocol doesn’t support
protocol.
-
classmethod