PcapPlusPlus
19.12
|
#include <PcapLiveDevice.h>
Public Member Functions | |
DeviceConfiguration (DeviceMode mode=Promiscuous, int packetBufferTimeoutMs=0, int packetBufferSize=0, PcapDirection direction=PCPP_INOUT) | |
Public Attributes | |
DeviceMode | mode |
int | packetBufferTimeoutMs |
int | packetBufferSize |
PcapDirection | direction |
A struct that contains user configurable parameters for opening a device. All parameters have default values so the user isn't expected to set all parameters or understand exactly how they work
|
inline |
A c'tor for this struct
[in] | mode | The mode to open the device: promiscuous or non-promiscuous. Default value is promiscuous |
[in] | packetBufferTimeoutMs | Buffer timeout in millisecond. Default value is 0 which means set timeout of 1 or -1 (depends on the platform) |
[in] | packetBufferSize | The packet buffer size. Default value is 0 which means use the default value (varies between different OS's) |
[in] | direction | Direction for capturing packtes. Default value is INOUT which means capture both incoming and outgoing packets (not all platforms support this) |
PcapDirection pcpp::PcapLiveDevice::DeviceConfiguration::direction |
Set the direction for capturing packets. You can read more here: https://www.tcpdump.org/manpages/pcap.3pcap.html#lbAI.
DeviceMode pcpp::PcapLiveDevice::DeviceConfiguration::mode |
Indicates whether to open the device in promiscuous or normal mode
int pcpp::PcapLiveDevice::DeviceConfiguration::packetBufferSize |
Set the packet buffer size. You can read more about the packet buffer here: https://www.tcpdump.org/manpages/pcap.3pcap.html . Any value of 100 or above is considered valid, otherwise the default value is used (which varies between different OS's). However, please notice that setting values which are too low or two high may result in failure to open the device. These too low or too high thresholds may vary between OS's, as an example please refer to this thread: https://stackoverflow.com/questions/11397367/issue-in-pcap-set-buffer-size
int pcpp::PcapLiveDevice::DeviceConfiguration::packetBufferTimeoutMs |
Set the packet buffer timeout in milliseconds. You can read more here: https://www.tcpdump.org/manpages/pcap.3pcap.html . Any value above 0 is considered legal, otherwise a value of 1 or -1 is used (depends on the platform)