Built-in Engines#
PCAP Support#
This module contains the implementation for PCAP file extraction
support, as is used by pcapkit.foundation.extraction.Extractor.
- class pcapkit.foundation.engines.pcap.PCAP(extractor)#
-
PCAP file extraction support.
- run()#
Start extraction.
This method is the entry point for PCAP file extraction. It will start the extraction process by parsing the PCAP global header and then halt the extraction process until the
self.extractor._read_framemethod is called.The method will parse the PCAP global header and save the parsed result as
self.extractor._gbhdr. Information such as PCAP version, data link layer protocol type, nanosecond flag and byteorder will also be save the currentExtractorinstance.If TCP flow tracing is enabled, the nanosecond flag and byteorder will be used for the output PCAP file of the traced TCP flows.
For output, the method will dump the parsed PCAP global header under the name of
Global Header.- Return type:
- read_frame()#
Read frames.
This method performs following operations:
extract frames and each layer of packets;
make
Infoobject out of frame properties;write to output file with corresponding dumper;
reassemble IP and/or TCP datagram;
trace TCP flows if any;
record frame
Infoobject to frame storage.
- Return type:
- Returns:
Parsed frame instance.