|
PcapPlusPlus
Next
|
#include <Device.h>
Public Member Functions | |
| bool | setFilter (GeneralFilter &filter) |
| bool | setFilter (std::string const &filterAsString) |
| bool | clearFilter () |
Public Member Functions inherited from pcpp::IDevice | |
| virtual bool | open ()=0 |
| virtual void | close ()=0 |
| Close the device. | |
| virtual bool | isOpened () const =0 |
Protected Member Functions | |
| virtual bool | doUpdateFilter (std::string const *filterAsString)=0 |
| Updates the filter on the device with a BPF string. More... | |
An abstract interface representing all devices that have BPF (Berkeley Packet Filter) filtering capabilities, meaning devices that can filter packets based on the BPF filtering syntax. This is an abstract class that cannot be instantiated
|
inline |
Clear the filter currently set on the device
|
protectedpure virtual |
Updates the filter on the device with a BPF string.
Only packets that match the filter should be processed by the device after this method is called. A nullptr should disable any existing filter on the device.
| filterAsString | A pointer to a string representing the filter in BPF syntax (http://biot.com/capstats/bpf.html). |
Implemented in pcpp::PfRingDevice, pcpp::PcapNgFileWriterDevice, pcpp::IPcapDevice, and pcpp::PcapNgFileReaderDevice.
|
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 |
|
inline |
Set a filter for the device. When implemented by the device, only packets that match the filter will be processed.
| [in] | filterAsString | The filter to be set in Berkeley Packet Filter (BPF) syntax (http://biot.com/capstats/bpf.html) |