PcapPlusPlus  19.12
PcapLiveDeviceList.h
Go to the documentation of this file.
1 #ifndef PCAPPP_LIVE_DEVICE_LIST
2 #define PCAPPP_LIVE_DEVICE_LIST
3 
4 #include "IpAddress.h"
5 #include "PcapLiveDevice.h"
6 #include "WinPcapLiveDevice.h"
7 #include <vector>
8 
9 
11 
16 namespace pcpp
17 {
18 
26  {
27  private:
28  std::vector<PcapLiveDevice*> m_LiveDeviceList;
29 
30  std::vector<IPv4Address> m_DnsServers;
31 
32  // private c'tor
34  // private copy c'tor
35  PcapLiveDeviceList( const PcapLiveDeviceList& other );
36  PcapLiveDeviceList& operator=(const PcapLiveDeviceList& other);
37  // private d'tor
39 
40  void init();
41 
42  void setDnsServers();
43  public:
49  {
50  static PcapLiveDeviceList instance;
51  return instance;
52  }
53 
57  const std::vector<PcapLiveDevice*>& getPcapLiveDevicesList() const { return m_LiveDeviceList; }
58 
65 
72 
79 
85  PcapLiveDevice* getPcapLiveDeviceByIp(const char* ipAddrAsString) const;
86 
92  PcapLiveDevice* getPcapLiveDeviceByName(const std::string& name) const;
93 
98  const std::vector<IPv4Address>& getDnsServers() const { return m_DnsServers; }
99 
103  void reset();
104  };
105 
106 } // namespace pcpp
107 
108 #endif
pcpp::IPv4Address
Definition: IpAddress.h:119
pcpp::IPv6Address
Definition: IpAddress.h:229
pcpp::PcapLiveDevice
Definition: PcapLiveDevice.h:76
pcpp::PcapLiveDeviceList::getPcapLiveDevicesList
const std::vector< PcapLiveDevice * > & getPcapLiveDevicesList() const
Definition: PcapLiveDeviceList.h:57
pcpp::IPAddress
Definition: IpAddress.h:28
pcpp::PcapLiveDeviceList::getInstance
static PcapLiveDeviceList & getInstance()
Definition: PcapLiveDeviceList.h:48
PcapLiveDevice.h
IpAddress.h
pcpp::PcapLiveDeviceList
Definition: PcapLiveDeviceList.h:25
pcpp
The main namespace for the PcapPlusPlus lib.
pcpp::PcapLiveDeviceList::getPcapLiveDeviceByIp
PcapLiveDevice * getPcapLiveDeviceByIp(IPAddress *ipAddr) const
pcpp::PcapLiveDeviceList::getPcapLiveDeviceByName
PcapLiveDevice * getPcapLiveDeviceByName(const std::string &name) const
WinPcapLiveDevice.h
pcpp::PcapLiveDeviceList::getDnsServers
const std::vector< IPv4Address > & getDnsServers() const
Definition: PcapLiveDeviceList.h:98
pcpp::PcapLiveDeviceList::reset
void reset()