No-Payload Packet

pcapkit.protocols.null contains NoPayload only, which implements a Protocol like object whose payload is recursively NoPayload itself.

class pcapkit.protocols.misc.null.NoPayload(file=None, length=None, **kwargs)[source]

Bases: Protocol[NoPayload]

This class implements no-payload protocol.

Parameters
  • *args (Any) – Arbitrary positional arguments.

  • **kwargs (Any) – Arbitrary keyword arguments.

Return type

Protocol[PT]

__post_init__(file: BinaryIO, length: Optional[int] = None, **kwargs: Any) None[source]
__post_init__(**kwargs: Any) None

Post initialisation hook.

Parameters
  • file (Optional[BinaryIO]) – Source packet stream.

  • length (Optional[int]) – Length of packet data.

  • **kwargs (Any) – Arbitrary keyword arguments.

Return type

None

classmethod __index__()[source]

Numeral registry index of the protocol.

Raises

UnsupportedCall – This protocol has no registry entry.

Return type

NoReturn

property name: Literal['Null']

Name of current protocol.

Return type

Literal[‘Null’]

property length: Literal[0]

Header length of current protocol.

Return type

Literal[0]

property protocol: NoReturn

Name of next layer protocol.

Raises

UnsupportedCall – This protocol doesn’t support protocol.

Return type

NoReturn

read(length=None, **kwargs)[source]

Read (parse) packet data.

Parameters
  • length (Optional[int]) – Length of packet data.

  • **kwargs (Any) – Arbitrary keyword arguments.

Return type

NoPayload

Returns

Parsed packet data.

make(**kwargs)[source]

Make (construct) packet data.

Parameters

**kwargs (Any) – Arbitrary keyword arguments.

Return type

bytes

Returns

Constructed packet data.

Data Structures

class pcapkit.protocols.data.misc.null.NoPayload[source]

Bases: Info

No-payload packet is an empty packet.

Parameters
  • args (VT) –

  • kwargs (VT) –

Return type

Info