PcapPlusPlus  Next
WinPcapLiveDevice.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include "PcapLiveDevice.h"
6 
9 namespace pcpp
10 {
17  {
18  friend class PcapLiveDeviceList;
19 
20  protected:
21  int m_MinAmountOfDataToCopyFromKernelToApplication;
22 
23  // c'tor is not public, there should be only one for every interface (created by PcapLiveDeviceList)
24  WinPcapLiveDevice(pcap_if_t* iface, bool calculateMTU, bool calculateMacAddress, bool calculateDefaultGateway)
25  : WinPcapLiveDevice(DeviceInterfaceDetails(iface), calculateMTU, calculateMacAddress,
26  calculateDefaultGateway)
27  {}
28  WinPcapLiveDevice(DeviceInterfaceDetails interfaceDetails, bool calculateMTU, bool calculateMacAddress,
29  bool calculateDefaultGateway);
30 
31  public:
32  WinPcapLiveDevice(const WinPcapLiveDevice& other) = delete;
33  WinPcapLiveDevice& operator=(const WinPcapLiveDevice& other) = delete;
34 
35  LiveDeviceType getDeviceType() const override
36  {
37  return WinPcapDevice;
38  }
39 
41  virtual int sendPackets(RawPacket* rawPacketsArr, int arrLength);
42 
50 
54  {
55  return m_MinAmountOfDataToCopyFromKernelToApplication;
56  }
57 
58  WinPcapLiveDevice* clone() const override;
59 
60  protected:
61  void prepareCapture(bool asyncCapture, bool captureStats) override;
62  };
63 } // namespace pcpp
Definition: PcapLiveDevice.h:66
LiveDeviceType
The type of the live device.
Definition: PcapLiveDevice.h:175
@ WinPcapDevice
WinPcap/Npcap live device.
Definition: PcapLiveDevice.h:179
virtual int sendPackets(RawPacket *rawPacketsArr, int arrLength, bool checkMtu=false)
Definition: PcapLiveDeviceList.h:22
Definition: RawPacket.h:259
Definition: WinPcapLiveDevice.h:17
int getMinAmountOfDataToCopyFromKernelToApplication() const
Definition: WinPcapLiveDevice.h:53
virtual int sendPackets(RawPacket *rawPacketsArr, int arrLength, bool checkMtu=false)
LiveDeviceType getDeviceType() const override
Definition: WinPcapLiveDevice.h:35
void prepareCapture(bool asyncCapture, bool captureStats) override
Called before starting a capture to prepare the device for capturing packets.
bool setMinAmountOfDataToCopyFromKernelToApplication(int size)
WinPcapLiveDevice * clone() const override
The main namespace for the PcapPlusPlus lib.
A struct that contains all details of a network interface.
Definition: PcapLiveDevice.h:73