PcapPlusPlus  19.12
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) || defined(WINx64) || defined(PCAPPP_MINGW_ENV)
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* onStatsUpdateUsrrCookie);
39  bool startCapture(int intervalInSecondsToUpdateStats, OnStatsUpdateCallback onStatsUpdate, void* onStatsUpdateUserCookie);
40  bool startCapture(RawPacketVector& capturedPacketsVector) { return PcapLiveDevice::startCapture(capturedPacketsVector); }
41 
42  virtual int sendPackets(RawPacket* rawPacketsArr, int arrLength);
43 
52 
57  int getMinAmountOfDataToCopyFromKernelToApplication() const { return m_MinAmountOfDataToCopyFromKernelToApplication; }
58  };
59 
60 } // namespace pcpp
61 
62 #endif // WIN32 || WINx64 || PCAPPP_MINGW_ENV
63 
64 #endif /* PCAPP_WINPCAP_LIVE_DEVICE */
pcpp::WinPcapLiveDevice::setMinAmountOfDataToCopyFromKernelToApplication
bool setMinAmountOfDataToCopyFromKernelToApplication(int size)
pcpp::PcapLiveDevice
Definition: PcapLiveDevice.h:76
pcpp::PcapLiveDevice::startCapture
virtual bool startCapture(OnPacketArrivesCallback onPacketArrives, void *onPacketArrivesUserCookie)
pcpp::WinPcapLiveDevice::startCapture
bool startCapture(OnPacketArrivesCallback onPacketArrives, void *onPacketArrivesUserCookie, int intervalInSecondsToUpdateStats, OnStatsUpdateCallback onStatsUpdate, void *onStatsUpdateUsrrCookie)
pcpp::WinPcapLiveDevice::sendPackets
virtual int sendPackets(RawPacket *rawPacketsArr, int arrLength)
pcpp::WinPcapLiveDevice
Definition: WinPcapLiveDevice.h:23
pcpp::PcapLiveDevice::LiveDeviceType
LiveDeviceType
Definition: PcapLiveDevice.h:128
pcpp::OnPacketArrivesCallback
void(* OnPacketArrivesCallback)(RawPacket *pPacket, PcapLiveDevice *pDevice, void *userCookie)
Definition: PcapLiveDevice.h:30
pcpp::PcapLiveDevice::WinPcapDevice
Definition: PcapLiveDevice.h:133
PcapLiveDevice.h
pcpp::PcapLiveDeviceList
Definition: PcapLiveDeviceList.h:25
pcpp
The main namespace for the PcapPlusPlus lib.
pcpp::WinPcapLiveDevice::startCapture
bool startCapture(RawPacketVector &capturedPacketsVector)
Definition: WinPcapLiveDevice.h:40
pcpp::WinPcapLiveDevice::getDeviceType
virtual LiveDeviceType getDeviceType() const
Definition: WinPcapLiveDevice.h:36
pcpp::WinPcapLiveDevice::getMinAmountOfDataToCopyFromKernelToApplication
int getMinAmountOfDataToCopyFromKernelToApplication() const
Definition: WinPcapLiveDevice.h:57
pcpp::OnStatsUpdateCallback
void(* OnStatsUpdateCallback)(pcap_stat &stats, void *userCookie)
Definition: PcapLiveDevice.h:49
pcpp::PointerVector
Definition: PointerVector.h:24
pcpp::RawPacket
Definition: RawPacket.h:219