PcapPlusPlus
21.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 | verifyFilter (std::string filterAsString) |
static bool | matchPacketWithFilter (std::string filterAsString, RawPacket *rawPacket) |
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 retreiving 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::PcapLiveDevice, pcpp::PcapNgFileWriterDevice, pcpp::PcapFileWriterDevice, pcpp::PcapNgFileReaderDevice, pcpp::PcapFileReaderDevice, and pcpp::PcapRemoteDevice.
|
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] | filterAsString | The BPF filter |
[in] | rawPacket | A pointer to the raw packet to match the BPF filter with |
|
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.
|
static |
Verify a filter is valid
[in] | filterAsString | The filter in Berkeley Packet Filter (BPF) syntax (http://biot.com/capstats/bpf.html) |