Auxiliary Interface

pcapkit.interface.misc contains miscellaneous user interface functions, classes, etc., which are generally provided per user’s requests.

pcapkit.interface.misc.follow_tcp_stream(fin=None, verbose=False, extension=True, engine=None, fout=None, format=None, byteorder='little', nanosecond=False)[source]

Follow TCP streams.

Parameters:
  • fin (Optional[str]) – file name to be read; if file not exist, raise FileNotFound

  • extension (bool) – if check and append extensions to output file

  • verbose (bool) – if print verbose output information

  • engine (Optional[Literal['default', 'pcapkit', 'dpkt', 'scapy', 'pyshark']]) – extraction engine to be used

  • fout (Optional[str]) – path name for flow tracer if necessary

  • format (Optional[Literal['pcap', 'json', 'tree', 'plist']]) – output file format of flow tracer

  • byteorder (Literal['little', 'big']) – output file byte order

  • nanosecond (bool) – output nanosecond-resolution file flag

Return type:

tuple[Stream, ...]

Returns:

List of extracted TCP streams.

Data Models

class pcapkit.interface.misc.Stream(*args: VT, **kwargs: VT)[source]

Bases: Info

Data model for TCP streams.

filename: Optional[str]

Output filename.

packets: tuple[Packet, ...]

Packet list.

conversations: tuple[bytes | tuple[bytes, ...], ...]

TCP conversation.