PcapPlusPlus  23.09
WinPcapLiveDevice.h
Go to the documentation of this file.
1 #ifndef PCAPP_WINPCAP_LIVE_DEVICE
2 #define PCAPP_WINPCAP_LIVE_DEVICE
3 
4 #if defined(_WIN32)
5 
7 
8 #include "PcapLiveDevice.h"
9 
14 namespace pcpp
15 {
16 
24  {
25  friend class PcapLiveDeviceList;
26  protected:
27  int m_MinAmountOfDataToCopyFromKernelToApplication;
28 
29  // c'tor is not public, there should be only one for every interface (created by PcapLiveDeviceList)
30  WinPcapLiveDevice(pcap_if_t* iface, bool calculateMTU, bool calculateMacAddress, bool calculateDefaultGateway);
31  // copy c'tor is not public
32  WinPcapLiveDevice( const WinPcapLiveDevice& other );
33  WinPcapLiveDevice& operator=(const WinPcapLiveDevice& other);
34 
35  public:
36  virtual LiveDeviceType getDeviceType() const { return WinPcapDevice; }
37 
38  bool startCapture(OnPacketArrivesCallback onPacketArrives, void* onPacketArrivesUserCookie, int intervalInSecondsToUpdateStats, OnStatsUpdateCallback onStatsUpdate, void* onStatsUpdateUserCookie);
39  bool startCapture(int intervalInSecondsToUpdateStats, OnStatsUpdateCallback onStatsUpdate, void* onStatsUpdateUserCookie);
40  bool startCapture(RawPacketVector& capturedPacketsVector) { return PcapLiveDevice::startCapture(capturedPacketsVector); }
41 
43  virtual int sendPackets(RawPacket* rawPacketsArr, int arrLength);
44 
53 
58  int getMinAmountOfDataToCopyFromKernelToApplication() const { return m_MinAmountOfDataToCopyFromKernelToApplication; }
59  };
60 
61 } // namespace pcpp
62 
63 #endif // _WIN32
64 
65 #endif /* PCAPP_WINPCAP_LIVE_DEVICE */
The main namespace for the PcapPlusPlus lib.
Definition: PcapLiveDevice.h:140
bool setMinAmountOfDataToCopyFromKernelToApplication(int size)
Definition: PointerVector.h:24
LiveDeviceType
Definition: PcapLiveDevice.h:135
Definition: RawPacket.h:254
void(* OnStatsUpdateCallback)(IPcapDevice::PcapStats &stats, void *userCookie)
Definition: PcapLiveDevice.h:57
bool startCapture(RawPacketVector &capturedPacketsVector)
Definition: WinPcapLiveDevice.h:40
bool startCapture(OnPacketArrivesCallback onPacketArrives, void *onPacketArrivesUserCookie, int intervalInSecondsToUpdateStats, OnStatsUpdateCallback onStatsUpdate, void *onStatsUpdateUserCookie)
void(* OnPacketArrivesCallback)(RawPacket *pPacket, PcapLiveDevice *pDevice, void *userCookie)
Definition: PcapLiveDevice.h:38
Definition: PcapLiveDevice.h:82
Definition: WinPcapLiveDevice.h:23
virtual LiveDeviceType getDeviceType() const
Definition: WinPcapLiveDevice.h:36
virtual bool startCapture(OnPacketArrivesCallback onPacketArrives, void *onPacketArrivesUserCookie)
int getMinAmountOfDataToCopyFromKernelToApplication() const
Definition: WinPcapLiveDevice.h:58
virtual int sendPackets(RawPacket *rawPacketsArr, int arrLength, bool checkMtu=false)
Definition: PcapLiveDeviceList.h:24