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)#

Bases: Protocol[PT, ST], Generic[PT, ST]

Abstract base class for transport layer protocol family.

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

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

Return type:

Self

property layer: Literal['Application']#

Protocol layer.

_decode_next_layer(dict_, proto=None, length=None, *, packet=None)#

Decode next layer protocol.

Raises:

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

Return type:

NoReturn

Parameters:
  • dict_ (PT) –

  • proto (int | None) –

  • length (int | None) –

  • packet (dict[str, Any] | None) –

_import_next_layer(proto, length=None, *, packet=None)#

Import next layer extractor.

Raises:

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

Return type:

NoReturn

Parameters:
__layer__: Literal['Application'] = 'Application'#

Layer of protocol.

__post_init__(file=None, length=None, **kwargs)#

Post initialisation hook.

Parameters:
  • file (Union[IO[bytes], bytes, None]) – Source packet stream.

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

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

Return type:

None

See also

For construction arguments, please refer to self.make.

classmethod __index__()#

Numeral registry index of the protocol.

Raises:

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

Return type:

NoReturn