PcapPlusPlus
20.08
|
#include <PcapDevice.h>
Public Member Functions | |
virtual void | getStatistics (pcap_stat &stats) const =0 |
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 | |
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 device:
[out] | stats | The stats struct where stats are returned |
Implemented in pcpp::PcapNgFileWriterDevice, pcpp::PcapLiveDevice, 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] | filter | A filter class to test against |
[in] | rawPacket | A pointer to the raw packet to match the 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] | filterAsString | The BPF filter |
[in] | rawPacket | A pointer to the raw packet to match the BPF filter with |
|
inline |
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
[in] | filter | The filter to be set in PcapPlusPlus' GeneralFilter format |
|
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.
virtual bool pcpp::IFilterableDevice::setFilter |
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
[in] | filterAsString | The filter to be set in Berkeley Packet Filter (BPF) syntax (http://biot.com/capstats/bpf.html) |
|
static |
Verify a filter is valid
[in] | filterAsString | The filter in Berkeley Packet Filter (BPF) syntax (http://biot.com/capstats/bpf.html) |