PcapPlusPlus
22.05
|
#include <PcapDevice.h>
Classes | |
struct | PcapStats |
Public Member Functions | |
virtual void | getStatistics (PcapStats &stats) const =0 |
virtual bool | setFilter (std::string filterAsString) |
bool | clearFilter () |
Public Member Functions inherited from pcpp::IDevice | |
virtual bool | open ()=0 |
virtual void | close ()=0 |
bool | isOpened () |
Public Member Functions inherited from pcpp::IFilterableDevice | |
virtual bool | setFilter (GeneralFilter &filter) |
Static Public Member Functions | |
static std::string | getPcapLibVersionInfo () |
static bool | matchPacketWithFilter (GeneralFilter &filter, RawPacket *rawPacket) |
An abstract class representing all libpcap-based packet capturing devices: files, libPcap, WinPcap/Npcap and RemoteCapture. This class is abstract and cannot be instantiated
|
virtual |
Clear the filter currently set on device
Implements pcpp::IFilterableDevice.
|
static |
A static method for retrieving pcap lib (libpcap/WinPcap/etc.) version information. This method is actually a wrapper for pcap_lib_version()
|
pure virtual |
Get statistics from the device
[out] | stats | An object containing the stats |
Implemented in pcpp::PcapNgFileWriterDevice, pcpp::PcapLiveDevice, pcpp::PcapFileWriterDevice, pcpp::PcapNgFileReaderDevice, pcpp::SnoopFileReaderDevice, and pcpp::PcapFileReaderDevice.
|
static |
Match a raw packet with a given BPF filter. Notice this method is static which means you don't need any device instance in order to perform this match
[in] | filter | A filter class to test against |
[in] | rawPacket | A pointer to the raw packet to match the filter with |
|
virtual |
Set a filter for the device. When implemented by the device, only packets that match the filter will be received. Please note that when the device is closed the filter is reset so when reopening the device you need to call this method again in order to reactivate the filter
[in] | filterAsString | The filter to be set in Berkeley Packet Filter (BPF) syntax (http://biot.com/capstats/bpf.html) |
Implements pcpp::IFilterableDevice.
Reimplemented in pcpp::PcapNgFileWriterDevice, and pcpp::PcapNgFileReaderDevice.