PcapPlusPlus
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 setDnsServers();
41  public:
47  {
48  static PcapLiveDeviceList instance;
49  return instance;
50  }
51 
55  inline const std::vector<PcapLiveDevice*>& getPcapLiveDevicesList() { return m_LiveDeviceList; }
56 
63 
70 
77 
83  PcapLiveDevice* getPcapLiveDeviceByIp(const char* ipAddrAsString);
84 
90  PcapLiveDevice* getPcapLiveDeviceByName(const std::string& name);
91 
96  std::vector<IPv4Address>& getDnsServers();
97  };
98 
99 } // namespace pcpp
100 
101 #endif
PcapLiveDevice * getPcapLiveDeviceByIp(IPAddress *ipAddr)
Definition: PcapLiveDevice.h:76
PcapLiveDevice * getPcapLiveDeviceByName(const std::string &name)
Definition: PcapLiveDeviceList.h:25
Definition: IpAddress.h:113
static PcapLiveDeviceList & getInstance()
Definition: PcapLiveDeviceList.h:46
Definition: IpAddress.h:27
Definition: IpAddress.h:212
const std::vector< PcapLiveDevice * > & getPcapLiveDevicesList()
Definition: PcapLiveDeviceList.h:55
std::vector< IPv4Address > & getDnsServers()
The main namespace for the PcapPlusPlus lib.