3rd-Party Engines#

Scapy Support#

This module contains the implementation for Scapy engine support, as is used by pcapkit.foundation.extraction.Extractor.

class pcapkit.foundation.engines.scapy.Scapy(extractor)#

Bases: Engine[ScapyPacket]

Scapy engine support.

Parameters:

extractor (Extractor) – Extractor instance.

run()#

Call scapy.all.sniff() to extract PCAP files.

This method assigns self._expkg as scapy.all and self._extmp as an iterator from scapy.all.sniff().

Warns:

AttributeWarning – If self._exlyr and/or self._exptl is provided as the Scapy engine currently does not support such operations.

Return type:

None

read_frame()#

Read frames with Scapy engine.

Return type:

Packet

Returns:

Parsed frame instance.

See also

Please refer to <PCAP.read_frame> pcapkit.foundation.engine.pcap.PCAP.read_frame() for more operational information.

DPKT Support#

This module contains the implementation for DPKT engine support, as is used by pcapkit.foundation.extraction.Extractor.

class pcapkit.foundation.engines.dpkt.DPKT(extractor)#

Bases: Engine[DPKTPacket]

DPKT engine support.

Parameters:

extractor (Extractor) – Extractor instance.

run()#

Call dpkt.pcap.Reader to extract PCAP files.

This method assigns self._expkg as dpkt and self._extmp as an iterator from dpkt.pcap.Reader.

Warns:

AttributeWarning – If self._exlyr and/or self._exptl is provided as the DPKT engine currently does not support such operations.

Return type:

None

read_frame()#

Read frames with DPKT engine.

Returns:

Parsed frame instance.

Return type:

dpkt.dpkt.Packet

See also

Please refer to _default_read_frame() for more operational information.

PyShark Support#

This module contains the implementation for PyShark engine support, as is used by pcapkit.foundation.extraction.Extractor.

class pcapkit.foundation.engines.pyshark.PyShark(extractor)#

Bases: Engine[PySharkPacket]

PyShark engine support.

Parameters:

extractor (Extractor) – Extractor instance.

run()#

Call pyshark.FileCapture to extract PCAP files.

This method assigns self._expkg as pyshark and self._extmp as an iterator from pyshark.FileCapture.

Warns:

AttributeWarning – Warns under following circumstances:

  • if self._exlyr and/or self._exptl is provided as the PyShark engine currently does not support such operations.

  • if reassembly is enabled, as the PyShark engine currently does not support such operation.

Return type:

None

read_frame()#

Read frames with PyShark engine.

Return type:

Packet

Returns:

Parsed frame instance.

See also

Please refer to _default_read_frame() for more operational information.

close()#

Close engine.

This method is to be used for closing the engine instance. It is to close the engine instance after the extraction process is finished.

Return type:

None