46 PcapHandle& operator=(std::nullptr_t) noexcept;
55 return m_PcapDescriptor !=
nullptr;
61 pcap_t*
get() const noexcept
63 return m_PcapDescriptor;
77 void reset(pcap_t* pcapDescriptor =
nullptr) noexcept;
89 explicit operator
bool() const noexcept
94 bool operator==(std::nullptr_t)
const noexcept
98 bool operator!=(std::nullptr_t)
const noexcept
104 pcap_t* m_PcapDescriptor =
nullptr;
Definition: PcapFilter.h:160
virtual bool setFilter(GeneralFilter &filter)
Definition: Device.h:79
Definition: PcapDevice.h:114
virtual bool setFilter(std::string filterAsString)
virtual void getStatistics(PcapStats &stats) const =0
static bool matchPacketWithFilter(GeneralFilter &filter, RawPacket *rawPacket)
static std::string getPcapLibVersionInfo()
Definition: RawPacket.h:269
A wrapper class for pcap_t* which is the libpcap packet capture descriptor. This class is used to man...
Definition: PcapDevice.h:29
pcap_t * release() noexcept
Releases ownership of the handle and returns the pcap descriptor.
char const * getLastError() const noexcept
Helper function to retrieve a view of the last error string for this handle.
void reset(pcap_t *pcapDescriptor=nullptr) noexcept
Replaces the managed handle with the provided one.
constexpr PcapHandle() noexcept=default
Creates an empty handle.
pcap_t * get() const noexcept
Definition: PcapDevice.h:61
bool isValid() const noexcept
Definition: PcapDevice.h:53
The main namespace for the PcapPlusPlus lib.
Definition: PcapDevice.h:128
uint64_t packetsRecv
Definition: PcapDevice.h:130
uint64_t packetsDrop
Definition: PcapDevice.h:132
uint64_t packetsDropByInterface
Definition: PcapDevice.h:134