Base Protocol

pcapkit.protocols.application.application contains only Application, which is a base class for application layer protocols, eg. HTTP/1.*, HTTP/2 and etc.

class pcapkit.protocols.application.application.Application(file=None, length=None, **kwargs)[source]

Bases: Protocol[PT], Generic[PT]

Abstract base class for transport layer protocol family.

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.

See also

For construction arguments, please refer to self.make.

Return type

None

classmethod __index__()[source]

Numeral registry index of the protocol.

Raises

IntError – This protocol doesn’t support __index__().

Return type

NoReturn

property layer: Literal['Application']

Protocol layer.

Return type

Literal[‘Application’]

_decode_next_layer(dict_, proto=None, length=None)[source]

Decode next layer protocol.

Raises

UnsupportedCall – This protocol doesn’t support _decode_next_layer().

Return type

NoReturn

Parameters
_import_next_layer(proto, length=None)[source]

Import next layer extractor.

Raises

UnsupportedCall – This protocol doesn’t support _import_next_layer().

Return type

NoReturn

Parameters
__layer__: Optional[Literal['Link', 'Internet', 'Transport', 'Application']] = 'Application'

Layer of protocol.