PcapPlusPlus
22.11
|
#include <PcapLiveDeviceList.h>
Public Member Functions | |
const std::vector< PcapLiveDevice * > & | getPcapLiveDevicesList () const |
PcapLiveDevice * | getPcapLiveDeviceByIp (const IPAddress &ipAddr) const |
PcapLiveDevice * | getPcapLiveDeviceByIp (const IPv4Address &ipAddr) const |
PcapLiveDevice * | getPcapLiveDeviceByIp (const IPv6Address &ip6Addr) const |
PcapLiveDevice * | getPcapLiveDeviceByIp (const std::string &ipAddrAsString) const |
PcapLiveDevice * | getPcapLiveDeviceByName (const std::string &name) const |
PcapLiveDevice * | getPcapLiveDeviceByIpOrName (const std::string &ipOrName) const |
const std::vector< IPv4Address > & | getDnsServers () const |
PcapLiveDeviceList * | clone () |
void | reset () |
Static Public Member Functions | |
static PcapLiveDeviceList & | getInstance () |
A singleton class that creates, stores and provides access to all PcapLiveDevice (on Linux) or WinPcapLiveDevice (on Windows) instances. All live devices are initialized on startup and wrap the network interfaces installed on the machine. This class enables access to them through their IP addresses or get a vector of all of them so the user can search them in some other way
PcapLiveDeviceList* pcpp::PcapLiveDeviceList::clone | ( | ) |
Copies the current live device list
|
inline |
|
inlinestatic |
The access method to the singleton
PcapLiveDevice* pcpp::PcapLiveDeviceList::getPcapLiveDeviceByIp | ( | const IPAddress & | ipAddr | ) | const |
Get a pointer to the live device by its IP address. IP address can be both IPv4 or IPv6
[in] | ipAddr | The IP address defined for the device |
PcapLiveDevice* pcpp::PcapLiveDeviceList::getPcapLiveDeviceByIp | ( | const IPv4Address & | ipAddr | ) | const |
Get a pointer to the live device by its IPv4 address
[in] | ipAddr | The IPv4 address defined for the device |
PcapLiveDevice* pcpp::PcapLiveDeviceList::getPcapLiveDeviceByIp | ( | const IPv6Address & | ip6Addr | ) | const |
Get a pointer to the live device by its IPv6 address
[in] | ip6Addr | The IPv6 address defined for the device |
PcapLiveDevice* pcpp::PcapLiveDeviceList::getPcapLiveDeviceByIp | ( | const std::string & | ipAddrAsString | ) | const |
Get a pointer to the live device by its IP address represented as string. IP address can be both IPv4 or IPv6
[in] | ipAddrAsString | The IP address defined for the device as string |
PcapLiveDevice* pcpp::PcapLiveDeviceList::getPcapLiveDeviceByIpOrName | ( | const std::string & | ipOrName | ) | const |
Get a pointer to the live device by its IP address or name
[in] | ipOrName | An IP address or name of the interface |
PcapLiveDevice* pcpp::PcapLiveDeviceList::getPcapLiveDeviceByName | ( | const std::string & | name | ) | const |
Get a pointer to the live device by its name
[in] | name | The name of the interface (e.g eth0) |
|
inline |
void pcpp::PcapLiveDeviceList::reset | ( | ) |
Reset the live device list and DNS server list, meaning clear and refetch them