Coverage Report

Created: 2026-02-14 06:19

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/PcapPlusPlus/Pcap++/header/PcapDevice.h
Line
Count
Source
1
#pragma once
2
3
#include <cstdint>
4
5
/// @file
6
7
/// @namespace pcpp
8
/// @brief The main namespace for the PcapPlusPlus lib
9
namespace pcpp
10
{
11
  /// @struct PcapStats
12
  /// A container for pcap device statistics
13
  struct PcapStats
14
  {
15
    /// Number of packets received
16
    uint64_t packetsRecv;
17
    /// Number of packets dropped
18
    uint64_t packetsDrop;
19
    /// number of packets dropped by interface (not supported on all platforms)
20
    uint64_t packetsDropByInterface;
21
  };
22
23
  /// @brief An interface for providing Pcap-based device statistics
24
  class IPcapStatisticsProvider
25
  {
26
  public:
27
13.9k
    virtual ~IPcapStatisticsProvider() = default;
28
29
    /// @brief Get statistics from the device
30
    /// @return An object containing the stats
31
    PcapStats getStatistics() const;
32
33
    /// Get statistics from the device
34
    /// @param[out] stats An object containing the stats
35
    virtual void getStatistics(PcapStats& stats) const = 0;
36
  };
37
}  // namespace pcpp