PcapPlusPlus
Next
|
#include <PcapFileDevice.h>
Public Member Functions | |
PcapFileReaderDevice (const std::string &fileName) | |
virtual | ~PcapFileReaderDevice ()=default |
A destructor for this class. | |
LinkLayerType | getLinkLayerType () const |
FileTimestampPrecision | getTimestampPrecision () const |
bool | getNextPacket (RawPacket &rawPacket) |
bool | open () |
![]() | |
virtual | ~IFileReaderDevice ()=default |
A destructor for this class. | |
uint64_t | getFileSize () const |
int | getNextPackets (RawPacketVector &packetVec, int numOfPacketsToRead=-1) |
![]() | |
std::string | getFileName () const |
void | close () override |
Close the file. | |
bool | isOpened () const override |
void | getStatistics (PcapStats &stats) const override |
Get the statistics for this device. More... | |
![]() | |
bool | setFilter (std::string filterAsString) override |
bool | clearFilter () override |
virtual bool | setFilter (GeneralFilter &filter) |
virtual bool | setFilter (std::string filterAsString)=0 |
![]() | |
virtual bool | setFilter (GeneralFilter &filter) |
![]() | |
PcapStats | getStatistics () const |
Get statistics from the device. More... | |
Static Public Member Functions | |
static bool | isNanoSecondPrecisionSupported () |
![]() | |
static IFileReaderDevice * | getReader (const std::string &fileName) |
![]() | |
static std::string | getPcapLibVersionInfo () |
static bool | matchPacketWithFilter (GeneralFilter &filter, RawPacket *rawPacket) |
Additional Inherited Members | |
![]() | |
IFileReaderDevice (const std::string &fileName) | |
![]() | |
void | reportPacketProcessed (uint64_t numPackets=1) |
Report that packets were processed (read or written, depending on the device type). More... | |
void | reportPacketDropped (uint64_t numPackets=1) |
Report that packets were dropped (not read or not written, depending on the device type). More... | |
void | resetStatisticCounters () |
Reset the internal statistic counters to zero. | |
A class for opening a pcap file in read-only mode. This class enable to open the file and read all packets, packet-by-packet
|
inline |
A constructor for this class that gets the pcap full path file name to open. Notice that after calling this constructor the file isn't opened yet, so reading packets will fail. For opening the file call open()
[in] | fileName | The full path of the file to read |
|
inline |
|
virtual |
Read the next packet from the file. Before using this method please verify the file is opened using open()
[out] | rawPacket | A reference for an empty RawPacket where the packet will be written |
Implements pcpp::IFileReaderDevice.
|
inline |
|
static |
A static method that checks if nano-second precision is supported in the current platform and environment
|
virtual |
Open the file name which path was specified in the constructor in a read-only mode
Implements pcpp::IDevice.