PcapPlusPlus
20.08
|
#include <PcapFileDevice.h>
Public Member Functions | |
PcapFileReaderDevice (const char *fileName) | |
virtual | ~PcapFileReaderDevice () |
LinkLayerType | getLinkLayerType () const |
bool | getNextPacket (RawPacket &rawPacket) |
bool | open () |
void | getStatistics (pcap_stat &stats) const |
Public Member Functions inherited from pcpp::IFileReaderDevice | |
virtual | ~IFileReaderDevice () |
uint64_t | getFileSize () const |
int | getNextPackets (RawPacketVector &packetVec, int numOfPacketsToRead=-1) |
Public Member Functions inherited from pcpp::IFileDevice | |
std::string | getFileName () const |
virtual void | close () |
Public Member Functions inherited from pcpp::IPcapDevice | |
virtual bool | setFilter (std::string filterAsString) |
bool | clearFilter () |
virtual bool | setFilter (GeneralFilter &filter) |
virtual bool | setFilter (std::string filterAsString)=0 |
Public Member Functions inherited from pcpp::IDevice | |
bool | isOpened () |
Public Member Functions inherited from pcpp::IFilterableDevice | |
virtual bool | setFilter (GeneralFilter &filter) |
Additional Inherited Members | |
Static Public Member Functions inherited from pcpp::IFileReaderDevice | |
static IFileReaderDevice * | getReader (const char *fileName) |
Static Public Member Functions inherited from pcpp::IPcapDevice | |
static std::string | getPcapLibVersionInfo () |
static bool | verifyFilter (std::string filterAsString) |
static bool | matchPacketWithFilter (std::string filterAsString, RawPacket *rawPacket) |
static bool | matchPacketWithFilter (GeneralFilter &filter, RawPacket *rawPacket) |
Protected Member Functions inherited from pcpp::IFileReaderDevice | |
IFileReaderDevice (const char *fileName) | |
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 |
|
inlinevirtual |
A destructor for this class
|
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.
|
virtual |
Get statistics of packets read so far. In the pcap_stat struct, only ps_recv member is relevant. The rest of the members will contain 0
[out] | stats | The stats struct where stats are returned |
Implements pcpp::IPcapDevice.
|
virtual |
Open the file name which path was specified in the constructor in a read-only mode
Implements pcpp::IDevice.