Auxiliary Interface

pcapkit.interface.misc contains auxiliary user interfaces, mostly added on users’ requests.

pcapkit.interface.misc.follow_tcp_stream(fin, *, verbose=False, engine='default', traceflow=None)[source]

Follow TCP streams.

Parameters:
Return type:

tuple[Stream, ...]

Returns:

Tuple of extracted TCP streams.

Raises:

FormatError – If traceflow does not name 'tcp'.

Changed in version 1.5.0: trace_bidirectional and trace_analyse are added. By default a stream holds both directions of a conversation; 1.4.x returned one stream per direction.

Changed in version 1.7.0: traceflow replaces fout, format, byteorder, nanosecond, trace_bidirectional and trace_analyse, with no alias, and every parameter after fin is keyword-only. fin is required and opened as named, so extension is removed (#2836). verbose and engine mirror those of Extractor, so engine defaults to 'default', where None stood for it (#2837).

Data Models

class pcapkit.interface.misc.Stream(filename, packets, conversations)[source]

Bases: Info

Data model for TCP streams.

filename: str | None

Output filename.

packets: tuple[Frame | PCAPNG | scapy.packet.Packet | dpkt.dpkt.Packet | pyshark.packet.packet.Packet | pcap_packet | Tuple[float, bytes], ...]

Packet list.

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

TCP conversation.