PcapPlusPlus
Next
|
#include <PcapFilter.h>
Public Member Functions | |
CompositeFilter ()=default | |
An empty constructor for this class. Use addFilter() to add filters to the composite filter. | |
CompositeFilter (const std::vector< GeneralFilter * > &filters) | |
void | addFilter (GeneralFilter *filter) |
void | removeFilter (GeneralFilter *filter) |
void | setFilters (const std::vector< GeneralFilter * > &filters) |
void | clearAllFilters () |
Remove all filters from the composite filter. | |
![]() | |
virtual | ~GeneralFilter ()=default |
Virtual destructor, frees the bpf program. | |
virtual void | parseToString (std::string &result) const =0 |
bool | matchPacketWithFilter (RawPacket *rawPacket) const |
bool | matches (RawPacket const &rawPacket) const |
Match a raw packet against the filter. More... | |
Additional Inherited Members | |
![]() | |
bool | cacheFilter () const |
Parse the filter and cache the compiled BPF program. More... | |
void | invalidateCache () const |
Invalidate the cached BPF program. This method should be called whenever the filter changes. | |
The base class for all filter classes composed of several other filters. This class is virtual and abstract, hence cannot be instantiated.
For deeper understanding of the filter concept please refer to PcapFilter.h
|
explicit |
A constructor that gets a list of pointers to filters and creates one filter from all filters
[in] | filters | The list of pointers to filters |
|
inline |
Add filter to the composite filter
[in] | filter | The filter to add |
void pcpp::CompositeFilter::removeFilter | ( | GeneralFilter * | filter | ) |
Removes the first matching filter from the composite filter
[in] | filter | The filter to remove |
void pcpp::CompositeFilter::setFilters | ( | const std::vector< GeneralFilter * > & | filters | ) |
Remove the current filters and set new ones
[in] | filters | The new filters to set. The previous ones will be removed |