PcapPlusPlus  21.05
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 
64  PcapLiveDevice* getPcapLiveDeviceByIp(const IPAddress& ipAddr) const;
65 
71  PcapLiveDevice* getPcapLiveDeviceByIp(const IPv4Address& ipAddr) const;
72 
78  PcapLiveDevice* getPcapLiveDeviceByIp(const IPv6Address& ip6Addr) const;
79 
85  PcapLiveDevice* getPcapLiveDeviceByIp(const std::string& ipAddrAsString) const;
86 
92  PcapLiveDevice* getPcapLiveDeviceByName(const std::string& name) const;
93 
99  PcapLiveDevice* getPcapLiveDeviceByIpOrName(const std::string& ipOrName) const;
100 
105  const std::vector<IPv4Address>& getDnsServers() const { return m_DnsServers; }
106 
110  void reset();
111  };
112 
113 } // namespace pcpp
114 
115 #endif
The main namespace for the PcapPlusPlus lib.
PcapLiveDevice * getPcapLiveDeviceByIp(const IPAddress &ipAddr) const
static PcapLiveDeviceList & getInstance()
Definition: PcapLiveDeviceList.h:48
const std::vector< PcapLiveDevice * > & getPcapLiveDevicesList() const
Definition: PcapLiveDeviceList.h:57
PcapLiveDevice * getPcapLiveDeviceByIpOrName(const std::string &ipOrName) const
PcapLiveDevice * getPcapLiveDeviceByName(const std::string &name) const
Definition: IpAddress.h:26
Definition: IpAddress.h:160
Definition: PcapLiveDevice.h:81
Definition: IpAddress.h:265
const std::vector< IPv4Address > & getDnsServers() const
Definition: PcapLiveDeviceList.h:105
Definition: PcapLiveDeviceList.h:25